jpatrick62
Well-known member
First, thanks for writing the library class, great job. I found my Nan issue (it was essentially an unformatted EEPROM entry). I basically used a Teensy 3.2 to run your class library and sent the results over a USB connection to a Windows WPF program. The program had a 3D object whose movements emualate the movements of the MPU. The Windows program displays the bias and scaling obtained by using your library so the user can see the units. I have also tried to build a graphical way for the user to calibrate the MPU using your class library as well.
So everything seems to work functionally, but I am seeing some calibrations issues as the object starts off well but then starts to drift in time. The calibrateMag function is self explaining, but I do have some questions on the calibrateAccel function.
You explain: This function works one axis at a time and needs to be run for all 6 sensor orientations. After it has collected enough sensor data, it will estimate the bias and scale factor for all three accelerometer channels and apply these corrections to the measured data.
So I’ll assume we do the X+,X-, Y+, Y-, Z+ and then Z- orientations, which is how I set it up. I guess the question arises from my very limited AHRS experience is: do we physically orient the MPU’s embossed XYZ vector arrows for each reading to magnetic North? For instance, I am using the Imverness MPU9250. I know the vectors of the unit are marked as such on the board and the +Z vector in this pic is coming at you.
Now I know this seems trivial and silly, but I just cannot seem to wrap my head on the physical orientation of the unit for accelerometer calibration.
So given the magnetic north as shown in the pic below, would aligning the MPU in this manner constitute X+ for calibration?
X-?
Y+?
Y-?
Z+?
Z-?
Sorry for such a silly question, but the physical alignment of the unit for calibration is the last thing I need to get my project going.
So everything seems to work functionally, but I am seeing some calibrations issues as the object starts off well but then starts to drift in time. The calibrateMag function is self explaining, but I do have some questions on the calibrateAccel function.
You explain: This function works one axis at a time and needs to be run for all 6 sensor orientations. After it has collected enough sensor data, it will estimate the bias and scale factor for all three accelerometer channels and apply these corrections to the measured data.
So I’ll assume we do the X+,X-, Y+, Y-, Z+ and then Z- orientations, which is how I set it up. I guess the question arises from my very limited AHRS experience is: do we physically orient the MPU’s embossed XYZ vector arrows for each reading to magnetic North? For instance, I am using the Imverness MPU9250. I know the vectors of the unit are marked as such on the board and the +Z vector in this pic is coming at you.
Now I know this seems trivial and silly, but I just cannot seem to wrap my head on the physical orientation of the unit for accelerometer calibration.
So given the magnetic north as shown in the pic below, would aligning the MPU in this manner constitute X+ for calibration?
X-?
Y+?
Y-?
Z+?
Z-?
Sorry for such a silly question, but the physical alignment of the unit for calibration is the last thing I need to get my project going.