diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-09-26 14:26:55 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2018-10-01 11:12:30 -0400 |
commit | 19d18c2bc1944c3d4c4ef325f42f8726ad1f608d (patch) | |
tree | 2b5d71ddfd0c95d3a015d6bb93932e501951bcdc /klippy/extras | |
parent | 348a41c325f6580d57e982bcc197978c1c977bbc (diff) | |
download | kutter-19d18c2bc1944c3d4c4ef325f42f8726ad1f608d.tar.gz kutter-19d18c2bc1944c3d4c4ef325f42f8726ad1f608d.tar.xz kutter-19d18c2bc1944c3d4c4ef325f42f8726ad1f608d.zip |
bed_tilt: Take into account probe xy offset when calculating z_adjust
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/bed_tilt.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/klippy/extras/bed_tilt.py b/klippy/extras/bed_tilt.py index 04037011..a0c31cbd 100644 --- a/klippy/extras/bed_tilt.py +++ b/klippy/extras/bed_tilt.py @@ -73,10 +73,11 @@ class BedTiltCalibrate: new_params = mathutil.coordinate_descent( params.keys(), params, errorfunc) # Update current bed_tilt calculations - z_diff = new_params['z_adjust'] - z_offset - bed_tilt = self.printer.lookup_object('bed_tilt') - bed_tilt.update_adjust(new_params['x_adjust'], new_params['y_adjust'], - z_diff) + x_adjust = new_params['x_adjust'] + y_adjust = new_params['y_adjust'] + z_adjust = (new_params['z_adjust'] - z_offset + - x_adjust * offsets[0] - y_adjust * offsets[1]) + self.bedtilt.update_adjust(x_adjust, y_adjust, z_adjust) self.gcode.reset_last_position() # Log and report results 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), adjusted_height(pos, new_params)) 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.gcode.respond_info( "%s\nThe above parameters have been applied to the current\n" |