aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/probe.py
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* probe: Implement ProbePointsHelper get_probed_position() locallyKevin O'Connor2018-10-011-5/+7
| | | | | | | | Now that all users of ProbePointsHelper use the same get_probed_position() code, it is possible to implement that locally within the ProbePointsHelper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Rename add_config_object() to register_config_callback()Kevin O'Connor2018-09-031-1/+1
| | | | | | | | | Change the name of the config registration method and pass an explicit reference to the callback to the new method. This makes the relationship between mcu registration and build_config() more clear in the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Use probe speed for initial move to the Z heightKevin O'Connor2018-08-301-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add ability to multi-sample points to ProbePointsHelperArksine2018-08-291-8/+23
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* probe: Refactor z lift code to its own function.Arksine2018-08-291-7/+11
| | | | | | Call lift-z prior to the first move. This prevents the nozzle from hitting the build surface in situations that home the nozzle off and below the bed. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* probe: Allow restarting an incomplete probe setRomain “Artefact2” Dal Maso2018-08-241-0/+3
| | | | Signed-off-by: Romain “Artefact2” Dal Maso <artefact2@gmail.com>
* bed_mesh: move probe x and y offsets to the [probe] moduleArksine2018-08-191-4/+8
| | | | | | All probe offsets are now passed to the finalize() callback in the ProbePointsHelper Class. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* bed_mesh: update z_offset checkArksine2018-08-191-0/+5
| | | | | | Only check the probe's z_offset against the stepper_z endstop position if the probe is used as a virtual endstop. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* pins: Explicitly pass can_invert and can_pullup to lookup_pin()Kevin O'Connor2018-07-261-5/+5
| | | | | | | | | | | | Don't pass pin_type to lookup_pin() - instead, if a pin can be inverted or can have a pullup, then the caller must explicitly specify that when calling lookup_pin(). This simplifies the code for the cases where it is not valid to invert or pullup. Explicitly pass the pin_type to setup_pin() and have ppins.setup_pin() apply default pullup and invert flags. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* kinematics: Convert get_rails() method to get_steppers()Kevin O'Connor2018-07-161-3/+2
| | | | | | | All callers of get_rails() actually just want the steppers, so return them directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Make sure there are at least 3 points even if using default_pointsKevin O'Connor2018-07-141-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Simplify mcu_probe stepper registrationKevin O'Connor2018-07-131-6/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Rename run_script() to run_script_from_command()Kevin O'Connor2018-06-301-3/+3
| | | | | | | Emphasize that the run_script() method is only valid when run from a g-code command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>