Skip to content

Commit

Permalink
Increase emergency stop time threshold.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Balthaser committed Jun 10, 2023
1 parent 20f29b0 commit d1249d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/motorControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,17 @@ void MotorControl::exec() {
if (motor->getCurrentSpeed() == 0) {
state.isRunning = false;
state.isStopping = false;
motor->setCurrentPosition(0, true); // Reset position
motor->setTargetPosition(0); // Reset position

platform->enableMotor(false);

if (stoppedCallback != nullptr) {
stoppedCallback(state.program);
}
} else {
// Give it 10 10 ticks to finish before stopping it manually
if (!state.isTesting && state.stopping_cnt == 10) {
// Give it 50 ticks to finish before stopping it manually
if (!state.isTesting && state.stopping_cnt == 50) {
motor->setCurrentPosition(0, true); // Reset position
motor->setTargetPosition(0); // Reset position

Expand Down

0 comments on commit d1249d1

Please sign in to comment.