Thanks to Jason and DIY drones / ardupilot community for creating all this for us!
I have been fooling around with latest arducopter 2 beta 1. So far everything has gone very smoothly
Quick question. where do we define how our magnetometer is mounted? also How do we perform the mag offset using this code? or are these determined automatically in the code?
The mag offsets are determined automatically in the code.
However, you still have to modify a #define in the code to tell how your mag is mounted.The default position is the one described in the wiki so if yours is like that, you can use the firmware provided by the APM Mission Planner with no modification.
Otherwise, if your mag is mounted differently, you will have to download the code, modify APM_Config.h as explained in the wiki, and build your own firmware.
My mag is soldered to the oilpan with a header - so I presume I don't have to define the mag orientation. The mag is reading heading correctly, but all the offsets remain zero.Yaw hold with compass on is sloppy and poor. With compass off it is much better. I have turnid yaw PIDS up but does not help much unless i need to go to real high values?
its like with the offset correction with each small roll or pitch the compass must be jumping around ?
Check ur Declination. Mine is 14. 5'' which = an offset of 6 deg
so my declination should = 6. WRONG
Declination really = -6 CORRECT
Now it seems to work better
my issue was with piratesNG code and thats how i fixed it. wierd to me. AC2 Is good to go I checked it with many declination configs.
Not sure if this would apply to yours, but others mentioned in different post that your computer and in general you house may be affecting you magnometer. I noticed that the Iphone's compass I used was about 40 degrees off from the APM's magno reading until I walked away from the computer towards the balcony. Here it stabilized, but the two still weren't even close. Next time, I will try outside with APM/magno away from the computer and any potential interference.
If the difference is only a few degrees, try to look up the declination for your location.
My issue is not that the compass is reading the heading incorrectly. My local declination is 15.167 and when input as such during setup, the mag reading is right on with north. My problem is that with Mag enabled, my yaw hold is very poor. it drifts back and forth, and I constatnly have to be on rudder to correct. with Mag off, the yaw holds very much like a heading hold heli.
I don't think declination being off comes into this since I am not currently testing loiter or RTH - nbut regardless my declination is correct. Russell I an am not sure where one would enter the offset and how you calculated it. I entered the declination as per the insturctions during the set up routine
Also I don't see where the offsets are being saved by the code. with the Ardupirates version I was using there was a routine to read offsets while one rotates the copter around in all orientations etc. My offsets are reading 0,0,0
Yeah I checked Declination is good with AC2, Man I wish I had a Tx so I could fly my quad to help out more. I had this same problem with PiratesNG code.
in CLI mode when you type compass are your x,y,z offset 0,0,0 or have they been set to something else?
thanks for your help
I think not.
Does someone have the link to the reference between DIY and sparkfun mag?