Commit Graph
1832 Commits
Author SHA1 Message Date
Timofey Titovets 644cda5eca sht3x: fix exception type
Since 0bdee6b query commands return printer.command_error

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-03-09 22:19:27 -04:00
Timofey Titovets 88a71c3ce5 tmc: support tmc2240 sg4 homing
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-04 19:56:26 -05:00
Timofey Titovets 0c32f3bd99 tmc2240: allow enable SG4 threshold
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2026-03-04 19:56:26 -05:00
Timofey Titovets 4f4a9a27a8 tmc: simplify homing start/end
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-04 19:56:26 -05:00
Kevin O'Connor c89393cdaf mcu: Rework mcu.register_response() to mcu.register_serial_response()
Rename mcu.register_response() to mcu.register_serial_response and
validate the message response format.

Only register the callbacks after the mcu has been initialized.  This
avoids invoking callbacks with data from a previous sessions, which
could lead to internal errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-04 19:50:53 -05:00
Kevin O'Connor e234f2415d hx71x: Remove dead self.bulk_queue code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-04 19:50:53 -05:00
Kevin O'Connor f33292aacc ads1220: Remove dead self.bulk_queue code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-03-04 19:50:53 -05:00
Timofey Titovets 7a44726492 pwm_tool: fix missing updates
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
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 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 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 57c2e0c960 manual_stepper: Support STOP_ON_ENDSTOP=probe
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
FranciscoStephens 8a210d23fe bmi160: Add support for BMI160 accelerometer
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
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
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 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
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)
Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
2026-02-05 12:19:33 -05:00
Timofey Titovets ca7d90084c probe: disable PROBE_CALIBRATE for Eddy
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
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
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
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)
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
Kevin O'Connor 87c8b505a7 trigger_analog: Attach trigger_analog to sensor during initialization
Avoid setting up a "connect" callback - just register the association
using mcu.add_config_cmd() .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor 5bd791d96e hx71x: Make sure to use the same cmd_queue for all commands
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2026-01-25 12:49:01 -05:00
Kevin O'Connor f9b1b9c1b5 trigger_analog: Create trigger_dispatch within MCU_trigger_analog
Don't require callers of MCU_trigger_analog to create the
mcu.TriggerDispatch() instance - instead, create it within the
MCU_trigger_analog() class.

Also, make it easier to use MCU_trigger_analog without an
MCU_SosFilter - the MCU_trigger_analog can automatically create an
empty filter if needed.

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