2859 Commits

Author SHA1 Message Date
Kevin O'Connor
bb281834b0 toolhead: Initial support for adding extra axes to toolhead moves
Add a new add_extra_axes() to support adding additional axes.  Once
called, toolhead.get_position() will return a list object with more
than 4 items, and toolhead.move() requires the same size list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
9dbfc76d9d force_move: No need to pass 4 parameters to toolhead.set_position()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
ae536b4786 toolhead: Only alter XYZ coordinates on set_position() calls
It's not valid to alter the extruder position from a call to
set_position(), so don't allow callers to attempt that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
8928c394cf toolhead: Support unregister_step_generator() call
Allow both registering and unregistering step generation callbacks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
01422da951 extruder: Remove update_move_time() call
The toolhead can obtain the underlying extruder trapq via
extruder.get_trapq().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Kevin O'Connor
f06eeb5c7a extruder: Rename extruder.move() to extruder.process_move()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-12 20:15:03 -04:00
Dmitry Butyugin
ca83c13f37 generic_cartesian: Fixed safe_z_home and manual_probe for new kinematics
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-05-10 20:16:00 -04:00
Dmitry Butyugin
8627c94d6a
stepper: Fix broken manual_stepper rail naming (#6929)
The naming got broken during refactoring for generic_cartesian.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-05-10 20:10:54 -04:00
Matszwe02
9aba1a8536 gcode_macro: more descriptive "unable to parse as a literal" error - display faulty command
Signed-off-by: Mateusz Szwedka <matszwe02@gmail.com>
2025-05-08 11:37:38 -04:00
Dmitry Butyugin
89ffbbed4c dual_carriage: Fixed broken safe_distance parameter
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-05-07 14:23:39 -04:00
Dmitry Butyugin
cc6736c3e3
kinematics: Generic Cartesian kinematics implementation (#6815)
* tests: Added a regression test for generic_cartesian kinematics

* kinematics: An intial implementation of generic_cartesian kinematics

* generic_cartesian: Refactored kinematics configuration API

* generic_cartesian: Use stepper instead of kinematic_stepper in configs

* generic_cartesian: Added SET_STEPPER_KINEMATICS command

* generic_cartesian: Fixed parsing of section names

* docs: Generic Caretsian kinematics documentation and config samples

* generic_cartesian: Implemented multi-mcu homing validation

* generic_cartesian: Fixed typos in docs, minor fixes

* generic_cartesian: Renamed `kinematics` option to `carriages`

* generic_cartesian: Moved kinematic_stepper.py file

* idex_modes: Internal refactoring of handling dual carriages

* stepper: Refactored the code to not store a reference to config object

* config: Updated example-generic-cartesian config

* generic_cartesian: Restricted SET_STEPPER_CARRIAGES and exported status

* idex_modes: Fixed handling stepper kinematics with input shaper enabled

* config: Updated configs and tests for SET_DUAL_CARRIAGE new params

* generic_cartesian: Avoid inheritance in the added classes

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2025-05-06 18:06:36 -04:00
Eric Callahan
f7e33df99d webhooks: support msgspec json serialization
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-05-02 12:19:13 -04:00
Kevin O'Connor
42faa962fc mcu: Decrease mcu.max_nominal_duration() to 3 seconds from 5
This allows the mcu to utilize faster internal speeds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
0f94f6c8e3 heaters: Confirm heater setting in mcu every 3 seconds instead of 5
Increase the confirmation rate of heater enable settings.  This allows
the mcu to utilize faster internal speeds.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
c917bd893d pwm_tool: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
d57bc253c5 led: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
0dce120a20 pwm_cycle_time: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
ab61b0a435 output_pin: Use mcu.min_schedule_time() and mcu.max_nominal_duration()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Kevin O'Connor
cc919a5f8d mcu: Add new min_schedule_time() and max_nominal_duration() helpers
Add a function that returns the minimum amount of time the host needs
to reserve for messages to be sent from host to micro-controller.

Add a function that returns the maximum amount of time (in seconds)
that all micro-controllers should be able to schedule future timers
at.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-28 19:28:52 -04:00
Wulfsta
f1e0730701 lis3dh: increase scale from 8g to 16g
Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
2025-04-28 19:27:43 -04:00
Kevin O'Connor
1f5783a250 probe: Remove ProbeEndstopSessionHelper
Have all callers instantiate the individual helper classes directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
37952e8686 probe_eddy_current: Separate probe style commands from homing operations
Separate homing operations (as called from probe:z_virtual_endstop)
from the normal probe command handling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
ab9b9e8584 probe_eddy_current: Do not support QUERY_PROBE command
Report an error if a user issues a QUERY_PROBE command (instead of
always returning not-triggered).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
3fb1191cad probe: Add a new LookupZSteppers helper class
Split code to lookup the Z stepper from HomingViaProbeHelper to new
LookupZSteppers class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f3a1c914a4 probe: Convert probing_move() callback to use regular probe sessions system
Use the normal probe_session_start(), run_probe(),
pull_probed_results(), and end_probe_session() API from
ProbeSessionHelper.  This removes the custom probing_move() callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
b2e36e5d98 probe: Change probing_move() to pass a gcmd instead of (pos, speed)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
ff0ffedd17 probe: Add a new ProbeParameterHelper class
Split multi-sample config reading from ProbeSessionHelper to a new
ProbeParameterHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
1e87d26707 probe: Add a new lookup_minimum_z() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f8de9ae080 probe: Add a new ProbeEndstopSessionHelper class
Move the HomingViaProbeHelper() instance from ProbeSessionHelper to a
new ProbeEndstopSessionHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
6a87c5e9f5 probe: Add a default probing_move() function to HomingViaProbeHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
db7a9cf071 manual_stepper: Implement "drip moves" for manual stepper STOP_ON_ENDSTOP
Currently, `MANUAL_STEPPER STOP_ON_ENDSTOP=1` type commands will move
until hitting the endstop, but it will still always consume the total
amount of move time.  That is, following moves can't be started until
the total possible time of the homing move is completed.

Implement "drip moves" so that the code only schedules the movement in
small segments.  This allows following movements to be scheduled
without a significant delay.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Kevin O'Connor
765de72f9e toolhead: Avoid toolhead.move() and toolhead._process_moves() in drip_move()
Implement move checking and trapq loading directly from drip_move().
This simplifies the interactions between these components.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Kevin O'Connor
6202a0f3bc toolhead: Avoid LookAheadQueue calling back into toolhead class
Avoid lookahead.flush() calling back into toolhead._process_moves().
Instead, rename toolhead._process_moves() to
toolhead._process_lookahead(), have it call lookahead.flush(), and
consistently use it when flushing the lookahead queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Russell Cloran
516ef1d361 hall_filament_width_sensor: Add filament switch values to status
`hall_filament_width_sensor` contains a runout sensor object internally.
This exposes those values in the API status result.

```
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","filament_detected","is_active","Diameter","Raw"]}}}
GOT: b'{"id":123,"result":{"eventtime":199567.823596603,"status":{"hall_filament_width_sensor":{"enabled":true,"filament_detected":true,"is_active":true,"Diameter":1.9499999999999986,"Raw":6113}}}}'
```

The duplication of `is_active` and `enabled` seems confusing, but both
of these can be independently manipulated by GCode:

```
SEND: {"id":123,"method":"gcode/script","params":{"script":"DISABLE_FILAMENT_WIDTH_SENSOR"}}
GOT: b'{"id":123,"result":{}}'
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","is_active"]}}}
GOT: b'{"id":123,"result":{"eventtime":199770.446013297,"status":{"hall_filament_width_sensor":{"enabled":true,"is_active":false}}}}'

SEND: {"id":123,"method":"gcode/script","params":{"script":"SET_FILAMENT_SENSOR SENSOR=hall_filament_width_sensor ENABLE=0"}}
GOT: b'{"id":123,"result":{}}'
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","is_active"]}}}
GOT: b'{"id":123,"result":{"eventtime":199847.927726196,"status":{"hall_filament_width_sensor":{"enabled":false,"is_active":false}}}}'
```

Signed-off-by: Russell Cloran <rcloran@gmail.com>
2025-04-17 11:44:26 -04:00
Timofey Titovets
b9757c9b69 tmc: add missing freewheel config options
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:42:44 -04:00
Timofey Titovets
a9b04e8536 i2c_software: pass pulse ticks from host
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:41:49 -04:00
Timofey Titovets
abc76ee963 software_spi: set rate limiting ticks from the host
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:37:12 -04:00
Kevin O'Connor
037377b927 led: Fix off-by-one bug in SET_LED_TEMPLATE INDEX parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-11 12:00:34 -04:00
Kevin O'Connor
4b9cb36247 force_move: Make sure to use lower() on SET_KINEMATIC_POSITION CLEAR_HOMED
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-08 23:30:08 -04:00
Kevin O'Connor
f3e89e25c5 force_move: Support a SET_HOMED parameter to SET_KINEMATIC_POSITION
Commit 70838797 added support for clearing the homing state in
SET_KINEMATIC_POSITION commands.  However, it can be difficult to use
that support as the default for SET_KINEMATIC_POSITION is to set all
axes as homed.

Add a new SET_HOMED parameter to allow one to explicitly request which
axes to consider in a homed state.

Also introduce a CLEAR_HOMED parameter and prefer that to the existing
CLEAR parameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-08 23:23:05 -04:00
Maksim Bolgov
46ee920b93
axis_twist_compensation: Fix AttributeError on klippy connect state (#6881)
Object 'configfile' has no attribute 'error'

Signed-off-by: Maksim Bolgov <maksim8024@gmail.com>
2025-04-05 21:36:35 -04:00
Timofey Titovets
3a9e9a4bef temperature_combined: avoid crash with temperature monitors
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-05 21:27:37 -04:00
Timofey Titovets
3beb465247 temperature_combined: delay initialization
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-05 21:27:37 -04:00
MRX8024
52b07f467e adxl345: Allow read and write 127 register address
icm20948 accelerometer has an ACCEL_CONFIG register at address 127

Signed-off-by: Maksim Bolgov maksim8024@gmail.com
2025-04-03 14:08:23 -04:00
MRX8024
81a1a03ed0 icm20948: Formatting refactor
Signed-off-by: Maksim Bolgov maksim8024@gmail.com
2025-04-03 14:08:23 -04:00
MRX8024
869440a7ed icm20948: Transition from 8g to 16g accels scale
During standard resonance measurements, the icm20948 in 8g mode may reach the accels max threshold.

Signed-off-by: Maksim Bolgov maksim8024@gmail.com
2025-04-03 14:08:23 -04:00
MRX8024
20f26b534d icm20948: Fix sample rate and accels scale selection
To set a value in the SET_ACCEL_CONFIG register, you must first go to BANK_2.

Signed-off-by: Maksim Bolgov maksim8024@gmail.com
2025-04-03 14:08:23 -04:00
Kevin O'Connor
be429caba3 output_pin: Make it possible to assign dicts/lists as template parameters
The output_pin template code has a cache to speed up duplicate
rendering of templates.  However, this cache doesn't work if one of
the parameters is a Python list or dictionary.  Just disable the cache
in this case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-03 13:38:31 -04:00
XiaoK
52617455ce
ldc_1612: Supports configurable external crystal frequency (#6734)
You can use the 40Mhz crystal oscillator recommended by TI official manual to get the best performance.
refer to: [ldc1612.pdf](https://www.ti.com/cn/lit/ds/symlink/ldc1612.pdf) 7.3.4

Signed-off-by: Xiaokui Zhao <xiaok@zxkxzk.cn>
2025-03-29 21:53:52 -04:00
Kevin O'Connor
59ebdce605 output_pin: Fix handling of template rendering errors
Make sure to assign 'value' on a rendering error to avoid an internal
error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-03-25 18:46:38 -04:00