Simple mixer: add output slew rate

This adds the option to limit the rate of change (slew rate) of an output that's mixed by a simple mixer.
To enable it, a positive number has to be added at the end (6th number) of the output scaler line of the mixer,
specifying the min rise time of this output.
E.g. O:      10000  10000      0 -10000  10000 20000 for a rise time of 2s, resp. a max slew rate of 0.5s^-1.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2020-08-28 11:07:47 +02:00
committed by Lorenz Meier
parent 98cff94702
commit 7c727edc3f
8 changed files with 85 additions and 13 deletions
+6
View File
@@ -304,6 +304,9 @@ mixer_tick()
mixer_group.set_max_delta_out_once(delta_out_max);
}
/* set dt to be used in simple mixer for slew rate limiting */
mixer_group.set_dt_once(dt);
/* update parameter for mc thrust model if it updated */
if (update_mc_thrust_param) {
mixer_group.set_thrust_factor(REG_TO_FLOAT(r_setup_thr_fac));
@@ -657,6 +660,9 @@ mixer_set_failsafe()
mixer_group.set_max_delta_out_once(delta_out_max);
}
/* set dt to be used in simple mixer for slew rate limiting */
mixer_group.set_dt_once(dt);
/* update parameter for mc thrust model if it updated */
if (update_mc_thrust_param) {
mixer_group.set_thrust_factor(REG_TO_FLOAT(r_setup_thr_fac));