I've wiped my board (reset APM to default), then reprogrammed 2.0.55. I have the compass and sonar, along with an XBee 900 pro for telemetry. Removed the XBee, no change. Removed sonar, no change.
The compass constantly reads in an endless loop of rotation, sometimes it changes direction after a reboot. See the first 10 seconds of the youtube video below.
Previously when I enabled the compass in mission planner, it calculated my offset based on the GPS lock (at least that's how I remember it). This time it didn't grab the declination until I entered the first three digits (14.1, San Jose CA) myself.
Level was set manually and works fine, pitch, yaw and roll respond normally, only the compass is whacked. From the tuning (screencap below) I see the target_bearing go from 0-360 in an endless loop as well.
Worked fine in 2.0.49. :-) Any expert advice would be appreciated.
That looks to me like gyro drift that is not being compensated for by the compass. So it's not the compass that is providing the bad heading but rather the compass is not working and so it's not being used at all to offset the gyro drift.
Of course you've enabled your compass through the mission planner or CLI menu right?
Can you use the CLI menu to test the compass? put the white switch towards the back, connect using usb, type "test" then "compass"
I finally figured out that loading code with the Arduino IDE v.1.0 doesn't work, kept thinking I was missing library files. I loaded up 2.0.55+AltHold, I presume I can call this the latest stable release until Friday.
Compass test from the CLI shows it's fine one time. After restoring the CLI switch to flight mode and restarting, it's doing it again. This time in the opposite direction as well. I went back to CLI, now the readings look to be off by 90 deg. Completely wiped settings, reset everything. Holds stable until I move the quad the first time, then it starts again.
Odd, it was fine with 2.0.49 and no crashes recently. I'll wait for 2.1 and see what happens. :-)
After loading 2.1 everything looks good. Not sure what happened, but I will be back in the air soon. Cheers.
Same hard/software here. Mine does the same thing: very slow, continuous CCW rotation- but only inside. If I take it outside for a minute or less its spot-on and tracks very fast- till I bring it back inside.
I can only imagine that this is caused by magnetic interference in your house. It's nearly impossible to imagine it has anything to do with the GPS because the GPS isn't involved in the yaw correction in any way. It would be interesting to see how a regular hand-held compass fares in the house. You also might want to double check that you don't have any metal screws near the compass that could be throwing it off although this wouldn't explain an indoor vs outdoor difference that you're seeing.
I wonder if the magnetic field inside the building is completely blocked, so the compass is not measuring anything? Would mean that it is operational, but not returning any heading value?
For what its worth, I had this same problem. I did not have any problem with the installation of .55 and I had terrible drift in the compass. I had to disable simple mode as it would be almost impossible to fly. if it makes any difference, I also did an erase and re-flash before I flashed .55
after an upgrade to 2.1 now, the compass is very stable. Also I noticed the "level" in the mission planner is now actually level while in .55 it was not.
I know we are all past this, but I thought more information is better then less.