Hi,
I’ve been thinking about the possibility to add MC support on standard VTOLs (quadplanes and similar) in FW flight when the FW attitude controller isn’t working well. For example if a gust of wind risks to topple the drone over or if the airspeed sensor is badly calibrated and the drone is flying too close to stall speed. E.g. in situations where currently it’s likely to see a Quadchute. We’re flying long range missions and if the drone quadchutes in the middle of the route we have no way of getting it to the designated landing spot and also rallypoints only give us limited options. So we’d prefer to not quadchute at all by having the MC part helping in stabilizing the drone in FW flight if performance is degraded. Of course, when this happens the user should be notified with a warning message.
I would like to add such a feature to PX4, but I still have some implementation questions. First off, do you think that the idea in principle makes sense?
In the introductory paragraph I write vaguely about “if FW attitude controller isn’t working well”, but I find it not easy to put down exact criteria of how we would detect that in all cases.
The first option that comes to my mind is to set a max pitch and roll angle threshold somewhere between FW_MAN_R_MAX and VT_FW_QC_R (same for pitch, obviously). If above this threshold, activate MC rate control until back below FW_MAN_R_MAX. I think this should protect well against high winds and other one-off stalls (climbing too hard, flying too slow etc), but it could become a trap if it’s a broken servo that causes the drone to always tip over and you could end up flying in some bad circle (for example roll above 45° → MC support brings it back to 30°. When MC support stops roll will increase again up to 45° until MC kicks in again and so forth). To get around this trap we’d need a monitoring mechanism that decides if it happens too often either use MC actuation all the time or trigger a quadchute to fall back to MC. I’m thinking of some sort of leaky integrator or simply a counter / timer that measures how long you’ve been in this mode throughout the flight.
In order to more accurately characterize the FW attitude controller performance there are system identification procedures to get the rise time, overshoot and delay, but I think this is a bit too complicated to have it working reliably for all different sorts of models (many parameters, real time execution…), so I think this is a dead-end in PX4. Could be done on a companion computer on a case-per-case basis.
On the implementation side, if I’m not mistaken the MC rate controller already runs all the time and continuously publishes actuator_controls_virtual_mc
also in FW mode, so they could be used in void Standard::fill_actuator_outputs(). I reckon Airmode would have to be active so that the MC outputs can actually create the required differential thrust without having a MC thrust setpoint. And probably you also need to use set_all_motor_state(motor_state::ENABLED);
to activate the MC motors in FW flight.
Looking forward to hearing your thoughts!