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
Pixracer + S.Bus = Failsafe not working properly => fly away #5357
Comments
@kd0aij Could you look into this? Very likely the FMU driver doesn't set the failsafe state correctly. |
@kd0aij please let me know if you need any logs or help with that. |
Just in case sess161.zip |
Somewhat related issue from long time ago ArduPilot/ardupilot#645 |
I have found the root cause of the problem. |
@jgoppert That's confusing, since the commander module (not the position estimator) should be managing failsafe. |
This issue seems to be related to #4344, but there are many unanswered questions (of mine) there, and no indication that there was any successful testing. |
Yeah that is odd. The position estimator shouldn't have any effect on this. |
@kd0aij The flag you linked has nothing to do with this. Its for forcing flight termination. I noticed though that this is missing in multicopters, so something we should address in the commander rewrite. @jgoppert The reason things go bad is probably because you're deriving your own EPH / EPV in LPE instead of forwarding the GPS values. That leads to the state machine in commander thinking you have valid GPS and trying to put the system into GPS failsafe (which doesn't work). So what we need to do is to introduce a global position valid flag into the |
Or we might not need a change at all and its some bad initially published values. Needs more inspection. |
It sounds weird to me either, but I have tried to reproduce it several times. And behavior is 100% stable.
If I switch to inav estimator I see:
So failsafe triggers on in both the cases, but no failsafe action is taken in the first case. |
@LorenzMeier I said that I had little knowledge about this. And your comment might have explained why something called "flag_control_termination_enabled" is irrelevant to nav state "NAVIGATION_STATE_TERMINATION". It's difficult to reverse engineer code like that. |
Lpe won't publish the global position message if it doesn't have any gps or flow, is that the issue? |
I did some real flight tests and drone really tries to fly away (it was tethered, so I still have it). Another observation via QGC is that failsafe triggers LAND mode on RC loss no matter what setting I have in the parameters (loiter, land or RTL). And also when I try to enable LAND mode via QGC it doesn't let me do that which is correct as I don't have GPS. P.S. This is the failsafe logic:
|
I have also compared parameters of my previous setup that worked and was terminating flight on RC loss (configured with QGC 2.9.7 dev build)
and my current parameters (configured with QGC 3.0.0 stable) and here are results:
The difference is that CBRK_GPSFAIL was enabled in previous build, but not in the current one and CBRK_FLIGHTTERM is enabled in the current build. But I have not configured either of them, they are coming as default values. @LorenzMeier I don't feel that these are correct defaults. |
@LorenzMeier is there a way to configure failsafe to just kill motors instead of RTL or Land as neither of them is possible without GPS (however failsafe still tries to do it). |
Without GPS it should perform an open loop descent. However, killing the motors should be implemented as an option as well, especially for racers. |
@mhkabir you are correct, it switches to NAVIGATION_STATE_DESCEND, not NAVIGATION_STATE_AUTO_LAND |
What does |
It's implemented for fixed wing only. Probably be easy to extend the termination state to MC to kill the motors. Just check the kill switch implementation. |
Ok. I will try to do that. |
I have performed more in flight testing, but this time indoors. Drone is really switching to I have also tried to use local pos estimator and drone just locked pwm outputs instead of landing. However logs show that it have switched to I have collected all the logs and recorded videos of all my tests. If you are interested in them I will upload them. |
Termination needs to be allowed by clearing the circuit breaker for it which defaults to on. Is this the missing step? |
I will try it out without circuit breaker for termination and see what happens |
This seems like a bug.
I think we need to look at if different valid flags or topics are published for LPE vs. inav when used without GPS.
I don't think termination plays a role here, unless we lose baro as well. |
I have made a test of LPE with termination circuit breaker off and it behavior is the same. |
Fixed in #5863 |
I have switched to the new FrSky X4R-SB RX (S.Bus) for my Pixracer drone and experience an issue with failsafe mode.
I have set RX failsafe to no pulse and px4 can detect RC signal loss with no problem and triggers failsafe mode on.
However instead of performing failsafe action it just holds the same servo values (even if I move drone).
This behavior is very dangerous and can result in fly away.
P.S.
I was using Orange RX with CPPM protocol previously and all worked perfectly fine with it. On signal loss px4 was simply turning off all PWM outputs (as it has no GPS and can't RTL/loiter/land) which is acceptable behavior for racing drone.
P.P.S.
I use 1.4.1 Release
The text was updated successfully, but these errors were encountered: