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

This fix is for avoiding yaw overshoot and bounce back for some

configurations
The hardcoded limit in the mixer and PID controllers 3-5 would be
removed
by default and will be configurable by CLI variables:

yaw_jump_prevention_limit, global setting (original fixed value was 100)
yaw_p_limit, per profile setting (fixed value was 300)
This commit is contained in:
Michael Jakob 2015-04-23 00:48:37 +02:00
parent bad0b1b04d
commit 2fd79a7aa2
6 changed files with 16 additions and 13 deletions

View file

@ -564,9 +564,9 @@ void mixTable(void)
{
uint32_t i;
if (motorCount > 3) {
if (motorCount >= 4 && mixerConfig->yaw_jump_prevention_limit) {
// prevent "yaw jump" during yaw correction
axisPID[YAW] = constrain(axisPID[YAW], -100 - ABS(rcCommand[YAW]), +100 + ABS(rcCommand[YAW]));
axisPID[YAW] = constrain(axisPID[YAW], -mixerConfig->yaw_jump_prevention_limit - ABS(rcCommand[YAW]), mixerConfig->yaw_jump_prevention_limit + ABS(rcCommand[YAW]));
}
// motors for non-servo mixes