feat(fw-rate-ctrl): scale negative FF quadratically

This commit is contained in:
bresch authored and Mathieu Bresciani committed 2026-06-30 11:37:56 +02:00
1 parent 84ddad88e3
commit 326bad2f6e
2 files changed
+25 -7

No files matched your search

@@ -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.
@@ -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