Commit graph

1737 commits

Author SHA1 Message Date
Dmitry Butyugin
baf188bd62 shaper_calibrate: Fixed sending large objects via Pipe from bg process
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>
2025-11-21 17:48:56 -05:00
Dmitry Butyugin
c339bb0cdf shaper_calibrate: Reworked best shaper recommendations
* Do not recommend ZV shaper by default if possible
* Try to find more optimal shaper out of more aggressive ones

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-21 17:48:56 -05:00
Dmitry Butyugin
2aff840f68 shaper_calibrate: Reworked multi-file shaper autocalibration
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-11-21 17:48:56 -05:00
Timofey Titovets
edaa61471f bme680: fix infinite data wait
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-11-14 18:47:27 -05:00
Kevin O'Connor
db7acaa34a motion_report: Fix off-by-one error in live_extruder_velocity calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-09 18:57:16 -05:00
Kevin O'Connor
c3bf7b109e motion_report: Support reporting live_position of extra axes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
24a1116c7c motion_report: Support reporting of manual_stepper trapqs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
67db551be5 toolhead: Export "extra axes" coordinates in status
Update the "position" status to include extra axes.  Export a new
"extra_axes" value that describes the class associated with each
component of the coordinate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
ac6cab9168 gcode_move: Export extra axes in status reference
Change "homing_origin" and "position" to support more than 4
components.  Export a new "axis_map" value to describe the contents at
each component index.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
d0b1b832dd gcode: Change Coord() class to initialize from a list or tuple
Instead of passing arguments as parameters, pass them as a list (or
tuple).  This simplifies the callers and makes it easier to pass
additional parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-11-06 10:19:00 -05:00
Kevin O'Connor
6465921a5a gcode_macro: Verify nothing attempts to pause in a get_status() callback
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Kevin O'Connor
ff667075cf statistics: Verify nothing attempts to pause in a stats() callback
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-23 12:47:55 -04:00
Timofey Titovets
bb04546e6e pca9533: do write on connect like pca9632 does
Some checks are pending
Build test / build (push) Waiting to run
This is the only user of the i2c_write inside the init
compatibility layer, so remove it as well.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:46:58 -04:00
Timofey Titovets
6a8b823a45 led: run update function as reactor callback
Update functions could be called within the flush/lookahead context
If the update function internally does pause()
That would lead to the unpredictable execution of time-critical functions

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-10-18 13:46:58 -04:00
Kevin O'Connor
6557050968 motion_queuing: Verify nothing attempts to pause in flush callbacks
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
e549cc4143 load_cell: Only launch a callback in the klippy:ready event handler
It is not valid to pause in the klippy:ready callback, so perform the
sensor startup process in a separate reactor task.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:28:06 -04:00
Kevin O'Connor
0d0d3917c9 motion_report: Simplify shutdown_clock tracking
Determine which mcu raised the shutdown from the shutdown details
report.  Also, pass shutdown_clock via that details report.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
1bba59b7a0 motion_report: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:18 -04:00
Kevin O'Connor
c64c5e891c virtual_sdcard: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
e672391dbc gcode_move: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
38b286db4b error_mcu: Report reactor stats in error_mcu module
Move reactor debugging info from main klippy.py code to error_mcu code
for improved exception handling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
f147804d97 error_mcu: Rename "klippy:notify_mcu_shutdown" to "klippy:analyze_shutdown"
Rename the event to make it a little more clear what it is intended
for.  Also, check for an exception in each event handler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:18:17 -04:00
Kevin O'Connor
3215e3a2aa motion_report: Improve "motion_report/dump_stepper" during homing
Step timing is reset when stepper.set_position() is called.  Detect
that case and ensure future steps after set_position start on a new
block.  This simplifies the timing for users of the data.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:12:45 -04:00
Kevin O'Connor
95b0ebf4c7 motion_report: Improve "motion_report/dump_trapq" during homing
Now that trapq_extract_old() can return upcoming moves, it's possible
for homing to cause confusing results (as these moves can end early).
Avoid this by delaying query responses until after homing completes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-18 12:12:45 -04:00
Kevin O'Connor
e3909fb205 manual_stepper: Remove some unused code
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-10-12 14:38:07 -04:00
Kevin O'Connor
84e9a28141 virtual_sdcard: Reduce pause time on busy detection
If there are other users of the gcode mutex then pause for 50ms
(instead of 100ms).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-10 11:07:50 -04:00
Kevin O'Connor
e87de2ae49 motion_queuing: Don't disable step+dir+step filter in drip_update_time()
Allow the step compress code to perform regular step+dir+step
filtering even during probing and homing actions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-08 20:11:40 -04:00
Kevin O'Connor
d55baaf265 bus: Additional devices require i2c_write_noack()
Some checks failed
Build test / build (push) Has been cancelled
Currently, the LEDHelper() and GCodeRequestQueue() helper classes
require that their callbacks do not block.  As a result, the pca9533,
pca9632, and sx1509 devices need to use non-blocking i2c write calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-10-06 21:19:01 -04:00
Dmitry Butyugin
ec82cee7fc resonance_tester: Support testing resonances over Z axis
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-10-04 19:50:34 -04:00
Dmitry Butyugin
caf7accf2d input_shaper: Z-axis input shaper
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-10-04 19:50:34 -04:00
Dmitry Butyugin
768b19e8be input_shaper: Limit maximum damping_ratio of the shapers
Some checks are pending
Build test / build (push) Waiting to run
klipper3d deploy / deploy (push) Waiting to run
Numerically optimized versions of *EI shapers have been tuned
for specific ranges of damping ratios and will show poor stability
outside of these designated ranges.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-10-04 13:07:49 -04:00
Kevin O'Connor
30a1f22e1d motion_queuing: Improve run to run stability of flushing when in debug mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-26 12:27:26 -04:00
Timofey Titovets
8c7693c048 uc1701: allow non blocking i2c writes
Some checks failed
Build test / build (push) Has been cancelled
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 19:33:37 -04:00
Kevin O'Connor
3ef4702e06 steppersync: Move step generation thread from stepcompress.c to steppersync.c
Implement step generation from 'struct syncemitter' instead of in the
stepcompress code.  This simplifies the stepcompress code and
simplifies the overall interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 15:07:25 -04:00
Kevin O'Connor
e78d11bc6f steppersync: Support sending messages directly from syncemitter
Move msg_queue allocation from stepcompress to syncemitter.  With this
change the pwm_tool module does not need to allocate a stepcompress
object.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 15:07:25 -04:00
Kevin O'Connor
d831d66c11 steppersync: Introduce new 'struct syncemitter'
Create a new 'struct syncemitter' for each object that can generate
messages for a 'struct steppersync' and store in a regular linked
list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 15:07:25 -04:00
Kevin O'Connor
a29cfc1701 stepcompress: Pass oid in stepcompress_fill() instead of stepcompress_alloc()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 14:51:34 -04:00
Kevin O'Connor
f21cca049f steppersync: Add new steppersyncmgr_gen_steps() function
Generate and flush all the steppersync instances from a single
steppersyncmgr_gen_steps() call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 14:51:34 -04:00
Kevin O'Connor
bd747872c3 steppersync: Add new 'struct steppersyncmgr'
Add a new C based mechanism for tracking all the 'struct steppersync'
instances.  This simplifies memory management.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 14:51:34 -04:00
Kevin O'Connor
13cfdf5711 motion_queuing: Reorganize code into sections
Only code movement - no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-24 14:51:34 -04:00
Dmitry Butyugin
1c76ed1dc9 resonance_tester: Gracefully handle zero accelerations during the test
Some checks are pending
Build test / build (push) Waiting to run
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-09-23 14:57:00 -04:00
Dmitry Butyugin
599dcd176c resonance_tester: Correctly handle incorrect accelerometer chip names
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-09-23 14:57:00 -04:00
Dmitry Butyugin
5da026a337 input_shaper: Updated definitions of *EI input shapers
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>
2025-09-22 15:18:01 -04:00
Kevin O'Connor
df29a38011 motion_queuing: Further tune flushing in batches
Avoid unnecessary reactor wakeups if a batch is close to being ready.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-15 14:30:27 -04:00
Kevin O'Connor
4c46b80f38 motion_queuing: Further improve step flushing in batches
Further encourage flushing steps in batches by delaying flushing if a
batch isn't needed yet.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-15 14:19:02 -04:00
Kevin O'Connor
f341031834 motion_queuing: Try harder to use next_batch_time when flushing
Use the next_batch_time even if it is slightly past or before the
ideal flushing window.  This should improve run to run reproducibility
of flush timing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-15 13:46:35 -04:00
Kevin O'Connor
950aa103e4 motion_queuing: It is no longer necessary to loop in _advance_flush_time()
Some checks failed
Build test / build (push) Has been cancelled
Now that the host code does not flush far into the future, it is no
longer necessary to flush in waves.  Integrate _advance_flush_time()
into _flush_motion_queues().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-12 22:41:30 -04:00
Kevin O'Connor
42d149b40f motion_queuing: Avoid flushing far into the future
If a flush_all_steps() request is for a time far in the future, then
wait for that time to become close prior to flushing steps.  This
avoids committing to a step schedule that is far in the future.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-12 22:41:30 -04:00
Kevin O'Connor
7ea5f5d25e motion_queuing: Generate steps from timer instead of from lookahead
Don't tie the step generation logic to the toolhead lookahead logic.
Instead, use regular timers to generate steps with a goal of staying
500-750ms ahead of the micro-controllers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-12 22:41:30 -04:00
Kevin O'Connor
32bd03703b motion_queuing: Don't use lazy_target in drip_update_time()
Using separate flush_time and step_gen_time is a minor optimization.
Using it in drip_update_time() complicates the code and may reduce the
time needed to schedule post homing/probing movements.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-09-12 22:41:30 -04:00