Basic program to obtain properly-scaled gyro, accelerometer, and magnetometer data from the MPU-9250 9-axis motion sensor and do 9 DoF sensor fusion using the open-source Madgwick and Mahony sensor fusion filters. Running on STM32F401RE Nucleo board at 84 MHz achieves sensor fusion filter update rates of ~5000 Hz.

Dependencies:   BufferedSerial ST_401_84MHZ USBDevice mbed

Fork of MPU9250AHRS by Kris Winer

Files at this revision

API Documentation at this revision

Comitter:
onehorse
Date:
Tue Aug 05 01:34:45 2014 +0000
Parent:
0:2e5e65a6fb30
Child:
2:4e59a37182df
Commit message:
Corrected self test

Changed in this revision

N5110.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/N5110.lib	Sun Jun 29 22:02:30 2014 +0000
+++ b/N5110.lib	Tue Aug 05 01:34:45 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/onehorse/code/JUNK/#b141fa7ede70
+http://mbed.org/users/onehorse/code/Adfs/#28c629d0b0d0
--- a/main.cpp	Sun Jun 29 22:02:30 2014 +0000
+++ b/main.cpp	Tue Aug 05 01:34:45 2014 +0000
@@ -86,6 +86,13 @@
     wait(1);
     
     mpu9250.resetMPU9250(); // Reset registers to default in preparation for device calibration
+    mpu9250.MPU9250SelfTest(SelfTest); // Start by performing self test and reporting values
+    pc.printf("x-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[0]);  
+    pc.printf("y-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[1]);  
+    pc.printf("z-axis self test: acceleration trim within : %f % of factory value\n\r", SelfTest[2]);  
+    pc.printf("x-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[3]);  
+    pc.printf("y-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[4]);  
+    pc.printf("z-axis self test: gyration trim within : %f % of factory value\n\r", SelfTest[5]);  
     mpu9250.calibrateMPU9250(gyroBias, accelBias); // Calibrate gyro and accelerometers, load biases in bias registers  
     pc.printf("x gyro bias = %f\n\r", gyroBias[0]);
     pc.printf("y gyro bias = %f\n\r", gyroBias[1]);