-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multirotor inverted crash detection #10099
Multirotor inverted crash detection #10099
Conversation
I gave it some tests. Having Most of the time it wouldn't disarm at all.. Which I think was because the landing detector expects the quad to be sitting still.. Which is not going to happen when the quad is upside down, with the props chewing up the grass. I also notice, even with |
How did you test @Jetrell, motors running or not ? I assume you didn't try it with props mashing up the grass ? One of the problems I can see is the vibration from props hitting the ground and being damaged causing vibration. This will potentially screw up the altitude estimations which will prevent this PR from working if the estimated Z velocity exceeds 1 m/s. Other than that the logic is very simple, just needs to be upside down. Did you try just holding it inverted without the props hitting anything (or motors disabled using ground test mode). One of the problems with this is a proper test will likely damage props and motors, something most people aren't going to want to do. Testing with a whoop I guess is one option but then you don't get the vibration that might upset the Z velocity estimation. I guess the other possibility is to look for the vibration but then some quads might have clear props when inverted so that's not fool proof either. Not sure about the Failsafe issue. It reset correctly when I tested just now. |
Yes, with motors running.. I figured it wasn't much point unless the quad was in nav rth. And I triggered an RX failsafe straight after wards. To simulate what happened in the cases this feature was designed to protect against. I've got used to mitigating damage in tests. But the grass still sticks through the cage I made for testing.. Although I'll have to print another cage.. But the quad wasn't damaged. And these are the results I seen after 7 tests..
It would operate after the RC link was re-established.. But the OSD FS warning message and FS flight mode wouldn't go away until after a reboot. |
Well you'd need to look at the logs. Check attitude[0] and attitude[1] and also navVel[2], see if they remain within limits for the time delay you set (2 + 4 = 6s). navVel[2] should be below 1 m/s. Can't see why it didn't work if these values remain within limits. I assume landing detection was active when you tested. It needs throttle above hover throttle and some movement to activate the landing detection which is required for this PR to work. Failsafe sounds like it's just stuck in Failsafe mode even after the Rx is re-connected. What does the log say ? Edit: |
Yes, landing detection was active. But the times it didn't disarm, it was between -1 to -3m/s. When upside down, the Baro altitude remained with 0.5m fluctuation. And GNSS EPV was relatively constant, around 200.
It stayed in FAILSAFE RX LOSS MONITORING
Yes.. Disarmed and rearmed.
Yes, as always. Airmode throttle threshold and hover throttle is well and truly meet before these tests. |
So the quad is in a crash cage and the props aren't clipping anything solid causing vibration ? Is vibration high in the logs ? I thought the Z velocity might be an issue. I guess the fact the quad body is on the ground with motors spinning creates vibration in itself which screws things up. Might have to think of something else in that case. To get out of Failsafe after a landing you need to waggle the stick then wait 30s and be disarmed ... then it should reset. Worked last time I tried it on a fixed wing. |
Thanks for the tip about the 30s failsafe landing reset. I didn't know about that. Can I ask. How motionless did you have your quad before it disarmed, when you performed the bench tests ? |
I was just wobbling it about and shaking it at the same time .. which probably doesn't simulate the sort of vibration you get from motors. Could use Baro rate instead of estimated Z velocity I guess, which is available, but not sure how well that will work to differentiate between a quad jumping about on the ground upside down and a quad free falling during flips etc. |
I'm thinking now it might be better to just use estimated altitude to check for vertical movement and increase the minimum delay to 5s which should still help significantly to limit damage and risk from an out of control quad. @Jetrell it would be useful if you could check what navPos[2] was doing during the tests you did above. I get the impression Position isn't as sensitive to acceleration factors as Velocity is so maybe it's a more reliable value to use. |
Sorry. I deleted those logs, thinking I wouldn't need them anymore. I do remember looking at it. And comparing it to baro altitude. The two were reasonably steady, within a meter of each other.. Although this particular quad has good separation between the GNSS module and other RF noise emitting devices. Meaning it held a good fix and low HDOP, even when the GNSS module antenna was facing the ground. |
Changed to use an inflight sanity check based on vertical position rather than velocity. Hopefully more reliable. |
I tried two types of tests using vertical position. 1) Taking off and entering a hover, and then flipping it over just above the ground, while entering failsafe. 2) Took off and flew >10m from the arming location at 2m above the ground. Flipping it over and entering failsafe. I could trick it to disarm by failsafe with the motors running and the props removed. When I did a ground test.. But not every time.. And its not a real world situation. This showed the worst case from the 2nd test method. |
OK, maybe this should just use Baro for a sanity check and increase the altitude margin to say 5m. Can't see a flying quad remaining within a 5m altitude band for >4s when inverted. Theoretically it could stay within a 5m attitude band for at most around 2s in flight when inverted assuming the props don't provide any significant translational lift. The props if anything should push the quad earthward when inverted even at idle. I suppose the other question is how long can a quad realistically fly for inverted, in ACRO mode I guess ? Never tried it but I assume it's possible to flip it on its back and freefall inverted ... so available height is your only limitation timewise ? |
Yes.. In theory any prop draft will be blowing skywards, when the copter is inverted after a flip crash. So the barometer is less likely to see prop-wash effect it.. So the barometer should provide a stable means of measurement. You can use thrust to start a climb before the quad is flipped inverted and the throttle lowered. So hang time could possible be a few seconds before it looses upward inertial motion, and starts to descend.. We are seeing more BF freestyle pilots giving INAV a crack. |
OK 3rd attempt at getting this to work reliably. Changed to using Baro rate to detect vertical movement which is probably what should have been used to begin with given it shouldn't be affected by vibration. Inverted detection should now only trigger if Baro rate is below 2 m/s. This could be adjusted higher if it still causes problems from testing. It certainly stops it triggering just by moving the quad rapidly up and down by hand which results in a Baro rate slightly higher than the 2m/s limit. |
Looks much better with this method. And I also held it down once in FS without instigating a flip before hand. And it didn't disarm when upright. Which seems correct.
|
I did work out that if you assume a flipped quad in flight acts like a projectile then at the normal expected flight speeds or even just moving vertically it shouldn't remain within the +2 to -2 m/s vertical velocity range for any longer than only around 0.5s. In reality there will be some thrust pushing it earthward so it would probably be even less time than this. So a minimum disarm delay of 4s leaves a lot of margin. Although I've just realised this needs inhibiting during Turtle mode. Should be OK to merge otherwise. |
Disarms a multirotor if it has ended up inverted on the ground following a crash and can't be disarmed manually due to loss of control.
Detection is based simply on a roll angle > 100 degrees or a pitch angle > 70 degrees together with Baro altitude rate remaining below 2m/s. These conditions must be maintained for at least a minimum of 4s before disarm occurs. The time delay to disarm can be increased by a user setting which also allows detection to be disabled by setting to 0 (default setting).
Seems to work as expected with static tests but not tested with motors running yet.