mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-19 06:15:14 +03:00
Change YAW NAV pid scaling and Dterm type
This commit is contained in:
parent
746d7423e8
commit
f80e44ac41
2 changed files with 6 additions and 4 deletions
|
@ -3213,9 +3213,9 @@ void navigationUsePIDs(void)
|
|||
NAV_DTERM_CUT_HZ
|
||||
);
|
||||
|
||||
navPidInit(&posControl.pids.fw_heading, (float)pidProfile()->bank_fw.pid[PID_POS_HEADING].P / 100.0f,
|
||||
(float)pidProfile()->bank_fw.pid[PID_POS_HEADING].I / 100.0f,
|
||||
(float)pidProfile()->bank_fw.pid[PID_POS_HEADING].D / 100.0f,
|
||||
navPidInit(&posControl.pids.fw_heading, (float)pidProfile()->bank_fw.pid[PID_POS_HEADING].P / 10.0f,
|
||||
(float)pidProfile()->bank_fw.pid[PID_POS_HEADING].I / 10.0f,
|
||||
(float)pidProfile()->bank_fw.pid[PID_POS_HEADING].D / 10.0f,
|
||||
0.0f,
|
||||
2.0f
|
||||
);
|
||||
|
|
|
@ -354,6 +354,8 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
|
|||
limit = pidProfile()->navFwPosHdgPidsumLimit * 100.0f;
|
||||
}
|
||||
|
||||
const pidControllerFlags_e yawPidFlags = errorIsDecreasing ? PID_SHRINK_INTEGRATOR : 0;
|
||||
|
||||
float yawAdjustment = navPidApply2(
|
||||
&posControl.pids.fw_heading,
|
||||
0,
|
||||
|
@ -361,7 +363,7 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
|
|||
US2S(deltaMicros),
|
||||
-limit,
|
||||
limit,
|
||||
pidFlags
|
||||
yawPidFlags
|
||||
) / 100.0f;
|
||||
|
||||
DEBUG_SET(DEBUG_NAV_YAW, 0, posControl.pids.fw_heading.proportional);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue