mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Merge pull request #4702 from martinbudden/bfa_3d_iterm
Reset ITerm on motor reversal
This commit is contained in:
commit
dd3a40f036
5 changed files with 20 additions and 4 deletions
|
@ -541,6 +541,10 @@ static void calculateThrottleAndCurrentMotorEndpoints(void)
|
|||
motorOutputMin = deadbandMotor3dLow;
|
||||
motorOutputRange = motorOutputLow - deadbandMotor3dLow;
|
||||
}
|
||||
if (motorOutputMixSign != -1) {
|
||||
// reset ITerm on motor reversal
|
||||
pidResetITerm();
|
||||
}
|
||||
motorOutputMixSign = -1;
|
||||
rcThrottlePrevious = rcCommand[THROTTLE];
|
||||
throttle = rcCommand3dDeadBandLow - rcCommand[THROTTLE];
|
||||
|
@ -551,6 +555,10 @@ static void calculateThrottleAndCurrentMotorEndpoints(void)
|
|||
motorRangeMax = motorOutputHigh;
|
||||
motorOutputMin = deadbandMotor3dHigh;
|
||||
motorOutputRange = motorOutputHigh - deadbandMotor3dHigh;
|
||||
if (motorOutputMixSign != 1) {
|
||||
// reset ITerm on motor reversal
|
||||
pidResetITerm();
|
||||
}
|
||||
motorOutputMixSign = 1;
|
||||
rcThrottlePrevious = rcCommand[THROTTLE];
|
||||
throttle = rcCommand[THROTTLE] - rcCommand3dDeadBandHigh;
|
||||
|
@ -568,6 +576,10 @@ static void calculateThrottleAndCurrentMotorEndpoints(void)
|
|||
motorOutputMin = deadbandMotor3dLow;
|
||||
motorOutputRange = motorOutputLow - deadbandMotor3dLow;
|
||||
}
|
||||
if (motorOutputMixSign != -1) {
|
||||
// reset ITerm on motor reversal
|
||||
pidResetITerm();
|
||||
}
|
||||
motorOutputMixSign = -1;
|
||||
throttle = 0;
|
||||
currentThrottleInputRange = rcCommandThrottleRange3dLow;
|
||||
|
@ -577,6 +589,10 @@ static void calculateThrottleAndCurrentMotorEndpoints(void)
|
|||
motorRangeMax = motorOutputHigh;
|
||||
motorOutputMin = deadbandMotor3dHigh;
|
||||
motorOutputRange = motorOutputHigh - deadbandMotor3dHigh;
|
||||
if (motorOutputMixSign != 1) {
|
||||
// reset ITerm on motor reversal
|
||||
pidResetITerm();
|
||||
}
|
||||
motorOutputMixSign = 1;
|
||||
throttle = 0;
|
||||
currentThrottleInputRange = rcCommandThrottleRange3dHigh;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue