I was more interested in the reference hardware. I'm finding that my weird logic & power board v4.12s seem to be completely unsupported by the new VESC-Tool and I'm a little weary of hacking about.
I am also very much looking forward to the reference design release since I have some custom ideas brewing. It would be awesome to get an official update on this.
Essentially the reference hw will be the vesc6, but with a rectangular PCB with SMD electrolytic capacitors instead of the through-hole ones. This way it can be wrapped in heatshrink without worrying about bending the leads of the through-hole caps.
Do you have any code that shows how to use the mpu9150 you added in a control application? I still haven't been able to find any freelance programmers that could figure out how to make a control app using an IMU after 12 months.
I will probably add support for that in the firmware soon, but first I'm waiting for a PCB with a MPU 9250 to see if I can update the driver so that it works for both.
Thanks for the info, the main thing I don't quite understand is how to connect the MPU to the VESC app, assuming I had an mpu9050, I want to run a kalman filter and then use the result in an app. Do I just place mpu9050.c & mpu9050.h in the root directory and add them to includes in the main.c file? Would the kalman filter be performed in the control app or in the mpu9050 c file?
Bump!
At least 3 members have done a project like your wanna do.
Paltatech among others.
Have a Nice Day.
Thierry
Thanks!
I was more interested in the reference hardware. I'm finding that my weird logic & power board v4.12s seem to be completely unsupported by the new VESC-Tool and I'm a little weary of hacking about.
I am also very much looking forward to the reference design release since I have some custom ideas brewing. It would be awesome to get an official update on this.
Cheers!
I will finish it soon, sorry about the delay. Here is another link to the schematic of the VESC6 for convenience:
http://vedder.se/forums/download/file.php?id=438
Essentially the reference hw will be the vesc6, but with a rectangular PCB with SMD electrolytic capacitors instead of the through-hole ones. This way it can be wrapped in heatshrink without worrying about bending the leads of the through-hole caps.
Awesome news! Thanks for the update Ben. I can't wait to see the new design!
Do you have any code that shows how to use the mpu9150 you added in a control application? I still haven't been able to find any freelance programmers that could figure out how to make a control app using an IMU after 12 months.
This code uses the MPU9150:
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...
You can set USE_MAGNETOMETER to 0 and use a MPU6050 as well, which is easier to buy.
Remove the i2c initialization from mpu9150.c and use instead
void hw_start_i2c(void);
also set I2C_DEV to HW_I2C_DEV in mpu9150.c
You can set a callback for when new readings are received:
mpu9150_set_read_callback(mpu9150_read);
Which can be implemented something like this
static void mpu9150_read(void) {
float accel[3], gyro[3], mag[3];
mpu9150_get_accel_gyro_mag(accel, gyro, mag);
}
Those values are raw sensor readings. If you want to get an orientation you can use
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...
https://github.com/vedderb/rise_sdvp/blob/master/Embedded/RC_Controller/...
with this function
static ATTITUDE_INFO m_att;
ahrs_update_madgwick_imu(gyro, accel, dt, m_att);
dt is the iteration time in seconds, which you can get from chibios. Then you can get euler angles with
float roll = ahrs_get_roll((ATTITUDE_INFO*)&m_att);
float pitch = ahrs_get_pitch((ATTITUDE_INFO*)&m_att);
float yaw = ahrs_get_yaw((ATTITUDE_INFO*)&m_att);
I will probably add support for that in the firmware soon, but first I'm waiting for a PCB with a MPU 9250 to see if I can update the driver so that it works for both.
Thanks for the info, the main thing I don't quite understand is how to connect the MPU to the VESC app, assuming I had an mpu9050, I want to run a kalman filter and then use the result in an app. Do I just place mpu9050.c & mpu9050.h in the root directory and add them to includes in the main.c file? Would the kalman filter be performed in the control app or in the mpu9050 c file?