PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.16k stars 13.36k forks source link

[v1.14] RC signal lost -> actuators stuck at last commanded position (Prearm = Always & RC loss Failsafe = Disarm) #23035

Open junwoo091400 opened 4 months ago

junwoo091400 commented 4 months ago

Describe the bug

Little Story:

Imagine you are flying a Fixed Wing in Manual mode and lose RC signal. When the RC signal lost failsafe is set to "disarmed", but the prearm mode is set to "always", after RC signal is lost, should the Servo actuators (control surfaces) be at disarmed position or at the last manually commanded position?


Detailed description:

  1. v1.14.0 stable release Firmware
  2. Fixed wing vehicle (Flying wing configuration)
  3. Current flight mode = Manual (the same problem will exist for Stabilized / Altitude / Position modes too, where it's not fully autonomous and requires Manual control input)
  4. Commander Prearm mode = Always
  5. RC loss failsafe action = Disarm

When the RC signal is lost, and Disarm is triggered, the Actuator does not go to 'Disarmed' position but rather continuously gives out the actuator output as if the RC signal is at it's last packet's value.

To Reproduce

  1. Have at least 1 Servo actuator in actuators (to be influenced by prearm)
  2. Set COM_PREARM_MODE to 2 (Always)
  3. Set RC loss failsafe action to Disarm
  4. Set Actuator disarmed values to specific value (e.g. extreme low / high)
  5. Set to Manual Flight mode and command RC roll/pitch, etc commands to move the actuator
  6. Turn off the RC controller

Then the actuator will stay stuck (in Manual mode), and in other modes probably as if the RC control is constantly coming in as it's last values.

Expected behavior

I expected that as "Failsafe" action was to "Disarm", the actuators would all go to Disarmed values. At least I think that constantly treating the last manual control setpoint value as valid while the RC signal is lost seems really absurd to me.

Also, this is only relevant for the "Disarm" or "None" RC loss failsafe action cases, as in other RTL / Land / Terminate cases, vehicle will fully automatically guide themselves, or the prearm mode will be overridden (terminate case).

Perhaps there should be a way to *not use the RC input when it is not valid anymore for prearmed actuator output value. Some solutions I thought of were:

  1. Command 0 torque & thrust setpoint instead for FW rate control when manual control is not valid (Not so elegant, error prone)
  2. In mixer module check if it's "Manual" flight mode & whether "Prearm" mode is active, and if so send out "Disarmed" values instead? (Will affect Hybrid VTOL systems and every little RC loss can lead to Servos twitching)

Not sure what the solution should be, or whether current behavior should be accepted, but open for discussion!

Screenshot / Media

image

Flight Log

https://logs.px4.io/plot_app?log=a45dca4b-9975-43de-9499-cee5690c984a

Software Version

v1.14

Flight controller

Cube Orange

Vehicle type

Fixed Wing

How are the different components wired up (including port information)

No response

Additional context

This is the case due to the following logic in FW Rate controller:

https://github.com/PX4/PX4-Autopilot/blob/011af5f7971eab9837fd209a05a63af509aeb492/src/modules/fw_rate_control/FixedwingRateControl.cpp#L128-L139

sfuhrer commented 2 months ago

Interesting case you found here! I don't see an easy solution with the current terminology - PREARM mode is a weird state. I'm curious: why did you set NAV_RCL_ACT to "Disarm" and not "Terminate"? If you set it to "Terminate" (I think) it sends failsafe PWM values instead of disarm values .