Commit graph

3138 commits

Author SHA1 Message Date
Timofey Titovets
7a44726492 pwm_tool: fix missing updates
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
Generate intermediate updates if a set_pwm() call schedules an update
far in the future.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-01 15:29:26 -05:00
Kevin O'Connor
0624cce4b3 probe_eddy_current: Support TAP_THRESHOLD parameter on "tap" probes
Some checks failed
Build test / build (push) Has been cancelled
Allow the "tap_threshold" to be overriden during PROBE type commands.
This makes it easier to calibrate an initial tap_threshold.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-28 20:11:16 -05:00
Kevin O'Connor
7e0dcc3c49 probe_eddy_current: Improve gap detection in EddyTap
Verify no gaps at start and end of requested capture range.

Raise an error if a gap is detected.

Raise an error if not enough data collected during "tap".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-24 10:21:11 -05:00
Kevin O'Connor
016f6e62b8 probe_eddy_current: Stop measurements on an error in EddyScanningProbe
Register an event handler to make sure measurements are stopped if a
gcode error occurs while using EddyScanningProbe.  EddyTap and
EddyDescend use ProbeSessionHelper which already provides this
handling, but EddyScanningProbe doesn't use that wrapper so it must be
implemented manually.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-24 10:14:55 -05:00
Kevin O'Connor
0213ad7536 canbus_stats: Note mcu code deprecation if missing get_canbus_status
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
90c72b7986 stepper: Note mcu code deprecation if missing STEPPER_STEP_BOTH_EDGE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
6bbc90697a bus: Note mcu code deprecation if missing i2c_transfer
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
ee28dec93d bus: Note mcu code deprecation if missing i2c_set_sw_bus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
016474b68d bus: Note mcu code deprecation if missing spi_set_sw_bus
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
a445013f7a configfile: Add support for warning on deprecated mcu code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:27:22 -05:00
Kevin O'Connor
2f2219b4b7 buttons: Use ADC batching for ADC based buttons
Increase ADC report time from every 15ms to every 10ms and batch every
5 reports into a single message.  This should improve the
responsiveness and reduce the communication overhead when using ADC
buttons.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:24:38 -05:00
Kevin O'Connor
8ed426b54c mcu: Convert ADC callback to pass a list of samples
Support batching multiple samples together and pass those samples to
the registered adc callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:24:38 -05:00
Kevin O'Connor
5a2fd1009d mcu: Change MCU_adc.get_last_value() to return (time, value)
Change the get_last_value() method to return time first then value
(instead of value, then time).  This makes get_last_value() match the
order of parameters that is used in the adc update callback.

This also fixes ads1x1x to return the "print_time" instead of a system
time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:24:38 -05:00
Kevin O'Connor
41bc240b16 adccmds: Support batching multiple reports into a single message
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-23 21:24:38 -05:00
Dmitry Butyugin
187481e251 dual_carriage: Allow dual carriage inactivation
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>
2026-02-19 21:37:18 -05:00
Kevin O'Connor
57c2e0c960 manual_stepper: Support STOP_ON_ENDSTOP=probe
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
Support moving a manual_stepper until a trigger event, without
resetting the final position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-14 14:08:21 -05:00
Kevin O'Connor
5a877d7220 manual_stepper: Rework STOP_ON_ENDSTOP parameter
Replace the integer values of STOP_ON_ENDSTOP with string values and
deprecate the older format.  The newer string values should make the
commands easier to understand and allow for more homing options in the
future.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-14 14:08:21 -05:00
Kevin O'Connor
21604d8bc7 configfile: Support warning for deprecated gcode commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-14 13:54:38 -05:00
Kevin O'Connor
1473b79ac0 configfile: Only warn once for each message sent to runtime_warning()
Also simplify the maintenance of warnings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-14 13:54:38 -05:00
FranciscoStephens
8a210d23fe bmi160: Add support for BMI160 accelerometer
Some checks failed
Build test / build (push) Has been cancelled
klipper3d deploy / deploy (push) Has been cancelled
This adds host and firmware support for the Bosch BMI160 IMU. It includes support for both SPI and I2C communication protocols.

The firmware implementation includes a specific SPI wake-up sequence (dummy read) required to switch the sensor interface mode reliably. Validated on Linux MCU (SPI) and RP2040 (I2C) with stable 1600Hz ODR.

Signed-off-by: FranciscoStephens <francisco.stephens.g@gmail.com>
2026-02-12 17:46:33 -05:00
Kevin O'Connor
636a6141f1 probe: Fix application of axis_twist_compensation
Some checks failed
Build test / build (push) Has been cancelled
Commit 2a1027ce changed the "probe:update_results" event to take a
list, but failed to update the callers to utilize that modified list
in its results.

Change axis_twist_compensation to update all members in the list and
change the callers to use the resulting list.

