Commit graph

1771 commits

Author SHA1 Message Date
Kevin O'Connor
2a1027ce41 probe: Convert pull_probed_results() to return ProbeResult
Change the low-level probe code to return ProbeResult tuples from
probe_session.pull_probed_results().  Also update callers to use the
calculated bed_xyz values found in the tuple instead of calculating
them from the probe's xyz offsets.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
f33c76da22 load_cell_probe: Pass probe_offsets to TapSession()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
8c2c90b8d6 probe_eddy_current: Pass probe_offsets class to EddyDescend
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
252fc18c12 probe: Pass probe_offsets to HomingViaProbeHelper() class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
2e0c2262e7 probe: Convert ProbePointsHelper to use ProbeResult
Change the ProbePointsHelper class to return ProbeResult tuples.
Callers of this class are also updated so that they use the tuple's
bed_xyz parameters instead of manually calculating these values from
the probe xyz offsets.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
9ccb4d96e9 manual_probe: Report final probe results in new ProbeResult named tuple
Return the manual probe results in a named tuple containing (bed_x,
bed_y, bed_z, test_x, test_y, and test_z) components.  For a manual
probe the test_xyz will always be equal to bed_xyz, but these
components may differ when using automated z probes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor
3c56eb7f6f load_cell_probe: Enhance regression test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:06:27 -05:00
Kevin O'Connor
8be004401e probe_eddy_current: Implement regression test case
Update the code to support simple regression test cases.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-20 11:34:21 -05:00
Kevin O'Connor
57b94520de mcu: Generate a dummy response to query commands when in debugging mode
Previously a querycmd.send() request would silently hang if the code
is run in "file output" mode (that is, it is not communicating with a
real micro-controller).  This behavior makes it hard to implement
regression tests and is generally confusing.

Change the code to respond with a dummy response (typically all zeros
and empty strings) instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-20 11:34:21 -05:00
Kevin O'Connor
48f0b3cad6 gcode_move: Export more than 4 components in gcode_position status
Some checks failed
Build test / build (push) Has been cancelled
Commit f04895f5 documented that "{printer.gcode_move.gcode_position}"
may contain more than 4 components, however the code was not actually
updated to export that additional information.  (Commit ac6cab91 only
made the change to "homing_origin" and "position".)

Export the information in gcode_position as intended.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-11 17:30:28 -05:00
Dmitry Butyugin
2bd0acb6ca exclude_object: Fixed object exclusion with changing GCode axes
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2026-01-09 20:37:06 -05:00
Timofey Titovets
f1bd17d83d ldc1612: decode error flags
Most errors, aside from amplitude, should never happen.
Output them to the log to simplify later debugging.
Count them to aggregate error metrics.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-08 12:00:45 -05:00
Timofey Titovets
f7ddb40037 ldc1612: handle i2c errors
I2C error means we don't know the sensor status.
Force data output to the host and cancel homing.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-08 12:00:45 -05:00
Kevin O'Connor
8bca4cbcd9 static_pwm_clock: Don't rely on custom stm32_timer_output mcu code
Use the regular hardware pwm interface instead of relying on a custom
interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-06 21:53:29 -05:00
Timofey Titovets
abda66d6ef ldc1612: enable frequency div to reduce noise
Some checks failed
Build test / build (push) Has been cancelled
BTT Eddy uses 12MHz clock in frequency.
Coil is oscillating at 3+MHz.
Which is out of spec for LDC1612 sensors.
Division of coil frequency seems to reduce output noise.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-04 15:56:21 -05:00
MRX8024
8dd798ebb8 tmc: Fix stepper:set_dir_inverted event handler name
Some checks failed
Build test / build (push) Has been cancelled
The event handler is registered with an incorrect event name, causing the handler to never be called.

Signed-off-by: Maksim Bolgov maksim8024@gmail.com
2025-12-31 19:33:50 -05:00
Timofey Titovets
51dcb09d12 probe_eddy_current: reload z_offset probe helper
Some checks failed
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Has been cancelled
Currently, there is no way to adjust the calibration curve.
The existing z_offset infrastructure is not applicable
or disabled here.

