Im using the mpu-9250 IMU and the arduino nano. I need help figuring out how to get the program to use the starting pitch angle (currently if the IMU is started at an angle, the pitch reads 0 and moves from there).
Also the yaw does not seem to work and I need help fixing it. It just seems to stay around the same figure no matter what direction I point the IMU- it will only fluctuate slightly for a moment, then goes back.
Im using this example (I have removed the LCD code):
jremington:
You need to go through the calibration procedure, at the very least for the magnetometer.
Thanks, I'll try that for the yaw issue.
This also solved the starting pitch issue- well kind of. The code always calibrates the gyro and accelerometer causing the pitch to start at zero. By commenting out the line below I now get a starting pitch figure.
I think I will just run the calibration one time on a level surface, then hard code the gyroBias and accelBias that it comes up with. If that makes sense.