Skip to content

Commit

Permalink
Disable software endstops for UBL fine tuning
Browse files Browse the repository at this point in the history
When doing manual fine tuning using UBL, there are often mesh areas with
negative Zs.  The existing fine tune algorithm does a travel to the
negative Z properly, but when it polls the LCD the software endstops
engage and immediately slam the Z back to 0 on each encoder poll.

This up and down can repeat tens of time each second, turning the printer
into a jackhammer and making the fine tune adjustment of negative Z
meshes almost impossible.

This patch uses M211 S0/S1 to disable/re-enable software endstops during
each manual fine tune probe, avoiding the bouncing.
  • Loading branch information
earlephilhower committed Oct 10, 2020
1 parent 98427ea commit 5ca5ddc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,10 @@

if (!position_is_reachable(raw)) break; // SHOULD NOT OCCUR (find_closest_mesh_point_of_type only returns reachable)

#if HAS_SOFTWARE_ENDSTOPS
gcode.process_subcommands_now_P(PSTR("M211 S0")); // We can go below Z=0 while fine tuning the mesh
#endif

do_blocking_move_to(raw); // Move the nozzle to the edit point with probe clearance

TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset)); // Move Z to the given 'H' offset before editing
Expand Down Expand Up @@ -1016,6 +1020,10 @@
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.
} while (!ui.button_pressed());

#if HAS_SOFTWARE_ENDSTOPS
gcode.process_subcommands_now_P(PSTR("M211 S1")); // Return to normal endstop operation
#endif

if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status

if (click_and_hold(abort_fine_tune)) break; // Button held down? Abort editing
Expand Down

0 comments on commit 5ca5ddc

Please sign in to comment.