1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-19 14:25:16 +03:00

Refactor Dterm atenuation

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-03-06 15:27:59 +01:00
parent ae774017da
commit 0ae860faf6
6 changed files with 46 additions and 34 deletions

View file

@ -171,8 +171,9 @@ PG_RESET_TEMPLATE(navConfig_t, navConfig,
}
);
navigationPosControl_t posControl;
navSystemStatus_t NAV_Status;
EXTENDED_FASTRAM navigationPosControl_t posControl;
EXTENDED_FASTRAM navSystemStatus_t NAV_Status;
EXTENDED_FASTRAM multicopterPosXyCoefficients_t multicopterPosXyCoefficients;
#if defined(NAV_BLACKBOX)
int16_t navCurrentState;
@ -3231,6 +3232,14 @@ void navigationUsePIDs(void)
);
}
/*
* Set coefficients used in MC VEL_XY
*/
multicopterPosXyCoefficients.dTermAttenuation = pidProfile()->navVelXyDtermAttenuation / 100.0f;
multicopterPosXyCoefficients.dTermAttenuationStart = pidProfile()->navVelXyDtermAttenuationStart / 100.0f;
multicopterPosXyCoefficients.dTermAttenuationEnd = pidProfile()->navVelXyDtermAttenuationEnd / 100.0f;
multicopterPosXyCoefficients.breakingBoostFactor = (float) navConfig()->mc.braking_boost_factor / 100.0f;
// Initialize altitude hold PID-controllers (pos_z, vel_z, acc_z
navPidInit(
&posControl.pids.pos[Z],