Reported by @ritzi26.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-02-11 09:31:25 -05:00
Kevin O'Connor
6d7d3403e4 stepcompress: Add some comments on internal structs
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>
2026-02-07 14:52:38 -05:00
Timofey Titovets
0a43774432 heaters: refactor to mux commands
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:42:41 -05:00
Timofey Titovets
c85a1a6761 stepper_enable: refactor to mux commands
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:42:41 -05:00
Timofey Titovets
cfd9dc7242 force_move: refactor to mux commands
Gcode mux supports arg verification and error output.
Just reuse it.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:42:41 -05:00
Timofey Titovets
c2d0cc1967 gcode: enrich param errors
Give suggestion or avaliable options to the user.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:42:41 -05:00
Timofey Titovets
0dff097b72 stepcompress: wrap steps in struct qstep
That allows us to make it self-explanatory what is contained here.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:37:31 -05:00
Timofey Titovets
0c2c1dd13b bus: allow mark i2c as write only
If the bus is write only, with new i2c_transfer code
it is possible to at least provide some feedback on error

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:01:45 -05:00
Timofey Titovets
8965958a8b bus: raise I2C errors on the host side
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-07 14:01:45 -05:00
Timofey Titovets
87ea2ff1ce temperature_combined: fix operations on empty list
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-05 21:23:28 -05:00
bigtreetech
36d9a77580 temperature_combined: add additional sensor values(humidity, pressure, gas)
Some checks are pending
Build test / build (push) Waiting to run
Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
2026-02-05 12:19:33 -05:00
Dmitry Butyugin
4c89f7f826
generic_cartesian: Full IQEX printers support (#7165)
Some checks failed
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Has been cancelled
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2026-02-04 16:54:05 -05:00
Timofey Titovets
ca7d90084c probe: disable PROBE_CALIBRATE for Eddy
Some checks failed
Build test / build (push) Has been cancelled
PROBE_CALIBRATE will try to adjust z_offset
Which will produce a confusing outcome and
will not do what it is supposed to do

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-02-02 19:25:43 -05:00
Timofey Titovets
85ccd1d9df temperature_probe: fix missing kin_pos
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-30 18:30:07 -05:00
Kevin O'Connor
576d0ca13d probe_eddy_current: Minor reorg to PrinterEddyProbe startup
Some checks are pending
Build test / build (push) Waiting to run
The EddyTap class doesn't need the calibration object.  Add some code
comments.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-30 14:00:55 -05:00
Kevin O'Connor
1fe9fb3ad4 trigger_analog: Don't report trigger time as the peak time
Some checks failed
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Has been cancelled
There are some rare corner cases where reporting the peak time could
cause hard to debug issues (for example, the peak time could
theoretically be a significant time prior to the actual trigger time,
which could possibly cause unexpected clock rollover issues).  Now
that the host code does not utilize the peak time for "tap" detection,
it can be removed from the mcu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Timofey Titovets
0795fb0141 probe_eddy_current: analyze tap data
To cancel out any lag, filter data on the host
Then to avoid derivatives lag,
compute central difference.

Assume that peak velocity is always the moment
right before collision happens.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Timofey Titovets
5fb9902dda sos_filter: define filtfilt call
To implement host-side analysis of tap data,
we need a way to apply the same filtering as on the mcu.
As bonus, it cancels the induced signal delay.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Kevin O'Connor
5c23f9296a probe_eddy_current: implement tap support
Use SOS filters + derivative filter to generate dF/dT on mcu.
Feed that to the MCU's trigger_analog peak detection.
Interpret peak time as a tap event

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-29 20:57:55 -05:00
Kevin O'Connor
08f4b65c7c probe_eddy_current: Make EddyScanningProbe a long lived class
Create the class at the start of PrinterEddyProbe and call it as
needed.  This makes the class life-cycle similar to EddyDescend.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Kevin O'Connor
8922481034 probe_eddy_current: Create trigger_analog instance in main PrinterEddyProbe
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Kevin O'Connor
9957546ae0 probe_eddy_current: Rework EddyGatherSamples()
Rework the internal EddyGatherSamples() class with a goal of making it
easier to add tap analysis in the future.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-29 20:57:55 -05:00
Timofey Titovets
7f822f3a5c
probe: fix sign inversion in probe calibrate (#7178)
Some checks failed
Build test / build (push) Has been cancelled
Commit 2a1027ce inadvertently flipped the signs in probe_calibrate_finalize().

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-01-26 19:03:55 -05:00
Kevin O'Connor
7e394d6dd7 bed_mesh: Fix tuple vs list error
Commit 2e0c2262e incorrectly changed the internal fpt variable from a
list to a tuple.

Reported by @nefelim4ag.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-26 18:30:18 -05:00
Kevin O'Connor
9a97ade74f sos_filter: Implement auto_offset feature
Add a setting that will enable the mcu sos_filter code to
automatically set an offset using the first read measurement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:55:39 -05:00
Kevin O'Connor
30720d29b5 trigger_analog: Avoid storing value_frac_bits in MCU_SosFilter
It is simpler for callers to convert values to their desired format.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor
36b9898117 trigger_analog: Set the MCU_SosFilter coeff_frac_bits in set_filter_design()
This parameter is rarely changed and is directly tied to the
coefficients in the filter "design".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor
16755481cc trigger_analog: Support scaling the filter's initial start state
Add a new set_start_state() method to MCU_SosFilter that can arrange
for the filter to better handle a non-zero initial starting state.

Also, this removes the previous 1.0 gram initial start state for load
cells as it tares the initial value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor
58cc059e31 sensor_ldc1612: Convert homing code to use trigger_analog system
Remove the homing code from sensor_ldc1612.c and utilize the generic
homing support found in trigger_analog.c .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor
147022dee2 trigger_analog: Update to support generic trigger types
Rework the trigger_analog code to support different "trigger"
conditions.  This merges in features of ldc1612.c into
trigger_analog.c, such as error code reporting in the MCU.  This is in
preparation for using trigger_analog with ldc1612.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00