(Almost Crash)Toilet Bowl after many hours flying in loiter

Hi,

Today I had a terrible problem that didnt turn to a disaster, I was flying close to the beach when suddenly the copter started to go woblle slowly and go to the side, it wasnt normal as I was flying for over 4 minutes in loiter, I then, turned rth and it went crazy again, I switched stabilizer on and brought it back normaly, when I was close and the situation was controled, I then turned loiter on when I saw it was going in a toilet bowl, tried rth and the behaviour was similar, what I dont understand is how it can happen after over 10 flights I have had in this similar configuration and it never happened? Later I tried to fly in stab and it fliped the quad for no reason as it never hapened also , I am attaching log file from the TB problem for whom can help me, thanx in advance.

Jvictorfc,
Just a quick observation…

If you load your log file into mission planner and review the log in the log browser, select GPS glitch from the drop down you will see all of your mode changes in the graph as well as several GPS errors indicated.

The major common factor that’s in Loiter and RTL and not in Stabilize is GPS. So my guess is that you had a bad GPS signal for some reason. Looking deeper into the logs may tell you more… like why it flipped in stabilize…

Steve

You have compass_external set to 1. Do you have the 3DR GPS/mag unit? If so, compass_orient needs to be 8. Unfortunately, you don’t have enough data for me to check this, as you are not logging MAG.

This could easily flip a copter, as the AHRS requires the compass to be correct or it will apply corrections to the wrong axes.

[quote=“jschall”]You have compass_external set to 1. Do you have the 3DR GPS/mag unit? If so, compass_orient needs to be 8. Unfortunately, you don’t have enough data for me to check this, as you are not logging MAG.

This could easily flip a copter, as the AHRS requires the compass to be correct or it will apply corrections to the wrong axes.[/quote]

I have an external compass, the prblem I have when the quad flipped it’s not related to compass as I was in stab mode, what is most strange it’s the fact I was flying for over 5 minutes and just after that the problem appeared.

I also noticed that there were quite a few battery power fluctuations in your log, almost like a lose lead or something, could be causing gps errors and flips…

Also are you in simple or super simple modes?
Steve

A very bad compass could flip a copter in stabilize.

[quote=“jschall”]
A very bad compass could flip a copter in stabilize.[/quote]

Could you please describe the logic behind that ? - I cannot understand where /why compass would be used for stabilize mode.

I am far away of being an expert but I have also the opinion as I have seen that the compass doesn’t interfer in any way and is not even used in stabilized mode.
Anyways talking about my problem, today I rechecked the compass orientation and it’s correct, It’s set to 0 because I am using the external standalone compass and it’s set per it’s instruction, with the drone pointed forward. I also re-did compass calibration which was shown very different of what was set, everything under -150 and 150. thanx to everyone trying to help.

The compass is used in the attitude determination. I haven’t tested whether it is possible for an incorrectly oriented compass to actually crash a copter in stabilize, but it is important to be aware that it is used in every mode.

The compass is used in the attitude determination. I haven’t tested whether it is possible for an incorrectly oriented compass to actually crash a copter in stabilize, but it is important to be aware that it is used in every mode.[/quote]

Jschall,

Today I did a live calibration and flew a little bit, could you take a look at my log to see if there’s any problem with my compass or anything else? Althought I have a very nice stab my loiter maintain position very well but it is sluggish when I give command and it wobbles forth and back when I am flying in loiter.

[quote=“jvictorfc”]Jschall,

Today I did a live calibration and flew a little bit, could you take a look at my log to see if there’s any problem with my compass or anything else? Althought I have a very nice stab my loiter maintain position very well but it is sluggish when I give command and it wobbles forth and back when I am flying in loiter.[/quote]

I would recommend that you do an autotune. It will give you fairly aggressive gains - do it in the lightest configuration that you’re likely to fly (no cameras etc). A “nice stabilize” (by which I assume you mean a nice hover) doesn’t really mean that you’re getting the fastest response that you can get.

