1662 Commits

Author SHA1 Message Date
Timofey Titovets
edbfc6f856 resonance_tester: replace missing M204 call
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-08-14 15:10:13 -04:00
Kevin O'Connor
d6d8587289 motion_queuing: Remove clean_motion_queues()
Merge the clean_motion_queues() code into the existing
flush_motion_queues() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
2919f37343 stepcompress: Store a reference to 'struct stepper_kinematics'
Support storing a reference to 'struct stepper_kinematics' in 'struct
stepcompress' and support globally generating steps via the
steppersync mechanism.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
c454e88d9a stepper: Implement active callbacks via motion_queuing.register_flush_callback()
Use the existing register_flush_callback() system to implement motor
activity checking.  This simplifies the generate_steps() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
b5e573957c motion_queuing: Move clear_history_time from toolhead to motion_queuing
Implement the 30 second clear_history_time offset checking directly in
the motion_queuing module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
6d59279438 statistics: Avoid adding extra blank spaces on empty stats reports
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
1d569a6631 motion_queuing: Remove flush_steppersync()
Move code from flush_steppersync() to existing flush_motion_queues()
and clean_motion_queues() functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
7b25d1c06f stepcompress: Export steppersync_history_expire()
Don't implement history expiration from the main steppersync_flush()
code.  Instead, have callers directly invoke
steppersync_history_expire().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
864c78f24a motion_queueing: Add flush_steppersync()
Move the mcu.flush_moves() code to motion_queuing.flush_steppersync().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:35 -04:00
Kevin O'Connor
c09ca4cf5a motion_queuing: Add register_flush_callback()
Move register_flush_callback() from mcu.py code to motion_queuing
module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Kevin O'Connor
6f685e9e01 motion_queuing: Add allocate_stepcompress() call
Allocate the low-level C stepcompress object in the motion_queuing
module.  This simplifies the mcu.py code as it no longer needs to
track the stepqueues for the steppersync object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Kevin O'Connor
128226fe8a motion_queuing: Add allocate_steppersync() call
Allocate the low-level C steppersync object from the motion_queuing
module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Kevin O'Connor
5cbe7d83e8 motion_queuing: Track all trapqs and globally flush all trapqs
Add an allocate_trapq() helper function to facilitate the creation of
a low-level C trapq object.  Track all trapq objects and clear history
on them globally when the main motion queues are flushed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Kevin O'Connor
9399e738bc motion_queuing: Add new module to help with motion queues and flushing
Create a new module to assist with host management of motion queues.
Register all MCU_stepper objects with this module and use the module
for step generation.

All steppers will now automatically generate steps whenever
toolhead._advance_flush_time() is invoked.  It is no longer necessary
for callers to individually call stepper.generate_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Kevin O'Connor
126275d1f4 toolhead: Default note_mcu_movequeue_activity() to set step_gen_time
Change note_mcu_movequeue_activity() to default to setting the
step_gen_time (instead of the previous default to not set it).

Most users of the mcu "move queue" will be for stepper activity.
There is also little harm in incrementing the tracking of the last
possible step generation time, but accidentally generating a step
without incrementing the tracking can lead to very hard to debug
failures.

