100 Commits
Author SHA1 Message Date
Kevin O'Connor c63b29510b docs: Minor wording improvement to PID_CALIBRATE notice in Config_Changes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-10-18 22:58:12 -04:00
Kevin O'Connor e81223416c docs: Add more context to PID_CALIBRATE change in Config_Changes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-10-18 22:53:30 -04:00
Kevin O'Connor e2b99a9159 ar100: Verify SERIAL_BAUD is set correctly
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-10-01 11:31:08 -04:00
Kevin O'Connor f3897efa43 pru: Utilize timer_dispatch_many_polling()
Convert to timer_dispatch_many_polling() and check for command
activity in the dispatch loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-30 15:28:36 -04:00
Kevin O'Connor ffde3b27d7 ar100: Utilize timer_dispatch_many_polling()
Convert to timer_dispatch_many_polling() and check for serial activity
in the dispatch loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-30 15:28:36 -04:00
Kevin O'Connor e562a6db3a timer_irq: Add new timer_dispatch_many_polling()
Add a new variant of timer_dispatch_many() for chips that do not
support hardware irqs, or do not support hardware irqs being enabled
during timer dispatch.  This new variant allows the boards to poll for
events if many timers are run back to back.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-30 15:28:36 -04:00
Kevin O'Connor ad425fc22e docs: Fix spelling error in FAQ.md
Reported by @reitermarkus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-17 12:26:59 -04:00
Kevin O'Connor 9871eeef13 docs: Note TEMPERATURE_PROBE_CALIBRATE MANUAL_METHOD in Config_Changes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-15 11:14:11 -04:00
Kevin O'Connor 6b2eb15d20 motion_report: Don't report stale velocity if no move found
If there is no entry in the trapq at the requested time then the
velocity is zero.  However, the current code would report the previous
velocity, which could be non-zero in cases with instantaneous velocity
changes.  Check for that case and return a velocity of zero if no move
found.

Reported by @pedrolamas.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-09 18:14:06 -04:00
Kevin O'Connor 71948a75f7 trapq: Skip tail sentinel in trapq_extract_old()
Commit cba7a285 updated trapq_extract_old() to check the list of
active trapq entries.  However, that change could get confused if the
tail sentinel wasn't pristine.  Change the code to always skip the
tail sentinel to avoid that issue.

Reported by @pedrolamas.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-09 18:14:06 -04:00
Kevin O'Connor 3a1f884dc8 mcu: Log mcu reported kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-09 11:13:51 -04:00
Kevin O'Connor 6c68dc7bf3 command: Simplify bounds checks in command_parsef()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-09 10:55:36 -04:00
Kevin O'Connor e1db758c17 command: Verify parser didn't overrun buffer in command_parsef()
Reported by @guanleustc.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-09-08 17:35:41 -04:00
Kevin O'Connor ac2a7f8b0e docs: Update G-Codes.md SAVE_GCODE_STATE description for M83
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-21 17:48:59 -04:00
Kevin O'Connor 58bd67db3c gcode_move: Update docs to clarify M82 does not force absolute extrusion mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-19 13:41:57 -04:00
Kevin O'Connor 84104bbbd7 trigger_analog: Fix statement after label
Commit cab2f004 introduced a "statement after label" which some
versions of gcc don't like.  Add a semicolon to fix it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-07 11:01:38 -04:00
Kevin O'Connor cab2f00408 trigger_analog: Fix TT_ABS_GE handling on AVR mcu
The abs() function on AVR only handles 16-bit integers.  Implement
it manually.

Reported by @kmatzen.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-06 15:40:13 -04:00
Kevin O'Connor e759288831 gcode: Delay exiting from batch mode when virtual_sdcard is busy
When performing batch mode debugging it is possible for the input file
to complete before all background work has completed.  Add a new
'gcode:debuginput_exit' event so that other modules can signal when
they have finished.

