Failsafe Settings with eLRS MAVLink and RCin

Hello,

I have a bit of a strange system: I am using eLRS MAVLink on a plane for the telemetry capability without the need for a separate radio system. However, I want to use the plane only as a “traditional” RC plane – I have no need/want for the autopilot system, just telemetry and SD card data logging. Therefore, I am assigning all the servo outputs to RCin channels. The main reason that I don’t want to assign the servo functions to normal controls is that I have a complicated differential thrust setup (with 10x motors) and prefer to adjust the mixing in EdgeTX, partially for flexibility, and partially because Arduplane doesn’t seem to easily support such a control mixing scheme.

While the system works wonderfully, the major downside is the lack of integrated failsafe support. eLRS does not allow for failsafe configuration on non-PWM receivers, so the failsafe behavior must be handled on the flight controller side. However, since I’m just mapping the PWM outputs directly from the RC inputs, the typical Arduplane failsafe behavior doesn’t apply.

So, my question is: What workarounds should I try? I mainly just want predictable failsafe behavior, like what would be done on “traditional” RC planes (throttle to zero, control surfaces neutral). Would lua scripting be a sufficiently robust approach? I should note that Ardupilot is correctly identifying failsafes, it just can’t do anything with my setup.

Thank you for the help!

If you don’t allow the autopilot to do autopilot things, it’s a bit of a reach to expect it to do failsafe things.

You may be able to use the rc:has_valid_input() Lua binding to detect an RC failsafe event and, after some timeout, send some RC override commands. However, as soon as you begin overriding the RC channels, you may cause a false clear of the RC failsafe state, so you will need to be clever about how you implement such a script.

1 Like

I would use output override commands instead of the input ones.

@akv2207 you can do any mixing you want using Lua. IIRC most PWM ELRS receivers can simultaneously use CRSF and output PWM.

The output methods aren’t overrides. While it might be worth a try, I’d expect that approach to fail and favor the RCIN values.

SRV_Channels:set_output_pwm_chan_timeout(chan, pwm, timeout_ms) and non timeout version act as an output override.