bed_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
348a41c325
commit
19d18c2bc1
|
@ -73,10 +73,11 @@ class BedTiltCalibrate:
|
||||||
new_params = mathutil.coordinate_descent(
|
new_params = mathutil.coordinate_descent(
|
||||||
params.keys(), params, errorfunc)
|
params.keys(), params, errorfunc)
|
||||||
# Update current bed_tilt calculations
|
# Update current bed_tilt calculations
|
||||||
z_diff = new_params['z_adjust'] - z_offset
|
x_adjust = new_params['x_adjust']
|
||||||
bed_tilt = self.printer.lookup_object('bed_tilt')
|
y_adjust = new_params['y_adjust']
|
||||||
bed_tilt.update_adjust(new_params['x_adjust'], new_params['y_adjust'],
|
z_adjust = (new_params['z_adjust'] - z_offset
|
||||||
z_diff)
|
- x_adjust * offsets[0] - y_adjust * offsets[1])
|
||||||
|
self.bedtilt.update_adjust(x_adjust, y_adjust, z_adjust)
|
||||||
self.gcode.reset_last_position()
|
self.gcode.reset_last_position()
|
||||||
# Log and report results
|
# Log and report results
|
||||||
logging.info("Calculated bed_tilt parameters: %s", new_params)
|
logging.info("Calculated bed_tilt parameters: %s", new_params)
|
||||||
|
@ -84,7 +85,7 @@ class BedTiltCalibrate:
|
||||||
logging.info("orig: %s new: %s", adjusted_height(pos, params),
|
logging.info("orig: %s new: %s", adjusted_height(pos, params),
|
||||||
adjusted_height(pos, new_params))
|
adjusted_height(pos, new_params))
|
||||||
msg = "x_adjust: %.6f y_adjust: %.6f z_adjust: %.6f" % (
|
msg = "x_adjust: %.6f y_adjust: %.6f z_adjust: %.6f" % (
|
||||||
new_params['x_adjust'], new_params['y_adjust'], z_diff)
|
x_adjust, y_adjust, z_adjust)
|
||||||
self.printer.set_rollover_info("bed_tilt", "bed_tilt: %s" % (msg,))
|
self.printer.set_rollover_info("bed_tilt", "bed_tilt: %s" % (msg,))
|
||||||
self.gcode.respond_info(
|
self.gcode.respond_info(
|
||||||
"%s\nThe above parameters have been applied to the current\n"
|
"%s\nThe above parameters have been applied to the current\n"
|
||||||
|
|
Loading…
Reference in New Issue