TECS: added descent rate control - #33864
Conversation
Adds set_descent_rate_override(), which makes the height controller track a commanded sink rate instead of the mission height profile. The demanded rate must lie between -TECS_CLMB_MAX and TECS_SINK_MAX, and lapses after the requested duration so that loss of the commanding link reverts to normal height control. A landing approach or flare drops the request. Gated on AP_TECS_DESCENT_RATE_ENABLED, which defaults on for boards with more than 2048k of flash. The TECS log flags field gains a ninth bit and so widens from B to H on all builds, including those with the feature compiled out, to keep the log schema the same everywhere. Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
Only accepted when the current mode uses auto-throttle, except for a cancel, which is always allowed through. Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
Adds vehicle:set_tecs_descent_rate_override() plus an example script which commands a fixed sink rate while flying a LOITER_TO_ALT item. Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
Flies the glider up under a balloon, releases at 15km, and then checks that the descent rate override achieves and holds each of a range of demanded sink rates on the way down, before confirming that releasing the override hands height control back to TECS. Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
|
A rate input would be usefull. But having it as a override is a little odd. I would like to see TECS behave a little more like the VTOL controllers where you can input either a height, a rate, or a height and a rate. For example in FBWB we have to do the integration of a rate to a height in plane. I'm also not really a fan of scripting reaching in and messing with the stuff other modes are doing. If scripting wants to do something it should be in a scripting mode. |
It would be nice if we had scripted modes in plane ;-) |
I think that would be a massive overkill for this functionality. Right now we have just one user who wants this functionality (a high altitude glider doing atmospheric sampling where descent rate matters for the instrument) and for that user this lua override is exactly what they want. The new mode capability is a cool trick but it doesn't mean we have to use it everywhere. This application does want all of the other AUTO features, but just wants to change one thing, the ability to switch TECS to a descent rate. |
|
We do already have a scripting mode, Guided. My concern here is that this new binding allows a script to mess about with TECS in safety critical modes such as RTL. |
Summary
For some missions you want to descend at a very specific rate. This particular feature was developed by @priseborough for a high altitude glider for atmospheric sampling.
Classification & Testing (check all that apply and add your own)
Only tested in SITL so far, pending flight test on a real vehicle
Description
I've set this up to be disabled by default as this type of control is rarely needed, but when it is needed it is hard to do accurately outside of TECS.