probe: Allow overriding horizontal_move_z on gcode

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
This commit is contained in:
Lasse Dalegaard 2022-08-29 21:10:02 +02:00 committed by KevinOConnor
parent 5a69d0f857
commit ca6e5fe514
2 changed files with 46 additions and 37 deletions

View File

@ -146,14 +146,15 @@ The following commands are available when the
(also see the [bed mesh guide](Bed_Mesh.md)). (also see the [bed mesh guide](Bed_Mesh.md)).
#### BED_MESH_CALIBRATE #### BED_MESH_CALIBRATE
`BED_MESH_CALIBRATE [METHOD=manual] [<probe_parameter>=<value>] `BED_MESH_CALIBRATE [METHOD=manual] [HORIZONTAL_MOVE_Z=<value>]
[<mesh_parameter>=<value>]`: This command probes the bed using [<probe_parameter>=<value>] [<mesh_parameter>=<value>]`: This command probes
generated points specified by the parameters in the config. After the bed using generated points specified by the parameters in the config. After
probing, a mesh is generated and z-movement is adjusted according to probing, a mesh is generated and z-movement is adjusted according to the mesh.
the mesh. See the PROBE command for details on the optional probe See the PROBE command for details on the optional probe parameters. If
parameters. If METHOD=manual is specified then the manual probing tool METHOD=manual is specified then the manual probing tool is activated - see the
is activated - see the MANUAL_PROBE command above for details on the MANUAL_PROBE command above for details on the additional commands available
additional commands available while this tool is active. while this tool is active. The optional `HORIZONTAL_MOVE_Z` value overrides the
`horizontal_move_z` option specified in the config file.
#### BED_MESH_OUTPUT #### BED_MESH_OUTPUT
`BED_MESH_OUTPUT PGP=[<0:1>]`: This command outputs the current probed `BED_MESH_OUTPUT PGP=[<0:1>]`: This command outputs the current probed
@ -207,13 +208,14 @@ The following commands are available when the
[bed_tilt config section](Config_Reference.md#bed_tilt) is enabled. [bed_tilt config section](Config_Reference.md#bed_tilt) is enabled.
#### BED_TILT_CALIBRATE #### BED_TILT_CALIBRATE
`BED_TILT_CALIBRATE [METHOD=manual] [<probe_parameter>=<value>]`: This `BED_TILT_CALIBRATE [METHOD=manual] [HORIZONTAL_MOVE_Z=<value>]
command will probe the points specified in the config and then [<probe_parameter>=<value>]`: This command will probe the points specified in
recommend updated x and y tilt adjustments. See the PROBE command for the config and then recommend updated x and y tilt adjustments. See the PROBE
details on the optional probe parameters. If METHOD=manual is command for details on the optional probe parameters. If METHOD=manual is
specified then the manual probing tool is activated - see the specified then the manual probing tool is activated - see the MANUAL_PROBE
MANUAL_PROBE command above for details on the additional commands command above for details on the additional commands available while this tool
available while this tool is active. is active. The optional `HORIZONTAL_MOVE_Z` value overrides the
`horizontal_move_z` option specified in the config file.
### [bltouch] ### [bltouch]
@ -262,13 +264,14 @@ The following commands are available when the
is enabled (also see the [delta calibrate guide](Delta_Calibrate.md)). is enabled (also see the [delta calibrate guide](Delta_Calibrate.md)).
#### DELTA_CALIBRATE #### DELTA_CALIBRATE
`DELTA_CALIBRATE [METHOD=manual] [<probe_parameter>=<value>]`: This `DELTA_CALIBRATE [METHOD=manual] [HORIZONTAL_MOVE_Z=<value>]
command will probe seven points on the bed and recommend updated [<probe_parameter>=<value>]`: This command will probe seven points on the bed
endstop positions, tower angles, and radius. See the PROBE command for and recommend updated endstop positions, tower angles, and radius. See the
details on the optional probe parameters. If METHOD=manual is PROBE command for details on the optional probe parameters. If METHOD=manual is
specified then the manual probing tool is activated - see the specified then the manual probing tool is activated - see the MANUAL_PROBE
MANUAL_PROBE command above for details on the additional commands command above for details on the additional commands available while this tool
available while this tool is active. is active. The optional `HORIZONTAL_MOVE_Z` value overrides the
`horizontal_move_z` option specified in the config file.
#### DELTA_ANALYZE #### DELTA_ANALYZE
`DELTA_ANALYZE`: This command is used during enhanced delta `DELTA_ANALYZE`: This command is used during enhanced delta
@ -1078,16 +1081,17 @@ is enabled (also see the
#### SCREWS_TILT_CALCULATE #### SCREWS_TILT_CALCULATE
`SCREWS_TILT_CALCULATE [DIRECTION=CW|CCW] [MAX_DEVIATION=<value>] `SCREWS_TILT_CALCULATE [DIRECTION=CW|CCW] [MAX_DEVIATION=<value>]
[<probe_parameter>=<value>]`: This command will invoke the bed screws [HORIZONTAL_MOVE_Z=<value>] [<probe_parameter>=<value>]`: This command will
adjustment tool. It will command the nozzle to different locations (as invoke the bed screws adjustment tool. It will command the nozzle to different
defined in the config file) probing the z height and calculate the locations (as defined in the config file) probing the z height and calculate
number of knob turns to adjust the bed level. If DIRECTION is the number of knob turns to adjust the bed level. If DIRECTION is specified,
specified, the knob turns will all be in the same direction, clockwise the knob turns will all be in the same direction, clockwise (CW) or
(CW) or counterclockwise (CCW). See the PROBE command for details on counterclockwise (CCW). See the PROBE command for details on the optional probe
the optional probe parameters. IMPORTANT: You MUST always do a G28 parameters. IMPORTANT: You MUST always do a G28 before using this command. If
before using this command. If MAX_DEVIATION is specified, the command MAX_DEVIATION is specified, the command will raise a gcode error if any
will raise a gcode error if any difference in the screw height difference in the screw height relative to the base screw height is greater
relative to the base screw height is greater than the value provided. than the value provided. The optional `HORIZONTAL_MOVE_Z` value overrides the
`horizontal_move_z` option specified in the config file.
### [sdcard_loop] ### [sdcard_loop]
@ -1329,7 +1333,8 @@ The following commands are available when the
[z_tilt config section](Config_Reference.md#z_tilt) is enabled. [z_tilt config section](Config_Reference.md#z_tilt) is enabled.
#### Z_TILT_ADJUST #### Z_TILT_ADJUST
`Z_TILT_ADJUST [<probe_parameter>=<value>]`: This command will probe `Z_TILT_ADJUST [HORIZONTAL_MOVE_Z=<value>] [<probe_parameter>=<value>]`: This
the points specified in the config and then make independent command will probe the points specified in the config and then make independent
adjustments to each Z stepper to compensate for tilt. See the PROBE adjustments to each Z stepper to compensate for tilt. See the PROBE command for
command for details on the optional probe parameters. details on the optional probe parameters. The optional `HORIZONTAL_MOVE_Z`
value overrides the `horizontal_move_z` option specified in the config file.

View File

@ -362,7 +362,8 @@ class ProbePointsHelper:
if default_points is None or config.get('points', None) is not None: if default_points is None or config.get('points', None) is not None:
self.probe_points = config.getlists('points', seps=(',', '\n'), self.probe_points = config.getlists('points', seps=(',', '\n'),
parser=float, count=2) parser=float, count=2)
self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.) def_move_z = config.getfloat('horizontal_move_z', 5.)
self.default_horizontal_move_z = def_move_z
self.speed = config.getfloat('speed', 50., above=0.) self.speed = config.getfloat('speed', 50., above=0.)
self.use_offsets = False self.use_offsets = False
# Internal probing state # Internal probing state
@ -408,6 +409,9 @@ class ProbePointsHelper:
probe = self.printer.lookup_object('probe', None) probe = self.printer.lookup_object('probe', None)
method = gcmd.get('METHOD', 'automatic').lower() method = gcmd.get('METHOD', 'automatic').lower()
self.results = [] self.results = []
def_move_z = self.default_horizontal_move_z
self.horizontal_move_z = gcmd.get_float('HORIZONTAL_MOVE_Z',
def_move_z)
if probe is None or method != 'automatic': if probe is None or method != 'automatic':
# Manual probe # Manual probe
self.lift_speed = self.speed self.lift_speed = self.speed