1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Modified behavior of G-Tune switch and storing the tuned P values

G-Tune documentation update
G-Tune will only activated and deactivated when armed.
G-Tune should deactivated while the copter is airborne.
Tuned P values will only be stored when G-Tune is enabled while disarmed
and G-Tune was used before.
This commit is contained in:
Michael Jakob 2015-03-03 08:26:37 +01:00
parent 6c022455c5
commit e7e297ad53
3 changed files with 10 additions and 10 deletions

View file

@ -712,7 +712,7 @@ rollAndPitchTrims_t *angleTrim, rxConfig_t *rxConfig)
Mwii3msTimescale = (int32_t)FLOATcycleTime & (int32_t)~3; // Filter last 2 bit jitter
Mwii3msTimescale /= 3000.0f;
if (OLD_YAW) { // [0/1] 0 = multiwii 2.3 yaw, 1 = older yaw. hardcoded for now
if (pidProfile->pid5_oldyw) { // [0/1] 0 = multiwii 2.3 yaw, 1 = older yaw
PTerm = ((int32_t)pidProfile->P8[FD_YAW] * (100 - (int32_t)controlRateConfig->rates[FD_YAW] * (int32_t)ABS(rcCommand[FD_YAW]) / 500)) / 100;
int32_t tmp = lrintf(gyroADC[FD_YAW] * 0.25f);
PTerm = rcCommand[FD_YAW] - tmp * PTerm / 80;