The two cases (output_pin.py and pwm_tool.py) where
note_mcu_movequeue_activity() is called and definitely not related to
step generation can explicitly pass 'is_step_gen=False'.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-11 19:43:34 -04:00
Contomo
d5c031bc13
idle_timeout: Add status field for current idle timeout (#6982)
Signed-off-by: Eric Billmeyer <eric.billmeyer@freenet.de>
2025-08-01 12:37:47 -04:00
Kevin O'Connor
2cbb895978 tmc2240: Add OTW_OV_VTH to list of ReadRegisters
Reported by @poernahi.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-08-01 12:33:50 -04:00
Thijs Triemstra
60879fd298
klippy: fix typos in python code (#6989)
Signed-off-by: Thijs Triemstra <info@collab.nl>
2025-07-25 12:31:19 -04:00
Paul Arthur
ef4c76fe94 safe_z_home: correct error call
Signed-off-by: Paul Arthur <paul.arthur@flowerysong.com>
2025-07-22 14:17:43 -04:00
Kevin O'Connor
a209d4db5b mcp4018: Remove support for manual i2c - use standard mcu software i2c instead
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-22 14:04:50 -04:00
Kevin O'Connor
354b1e666b pca9632: Remove custom software i2c - use normal mcu software i2c instead
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-22 14:04:50 -04:00
Kevin O'Connor
4691243179 heaters: Increase time before clearing the temperature of an inactive heater
The get_temp() code will stop reporting the last temperature of the
heater if there hasn't been any recent temperature updates.  However,
on a full mcu communication loss this can cause the verify_heater code
to report a heating error prior to the mcu code reporting the
communication failure.  Increase the heater timeout from 5 to 7
seconds to make it more likely the mcu failure is reported first.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-19 11:24:59 -04:00
Timofey Titovets
317f8c94c8 tmc.py: add track of stallguard
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
9c0d0f6a72 tmc: add enriched UART read
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
5923a2e3a1 tmc: add spi status decode
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
8d67e1a4e9 tmc2660: add enriched SPI read
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
33bd67f9b7 tmc: add enriched SPI read
Currently TMC spi just drop the data that could be useful.
Export that data.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-12 16:17:22 -04:00
Timofey Titovets
2585accfeb sht3x: reads should be retried with at least 0.5s pause
SHT3x would return a read NACK on host retries.
When the MCU receives the I2C CMD, it reads out data.
SHT3x clears the data buffer.
The MCU fails to deliver a response to the host.
The host retries, the device returns NACK,
then the MCU goes into the shutdown state.

Make sure there is at least 0.5s between retries.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-07-11 10:46:57 -04:00
Kevin O'Connor
c01e6eee1d ads1x1x: Rename local 'config' variable to pcfg
Avoid using the name "config" as a local register storage variable as
it can be confused with the common "config" configfile reference.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-08 18:55:25 -04:00
Kevin O'Connor
42fbf8256f ads1x1x: Revert incorrect removal of assignment to self.config
Commit d120a313b incorrectly removed an assignment to self.config - in
this instance the reference was to a local variable not related to the
global configfile storage.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-07-08 18:49:12 -04:00
Timofey Titovets
607d0b4237 input_shaper: fix printer obj reference
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-06-06 15:43:29 -04:00
Kevin O'Connor
d120a313b7 docs: Note 'config' object shouldn't be accessed after initial load
Update Code_Overview.md to note that the config object should not be
stored after the "config loading phase".

Remove a few inadvertent cases where a 'config' object was stored
in module member variables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-06-04 13:46:28 -04:00
Dmitry Butyugin
4d4b9684a5 input_shaper: Track kinematics updates by dual_carriage
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-06-04 13:40:58 -04:00
Timofey Titovets
d6902240dd htu21: fix crash on unknown dev id
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-06-02 13:17:41 -04:00
Ingo Donasch
2dd73d0431
print_stats: Fix for filament statistics bug in print_stats.py for toolchangers (#6946)
added extruder:activate_extruder event hook to print_stats.py to update self.last_epos

Signed-off-by: Ingo Donasch <ingo@donasch.net>
2025-05-31 13:06:44 -04:00
Kevin O'Connor
8d7e487149 sos_filter: Improve error checking on section_idx
Validate host provided index prior to accessing memory using that
index.

Also, consistently use a uint8_t for max_sections (to account for
integer overflow issues).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-29 19:30:45 -04:00
Kevin O'Connor
eb43b20e3b load_cell_probe: Avoid peeking directly at config.section member variable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-29 19:17:45 -04:00
Gareth Farrington
b3e894f241 load_cell_probe: Create LoadCellProbe
Initial setup of Load Cell Probing. This implementation supports triggering from the Load Cell Probe on the MCU. It also supports, optiopnal, filtering of the force signal by sos filter to eliminate drift caused by bowden tubes or other mechanical causes.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:10:21 -04:00
Gareth Farrington
3dbac01e1d probe: Create ProbeVirtualEndstopDeprecation
As probes stop supporting `probe:z_virtual_endstop` this class will give users a polite and specific configuration error.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:08:32 -04:00
Gareth Farrington
69507a0354 sensor_hx71x: Update Sensors to report to load_cell_probe
Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:07:49 -04:00
Gareth Farrington
cb0c38f7d8 sos_filter: Second Order Sections MCU Filter
This is an implementation of the SOS fliltering algorithm that runs on the MCU.

The filter opperates on data in fixed point format to avoid use of the FPU as klipper does not support FPU usage.

This host object handles duties of initalizing and resetting the filter so client dont have to declare their own commands for these opperations. Clients can select how many integer bits they want to use for both the filter coefficients and the filters output value. An arbitrary number of filter sections can be configured. Filters can be designed on the fly with the SciPy library or loaded from another source.

Signed-off-by: Gareth Farrington <gareth@waves.ky>
2025-05-29 19:01:38 -04:00
Timofey Titovets
0181023954 lis2dw: if spi is used - disable i2c
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-05-26 18:44:29 -04:00
Dmitry Butyugin
b1011e3fb1 dual_carriage: Fixed input shaper stepper kinematics initialization
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-05-22 14:44:09 -04:00
Kevin O'Connor
ed36041b67 resonance_tester: Fix typo
Fix typo introduced in 307c03e48.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-13 11:14:30 -04:00
Kevin O'Connor
6c1d5d912a manual_stepper: Support LIMIT_VELOCITY and LIMIT_ACCEL when using gcode axis
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
ee0bc3d697 manual_stepper: Support position_min and position_max options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
64e01f03a2 manual_stepper: Support INSTANTANEOUS_CORNER_VELOCITY on gcode axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
7201f41664 manual_stepper: Support registering as an additional axis
Add a new G-Code command that can register a manual_stepper as an
additional axis on standard G-Code G1 commands.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
d40fd2190d gcode_move: Support additional toolhead axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
4c21e1d00f gcode_move: Internally track an axis_map to map gcode axis names
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00