Commit graph

6073 commits

Author SHA1 Message Date
Timofey Titovets
2f70b59ea7 probe: retract after PROBE
With probes where the nozzle touches the bed
It is safer to retract after the last probe
as PROBE_ACCURACY does.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-11 20:47:39 +01:00
Timofey Titovets
7f54f2622b ldc1612: implement tap support
Simple MCU side negative peak detection.
Host uses the raw MCU side timings for now.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-11 20:47:37 +01:00
Kevin O'Connor
4613594771 probe: Return to start XY position on each attempt in PROBE_ACCURACY
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-11 20:31:40 +01:00
Kevin O'Connor
f5de8a6a77 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-11 20:31:40 +01:00
Kevin O'Connor
362583adee 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-11 20:31:40 +01:00
Kevin O'Connor
a5d2d60956 load_cell_probe: Pass probe_offsets to TapSession()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-11 20:31:40 +01:00
Kevin O'Connor
588b1972c9 probe_eddy_current: Pass probe_offsets class to EddyDescend
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-11 20:31:40 +01:00
Kevin O'Connor
0f5131b0f9 probe: Pass probe_offsets to HomingViaProbeHelper() class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-11 20:31:40 +01:00
Kevin O'Connor
29ec901dd3 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-11 20:31:40 +01:00
Kevin O'Connor
1023a4b2d0 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-11 20:31:40 +01: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
1fc9d81095 docs: describe eddy error messages
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
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
Some checks failed
Build test / build (push) Has been cancelled
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
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
Kevin O'Connor
e60fe3d99b stm32: Fix off-by-one error in the prescaler calculation in hard_pwm.c
Some checks failed
Build test / build (push) Has been cancelled
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
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
05ce956456 stm32: fix static clock output for faster chips
Some checks are pending
Build test / build (push) Waiting to run
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
Some checks are pending
Build test / build (push) Waiting to run
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
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
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)
Some checks are pending
Build test / build (push) Waiting to run
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
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
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
Some checks are pending
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Waiting to run
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
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
dc622f4ac3 stm32: Allow disabling double buffering transmit in usbfs.c
Some checks failed
Build test / build (push) Has been cancelled
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
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
3f72e519ed atsamd: Fix possible buffer overflow in usbserial.c
The USB buffer size register PCKSIZE.SIZE was not being assigned
correctly.  As a result, it was possible for an incoming USB
transmission to write past the allocated buffer space, which could
corrupt memory of other storage.  In particular, in some cases gcc may
layout ram in such a way that the trailing bytes of an incoming
message might overlap the buffer for an outgoing message.  This could
cause sporadic transmit errors and unstable connections.

Fix by correctly configuring the PCKSIZE.SIZE register.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-17 10:18:39 -05:00
Kevin O'Connor
d92dda439e lib: Update pico-sdk to v2.2.0
The new rp2350 chips with A4 stepping require pico-sdk v2.2.0 .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-17 10:12:52 -05:00
Kevin O'Connor
867d73f0b8 serialqueue: Make 31-bit clock overflow check a little more robust
Allow reqclock to be slightly less than the transmitted messages's
deadline.  That is, delay messages with a reqclock far in the future
to slightly past (1<<31) ticks from its deadline.  Use (3<<29)
instead, which gives an additional (1<<29) grace period to avoid clock
overflows.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-14 15:55:57 -05:00
Kevin O'Connor
8e6e467ebc mcu: Fix incorrect reqclock during endstop homing
For correct operation the trsync system must be programmed prior to
the start of endstop checking.  This means the desired "reqclock" for
the trsync configuration messages need to use the same "clock" that
the endstop start message uses - even though the actual deadline for
these messages is later.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-14 15:31:09 -05:00