Commit graph

132 commits

Author SHA1 Message Date
Gareth Farrington
3dbac01e1d probe: Create ProbeVirtualEndstopDeprecation
As probes stop supporting `probe:z_virtual_endstop` this class will give users a polite and specific configuration error.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:08:32 -04:00
Dmitry Butyugin
ca83c13f37 generic_cartesian: Fixed safe_z_home and manual_probe for new kinematics
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-10 20:16:00 -04:00
Dmitry Butyugin
cc6736c3e3
kinematics: Generic Cartesian kinematics implementation (#6815)
* tests: Added a regression test for generic_cartesian kinematics

* kinematics: An intial implementation of generic_cartesian kinematics

* generic_cartesian: Refactored kinematics configuration API

* generic_cartesian: Use stepper instead of kinematic_stepper in configs

* generic_cartesian: Added SET_STEPPER_KINEMATICS command

* generic_cartesian: Fixed parsing of section names

* docs: Generic Caretsian kinematics documentation and config samples

* generic_cartesian: Implemented multi-mcu homing validation

* generic_cartesian: Fixed typos in docs, minor fixes

* generic_cartesian: Renamed `kinematics` option to `carriages`

* generic_cartesian: Moved kinematic_stepper.py file

* idex_modes: Internal refactoring of handling dual carriages

* stepper: Refactored the code to not store a reference to config object

* config: Updated example-generic-cartesian config

* generic_cartesian: Restricted SET_STEPPER_CARRIAGES and exported status

* idex_modes: Fixed handling stepper kinematics with input shaper enabled

* config: Updated configs and tests for SET_DUAL_CARRIAGE new params

* generic_cartesian: Avoid inheritance in the added classes

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-05-06 18:06:36 -04:00
Kevin O'Connor
1f5783a250 probe: Remove ProbeEndstopSessionHelper
Have all callers instantiate the individual helper classes directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
3fb1191cad probe: Add a new LookupZSteppers helper class
Split code to lookup the Z stepper from HomingViaProbeHelper to new
LookupZSteppers class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f3a1c914a4 probe: Convert probing_move() callback to use regular probe sessions system
Use the normal probe_session_start(), run_probe(),
pull_probed_results(), and end_probe_session() API from
ProbeSessionHelper.  This removes the custom probing_move() callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
b2e36e5d98 probe: Change probing_move() to pass a gcmd instead of (pos, speed)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
ff0ffedd17 probe: Add a new ProbeParameterHelper class
Split multi-sample config reading from ProbeSessionHelper to a new
ProbeParameterHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
1e87d26707 probe: Add a new lookup_minimum_z() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f8de9ae080 probe: Add a new ProbeEndstopSessionHelper class
Move the HomingViaProbeHelper() instance from ProbeSessionHelper to a
new ProbeEndstopSessionHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
6a87c5e9f5 probe: Add a default probing_move() function to HomingViaProbeHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
11f04ba1ba configfile: Allow getchoice() to take a list
If a list is passed to getchoice(), seamlessly convert it to a dict.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-17 13:49:05 -04:00
Kevin O'Connor
fcf064ba68 probe_eddy_current: Add support for probing in "scan" mode
When probing in "scan" mode, the toolhead will pause at each position,
but does not descend.  This can notably reduce the total probing time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-14 13:38:07 -04:00
Kevin O'Connor
1591a51f76 probe: Gather multiple results in ProbeSessionHelper
Change run_probe() to gather the results locally, and introduce a new
pull_probed_results() method that returns the previously probed
results.  This is in preparation for future probing code that benefits
from batching probe results.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-14 13:38:07 -04:00
Kevin O'Connor
8de7153952 probe: Rework ProbePointsHelper to store results locally
Store the results of each probe attempt in a local "results" variable
(instead of a class variable) when performing "automatic" probes.
This is in preparation for gathering the results in the probing
implementation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-14 13:38:07 -04:00
Kevin O'Connor
d4bae4dffe probe: Simplify PrinterProbe() now that there are no external callers
Create the mcu_probe interface locally within PrinterProbe().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
f72f94e299 probe: Move add_steppers() logic to HomingViaProbeHelper class
Perform the initial add_steppers() configuration in a single location.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
58753e58a2 probe: Use ppins.setup_pin() helper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
e780049a74 probe: Use an event for axis twist compensation updates
Instead of directly calling axis_twist_compensation, send an event
that can perform the necessary updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
f4adb29999 probe: Ensure all external callers always call end_probe_session()
Rework ProbeSessionHelper's multi_probe_start() and multi_probe_end()
to start_probe_session() and end_probe_session().  Ensure all external
callers always invoke these methods prior to running run_probe().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
982a50c70a probe: Split z_virtual_endstop handling to new HomingViaProbeHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
de9798fb5b probe: Move offset handling to new ProbeOffsetsHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
f9a2920cee probe: Move PROBE_ACCURACY command to ProbeCommandHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
292512f813 probe: Move PROBE_CALIBRATE to ProbeCommandHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
6ea5b94d1e probe: Convert probe.get_lift_speed() to probe.get_print_params()
Add a get_print_params() method that can extract all the common
probing parameters.  Replace get_lift_speed() with this more general
function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
6f6122a576 probe: Move Z_OFFSET_APPLY_PROBE to ProbeCommandHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
8fc11b4a2e probe: Introduce new ProbeCommandHelper class
Move the PROBE and QUERY_PROBE commands from ProbeSessionHelper class
to new ProbeCommandHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
bec47e0492 probe: Split out new ProbeSessionHelper() class from PrinterProbe()
Separate out the PrinterProbe() class to make the external probe
interfaces more clear.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
12f92c55f1 probe: Code movement in probe.py
Move code around in probe.py and add some comments.  No code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-06-10 12:20:21 -04:00
Kevin O'Connor
7b490f3ec1 probe: Fix typo in activate/deactive error messages
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-04-27 11:10:01 -04:00
Kevin O'Connor
acdf8bb108 probe: Add a probing_move() wrapper to low-level mcu_probe class
This allows the low-level probe class more control on the probing
implementation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-04-09 16:32:43 -04:00
Philippe Daouadi
039daecb4f
axis_twist_compensation: Add X twist compensation module (#6149)
Implements AxisTwistCompensation, and Calibrater

Supports calibration of z-offsets caused by x gantry twist

Modify PrinterProbe._probe function to check if the probed z value should be adjusted
based on axis_twist_compensation's configuration

Add documentation for [axis_twist_compensation] module

Signed-off-by: Jeremy Tan <jeremytkw98@gmail.com>
2023-08-01 13:08:53 -04:00
Pedro Lamas
87f109984a probe: expose name on status report
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-03-14 21:11:33 -04:00
Lasse Dalegaard
ca6e5fe514 probe: Allow overriding horizontal_move_z on gcode
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2023-03-14 21:01:40 -04:00
Kevin O'Connor
d3484efe73 probe: Use config.getlists() for points config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
shiftingtech
36e3969219
probe: bugfix to z_offset_apply_probe (#4553)
Command was accessing the wrong variable for the existing z offset,
leading to bad behavior.

Signed-off-by: Ben Eastep <shifting@shifting.ca>
2021-08-02 16:08:19 -04:00
shiftingtech
f949bc882d
probe: add ability to save babystepping (#4404)
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>
2021-07-25 20:20:15 -04:00
Kevin O'Connor
f3bd4e6acf probe: Call add_stepper() earlier in boot process
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Kevin O'Connor
0a4a64058d probe: Use original XY position on multiple probe samples
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>
2021-04-28 21:40:49 -04:00
nlef
2d2db0f839
probe: Add deactivate_on_each_sample: param for Probe (#4161)
Signed-off-by: Nick Lefskiy <n.lefskiy@yandex.ru>
2021-04-24 13:39:58 -04:00
Kevin O'Connor
58a0eb76c5 homing: Pass the HomingMove class to homing_move_begin/end events
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-29 21:20:57 -04:00
Kevin O'Connor
862d3f9633 homing: Move low-level probing logic from probe.py to homing.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-29 21:17:53 -04:00
Christian S
bc2f6faa17
probe: Add last_z_result to get the latest z result in an Macro (#3835)
Signed-off-by: Christian Schnellrieder <schnello.android@gmail.com>
2021-02-18 22:03:32 -05:00
Kevin O'Connor
8260a3a0c3 homing: Make homing.py an "extras" module
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>
2021-01-08 14:01:34 -05:00
Kevin O'Connor
b25520795d probe: Use configfile note_valid=False when inspecting z position_min
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-13 10:42:25 -05:00
Arksine
9e68105b74 probe: add update_probe_points() method to helper
This allows the consumers of the ProbePoints helper to be reconfigured at runtime.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-15 20:36:55 -04:00
Paul McGowan
5a2f406fd1
probe: add get_status wrapper to probe for last_query from query_probe 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>
2020-09-09 23:10:35 -04:00
Kevin O'Connor
3bcb6970f5 probe: Make sure z is homed before probing
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>
2020-09-04 15:47:52 -04:00
Kevin O'Connor
08adecd226 homing: Prefer printer.command_error() instead of homing.CommandError()
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>
2020-09-04 12:10:36 -04:00
Kevin O'Connor
2caaaea9a4 toolhead: Add a manual_move() helper function
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>
2020-08-20 21:03:22 -04:00