1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

update antigravity for 4.4, no boost on yaw

Update to anti-gravity, including removal of the old Step mode, ability to adjust the P contribution (thanks @Limon), PT2 smoothed derivative model, inherent limiting of P boost during extremely fast stick travels to minimise P oscillations, less I during the middle of a throttle up, no I boost on yaw, add hz to cutoff labels

No antigravity on yaw, fix longstanding typo

h
This commit is contained in:
ctzsnooze 2022-06-20 08:55:31 +10:00
parent 4fa4d4851e
commit 6aaaf727ff
13 changed files with 92 additions and 160 deletions

View file

@ -1884,8 +1884,8 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
sbufWriteU16(dst, currentPidProfile->yawRateAccelLimit);
sbufWriteU8(dst, currentPidProfile->levelAngleLimit);
sbufWriteU8(dst, 0); // was pidProfile.levelSensitivity
sbufWriteU16(dst, currentPidProfile->itermThrottleThreshold);
sbufWriteU16(dst, currentPidProfile->itermAcceleratorGain);
sbufWriteU16(dst, 0); // was currentPidProfile->itermThrottleThreshold
sbufWriteU16(dst, currentPidProfile->anti_gravity_gain);
sbufWriteU16(dst, 0); // was currentPidProfile->dtermSetpointWeight
sbufWriteU8(dst, currentPidProfile->iterm_rotation);
sbufWriteU8(dst, 0); // was currentPidProfile->smart_feedforward
@ -1914,8 +1914,7 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
sbufWriteU16(dst, currentPidProfile->pid[PID_ROLL].F);
sbufWriteU16(dst, currentPidProfile->pid[PID_PITCH].F);
sbufWriteU16(dst, currentPidProfile->pid[PID_YAW].F);
sbufWriteU8(dst, currentPidProfile->antiGravityMode);
sbufWriteU8(dst, 0); // was currentPidProfile->antiGravityMode
#if defined(USE_D_MIN)
sbufWriteU8(dst, currentPidProfile->d_min[PID_ROLL]);
sbufWriteU8(dst, currentPidProfile->d_min[PID_PITCH]);
@ -2975,8 +2974,8 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
sbufReadU8(src); // was pidProfile.levelSensitivity
}
if (sbufBytesRemaining(src) >= 4) {
currentPidProfile->itermThrottleThreshold = sbufReadU16(src);
currentPidProfile->itermAcceleratorGain = sbufReadU16(src);
sbufReadU16(src); // was currentPidProfile->itermAcceleratorGain
currentPidProfile->anti_gravity_gain = sbufReadU16(src);
}
if (sbufBytesRemaining(src) >= 2) {
sbufReadU16(src); // was currentPidProfile->dtermSetpointWeight
@ -3011,8 +3010,7 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
currentPidProfile->pid[PID_ROLL].F = sbufReadU16(src);
currentPidProfile->pid[PID_PITCH].F = sbufReadU16(src);
currentPidProfile->pid[PID_YAW].F = sbufReadU16(src);
currentPidProfile->antiGravityMode = sbufReadU8(src);
sbufReadU8(src); // was currentPidProfile->antiGravityMode
}
if (sbufBytesRemaining(src) >= 7) {
// Added in MSP API 1.41