Add code to virtual_sdcard module to catch this event and use it to
wait for any sdcard processing to complete.  This fixes the
sdcard_loop.test regression test case.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:32:11 -04:00
Kevin O'Connor e5465051ca reactor: Track amount of time between idling
Add a start_busy_time parameter to the idle notifier.  This makes it
possible for the idle notifier to track how long it takes for the
reactor to clear all pending events.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:11:13 -04:00
Kevin O'Connor a83fa60579 reactor: Improve callback reporting in latency reports for internal timers
The internal reactor code uses internal timers for callbacks and to
resume "pause" operations.  Support reporting the underlying callback
from these timers during high latency reports.  This should make the
high latency debugging reports more useful.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:11:13 -04:00
Kevin O'Connor 1295111834 reactor: Add support for detecting high latency
Add support to the reactor for reporting if a set of callbacks take a
long time before returning to the main reactor loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:11:13 -04:00
Kevin O'Connor a18ef01863 reactor: Move garbage collection to garbage_collection.py module
Support setting a callback just prior to the reactor invoking a
select() call that will sleep.

Move the Python garbage collection code from the main reactor.py and
klippy.py code to the garbage_collection.py module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:11:13 -04:00
Kevin O'Connor 6abe01df7e reactor: Don't duplicate _dispatch_loop() in each reactor variant
Introduce a new _check_fd_activity() method and add it to
SelectReactor, PollReacator, and EPollReactor.  This avoids needing to
duplicate _dispatch_loop() in each of those variants.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 10:11:13 -04:00
Kevin O'Connor 372ed596bb clocksync: Split _handle_clock() into sub-functions and improve comments
Break up the _handle_clock() function into multiple functions.  This
is intended to make it more clear there are several distinct processes
that _handle_clock() implements (64bit clock conversion,
sent_time/clock regression, serialqueue release handling,
round-trip-time tracking, and multi-mcu synchronization).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-08-04 09:47:22 -04:00
Kevin O'Connor 170c4b3740 manual_probe: Improve comment for ProbeResult
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-07-27 16:42:51 -04:00
Kevin O'Connor 7046bd00ef serialqueue: Remove last_clock tracking from clock estimate tracking
The clock 32bit conversion code is distinct from the clock to time
conversion code.  It is also only needed in the trdispatch.c code,
which can calculate a sufficient value for last_clock on its own.

This simplifies the serialqueue code.  It also reduces the chance of a
failure in the trdispatch code if last_clock isn't explicitly updated.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-07-13 20:27:41 -04:00
Kevin O'Connor f604aeeea3 stm32: Set FLASH_SIZE to 32KB on stm32f103x6
This enables the options to reduce code size during "make menuconfig".

Reported by @qpzm1258.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-07-11 11:21:44 -04:00
Kevin O'Connor e278790507 trigger_analog: Fix check_frac_bits() rounding validation
Fix a typo causing the rounding validation check to not actually be
run.

Reported by @Old-Ding.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-07-08 12:38:24 -04:00
Kevin O'Connor e5cc783dd0 trigger_analog: Fix off-by-one error in MIN_INT32 and MAX_INT32
Reported by @Old-Ding.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-07-08 12:34:04 -04:00
Kevin O'Connor 7e64fc8421 rp2040: Fix off-by-one bug in i2c.c
Reported by @Old-Ding .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-06-30 16:17:27 -04:00
Kevin O'Connor ccdb771764 probe_eddy_current: Separate least squares math from EddyTap class
Move the low-level least squares math to a new TapBestFit class and
add additional code comments.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-06-13 22:54:30 -04:00
Kevin O'Connor 2fb3d54e2f stale-issue-bot: Update lock-threads to v6 (from v4)
Update the github workflow lock-threads action in hope that it will
fix run failure reports.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-06-01 14:41:38 -04:00
Kevin O'Connor b7c0329f1d homing: Fix missing variable declaration in _do_home_rails()
Commit 4f178df8 moved the force_axes variable to
_set_start_position(), but failed to remove all uses of that variable
in home_rails().

