Hello all,
I am in the process of porting the Arduino code for the MinIMU-9 v3 to mbed. I have been able to get the code to talk and get data from the devices, but am still working on getting the calculations correct for the drift corrected angles (yaw, pitch, roll). In the main loop in the Arduino code, it should look something like the following. Could someone tell me what ‘normal’ values are for the sensor lying still and flat right before all the calculations? The raw data should be in gyro_x, gyro_y, gyro_z, magnetom_x, magnetom_y, magnetom_z, accel_x, accel_y, accel_z after Read_Gyro(), Read_Accel(), Read_Compass().
Read_Gyro(); // This read gyro data
Read_Accel(); // Read I2C accelerometer
if (counter > 5) // Read compass data at 10Hz... (5 loop runs)
{
counter=0;
Read_Compass(); // Read I2C magnetometer
Compass_Heading(); // Calculate magnetic heading
}
//I'm looking for the values of gyro_x, gyro_y, gyro_z, magnetom_x, magnetom_y, magnetom_z, accel_x, accel_y, accel_z here to see if the data is being read properly before the calculations.
// Calculations...
Matrix_update();
Normalize();
Drift_correction();
Euler_angles();