PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

Control Allocation: Differential thrust vs control surfaces, servo failsafe mode

Open sfuhrer opened this issue 1 year ago • 1 comments

Solved Problem

  • Feature: use MC motors in VTOL fixed-wing flight in case of servo failure
  • Clean up differential thrust vs. servo torque generation for fixed-wing vehicles

Solution

[summary TBD, see commit messages for details]

TODOs:

  • [ ] fix interface to rate controllers for actuator saturation (current idea is to set control_allocator.unallocated_torque to NAN if allocation instance doesn't have any effectiveness, to 0 if not saturated and to -1/1 if saturated
  • [ ] unit tests for normalization/allocation
  • [ ] enable differential thrust for planes (enable it by moving motors to matrix 0, servos to matrix 1 also for planes?)
  • [ ] remove tilt servos from effectiveness in fixed-wing flight (VTOL tiltrotor)

Changelog Entry

For release notes:

Feature: Control Allocation: Differential thrust vs control surfaces, servo failsafe mode

Alternatives

Test coverage

An older version of this PR was tested extensively on a Standard VTOL, including single aileron failures (remove one aileron from effectiveness), and double aileron failure (remove both and fall back to differential thrust). See attached video.

Context

Screen recording from flight with induced double aileron failure on a Standard VTOL. After the failure is injected the ailerons are locked at zero and a service running on an onboard computer detectes the system failure by monitoring the system response (not part of PX4). it then sends a message to notify PX4 about the failure (see this additional testing commit), and PX4 reacts by removing the failed servos from effectiveness.

https://github.com/PX4/PX4-Autopilot/assets/26798987/84f131a1-cd6f-4f9d-a2fd-5b3f60dceb2b

The fallback to differential thrust in case of servo failure can be simulated in SITL by putting https://github.com/PX4/PX4-Autopilot/commit/619812cbdd071bdf5141b5e09711784fb73498e6 on top of this PR.

sfuhrer avatar Jun 10 '24 11:06 sfuhrer

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/twin-motor-differential-thrust/39706/6

DronecodeBot avatar Aug 09 '24 13:08 DronecodeBot

We really need this

mengchaoheng avatar Dec 04 '24 11:12 mengchaoheng

Please fix the problem @sfuhrer

mengchaoheng avatar Dec 04 '24 11:12 mengchaoheng

I am developing a fixed-wing aircraft with a rotor on each of the left and right wings. It takes off on the water. I hope to support the use of the thrust difference generated by the propeller to generate the heading torque. When looking for a suitable take-off direction on the water surface, if the propeller can be differential, it does not require a large ground speed to achieve heading control, such as turning around on the water. Can the update you pushed be supported in px4 as soon as possible? @sfuhrer

mengchaoheng avatar Dec 04 '24 11:12 mengchaoheng

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/differential-thrust-with-pixhawk-6c-and-px4/43202/1

DronecodeBot avatar Jan 09 '25 17:01 DronecodeBot

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/mix-the-rudder-and-engine-thrust-on-a-twin-engine-aircraft/46910/2

DronecodeBot avatar Aug 10 '25 15:08 DronecodeBot