Magneto meter Issue cause of yaw problems ?


Hi Guys


Have any of you seen this happen


after loading new code and reseting APM . setting declination my APM board magneto meter seems to be drifting .


my board is on the table pointing north and in the APM planner you can see it does a full 360 drift while still pointing north . does doesnt change even if  make the declination from - to + any body else getting this ? this is reconfirmed with my code always yawing badley .

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

Join diydrones

Email me when people reply –


  • Hi there,

    i'm having the same problem as Johann with my APM1 + mag.

    Since i updated to version 2.1.* the copter started to yaw for quite a while after takeoff, but recovered after ~30 seconds. In loiter mode is also doing circles. Moving to version 2.2 didn't help and also going back to 2.0.45 (which i used before) didn't.

    My declination setting is correct (+1,26)

    I already resoldered my magnetomter to the board.

    When i read the heading of the magnetometer in flight planner i get wrong readings compared to my phones compass. When i turn my apm by 90 degress it only reports a change in heading of about 90 degrees but then drifts back by -20 degrees, while the apm is at rest. Then if i rotate it 90 deg further it reports a change of 170 and then also drifts by +20  (almost back to normal, which would be 180). Interesting thing is, that it seems to get north always right.

    I already tried moving the copter around in circles after startup, but that didn't change anything.

    So i checked the magnetic offsets in the CLI (setup->compass) and they were all 0. Then after some waving around of the copter they changed to some values. Then i did a reset and waved the apm around and after quite a while i got new mag offset values... but these were different than before (heading still being wrong).

    So i tried the AP_compass test in Arduino.

    Still wrong offsets like in the FlightPlanner.

    While running the test i waved the apm around until the offset values of the output didn't change any more. Then i put these

    offset values into the code of the AP_compass test where the mag is beeing initialized and suddenly the compass readings are correct.

    For me it seems, that the Arducopter Code forgot how the calibrate the mag offsets.

    But strange thing is, that going back to the previous version doesn't change anything.

    Is there a possibility to enter the mag offsets into arducopter code manually?


  • think got the same problem...

    does it take off ?

  • Stupid question, but is your magnetometer activated in the setup and working?

    Apparently, just because its working in the CLI, doesnt mean that DCM is using it to correct yaw drift.

    I remember back in the day (when I got my first apm from you)

    I got this exact issue, but it was because I didnt have a magnetometer. Chris said its caused by gyro drift...


  • I had a similiar issue recently:

    For me if you click on the Status tab, the yaw value was constantly counting down while the compass counted down as well.  In your video we cannot tell if the yaw value is changing.  I did fix my issue by going into CLI, 'setup, 'erase', 'reset' and then reloading the firmware.  Now when sitting on the table the yaw value and compass direction no longer count down... and best of all it flies normal again.

  • What magnetic declination are you using?

This reply was deleted.


DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #14 - #ParkingLotNerds join us January 15th for #AutonomousRacing #RoboRace ⁦@DAVGtec…
1 hour ago
DIY Robocars via Twitter
RT @chr1sa: And after that came our races, 50 in all. This battle between these two Russians was the best we've ever seen -- incredible fig…
1 hour ago
DIY Robocars via Twitter
RT @chr1sa: Before our @DIYRobocars virtual race this weekend, we had a presentation from the team that won the Indy Autonomous Challenge i…
1 hour ago
DIY Drones via Twitter
Dec 12, 2021
DIY Robocars via Twitter
Dec 12, 2021
DIY Robocars via Twitter
RT @chr1sa: Just a week to go before our next @DIYRobocars race at @circuitlaunch, complete with famous Brazilian BBQ. It's free, fun for k…
Dec 4, 2021
DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training
Nov 28, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Nov 26, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25, 2021
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23, 2021
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord:
Nov 23, 2021
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20, 2021
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20, 2021
DIY Robocars via Twitter
Incredible training performance with Donkeycar
Nov 9, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Sat Nov 6 Virtual DonkeyCar (and other cars, too) Race. So bring any car? @diyrobocars @IndyAChallenge…
Oct 31, 2021