From 801bd65edd83b6eb9142075c1ae896cecc5e9bd0 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Sun, 9 Oct 2022 23:32:03 +0200 Subject: [PATCH] Abort moves when tmc errors happen --- src/modules/movable_base.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/movable_base.cpp b/src/modules/movable_base.cpp index cf76329..7dca222 100644 --- a/src/modules/movable_base.cpp +++ b/src/modules/movable_base.cpp @@ -39,6 +39,7 @@ void MovableBase::PerformMove() { if (mm::motion.DriverForAxis(axis).CheckForErrors(axisParams[axis].params)) { // TMC2130 entered some error state, the planned move couldn't have been finished - result of operation is Failed tmcErrorFlags = mm::motion.DriverForAxis(axis).GetErrorFlags(); // save the failed state + mm::motion.AbortPlannedMoves(axis, true); state = TMCFailed; } else if (mm::motion.QueueEmpty(axis)) { // move finished @@ -91,6 +92,7 @@ void MovableBase::IdleChecks() { if (mm::motion.DriverForAxis(axis).CheckForErrors(axisParams[axis].params)) { // TMC2130 entered some error state, the planned move couldn't have been finished - result of operation is Failed tmcErrorFlags = mm::motion.DriverForAxis(axis).GetErrorFlags(); // save the failed state + mm::motion.AbortPlannedMoves(axis, true); state = TMCFailed; } }