Reported by "Crestless0166".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-27 14:46:19 -04:00
Kevin O'Connor a0d2769639 probe: Setup "probe:z_virtual_offset" from main probe class
Setup HomingViaProbeHelper() from the main printer probe class and not
from the low-level DescendToEndstopHelper() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-26 12:57:42 -04:00
Kevin O'Connor 4bc56464f9 motion_report: Report debugging on "Internal error in stepcompress"
Enhance the analyze shutdown code to also dump out stepper information
on an "Internal error in stepcompress" error raised from the
motion_queuing module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 18:20:49 -04:00
Kevin O'Connor e5241f109e motion_queuing: Collect debugging on "Internal error in stepcompress"
If steppersyncmgr_gen_steps() reports an error then directly call
printer.invoke_shutdown() and include extra details in the shutdown.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 18:20:49 -04:00
Kevin O'Connor ed82be0147 steppersync: Return failing syncemitter from steppersyncmgr_gen_steps()
If steppersyncmgr_gen_steps() fails (an "Internal error in
stepcompress") then report the underlying syncemitter raising the
error to the motion_queuing module.  This can improve debugging.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 18:20:49 -04:00
Kevin O'Connor cb54464d20 motion_queuing: Pass full config name to allocate_syncemitter()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 18:20:49 -04:00
Kevin O'Connor 85c79bc443 canserial: Increase transmit_buf size to 192 bytes
Increase the buffer size from 96 bytes to 192 bytes.  This reduces the
chance of dropped messages during high bus traffic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:27:09 -04:00
Kevin O'Connor ed1f9963c8 command: Try to encode messages even if space is low
Pass a maximum buffer size parameter to command_encode_and_frame() and
support encoding messages even if there may not be enough space for
the largest possible message.  In practice, most messages will encode
to a size notably smaller than their maximum so this improves buffer
utilization during heavy message traffic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:27:09 -04:00
Kevin O'Connor c250b7c86d docs: Note possibility of users observing "probe:z_virtual_endstop" change
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:17:44 -04:00
Kevin O'Connor 21ad5d8209 probe: Rename ProbeSessionHelper to SampleAveragingHelper
Rename the class to make it more clear what it does.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:17:44 -04:00
Kevin O'Connor 43baf9b833 probe: Use standard probe interface with DescendToEndstopHelper
Convert the low-level probing classes to use the standard probing
interface and have them instantiate DescendToEndstopHelper as a helper
class.  This simplifies the internal interfaces as the low-level
classes no longer need to emulate an "mcu_endstop" and there is no
longer a unique "mcu probe" interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:17:44 -04:00
Kevin O'Connor 82099afba1 bltouch: Mark internal functions with leading underscore
The BLTouchProbe class has a mixture of exported functions and
internal functions.  Mark the internal ones with a leading underscore
to document which functions are exported.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor ef26b04aa4 bltouch: Separate out main probe interface from low-level probing code
Introduce a new PrinterBLTouch class to separate out the high level
printer probe interface code from the low-level code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor 929b0f0cfb smart_effector: Separate out main probe interface from low-level probing code
Introduce a new PrinterSmartEffector class to separate out the high
level printer probe interface code from the low-level code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor 5a56830a01 docs: Homing correction macros no longer needed in Eddy_Probe.md
There is no longer a need for the correction macros now that the G28
code uses the standard probing interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor a9d441f70e load_cell_probe: Enable homing via "probe:z_virtual_endstop"
It is possible to home with load cells now that the G28 code uses the
standard probing interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor d92e9a38b7 probe: Simplify HomingViaProbeHelper now that it is only a thin wrapper
The HomingViaProbeHelper emulates an mcu_endstop, but that emulation
doesn't need to actually do anything.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor a5e8c5df94 probe: Support not checking for movement on first Z home attempt
Restore the previous behavior of only checking for toolhead movement
on the second home attempt when utilizing "probe:z_virtual_endstop".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor c92b1f73a8 probe: Split session management out of HomingViaProbeHelper
Create a new DescendToEndstopHelper that calls phoming.probing_move()
and manages the probing session.  Have HomingViaProbeHelper implement
just the "probe:z_virtual_endstop" logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor fb57d59ce0 probe: No need to register homing events in HomingViaProbeHelper
Now that the homing code does not treat the probe object as an
mcu_endstop object, there is no reason to handle the homing module
events.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor a496edfca1 probe: Suppress verbose probe information when called from G28
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:11:24 -04:00
Kevin O'Connor 5cbebdc3c8 homing: Use main probe code when homing with "probe:z_virtual_offset"
Change the homing code to detect if a home request is using a virtual
"probe:z_virtual_offset" endstop.  In that case, the code will perform
probing attempts using the main probe code (instead of treating the
probe hardware as a kind of mcu_endstop object).

This change will simplify the probing code (as it will no longer need
to emulate mcu_endstop objects), and allow Z homing with probes that
can't easily emulate an mcu_endstop.

There are some known behaviour differences introduced by this change:

* All probing actions currently verify that the toolhead has moved
  some amount of distance, while this is not required on the first
  home attempt with the current homing behavior.

* This exposes the temporary kinematic positions to the
  "homing:homing_move_end" event (which could be seen by probe
  deactivate_gcode macros).  However, the "homing:homing_move_begin"
  (and activate_gcode macros) were already exposed to these temporary
  positions.

* Z home attempts with the probe were previously always rounded to a Z
  microstep.  This behaviour may change with the new code.

* The internal "homing:home_rails_begin" and "homing:home_rails_end"
  events are no longer invoked for these Z home attempts.  It is no
  longer possible to use endstop_phases with a virtual Z home (though
  this functionality wasn't useful).

* It is no longer possible to simultaneously home some Z steppers with
  "probe:z_virtual_offset" while other Z steppers used a traditional
  endstop (however, this functionality wasn't useful).

The first difference (need to move some distance on first home
attempt) will be addressed in a future commit.  The remaining
differences are considered minor.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:10:34 -04:00
Kevin O'Connor 4f178df807 homing: Split parts of home_rails() into separate functions
Create new _set_start_position() and _retract_move() helper functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:08:34 -04:00
Kevin O'Connor 2825bae67f probe: Change HomingViaProbeHelper class to register itself as an "endstop"
Change HomingViaProbeHelper class to be the main interface to the rail
homing code in homing.py .  This will make it easier to change that
interface in future commits.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:08:34 -04:00
Kevin O'Connor b13ae529a9 probe_eddy_current: Create a ProbeSessionHelper for both tap and descend
Create two ProbeSessionHelper wrappers - one for EddyDescend and one
for EddyTap.  This simplifies the main start_probe_session() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:08:34 -04:00
Kevin O'Connor 6376b18341 test: Add a smart_effector test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-25 17:08:34 -04:00
Kevin O'Connor bd99b19b05 ads131m0x: Simplify config.getchoice() calls
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-23 19:41:06 -04:00
Kevin O'Connor db88a33689 mathutil: Optimizations for matrix multiplication
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-19 17:02:09 -04:00
Kevin O'Connor 76f3a97464 bed_tilt: Use solve_linear_equations() instead of coordinate_descent()
It's simpler and more accurate to use linear least squares.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-14 12:38:21 -04:00
Kevin O'Connor 455ef070e8 z_tilt: Use solve_linear_equations() instead of coordinate_descent()
It's simpler and more accurate to use linear least squares.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-14 12:38:21 -04:00
Kevin O'Connor ef7c9116f1 mathutil: Minor matrix optimizations
Python is faster with list comprehensions than generators (prefer
`sum([x for x in c])` over `sum(x for x in c)` ).

Python2 is faster if lists are built with list comprehensions instead
of appending.

Optimize the common `mat_mat_mul(mat_transp(a), a)` as only roughly
half the results are unique.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-14 12:38:21 -04:00
Kevin O'Connor 835c37aae0 mathutil: Add a solve_linear_equations() helper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-14 12:38:21 -04:00
Kevin O'Connor a994bb1f73 temperature_probe: Convert from custom fit() code to mathutil gaussian_solve()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-14 12:38:21 -04:00
Kevin O'Connor ca8230d505 ldc1612: Add support for a new 'max_sensor_hz' config parameter
Add a new option so that setting of sensor_div is more robust.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-11 20:50:21 -04:00
Kevin O'Connor 02cfc65eb6 docs: Note that Z "position_min" needed for "tap" in Eddy_Probe.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-08 10:37:06 -04:00
Kevin O'Connor 54f4827756 docs: Expand Eddy_Probe.md instructions for homing with an eddy probe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-08 10:37:06 -04:00
Kevin O'Connor 72c054f938 docs: Updates to Eddy_probe.md document
Provide more information on the different probe types available when
using an eddy current probe.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-08 10:37:06 -04:00
Kevin O'Connor 735644a062 probe_eddy_current: Separate PROBE_EDDY_CURRENT_CALIBRATE to its own class
Move the handling of the PROBE_EDDY_CURRENT_CALIBRATE command to a new
EddyCalibrationTool class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-08 10:21:17 -04:00
Kevin O'Connor d2aa4bd7e3 ldc1612: Increase sample rate to 400 samples per second (up from 250)
Increase the sample rate so that more samples are available during
"tap" analysis.

Further increases to the sample rate will likely provide diminishing
returns.  The ldc1612 sensor seems to exhibit internal quantization
(that is, repeat identical values are frequently observed).  So, it
seems increasing above 250sps can provide some additional information,
but going much higher is unlikely to provide significant benefit.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-01 23:39:15 -04:00
Kevin O'Connor ef7b13b1f2 probe_eddy_current: Add new PROBE_EDDY_CURRENT_TAP_CALIBRATE command
Add a command to help configure the tap_threshold parameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-01 23:39:15 -04:00
Kevin O'Connor 460ee78340 probe_eddy_current: Rework tap_threshold to use hz/mm
Rework the tap_threshold to use units of hz/mm (instead of hz).  This
will make it easier to implement tap calibration based on results of
PROBE_EDDY_CURRENT_CALIBRATE and previous tap attempts.  It can also
make the tap_threshold more stable with different probe speeds and
sensor rates.

As a result of this change, existing user configurations will need to
be updated.  It is hoped that existing configurations will have a
value that is sufficiently low that they will reliably get an error
until they can recalibrate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-05-01 23:31:17 -04:00
Kevin O'Connor 352bc8b2e3 probe_eddy_current: Support "tap" even if tap_threshold not configured
Now that "tap" support does not require the scipy package to be
installed it is reasonable to activate "tap" for all configurations.
This can make the initial calibration easier.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-29 18:34:24 -04:00
Kevin O'Connor 293e1e9d58 scripts: Fix logextract "MCU shutdown" line detection
Due to recent changes, a shutdown log line may not have a description.
Update the logextract.py script accordingly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-28 21:28:18 -04:00
Kevin O'Connor 6b4aeb4c44 probe_eddy_current: Scale intermediate values within the "tap" sos filter
Scale the internal mcu values to units of milli-hz to reduce the
chance of roundoff error in the internal calculations.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-15 10:39:39 -04:00
Kevin O'Connor 9c3ba2e3a5 trigger_analog: Automatically determine frac_bits in MCU_SosFilter
The coeff_frac_bits and scale_frac_bits can be automatically
calculated, so there's no need for the callers to specify this
information.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-15 10:15:24 -04:00
Kevin O'Connor b1bbd6dabe trigger_analog: Implement rounding in to_fixed_32()
Round the SOS filter coefficients to the nearest integer (instead of
truncating).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-15 10:13:18 -04:00
Kevin O'Connor 2a5c2fe35c trigger_analog: Require trigger_value to be an integer
Have the callers convert convert the trigger_value from a float to an
integer (if necessary).  This is in preparation for implementing
rounding in to_fixed_32().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-15 10:13:18 -04:00
Kevin O'Connor aea1bcf56e probe_eddy_current: Allow "tap" depress of as little as 30um
There have been some reports of the sanity check throwing an error
when the bed is depressed just under 50um.  For now, increase the
valid depress range to avoid unnecessary errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 19:56:33 -04:00
Kevin O'Connor db78babf91 probe_eddy_contact: Add sanity checks to "tap" analysis
Implement some basic checks on the tap results and report an error if
the results look obviously incorrect.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:30:05 -04:00
Kevin O'Connor ec4b88db7b probe_eddy_current: Allow other timers to run while processing tap data
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:16:11 -04:00
Kevin O'Connor 55d7ed1aa9 probe_eddy_current: Increase "tap" calculation precision to 50nm
Continue to run least squares evaluations until the uncertainty range
is within 50 nanometers (reduced from 250nm).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:16:11 -04:00
Kevin O'Connor 5680b74b1d probe_eddy_current: Cache data between each "tap" least squares calculation
Directly calculate the evaluated matrices instead of using
mat_mat_mult() and mat_transp().

Cache the intermediate summations to improve processing when using
similar z guesses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:15:55 -04:00
Kevin O'Connor c1ed295db2 probe_eddy_current: Remove dependency on numpy
Use the least squares solution code in the local mathutil.py module
instead of using the numpy package.  This allows users to utilize the
"tap" functionality without requiring additional package installation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor 3ef23b37a3 probe_eddy_current: Rework internal formulas for "tap" analysis
Use a different base frequency and base z value for the internal "tap"
least squares analysis to improve the numerical stability of the
calculations.

Rework the formulas being solved so that only the depressed slope
calculation is relative to the estimated z contact point.  This
results in less variables that are dependent on the z contact.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor 22dbdf1029 trigger_analog: Store pre-generated 25hz lowpass filter (at 250sps)
Store the 12 constants needed for the common probe_eddy_current "tap"
filter in trigger_analog.py code.  This avoids requiring "tap" users
to have the scipy python package installed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor c8b2ef0c21 probe_eddy_current: Allocate just enough SOS entries for filter
Support exporting the current SOS filter size from the DigitalFilter()
class.  Pass that value to the MCU_SosFilter() class to avoid
allocating unneccessary MCU memory (previously 5 entries were
allocated while only 3 are currently needed).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor 28c236df46 trigger_analog: Merge DerivativeFilter into DigitalFilter
Replace the DerivativeFilter() class with a new add_derivative()
method in DigitalFilter() class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor f05c66cb9e trigger_analog: Add filters individually in DigitalFilter
Add new add_lowpass(), add_highpass(), add_notch(), and
setup_initial_state() methods to DigitalFilter.  Use these instead of
creating the filters from the constructor.

Also remove the unused filtfilt() method.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-12 12:05:39 -04:00
Kevin O'Connor f3db41c637 docs: Update FAQ now that heaters have a MAX_HEAT_TIME of 3 seconds
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-04-08 16:06:57 -04:00
Kevin O'Connor 4db1bf8ac6 probe_eddy_current: Calculate "tap" position from lift movement
Don't calculate the nozzle/bed contact position from the descent
movement.  Instead, obtain the data during the lifting movement and
determine the contact point by analyzing where the nozzle separates
from the bed.

This improves the precision and repeatability of the "tap" results.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:13:37 -04:00
Kevin O'Connor de280e237b probe_eddy_current: Retract at end of each "tap" probe
Perform lifting at the end of EddyTap.run_probe().  This is in
preparation for performing tap analysis during retraction.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:13:37 -04:00
Kevin O'Connor e5c3dfe7a8 probe_eddy_current: Use different defaults for "scan", "rapid_scan" and "tap"
Add a new EddyParameterHelper to override ProbeParameterHelper.

Only use the printer.cfg lift_speed, samples, sample_retract_dist,
samples_result, samples_tolerance, and samples_tolerance_retries
settings for normal probe operations.  Don't use these defaults when
using a "METHOD" set to "scan", "rapid_scan", or "tap".  Each of these
probing mechanisms is distinct and it's unlikely a user could
meaningfully set a default for all of them.

Don't set sample_retract_dist when using "scan" and "rapid_scan"
modes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:13:37 -04:00
Kevin O'Connor 6c8c8d24d7 probe_eddy_current: Support new tap_z_offset config parameter
Theoretically a "tap" probe should detect the exact point that the
nozzle contacts the bed.  In practice, however, there can be a
systemic bias that one may wish to account for.  This bias may be due
to backlash, thermal expansion, a detection bias, or similar issues.

Add a new tap_z_offset config parameter to allow users to specify an
offset.

Also, update the Z_OFFSET_APPLY_PROBE command to support modifying
this value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:07:19 -04:00
Kevin O'Connor 20df766e21 probe_eddy_current: Rename config option z_offset to descend_z
The config option 'z_offset' name is confusing as its behavior is
notably different from how other probe hardware uses 'z_offset'.
Rename to 'descend_z' to make its behavior more clear.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:07:19 -04:00
Kevin O'Connor 7f5e918331 manual_probe: Introduce new create_probe_result() helper function
Add a new create_probe_result() helper function that can generate a
ProbeResult using a toolhead position and a set of probe offsets.

Use this helper in other modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:07:19 -04:00
Kevin O'Connor 4046b34a7b docs: Note probe options that can change via G-Code in Config_Reference.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 13:07:19 -04:00
Kevin O'Connor 9ebff0cc84 rp2040: Avoid run-time divide in i2c.c
Rework the code slightly to avoid an expensive software divide when
calculating the rate in i2c.c .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-24 12:55:51 -04:00
Kevin O'Connor 594ec7e120 rp2040: 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.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-21 11:23:01 -04:00