aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/probe.py
Commit message (Collapse)AuthorAgeFilesLines
* probe: expose name on status reportPedro Lamas2023-03-141-1/+2
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* probe: Allow overriding horizontal_move_z on gcodeLasse Dalegaard2023-03-141-1/+5
| | | | Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* probe: Use config.getlists() for points config optionKevin O'Connor2021-08-211-8/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: bugfix to z_offset_apply_probe (#4553)shiftingtech2021-08-021-2/+1
| | | | | | Command was accessing the wrong variable for the existing z offset, leading to bad behavior. Signed-off-by: Ben Eastep <shifting@shifting.ca>
* probe: add ability to save babystepping (#4404)shiftingtech2021-07-251-0/+19
| | | | | | | | Created two new extended gcodes: Z_OFFSET_APPLY_ENDSTOP, and Z_OFFSET_APPLY_PROBE. These use the z gcode offset to revise the probe offset, or z endstop position allowing users to make a frequently used babystepping value permanent without manual config editing. Signed-off-by: Ben Eastep <shifting@shifting.ca>
* probe: Call add_stepper() earlier in boot processKevin O'Connor2021-06-091-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Use original XY position on multiple probe samplesKevin O'Connor2021-04-281-2/+2
| | | | | | | | | On some kinematics it's possible for the XY position to change slightly during a probing move. Return back to the original XY position on a probe lift so each probe attempt starts at the same nominal position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add deactivate_on_each_sample: param for Probe (#4161)nlef2021-04-241-8/+25
| | | Signed-off-by: Nick Lefskiy <n.lefskiy@yandex.ru>
* homing: Pass the HomingMove class to homing_move_begin/end eventsKevin O'Connor2021-03-291-8/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move low-level probing logic from probe.py to homing.pyKevin O'Connor2021-03-291-8/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add last_z_result to get the latest z result in an Macro (#3835)Christian S2021-02-181-1/+4
| | | Signed-off-by: Christian Schnellrieder <schnello.android@gmail.com>
* homing: Make homing.py an "extras" moduleKevin O'Connor2021-01-081-5/+5
| | | | | | | Move klippy/homing.py to klippy/extras/homing.py and convert the code to an "extras" modules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Use configfile note_valid=False when inspecting z position_minKevin O'Connor2020-12-131-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: add update_probe_points() method to helperArksine2020-09-151-0/+3
| | | | | | This allows the consumers of the ProbePoints helper to be reconfigured at runtime. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* probe: add get_status wrapper to probe for last_query from query_probe ↵Paul McGowan2020-09-091-0/+4
| | | | | | | command (#3296) Add get_status wrapper with last_query status for macros It is sometimes useful to determine the state of the probe from a macro. If the probe is connected to an endstop pin, the results can be obtained via QUERY_ENDSTOPS but if a physical endstop is in use in addition to the probe the probe state cannot be obtained. This change allows one to use QUERY_PROBE and then access the printer.probe.last_query object to obtain the state. Signed-off-by: Paul McGowan <mental405@gmail.com>
* probe: Make sure z is homed before probingKevin O'Connor2020-09-041-4/+6
| | | | | | | Warn if the Z axis is not homed before attempting to probe. This improves the error message. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Prefer printer.command_error() instead of homing.CommandError()Kevin O'Connor2020-09-041-6/+5
| | | | | | | Update callers to use the printer.command_error reference instead of directly using homing.CommandError() when raising or catching errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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>