bed_mesh: simplify configuration

The 'bed_shape' option has been removed.  The user will enter a 'bed_radius' if they have a round be, otherwise they should enter 'min_point' and 'max_point'.  When the bed is round the user should supply a 'round_probe_count' option, otherwise just 'probe_count'.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2019-02-12 19:50:10 -05:00 committed by KevinOConnor
parent 7694c3e1b8
commit f7d8854587
3 changed files with 28 additions and 31 deletions

View File

@ -129,14 +129,14 @@
# center of the print area. # center of the print area.
# #
# Visual Examples: # Visual Examples:
# bed_shape = rectangular, probe_count = 3,3: # rectangular bed, probe_count = 3,3:
# x---x---x (max_point) # x---x---x (max_point)
# | # |
# x---x---x # x---x---x
# | # |
# (min_point) x---x---x # (min_point) x---x---x
# #
# bed_shape = round, probe_count = 5, radius = r: # round bed, round_probe_count = 5, bed_radius = r:
# x (0,r) end # x (0,r) end
# / # /
# x---x---x # x---x---x
@ -160,34 +160,30 @@
#sample_retract_dist: 2.0 #sample_retract_dist: 2.0
# The distance (in mm) to retract between each sample if # The distance (in mm) to retract between each sample if
# sampling more than once. Default is 2mm. # sampling more than once. Default is 2mm.
#bed_shape: rectangular #bed_radius:
# Defines the shape of the bed for probing. May be 'rectangular', # Defines the radius to probe for round beds. Note that the radius
# as is common for cartesian printers, or 'round', as is common for # is relative to the nozzle's origin, if using a probe be sure to
# delta printers. Default is rectangular. # account for its offset. This parameter must be provided for round
#radius: # beds and omitted for rectangular beds.
# Defines the radius to probe when the bed_shape is 'round'. Note
# that the radius is relative to the nozzle's origin, if using a
# probe be sure to account for its offset. This parameter must be
# provided if the bed_shape is 'round'.
#min_point: #min_point:
# Defines the minimum x,y position to probe when the bed_shape # Defines the minimum x,y position to probe when for rectangular
# is 'rectangular'. Note that this refers to the nozzle position, # beds. Note that this refers to the nozzle position, take care that
# take care that you do not define a point that will move the # you do not define a point that will move the probe off of the bed.
# probe off of the bed. This parameter must be provided. # This parameter must be provided for rectangular beds.
#max_point: #max_point:
# Defines the maximum x,y position to probe when the bed_shape # Defines the maximum x,y position to probe when for rectangular
# is 'rectangular'. Follow the same precautions as listed in min_point. # beds. Follow the same precautions as listed in min_point. Also note
# Also note that this does not necessarily define the last point # that this does not necessarily define the last point probed, only
# probed, only the maximum coordinate. This parameter must be provided. # the maximum coordinate. This parameter must be provided.
#probe_count: 3,3 #probe_count: 3,3
## OR ## # For rectangular beds, this is a comma separate pair of integer
#probe_count: 5
# For 'rectangular' beds, this is a comma separate pair of integer
# values (X,Y) defining the number of points to probe along each axis. # values (X,Y) defining the number of points to probe along each axis.
# A single value is also valid, in which case that value will be applied # A single value is also valid, in which case that value will be applied
# to both axes. 'Round' beds only accept a single integer value that is # to both axes. Default is 3,3.
# applied to both axes. The probe count must be odd for round beds. #round_probe_count: 5
# Default is 3,3 for 'rectangular' beds, and 5 for 'round' beds. # For round beds, this is integer value defines the maximum number of
# points to probe along each axis. This value must be an odd number.
# Default is 5.
#fade_start: 1.0 #fade_start: 1.0
# The gcode z position in which to start phasing out z-adjustment # The gcode z position in which to start phasing out z-adjustment
# when fade is enabled. Default is 1.0. # when fade is enabled. Default is 1.0.

View File

@ -6,6 +6,10 @@ All dates in this document are approximate.
# Changes # Changes
20190224: The bed_shape option has been removed from bed_mesh. The
radius option has been renamed to bed_radius. Users with round beds
should supply the bed_radius and round_probe_count options.
20190107: The i2c_address parameter in the mcp4451 config section 20190107: The i2c_address parameter in the mcp4451 config section
changed. This is a common setting on Smoothieboards. The new value is changed. This is a common setting on Smoothieboards. The new value is
half the old value (88 should be changed to 44, and 90 should be half the old value (88 should be changed to 44, and 90 should be

View File

@ -10,8 +10,6 @@ import json
import probe import probe
import collections import collections
BED_SHAPES = {'rectangular': 0, 'round': 1}
class BedMeshError(Exception): class BedMeshError(Exception):
pass pass
@ -210,14 +208,13 @@ class BedMeshCalibrate:
'BED_MESH_PROFILE', self.cmd_BED_MESH_PROFILE, 'BED_MESH_PROFILE', self.cmd_BED_MESH_PROFILE,
desc=self.cmd_BED_MESH_PROFILE_help) desc=self.cmd_BED_MESH_PROFILE_help)
def _generate_points(self, config): def _generate_points(self, config):
shape = config.getchoice('bed_shape', BED_SHAPES, 'rectangular') self.radius = config.getfloat('bed_radius', None, above=0.)
if shape == BED_SHAPES['round']: if self.radius is not None:
x_cnt = y_cnt = config.getint('probe_count', 5) x_cnt = y_cnt = config.getint('round_probe_count', 5, minval=3)
# round beds must have an odd number of points along each axis # round beds must have an odd number of points along each axis
if not x_cnt & 1: if not x_cnt & 1:
raise config.error( raise config.error(
"bed_mesh: probe_count must be odd for round beds") "bed_mesh: probe_count must be odd for round beds")
self.radius = config.getfloat('radius', above=0.)
# radius may have precision to .1mm # radius may have precision to .1mm
self.radius = math.floor(self.radius * 10) / 10 self.radius = math.floor(self.radius * 10) / 10
min_x = min_y = -self.radius min_x = min_y = -self.radius