This will reduce the delay between the loiter controller demanding an angle, and the copter achieving it. Really the only other thing on the menu is to improve vibration and compass.

I did autotune, it did stabilize go from 4.5 to 9, loiter is better but it’s very agressive in stabilize mode, is there a way of have a flying loiter with less agressive stabilizer?

For now: reduce the stabilize gain.
In future releases: set the acceleration limit lower.

[quote=“Andre-K”][quote=“jschall”]
A very bad compass could flip a copter in stabilize.[/quote]

Could you please describe the logic behind that ? - I cannot understand where /why compass would be used for stabilize mode.[/quote]

Ok…

The gyros are the primary attitude sensors of the entire system. We actually use gyros to remember which way is “down”, not the accelerometers. We simply integrate the gyro rates to figure out what our attitude angle is. However, gyros have “drift”. They give false readings as temperature changes, and a whole bunch of other things. If you only have gyros, you’ll have errors over time that will lead to attitude errors. So you need something to stop the drift. That is what we use the accelerometers for. The accelerometers point “down” when we are hovering, and we use that as a reference to determine how much the gyros have drifted, and correct for it.

However, what about yaw? Yaw gyros also drift, so we need a vector to correct the yaw drift. That is what we use the compass for. So the compass doesn’t simply tell us where north is, even if we didn’t care where north is, it still gives us an “anchor” for the yaw gyro drift.

There’s another important aspect to this. When doing high dynamic flight, such as high speed turns, the accelerometers don’t point down anymore. They point all over the place, due to the accelerations of the copter. This can actually mess up the pitch and roll gyro drift cancellation. Causing all sorts of errors in the pitch and roll angle estimation. And in fact, we used to see this about 2 years ago.

We now use the GPS to help, even in Stabilize mode! So what it does is, the GPS tells us “hey, you’ve just accelerated forward, so that gravity vector you got from the accelerometers actually had an error in it, it was pointing backwards as you accelerated forward. You must now have a gyro drift error, so go ahead and subtract that error from your gyro drift estimation.”

And here’s where the problem could occur. Say the copter is pointing north. And you accelerate to the north. Your GPS tells the attitude estimation system that you just accelerated north, in this case that aligns with “forward”. But what if your compass was backwards? The copter actually thinks it if facing south. So the acceleration compensation would actually point in the wrong direction. This would mean that not only did you have a pitch error because of the acceleration, it would be doubled, because the GPS correction is going the wrong way!

In my mind, it’s pretty inconceivable that this could actually cause a crash however.

Rob
thank you for letting us know that stab mode use gps
and how about Alt hold ? is gps used as well ?

Yes, it would as well because the pitch roll and yaw controllers are exactly the same as in Stabilize, it’s only the throttle which runs in a different mode.

Note, that while Stabilize mode is enhanced by GPS when available, you can fly in Stabilize without it. You’d never notice a difference while hovering, or in typical multirotor flight. I only noticed the difference in high speed flight on a helicopter, banking and yanking turns at 100 km/h.

Thank you very much Rob
This is a New knowledge I would keep in mind as at RCG they were thinking differently :smiley:

Hi, are there any thoughts of making this GPS acceleration vector correction optional?
I have read several stories now of crashes after bad GPS data. I had a case looking like that myself too (did not look into logs yet). Quadcopter suddenly flew in a perfectly straight line into a house. Cannot have been mechanical/electrical or it would have tumbled. Was not a bad flight plan.
Now I would prefer the assurance of having something that can perform basic flight under any signal conditions over something that corrects small imperfections after avoidably rough or repeated turns. That is, I hope the feature can be turned off.
Regards
Soren

It is optional. AHRS_GPS_GAIN. In the future, we will be using an EKF and it won’t be optional, but it won’t ever cause problems.

AHRS losing attitude is not usually the cause of such flyaways. It is usually the position/velocity solution that goes off, because of GPS, IMU or compass being bad.

In the future, PIXHAWK’s will be using EKF. EKF is far more refined and will not get an inaccurate attitude.