From 09f9871074ecd4e3c9bed97fc936d0e50c759567 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Thu, 7 Nov 2024 09:20:59 -0500 Subject: [PATCH] fix(motion-control): Don't clear stepper-ok in stop request (#813) (#814) * We don't need to clear the stepper ok field when we get a stop message. * Ok i was wrong about how this worked. We don't want to leave the motor enable false we just want to turn the brake on for a bit then turn it back off to leave the motor enabled. Co-authored-by: Ryan Howard --- include/motor-control/core/stepper_motor/motion_controller.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/motor-control/core/stepper_motor/motion_controller.hpp b/include/motor-control/core/stepper_motor/motion_controller.hpp index 2f62af9a1..0cadbe550 100644 --- a/include/motor-control/core/stepper_motor/motion_controller.hpp +++ b/include/motor-control/core/stepper_motor/motion_controller.hpp @@ -189,7 +189,8 @@ class MotionController { if (hardware.is_timer_interrupt_running()) { hardware.request_cancel(); } - disable_motor(); + hardware.deactivate_motor(); + hardware.activate_motor(); } auto read_limit_switch() -> bool { return hardware.check_limit_switch(); }