aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/probe.py
Commit message (Collapse)AuthorAgeFilesLines
...
* toolhead: Add a manual_move() helper functionKevin O'Connor2020-08-201-16/+6
| | | | | | | | Add a helper function for submitting relative movements. This function will also automatically ensure gcode.reset_last_position() is called. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Automatically call reset_last_position() on a toolhead set_position()Kevin O'Connor2020-08-201-1/+0
| | | | | | | | Generate a "toolhead:set_position" event on a call to toolhead.set_position() and use that event to automatically call gcode.reset_last_position(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extras: Use "from . import module" for relative importsKevin O'Connor2020-06-151-1/+2
| | | | | | Use alternate import syntax to improve Python3 compatibility. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Rename try_load_module() to load_object()Kevin O'Connor2020-05-081-1/+1
| | | | | | | | Rename try_load_module() so that it uses consistent naming for "printer objects". Change the function to raise an error by default if the specified module does not exist. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-53/+45
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Create new wrapper class for gcode command parametersKevin O'Connor2020-05-051-1/+2
| | | | | | | | Instead of passing a dictionary to the command handlers, create a wrapper class and pass that class to the command handlers. This can simplify the command handler code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Rename probe_prepare/finalize to probe_prepare/finishKevin O'Connor2020-04-251-2/+2
| | | | | | | | The probe_finalize() name is used for callbacks in both the PrinterProbe and ProbePointsHelper classes. Rename the PrinterProbe callback to avoid confusion. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Don't raise a TimeoutError from home_wait()Kevin O'Connor2020-02-191-1/+0
| | | | | | | Change home_wait() to return if the homing operation completed succesfully or not. This simplifies the callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Don't allow errors to propagate from "gcode:command_error" eventKevin O'Connor2020-02-181-2/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add multi_probe_begin() / multi_probe_end() callbacksKevin O'Connor2020-02-151-0/+35
| | | | | | | | Add support for notifying the low-level probing handlers that a multiple probe sequence is occurring. This is in preparation for the bltouch code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Merge home_prepare()/home_finalize() into move_begin/move_end eventsKevin O'Connor2020-02-151-4/+13
| | | | | | | | Collapse the "homing:move_begin", "homing:move_end", home_prepare(), and home_finalize() into two new events: "homing:homing_move_begin" and "homing:homing_move_end". This simplifies the homing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add support for configuring lift_speedKevin O'Connor2020-01-311-9/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: Remove support for identifying Z steppersKevin O'Connor2020-01-231-2/+3
| | | | | | | | | The caller can now determine which steppers are connected to cartesian Z movement via the new stepper.is_active_axis() method. It is therefore no longer necessary for the kinematic code to identify these steppers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ProbePointsHelper: Optionally add xy offsets to probe pointsArksine2020-01-091-0/+6
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stepper: Remove add_to_endstop() methodKevin O'Connor2019-11-121-1/+1
| | | | | | | Now that the PrinterStepper and MCU_stepper classes have been merged, there is no need for the add_to_endstop() method. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add range to probe accuracy results (#2015)Julien Lirochon2019-09-291-2/+3
| | | Signed-off-by: Julien Lirochon <julien@lirochon.net>
* probe: Rework the PROBE_ACCURACY command parametersKevin O'Connor2019-07-101-24/+18
| | | | | | | | | | | Don't default to a Z location of 10, as that could cause damage if the probe's z_offset is greater than 10. Instead, use the "retract distance" method that is used for normal multi-sample probing. Update the PROBE_ACCURACY command parameter names to use the same parameter names as the PROBE command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Integrate query_endstop_wait() into query_endstop()Kevin O'Connor2019-07-101-3/+1
| | | | | | There is no need to have two separate calls to query an endstop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Allow probe parameters to be specified as g-code parametersKevin O'Connor2019-06-211-15/+29
| | | | | | | | Add PROBE_SPEED, SAMPLES, SAMPLE_RETRACT_DIST, SAMPLES_TOLERANCE, SAMPLES_TOLERANCE_RETRIES, and SAMPLES_RESULT parameters to the PROBE command (and to commands that indirectly invoke a probe). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add support for samples_toleranceKevin O'Connor2019-06-211-5/+20
| | | | | | Add a check on the maximum Z distance between probe samples. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Always return just x,y,z from _probe()Kevin O'Connor2019-06-211-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Allow retries from ProbePointsHelperKevin O'Connor2019-06-181-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_macro: Add a default parameter to load_templateKevin O'Connor2019-06-071-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* manual_probe: Add extra checks to catch manual probe not finishing correctlyKevin O'Connor2019-06-061-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Check for toolhead movement during activate/deactivate_gcode scriptsKevin O'Connor2019-06-061-0/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: No need to re-raise an EndstopErrorKevin O'Connor2019-06-061-22/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Simplify ProbePointsHelper start and end trackingKevin O'Connor2019-06-061-58/+43
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Be sure to call gcode.reset_last_position() after any manual moveKevin O'Connor2019-06-061-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Unify mean and median code between run_probe() and PROBE_ACCURACYKevin O'Connor2019-06-061-42/+25
| | | | | | | | | | | Factor out _calc_mean() and _calc_median() functions and call from both run_probe() and cmd_PROBE_ACCURACY(). This also fixes a subtle error in the run_probe() median function - on some kinematics the x and y position can change on a z move so the x and y should be taken from the z probe values actually used. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Move multi-sampling capability from ProbePointsHelper to ProbeKevin O'Connor2019-06-061-66/+63
| | | | | | | | | | | This changes the config file so that the configuration of multi-samples is now done in the [probe] (and [bltouch]) section instead of the various delta, bed_mesh, z_tilt, etc. config sections. With this change, PROBE and PROBE_CALIBRATE commands now also utilize multi-sampling. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: ProbePointsHelper adjustable minimum pointsfess2019-05-211-4/+6
| | | | | | | | Factor out minimum required points check for ProbePointsHelper in prep for setting different values for quad_gantry_level and z_tilt_adjust Signed-off-by: John "Fess" Fessenden <fess@fess.org>
* probe: Use gcode_macro style templates on activate/deactivate_gcodeKevin O'Connor2019-04-041-8/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Fix PROBE_CALIBRATE commandKevin O'Connor2019-03-081-3/+5
| | | | | | | The z_offset calculation should have been calculated from the probe height to the measured bed position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Catch toolhead.move() exceptions in cmd_PROBE_CALIBRATE()Kevin O'Connor2019-03-081-15/+12
| | | | | | | Slightly rework the self._move_position() code and also use it in PROBE_CALIBRATE. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* screws_tilt_adjust: Add new screws_tilt_adjust tool (#1367)Rui Caridade2019-03-081-3/+23
| | | Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
* probe: Wrap code to 80 columnsKevin O'Connor2019-02-271-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Set z min value in probe_accuracy to z_offset. (#1314)Rui Caridade2019-02-251-1/+1
| | | Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
* probe: Add PROBE_ACCURACY commandRui Caridade2019-02-181-1/+74
| | | | | | | | Implementation of "PROBE_ACCURACY" to measure the maximum, minimum, average and standard deviation of a probe. Signed-off-by: Rui Caridade <rui.mcbc@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Use manual_probe helper when performing manual probesKevin O'Connor2019-02-121-15/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add PROBE_CALIBRATE commandKevin O'Connor2019-02-121-7/+37
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bltouch: Add initial support for a bltouch "extras" moduleKevin O'Connor2018-11-301-6/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Pass printer instead of toolhead object to Homing classKevin O'Connor2018-10-161-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Implement second home from homing.pyKevin O'Connor2018-10-101-1/+3
| | | | | | | Move the logic for performing the second home from the kinematics classes to the generic homing code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Merge ProbeVirtualEndstop and ProbeEndstopWrapper wrapper classesKevin O'Connor2018-10-011-41/+27
| | | | | | No need to have two wrappers around the mcu_endstop class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Infer position_endstop when using probe:z_virtual_offsetKevin O'Connor2018-10-011-20/+7
| | | | | | | | | Don't require (or permit) the user to specify a stepper_z position_endstop when using the probe:z_virtual_offset mechanism. In that case the position_endstop should always equal the probe's z_offset - so no need to have the user specify it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Verify the toolhead moves at least some distance on a probeKevin O'Connor2018-10-011-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Support manual probing at runtimeKevin O'Connor2018-10-011-19/+19
| | | | | | | | Don't require the config file to specify manual probing. Instead, allow the user to select manual probing on each ProbePointsHelper invocation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Perform multi-sample averaging in ProbePointsHelper classKevin O'Connor2018-10-011-4/+7
| | | | | | | | Now that all the callers of ProbePointsHelper take a cartesian coordinate for the probe locations, it's possible to perform averaging of multi-sample probes within the class. This simplifies the callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Separate out manual probing from automatic probing codeKevin O'Connor2018-10-011-39/+39
| | | | | | | | Only call cmd_NEXT() for manual probing. This simplifies the code as the automatic probing and manual probing have slightly different probing mechanisms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Move move_next() method within ProbePointsHelper classKevin O'Connor2018-10-011-12/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>