Commit Graph

69 Commits

Author SHA1 Message Date
Kevin O'Connor a4995c61c9 stepper: Remove add_to_endstop() method
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>
2019-11-12 17:32:18 -05:00
Julien Lirochon 0c247e55e6 probe: Add range to probe accuracy results (#2015)
Signed-off-by: Julien Lirochon <julien@lirochon.net>
2019-09-29 16:56:46 -04:00
Kevin O'Connor 364c22fe84 probe: Rework the PROBE_ACCURACY command parameters
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>
2019-07-10 15:21:09 -04:00
Kevin O'Connor b2c778b931 mcu: Integrate query_endstop_wait() into query_endstop()
There is no need to have two separate calls to query an endstop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-07-10 10:43:20 -04:00
Kevin O'Connor 83e6c01ada probe: Allow probe parameters to be specified as g-code parameters
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>
2019-06-21 14:44:28 -04:00
Kevin O'Connor c92aca74b5 probe: Add support for samples_tolerance
Add a check on the maximum Z distance between probe samples.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 14:06:20 -04:00
Kevin O'Connor 98915fb1d0 probe: Always return just x,y,z from _probe()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-21 11:04:55 -04:00
Kevin O'Connor bdf5898891 probe: Allow retries from ProbePointsHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-18 12:12:25 -04:00
Kevin O'Connor 27ca159285 gcode_macro: Add a default parameter to load_template
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 10:51:57 -04:00
Kevin O'Connor 49a3083d6a manual_probe: Add extra checks to catch manual probe not finishing correctly
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 40f73dd7f4 probe: Check for toolhead movement during activate/deactivate_gcode scripts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 1fd490ddf9 probe: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 15011012e5 probe: Simplify ProbePointsHelper start and end tracking
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor bbc8637ed6 probe: Be sure to call gcode.reset_last_position() after any manual move
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 74cc005ff3 probe: Unify mean and median code between run_probe() and PROBE_ACCURACY
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>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 2b8dca5dbf probe: Move multi-sampling capability from ProbePointsHelper to Probe
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>
2019-06-06 10:08:58 -04:00
fess 9887e72570 probe: ProbePointsHelper adjustable minimum points
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>
2019-05-21 14:17:09 -04:00
Kevin O'Connor 7d246e2624 probe: Use gcode_macro style templates on activate/deactivate_gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-04-04 18:35:23 -04:00
Kevin O'Connor 1b1d3f15d8 probe: Fix PROBE_CALIBRATE command
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>
2019-03-08 12:34:13 -05:00
Kevin O'Connor eac22df7cb probe: Catch toolhead.move() exceptions in cmd_PROBE_CALIBRATE()
Slightly rework the self._move_position() code and also use it in
PROBE_CALIBRATE.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-03-08 12:32:01 -05:00
Rui Caridade 5c0a2479be screws_tilt_adjust: Add new screws_tilt_adjust tool (#1367)
Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
2019-03-08 11:47:17 -05:00
Kevin O'Connor 9f1d9bf0f4 probe: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-27 13:28:55 -05:00
Rui Caridade 749beb731c probe: Set z min value in probe_accuracy to z_offset. (#1314)
Signed-off-by: Rui Caridade <rui.mcbc@gmail.com>
2019-02-25 12:52:54 -05:00
Rui Caridade 276d5a1436 probe: Add PROBE_ACCURACY command
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>
2019-02-18 00:36:28 -05:00
Kevin O'Connor b0b9fc6f4a probe: Use manual_probe helper when performing manual probes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor 35ea4a137d probe: Add PROBE_CALIBRATE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:20:32 -05:00
Kevin O'Connor 824e55d75a bltouch: Add initial support for a bltouch "extras" module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor fedf90680e homing: Pass printer instead of toolhead object to Homing class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-16 13:09:23 -04:00
Kevin O'Connor d4bf51231a homing: Implement second home from homing.py
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>
2018-10-10 12:14:27 -04:00
Kevin O'Connor f49f298003 probe: Merge ProbeVirtualEndstop and ProbeEndstopWrapper wrapper classes
No need to have two wrappers around the mcu_endstop class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:14:23 -04:00
Kevin O'Connor c5d4e14298 probe: Infer position_endstop when using probe:z_virtual_offset
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor a9a0bb87fa probe: Verify the toolhead moves at least some distance on a probe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 33887b8c39 probe: Support manual probing at runtime
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 0e9b8abde2 probe: Perform multi-sample averaging in ProbePointsHelper class
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor e5ef15ad0f probe: Separate out manual probing from automatic probing code
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor cb3fede19a probe: Move move_next() method within ProbePointsHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 8e7eac9b08 probe: Implement ProbePointsHelper get_probed_position() locally
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>
2018-10-01 11:12:30 -04:00
Kevin O'Connor 30013a1fb8 mcu: Rename add_config_object() to register_config_callback()
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>
2018-09-03 11:48:22 -04:00
Kevin O'Connor cf4f23ebf2 probe: Use probe speed for initial move to the Z height
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-30 16:20:23 -04:00
Arksine 40b7ba5111 probe: Add ability to multi-sample points to ProbePointsHelper
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2018-08-29 12:01:19 -04:00
Arksine 1588426229 probe: Refactor z lift code to its own function.
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>
2018-08-29 12:01:14 -04:00
Romain “Artefact2” Dal Maso 11e9bb286e probe: Allow restarting an incomplete probe set
Signed-off-by: Romain “Artefact2” Dal Maso <artefact2@gmail.com>
2018-08-24 13:20:55 -04:00
Arksine 3387cccdcf bed_mesh: move probe x and y offsets to the [probe] module
All probe offsets are now passed to the finalize() callback in the ProbePointsHelper Class.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-08-19 16:52:23 -04:00
Arksine 52df40dfbb bed_mesh: update z_offset check
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>
2018-08-19 16:52:23 -04:00
Kevin O'Connor 273a98d39a pins: Explicitly pass can_invert and can_pullup to lookup_pin()
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>
2018-07-26 09:44:45 -04:00
Kevin O'Connor ca505bf4ac kinematics: Convert get_rails() method to get_steppers()
All callers of get_rails() actually just want the steppers, so return
them directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-16 10:16:16 -04:00
Kevin O'Connor 260d12af6d probe: Make sure there are at least 3 points even if using default_points
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-14 15:33:58 -04:00
Kevin O'Connor 2af73d1006 probe: Simplify mcu_probe stepper registration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-07-13 17:14:33 -04:00
Kevin O'Connor 4ad44e3e83 gcode: Rename run_script() to run_script_from_command()
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>
2018-06-30 14:08:02 -04:00
Kevin O'Connor d9a32f75fa probe: Rename get_position() callback to get_probed_position()
The different uses of get_position() can be confusing, so choose a
different name for the ProbePointsHelper callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-06-22 15:33:12 -04:00