6228 Commits
Author SHA1 Message Date
Kevin O'Connor a353efa5b6 probe: Return to start XY position on each attempt in PROBE_ACCURACY
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
Kevin O'Connor 32a5f2b042 probe: Deprecate last_z_result and add new last_probe_position
Deprecate the PROBE command's exported value
`{printer.probe.last_z_result}`.  This value effectively returns the
toolhead Z position when the probe triggers and user's then need to
adjust the result using the probe's configured z_offset.

Introduce a new `{printer.probe.last_probe_position}` as a
replacement.  This replacement has an easier to understand behavior -
it states that the probe hardware estimates that if the toolhead is
commanded to last_probe_position.x, last_probe_position.y and descends
then the tip of the toolhead should first make contact at a Z height
of last_probe_position.z .  That is, the new exported value already
takes into account the probe's configured xyz offsets.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-21 12:13:15 -05:00
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 bb96318725 ci-install: Install scipy/numpy in github regression test case environment
This is in preparation for enhanced load_cell test cases which require
these packages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-20 11:34:21 -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 1cde5e2018 mcu: Pass conn_helper to CommandWrapper and CommandQueryWrapper
Pass the low-level MCUConnectHelper class to these helper classes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-20 11:34:21 -05:00
Kevin O'Connor e590bc87d8 spi_flash: Don't import mcu module
Avoid using mcu.CommandQueryWrapper() and mcu.CommandWrapper()
classes.  Instead, implement local variants of these classes.  This
will make it easier to modify the mcu classes without fear of breaking
the spi_flash code.

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
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
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2026-01-09 20:37:06 -05:00
Timofey Titovets 1fc9d81095 docs: describe eddy error messages
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-08 12:00:45 -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 2e0d746172 ldc1612: trigger error on high frequency
If the sensor coil is disconnected, the frequency is equal to the reference.
If the sensor is misconfigured or damaged, the coil frequency is
greater than 1/4 of the reference frequency.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-08 12:00:45 -05:00
Timofey Titovets c6c7614972 ldc1612: ignore amplitude errors during homing
Amplitude errors are useful but often too aggressive.
On some sensors, it is not possible to avoid them completely.
Make them non-critical for homing.

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 e605fd1856 stm32: Improve accuracy of hardware pwm cycle time
Use a different method of setting the hardware pwm registers so that
the actual cycle_time is much closer to the requested cycle_time.

Also, remove the now unused stm32_timer_output command, as the main
hardware pwm interface provides the same accuracy.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-06 21:53:29 -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
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
Kevin O'Connor e60fe3d99b stm32: Fix off-by-one error in the prescaler calculation in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-02 14:35:08 -05:00
Kevin O'Connor 74a15f4834 stm32: Minor comment and code organization changes to hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-02 14:35:08 -05:00
MRX8024 8dd798ebb8 tmc: Fix stepper:set_dir_inverted event handler name
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 05ce956456 stm32: fix static clock output for faster chips
If pcycle_time is scaled, the value should be scaled as well

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-31 12:03:54 -05:00
Kevin O'Connor ae3eb30f28 stm32: Enable MOE bit in hard_pwm.c for all stm32 chips
Always enable the MOE bit.  Reported by @tt33415366.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-31 11:34:15 -05:00
Kyoungkyu Park dd625933f7 avr: add lgt8f328p support
Signed-off-by: Kyoungkyu Park <choryu.park@choryu.space>
2025-12-30 21:51:15 -05:00
Timofey Titovets 51dcb09d12 probe_eddy_current: reload z_offset probe helper
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
Kevin O'Connor 7377da63b7 stm32: Declare gpio_timer_setup() as static in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-30 18:16:40 -05:00
Timofey Titovets 3d5f352e24 docs: Describe static_pwm_clock section
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-30 18:14:37 -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 ec0eb4a8bf stm32: hard pwm allow scale PWM frequency
To support the cartographer, it is required to output 24 MHz.
With current defaults max output frequency is:
48 MHz/256 = 187.5 KHz
Adjusting the PWM scale allows for ramping up the frequency.

To not mess up with existing PWM users,
define the STM32-specific command.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-30 18:14:37 -05:00
Timofey Titovets 12cc944fa0 stm32: F042 define PB4 HW PWM
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-12-30 18:14:37 -05:00
Markus Küffner 2cc3608945 buildcommands: retrieve version from klippy version file (#7134)
Signed-off-by: Markus Küffner <kueffner.markus@gmail.com>
2025-12-30 10:15:35 -05:00
Kevin O'Connor 5d24122c04 _klipper3d: Make sure custom css file is preserved
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-23 18:25:59 -05:00
Kevin O'Connor d9f5da7196 _klipper3d: Remove unnecessary files copied into the main website
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-23 18:05:19 -05:00
Kevin O'Connor 94cbde7517 _klipper3d: Rename build-translations.sh to build-website.sh
Rename the build script to make it more clear that it builds the
entire github hosted website.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-23 15:26:14 -05:00
Timofey Titovets 8b58aa1302 probe_eddy_current: show noise at distinct calibration points
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 dc622f4ac3 stm32: Allow disabling double buffering transmit in usbfs.c
Only enable double buffering transmit if
CONFIG_STM32_USB_DOUBLE_BUFFER_TX is set.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-18 20:57:50 -05:00
Kevin O'Connor c3b660dfbe stm32: Simplify USBx_IRQn per-chip definitions in usbfs.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-18 20:57:50 -05:00
Kevin O'Connor 59a754c48c stm32: Implement manual double buffering tx for usbotg
It is possible for USB host controllers to send back-to-back IN tokens
which only gives the MCU ~3us to queue the next USB packet in the
hardware.  That can be difficult to do if the MCU has to wake up the
task code.  The stm32 "usbotg" hardware does not support a builtin
generic double buffering transmit capability, but it is possible to
load the next packet directly from the irq handler code.  This change
adds support for queuing the next packet destined for the host so that
the USB irq handler can directly load it into the hardware.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-18 20:57:50 -05:00
Kevin O'Connor a3e24d2172 rp2040: Add support for ADC on rp2350b chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-18 20:56:13 -05:00
Kevin O'Connor 3a3e9fa2f1 rp2040: Support rp2350b extra gpios
Add support for gpio31 through gpio47 on rp2350, as these pins are
available on the rp2350b chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-18 20:56:13 -05:00