APM_Control: added D_FF support for fixed wing

This commit is contained in:
Andrew Tridgell
2023-11-21 13:26:23 +11:00
parent 60d5e65a1d
commit 69bfe9b837
4 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -206,13 +206,14 @@ float AP_RollController::_get_rate_out(float desired_rate, float scaler, bool di
pinfo.P *= deg_scale;
pinfo.I *= deg_scale;
pinfo.D *= deg_scale;
pinfo.DFF *= deg_scale;
// fix the logged target and actual values to not have the scalers applied
pinfo.target = desired_rate;
pinfo.actual = degrees(rate_x);
// sum components
float out = pinfo.FF + pinfo.P + pinfo.I + pinfo.D;
float out = pinfo.FF + pinfo.P + pinfo.I + pinfo.D + pinfo.DFF;
if (ground_mode) {
// when on ground suppress D term to prevent oscillations
out -= pinfo.D + 0.5*pinfo.P;