Skip to content

Commit b0b00cd

Browse files
authored
Merge pull request #7714 from yajo10/fix_reversible_esc_wrong_speed
Reversible ESC's for rovers: Don't start motor with high throttle in the mid of the stick
2 parents c4bcd2e + 87bebf4 commit b0b00cd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/flight/mixer.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,17 @@ void FAST_CODE mixTable()
540540

541541
motorValueWhenStopped = getReversibleMotorsThrottleDeadband();
542542
mixerThrottleCommand = constrain(rcCommand[THROTTLE], throttleRangeMin, throttleRangeMax);
543+
544+
#ifdef USE_DSHOT
545+
if(isMotorProtocolDigital() && feature(FEATURE_REVERSIBLE_MOTORS) && reversibleMotorsThrottleState == MOTOR_DIRECTION_BACKWARD) {
546+
/*
547+
* We need to start the throttle output from stick input to start in the middle of the stick at the low and.
548+
* Without this, it's starting at the high side.
549+
*/
550+
int throttleDistanceToMax = throttleRangeMax - rcCommand[THROTTLE];
551+
mixerThrottleCommand = throttleRangeMin + throttleDistanceToMax;
552+
}
553+
#endif
543554
} else {
544555
mixerThrottleCommand = rcCommand[THROTTLE];
545556
throttleRangeMin = throttleIdleValue;

0 commit comments

Comments
 (0)