diff --git a/src/modules/fw_rate_control/FixedwingRateControl.cpp b/src/modules/fw_rate_control/FixedwingRateControl.cpp index b75663bfac1..55904d040ce 100644 --- a/src/modules/fw_rate_control/FixedwingRateControl.cpp +++ b/src/modules/fw_rate_control/FixedwingRateControl.cpp @@ -379,7 +379,16 @@ void FixedwingRateControl::Run() } const Vector3f gain_ff(_param_fw_rr_ff.get(), _param_fw_pr_ff.get(), _param_fw_yr_ff.get()); - const Vector3f scaled_gain_ff = gain_ff / _airspeed_scaling; + + // Positive feedforward compensates aerodynamic damping and is scaled linearly with airspeed. + // Negative feedforward instead weights down the setpoint acting on the P gain (turning the + // controller into a 2-DOF controller). + Vector3f scaled_gain_ff; + + for (int i = 0; i < 3; i++) { + scaled_gain_ff(i) = (gain_ff(i) >= 0.f) ? gain_ff(i) / _airspeed_scaling : gain_ff(i); + } + _rate_control.setFeedForwardGain(scaled_gain_ff); // Run attitude RATE controllers which need the desired attitudes from above, add trim. diff --git a/src/modules/fw_rate_control/fw_rate_control_params.yaml b/src/modules/fw_rate_control/fw_rate_control_params.yaml index acad44dfa04..2fea36c1db0 100644 --- a/src/modules/fw_rate_control/fw_rate_control_params.yaml +++ b/src/modules/fw_rate_control/fw_rate_control_params.yaml @@ -134,33 +134,42 @@ parameters: FW_RR_FF: description: short: Roll rate feed forward - long: Direct feed forward from rate setpoint to control surface output. + long: | + Direct feed forward from rate setpoint to torque setpoint. + Positive values compensate aerodynamic damping (scaled linearly with airspeed). + Negative values reduce setpoint tracking aggressiveness while preserving disturbance rejection (2-DOF controller, scaled quadratically with airspeed) type: float default: 0.5 unit: '%/rad/s' - min: 0.0 + min: -10.0 max: 10.0 decimal: 2 increment: 0.05 FW_PR_FF: description: short: Pitch rate feed forward - long: Direct feed forward from rate setpoint to control surface output + long: | + Direct feed forward from rate setpoint to torque setpoint. + Positive values compensate aerodynamic damping (scaled linearly with airspeed). + Negative values reduce setpoint tracking aggressiveness while preserving disturbance rejection (2-DOF controller, scaled quadratically with airspeed) type: float default: 0.5 unit: '%/rad/s' - min: 0.0 + min: -10.0 max: 10.0 decimal: 2 increment: 0.05 FW_YR_FF: description: short: Yaw rate feed forward - long: Direct feed forward from rate setpoint to control surface output + long: | + Direct feed forward from rate setpoint to torque setpoint. + Positive values compensate aerodynamic damping (scaled linearly with airspeed). + Negative values reduce setpoint tracking aggressiveness while preserving disturbance rejection (2-DOF controller, scaled quadratically with airspeed) type: float default: 0.3 unit: '%/rad/s' - min: 0.0 + min: -10.0 max: 10.0 decimal: 2 increment: 0.05