Thank you for getting back to me so fast. I have been working on creating a quaternion based DCM filter by reading your papers and got to a point where I now have the roll pitch compensation using accelerometers, yaw compensation using magnetometer and magnetometer offset calculation using the rotation matrix working.
Recently I have been trying to implement the magnetometer offset cancellation using magnitude (Revisted Oct 14, 2011 paper) but could not get it to work. One question I had about the implementation is whether bB2 and bB1 have offsets subtracted before you update the offset with equation 6 on page 2. I assumed that the offset was subtracted before using equation 6. The implementation seems straight forward and simple so I don't think I'm making arithmetic mistakes trying to implement it. The offset estimation converges to the correct offset values when the unit is in motion but diverges away when the unit is stationary. I was wondering if you had any ideas on why this might be happening and if I am making some fundamental errors that you have corrected out that has not been done in my filter.
I get data from a imu unit which uses the Invensense mpu6050 along with the AK8975 compass and analyze it using Scilab. Attached is the code I use to update the magnetometer offset (bo) along with a plot of bo versus time. The xaxis is seconds and the yaxis is uT. The thick line is magnetometer offsets x,y,z calculated using the rotation matrix. The thin line is magnetometer offsets x,y,z calculated using the magnitude. MagnetormeterOffsets.pngmagoffsetCode.txt
No comments yet!
You need to be a member of DIY Drones to add comments!