Arduimu magnetometer calibration

Hi,

I was wondering if anyone knew how to calibrate the compass when used with the ArduIMU. I saw Bill Premerlani's code for the UAV DevBoard, it is very interesting and it would be really cool to calibrate the compass in flight by sending a signal, but it's not quite the same with the ArduIMU in the arduino code that is on google code I think.
Any idea?

Thank you in advance,

Christophe

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi everyone, 

    I can see it's been a while since there's been activity on this topic. Has anyone successfully accomplished ArduIMU magnetometer calibration as John describes?

  • Don't worry about it. The cod ewill handle it. The yaw axis is stabilized by the Magnetometer. Or else get a real compass and calibrate it with your eye. Right or left or only is up to you...:)
  • Christophe,

    When the magnetomter is initialized, it is run thru a self test as desribed in the HMC5843 datasheet. This should output a specific set of numbers. The difference between these readings and their theoretical value (715 the way I set up the magnetometer) is the scale factor that must be applied to every set of magnetometer readings. This is done once at the beginning of each power up sequence.

    The bias calculation is done every frame. I can't recall all the terms at the moment, but I believe this is referred to as the soft iron correction. The reason for doing this every frame is that the magnetic environment can vary with the varying loads on the motor/battery system, for example. This alleviates the need to do the mag cal swing you referred too.

    If I understand everything correctly, this is the whole point of the algorithm described in Bill P's post., and what I tried to implement in this code.

    John
  • Here's my code. I changed the formatting somewhat so I could read it easier. The matrix multiply routine and matrix storage method has been changed too. This was to accomodate matrix mulitplys in various dimensions. This also forced changes in the vector library.

    Not the cleanest code, I've been away from C programming for a while, but I believe it's working as intended.

    myRazorAHRS.zip

  • Didn't even see that that "Upload Files" link on the bottom of the page, will upload the code when I get home this evening.

    John
  • Christphe,

    I've implemented the HMC 5843 scale factor adjustment and bias adjusments to the Sparkfun Razor IMU code. Should port to the arduIMU fairly easily. I just need to figure out how to post the code.....

    John
This reply was deleted.

Activity

DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13, 2022
More…