From 5fd20ecac3725f84bf8f312479b7d1526a5b52d5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Apr 2016 02:33:22 -0700 Subject: [PATCH 1/2] Comments on some movement functions --- Marlin/Marlin_main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index fa280bb86..cd41e50f1 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1303,18 +1303,33 @@ inline void set_homing_bump_feedrate(AxisEnum axis) { } feedrate = homing_feedrate[axis] / hbd; } +// +// line_to_current_position +// Move the planner to the current position from wherever it last moved +// (or from wherever it has been told it is located). +// inline void line_to_current_position() { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate / 60, active_extruder); } inline void line_to_z(float zPosition) { plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate / 60, active_extruder); } +// +// line_to_destination +// Move the planner, not necessarily synced with current_position +// inline void line_to_destination(float mm_m) { plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m / 60, active_extruder); } inline void line_to_destination() { line_to_destination(feedrate); } +/** + * sync_plan_position + * Set planner / stepper positions to the cartesian current_position. + * The stepper code translates these coordinates into step units. + * Allows translation between steps and units (mm) for cartesian & core robots + */ inline void sync_plan_position() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("sync_plan_position", current_position); From cfcd3d7b3eb8ebf987b926f659450c104e4ca858 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Apr 2016 02:33:53 -0700 Subject: [PATCH 2/2] Rename z_offset local to zoffset --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cd41e50f1..d169d3531 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3131,8 +3131,8 @@ inline void gcode_G28() { #if ENABLED(DELTA) delta_grid_spacing[0] = xGridSpacing; delta_grid_spacing[1] = yGridSpacing; - float z_offset = zprobe_zoffset; - if (code_seen(axis_codes[Z_AXIS])) z_offset += code_value(); + float zoffset = zprobe_zoffset; + if (code_seen(axis_codes[Z_AXIS])) zoffset += code_value(); #else // !DELTA /** * solve the plane equation ax + by + d = z @@ -3222,7 +3222,7 @@ inline void gcode_G28() { eqnAMatrix[probePointCounter + 2 * abl2] = 1; indexIntoAB[xCount][yCount] = probePointCounter; #else - bed_level[xCount][yCount] = measured_z + z_offset; + bed_level[xCount][yCount] = measured_z + zoffset; #endif probePointCounter++;