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

@@ -14,7 +14,6 @@ class DeltaCalibrate:
self.radius = config.getfloat('radius', above=0.)
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.manual_probe = config.getboolean('manual_probe', None)
if self.manual_probe is None:
self.manual_probe = not config.has_section('probe')
@@ -38,7 +37,7 @@ class DeltaCalibrate:
def get_position(self):
kin = self.printer.lookup_object('toolhead').get_kinematics()
return kin.get_stable_position()
def finalize(self, positions):
def finalize(self, z_offset, positions):
kin = self.printer.lookup_object('toolhead').get_kinematics()
logging.info("Calculating delta_calibrate with: %s", positions)
params = kin.get_calibrate_params()
@@ -49,7 +48,7 @@ class DeltaCalibrate:
total_error = 0.
for spos in positions:
x, y, z = delta.get_position_from_stable(spos, params)
total_error += (z - self.probe_z_offset)**2
total_error += (z - z_offset)**2
return total_error
new_params = mathutil.coordinate_descent(
adj_params, params, delta_errorfunc)