From 0eb8bca3d9920ae7a08ace6f9fdceec432617620 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Sat, 23 May 2015 16:40:20 -0600 Subject: [PATCH] CoreXY planner bug fix. - CoreXY motions were moving to the negative value of the intended target. Now fixed. --- grbl/planner.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grbl/planner.c b/grbl/planner.c index 7989e00..1e0bd35 100644 --- a/grbl/planner.c +++ b/grbl/planner.c @@ -277,8 +277,8 @@ uint8_t plan_check_full_buffer() #ifdef COREXY target_steps[A_MOTOR] = lround(target[A_MOTOR]*settings.steps_per_mm[A_MOTOR]); target_steps[B_MOTOR] = lround(target[B_MOTOR]*settings.steps_per_mm[B_MOTOR]); - block->steps[A_MOTOR] = labs((target_steps[X_AXIS]-pl.position[X_AXIS]) - (target_steps[Y_AXIS]-pl.position[Y_AXIS])); - block->steps[B_MOTOR] = labs((target_steps[X_AXIS]-pl.position[X_AXIS]) + (target_steps[Y_AXIS]-pl.position[Y_AXIS])); + block->steps[A_MOTOR] = labs((target_steps[X_AXIS]-pl.position[X_AXIS]) + (target_steps[Y_AXIS]-pl.position[Y_AXIS])); + block->steps[B_MOTOR] = labs((target_steps[X_AXIS]-pl.position[X_AXIS]) - (target_steps[Y_AXIS]-pl.position[Y_AXIS])); #endif for (idx=0; idxstep_event_count = max(block->step_event_count, block->steps[idx]); if (idx == A_MOTOR) { - delta_mm = ((target_steps[X_AXIS]-pl.position[X_AXIS]) - (target_steps[Y_AXIS]-pl.position[Y_AXIS]))/settings.steps_per_mm[idx]; - } else if (idx == B_MOTOR) { delta_mm = ((target_steps[X_AXIS]-pl.position[X_AXIS]) + (target_steps[Y_AXIS]-pl.position[Y_AXIS]))/settings.steps_per_mm[idx]; + } else if (idx == B_MOTOR) { + delta_mm = ((target_steps[X_AXIS]-pl.position[X_AXIS]) - (target_steps[Y_AXIS]-pl.position[Y_AXIS]))/settings.steps_per_mm[idx]; } else { delta_mm = (target_steps[idx] - pl.position[idx])/settings.steps_per_mm[idx]; }