To make it possible to fine tune calibration curve.
Reload Z_OFFSET helper for probe_eddy_current.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-30 19:40:47 -05:00
Kevin O'Connor
8ea7be5dd7 tmc: Hold a mutex during enable/disable checking
It's possible for a motor disable request to occur while processing a
previous motor enable.  Use a reactor mutex to ensure the two events
are processed serially.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-30 18:34:55 -05:00
Kevin O'Connor
d5ef924751 tmc: Simplify TMCCommandHelper() error checking
Move shutdown checking from _do_enable() and _dos_disable() to new
enable_disable_cb().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-30 18:34:55 -05:00
Kevin O'Connor
db35e99ea1 tmc: Group code startup functions together in TMCCommandHelper()
Code movement only; no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-30 18:34:55 -05:00
Timofey Titovets
1fdf0ebaf4 static_pwm_clock: define module for stm32
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-30 18:14:37 -05:00
Timofey Titovets
8b58aa1302 probe_eddy_current: show noise at distinct calibration points
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-21 12:28:07 -05:00
Timofey Titovets
a40beb7b1b probe_eddy_current: filter noisy calibration points
A misplaced sensor or a misconfigured one
can return unreliable results.
Assist with this by refusing to use the too noisy points.
Filter noisy points by the frequency difference to noise ratio.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-21 12:28:07 -05:00
Kevin O'Connor
a8cbc93552 bus: Verify that software i2c pins are all on the same mcu
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-17 10:48:04 -05:00
Kevin O'Connor
f52a6f9491 output_pin: Rename "delay" flag to "repeat" in GCodeRequestQueue()
Some checks failed
Build test / build (push) Has been cancelled
Rename the flag to make it more clear what it does.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-10 13:39:26 -05:00
Timofey Titovets
2b4c55ffd1 servo: sync pwm clock times
Arriving of SW PWM out of sync
can cause pulse width distortion - make them longer
Synchronize the update clock to avoid that

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-10 13:39:26 -05:00
Timofey Titovets
f9108496a1 ldc1612: fix data rate calculation
There is no need to remove 4 from data rate.
Formula for conversion time is: (RCOUNT0×16)/ƒREF0

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-10 13:38:42 -05:00
hilbo86
9c84895a09
ads1x1x: Interface for "QUERY_ADC" (#7132)
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
"QUERY_ADC" command will fail without "get_last_value" function.

Signed-off-by: Timo Hilbig <timohilbig@t-online.de>
2025-11-30 16:52:22 -05:00
minicx
9ac90f8752 aht10: Add AHT10 as alias for AHT1X for backwards compatibility
Signed-off-by: Lev Voronov <minicx@disroot.org>
2025-11-30 16:50:11 -05:00
minicx
1f43be0b8b aht10: Add support for AHT2x/AHT3x families
Split into three classes with proper init commands:
- AHT1x: 0xE1 (AHT10, AHT15)
- AHT2x: 0xBE (AHT20, AHT21, AHT25)
- AHT3x: auto-cal (AHT30)

Signed-off-by: Lev Voronov <minicx@disroot.org>
2025-11-30 16:50:11 -05:00
minicx
355b6cee8c aht10: Fix status bit masks
Signed-off-by: Lev Voronov <minicx@disroot.org>
2025-11-30 16:50:11 -05:00
Timofey Titovets
a9cf02c412 sosfilter: handle high order butter filters
Some checks are pending
Build test / build (push) Waiting to run
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-26 14:11:20 -05:00
Timofey Titovets
900c908db8 sosfilter: fix case if no notch is defined
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-26 14:11:20 -05:00
Dmitry Butyugin
79189203e2 generic_cartesian: Added option 'axis' for primary carriages
Some checks failed
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Has been cancelled
This also enables arbitrary using names for primary carriages
with generic_cartesian kinematics.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-25 18:12:43 -05:00
Dmitry Butyugin
baf188bd62 shaper_calibrate: Fixed sending large objects via Pipe from bg process
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-21 17:48:56 -05:00
Dmitry Butyugin
c339bb0cdf shaper_calibrate: Reworked best shaper recommendations
* Do not recommend ZV shaper by default if possible
* Try to find more optimal shaper out of more aggressive ones

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-21 17:48:56 -05:00
Dmitry Butyugin
2aff840f68 shaper_calibrate: Reworked multi-file shaper autocalibration
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-21 17:48:56 -05:00
Timofey Titovets
edaa61471f bme680: fix infinite data wait
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-14 18:47:27 -05:00
Kevin O'Connor
db7acaa34a motion_report: Fix off-by-one error in live_extruder_velocity calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-09 18:57:16 -05:00
Kevin O'Connor
c3bf7b109e motion_report: Support reporting live_position of extra axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
24a1116c7c motion_report: Support reporting of manual_stepper trapqs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
67db551be5 toolhead: Export "extra axes" coordinates in status
Update the "position" status to include extra axes.  Export a new
"extra_axes" value that describes the class associated with each
component of the coordinate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
ac6cab9168 gcode_move: Export extra axes in status reference
Change "homing_origin" and "position" to support more than 4
components.  Export a new "axis_map" value to describe the contents at
each component index.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
d0b1b832dd gcode: Change Coord() class to initialize from a list or tuple
Instead of passing arguments as parameters, pass them as a list (or
tuple).  This simplifies the callers and makes it easier to pass
additional parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
6465921a5a gcode_macro: Verify nothing attempts to pause in a get_status() callback
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Kevin O'Connor
ff667075cf statistics: Verify nothing attempts to pause in a stats() callback
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Timofey Titovets
bb04546e6e pca9533: do write on connect like pca9632 does
Some checks are pending
Build test / build (push) Waiting to run
This is the only user of the i2c_write inside the init
compatibility layer, so remove it as well.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:46:58 -04:00
Timofey Titovets
6a8b823a45 led: run update function as reactor callback
Update functions could be called within the flush/lookahead context
If the update function internally does pause()
That would lead to the unpredictable execution of time-critical functions

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:46:58 -04:00
Kevin O'Connor
6557050968 motion_queuing: Verify nothing attempts to pause in flush callbacks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
e549cc4143 load_cell: Only launch a callback in the klippy:ready event handler
It is not valid to pause in the klippy:ready callback, so perform the
sensor startup process in a separate reactor task.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00