probe: Add z_offset parameter

Move the probe_z_offset parameter from delta_calibrate and
bed_tilt_calibrate to a z_offset parameter within the probe config
section.  It's easier to understand the z offset setting when it is in
the probe config section.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-03-17 14:00:37 -04:00
parent c95cc3fb66
commit e3f9ff6701
5 changed files with 15 additions and 14 deletions

View File

@@ -43,7 +43,6 @@ class BedTiltCalibrate:
raise config.error("Need at least 3 points for bed_tilt_calibrate")
self.speed = config.getfloat('speed', 50., above=0.)
self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.)
self.probe_z_offset = config.getfloat('probe_z_offset', 0.)
self.z_position_endstop = None
if config.has_section('stepper_z'):
zconfig = config.getsection('stepper_z')
@@ -64,11 +63,11 @@ class BedTiltCalibrate:
def get_position(self):
kin = self.printer.lookup_object('toolhead').get_kinematics()
return kin.get_position()
def finalize(self, positions):
def finalize(self, z_offset, positions):
logging.info("Calculating bed_tilt with: %s", positions)
params = { 'x_adjust': self.bedtilt.x_adjust,
'y_adjust': self.bedtilt.y_adjust,
'z_adjust': self.probe_z_offset }
'z_adjust': z_offset }
logging.info("Initial bed_tilt parameters: %s", params)
def adjusted_height(pos, params):
x, y, z = pos
@@ -85,7 +84,7 @@ class BedTiltCalibrate:
for pos in positions:
logging.info("orig: %s new: %s", adjusted_height(pos, params),
adjusted_height(pos, new_params))
z_diff = new_params['z_adjust'] - self.probe_z_offset
z_diff = new_params['z_adjust'] - z_offset
if self.z_position_endstop is not None:
# Cartesian style robot
z_extra = ""