I've come across what I suspect may be a bug in AP 2.5 and also maybe in 2.6. What happens is the APM will, shortly after takeoff, start showing an incorrect attitude which is always a pitch up relative to the real attitude. I've seen this happen several times in my flying wing with AP2.5.
In the attached log, which is a short flight that followed a completely successful flight, the wing takes off and gains altitude in FBW-A. Then I switch to RTL and it seems to be working at first. Almost as soon as it gets to 100m, the actual plane starts pitching down and losing altitude but the attitude indicator still shows level flight. I then switch to FBW-A and pull back all the way. The plane continues diving down at about 30-35* down but the HUD shows a huge pitch up. Then I switch to manual and the sudden control surface change makes the plane roll around a lot but it actually recovers to more or less right up in real life - I didn' tthink I could fly it manually so I switched back to FBW-A and it just kept diving until it crashed.
I have the APM secured in the plane with 3-4 square inches of velcro and it takes some muscle to get it off, I'm very confident it did not come loose in flight. It was still securely in place even after the crash as well. Whatever is causing this doesn't happen every flight, I did have several successful flights but I've also seen this issue 2-3 times so far.
Has anyone else seen this? If it's not something in the software, any ideas what might cause the APM to sense a false positive pitch?
Replies
Hi Jeff,
Jon Challinger and I had a closer look at your log file, and we found that there was indeed a serious bug in ArduPlane 2.50 when you don't have GPS lock.
The problem was the z acceleration correction which comes from the barometer code. With no GPS fix, the _last_velocity vector was zeroed where there is no GPS lock, which led to the vertical velocity delta being calculated as 10*barometric_climb_rate. That resulted in the corrected accelerometers being inverted, which meant the drift correction was reversed, moving it away from the correct pitch instead of towards it. That is why your plane thought it was pitched up when in fact it was pitched down.
The bug was fixed as a side effect of the 2.60 work on dead-reckoning. I'll do a posting on the 2.50 release thread to warn people about the bug.
Note that flying without a GPS or airspeed sensor is also not recommended. We will never be able to get a really accurate attitude estimate without knowing our speed.
My apologies for the bug and that it caused your plane to crash!
Cheers, Tridge
Hmm. Well, a plane with no GPS and no airspeed has no reference velocity for the AHRS, and in a plane this means it is essentially impossible to get a good attitude.
Whether that would make your pitch go so wildly off, I don't know...
My recommendation is, get an airspeed sensor if you want GPS-out robustness.
vibration, or loss of good GPS signal are your most likely cause/s. step ( 1 ) check your logs to see if you had a good number of sattelites ( above 6) and that the HDOP value is around 1 ( or 100 ) . step ( 2 ) try to *not* secure the APM down, mount it with as soft of a mount as you can imagine, eg suspended with rubberbands, or an anti-vibration mount like ( http://www.rangevideo.com/index.php?main_page=product_info&cPat... ) that one.