Commit Graph

5219 Commits

Author SHA1 Message Date
Dmitry Butyugin 72b301a285 scripts: Added shaper tuning parameters to calibrate_shaper script
The added parameters include square_corner_velocity, shaper frequencies
to optimize, input shapers to test, input shaper damping ratio and
damping ratios to test. All these options can be useful for fine-tuning
the input shapers when the default suggestions generated by the tuning
script are not optimal.

Also the `SHAPER_CALIBRATE` command was modified to pass some of these
parameters to the shaper tuning routine. Specifically, square corner
velocity and the maximum tested frequency are used to adjust shaper
tuning and maximum acceleration recommendations.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2024-02-16 19:20:56 -05:00
Kevin O'Connor 4f00f21991 docs: Note removal of deprecated options in Config_Changes.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-15 12:40:10 -05:00
Kevin O'Connor c92732e4f1 bed_mesh: Remove deprecated relative_reference_index
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-15 12:39:01 -05:00
Kevin O'Connor 2f7b234189 extruder: Remove deprecated commands and config
Remove the deprecated SET_EXTRUDER_STEP_DISTANCE and
SYNC_STEPPER_TO_EXTRUDER commands.  Remove the deprecated
shared_heater config option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-15 12:35:19 -05:00
Kevin O'Connor b2ac0f1ce3 heaters: Remove deprecated thermistor "NTC 100K beta 3950"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-15 12:35:19 -05:00
Kevin O'Connor 9a940ffccb docs: Fix typo in Skew_Correction.md
Reported by @streetgt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-15 12:29:13 -05:00
Eric Callahan 0aaabf1904 docs: update BED_MESH_OFFSET description
Add the ZFADE parameter to the documentation.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-15 12:03:41 -05:00
Eric Callahan 0cd16e956d bed_mesh: add ZFADE parameter to BED_MESH_OFFSET
When a ZFADE value is passed to BED_MESH_OFFSET it is used
to adjust how fade is applied.   This resolves issues with
fade when SET_GCODE_OFFSET is used during a tool change.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-15 12:03:41 -05:00
Anders Brujordet 1b24f6a2ad
docs: Add required dependency to run numpy with python3 on RPI (#6491)
Signed-off-by: Anders Brujordet <anders@brujordet.no>
2024-02-13 19:18:08 -05:00
Kevin O'Connor 6ce6fbbce0 docs: Fix typo in Probe_Calibrate.md
Reported by @nmattia.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-02-09 19:21:34 -05:00
Eric Callahan 9f41f53c5e bed_mesh: fix profile_name reporting in get_status()
Adaptive meshing avoids saving the mesh after calibration to prevent
users from inadvertently overwriting an existing profile with an
adaptive mesh.  This introduced a change in behavior of how
get_status() reports the profile_name, as it can now be an empty
string when a mesh is active.

This patch assigns adaptive meshes a name with a unique postfix.
In addition, it moves profile name tracking from the profile manager
to the ZMesh class.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-28 13:43:08 -05:00
Eric Callahan 16a7b50ce9 bed_mesh: fix manual mode point generation
Do not generate points for the zero_reference_position or faulty_regions
when manual probing is requested.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2024-01-28 13:43:08 -05:00
Kiswich 600e89ae8c
virtual_sdcard: fix virtual SD file position count (#6472)
Signed-off-by: Zhang Qiwei <zxy16305@gmail.com>
2024-01-27 09:23:50 -05:00
voidtrance 5e3daa6f21
bed_mesh: Implement adaptive bed mesh (#6461)
Adaptive bed mesh allows the bed mesh algorithm
to probe only the area of the bed that is being
used by the current print.

It uses [exclude_objects] to get a list of the
printed objects and their area on the bed. It,
then, modifies the bed mesh parameters so only
the area used by the objects is measured.

Adaptive bed mesh works on both cartesian and
delta kinematics printers. On Delta printers,
the algorithm, adjusts the origin point and
radius in order to translate the area of the
bed being probe.

Signed-off-by: Mitko Haralanov <voidtrance@gmail.com>
Signed-off-by: Kyle Hansen <kyleisah@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-26 17:50:01 -05:00
Kevin O'Connor 5e433fff06 rp2040: Only change SPI settings while peripheral is disabled
Make sure to disable/enable the peripheral to ensure the clock
polarity is properly set prior to a change in CS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-25 12:06:02 -05:00
Kevin O'Connor f1982edcd5 rp2040: Load vectortable into ram
Load the interrupt vector table into ram at startup.  This reduces the
chance of a flash cache access causing timing instability.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-25 11:05:11 -05:00
Kevin O'Connor 44e79e0c37 rp2040: Run all code from ram
Place all normal code into ram.  This reduces the chance that rp2040
instruction cache misses could cause subtle timing issues.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-25 11:03:45 -05:00
Kevin O'Connor 23c5b20f5b rp2040: Always link using rp2040_link.lds.S
Use the rp2040 specific linker script even when using a bootloader.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-25 11:03:40 -05:00
Kevin O'Connor 55e46aa625 armcm_boot: Avoid invoking functions in reset_handler_stage_two()
Avoid calling memset() and memcpy() prior to copying the ram and
clearing the bss.  Also, place both ResetHandler() and
reset_handler_stage_two() in an explicit ".text.armcm_boot" linker
section.  These changes make it easier to support targets that want to
run all code in ram.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-25 11:02:49 -05:00
Kevin O'Connor 43a9685c58 mcu: Remove support for set_pwm() cycle_time parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-23 20:04:03 -05:00
Kevin O'Connor fd2feff67d pwm_cycle_time: New module for output pins with dynamic cycle times
Remove support for changing the cycle time of pwm pins from the
output_pin module.  Use a new pwm_cycle_time module that supports
setting dynamic cycle times.  This simplifies the output_pin code and
low-level pin update code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-23 20:04:03 -05:00
Kevin O'Connor 1baa45913f output_pin: Deprecate the maximum_mcu_duration parameter
Advise users to configure a pwm_tool config section if checking for
maximum mcu duration is required.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-23 20:04:03 -05:00
Kevin O'Connor 7abafb575b mcu: Remove support for "static" pins
Update static_digital_output.py to directly configure static digital
pins.  There are no other users of "static" pins, so remove that
support from mcu.py, replicape.py, and sx1509.py.  This simplifies the
low-level pin handling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-23 20:04:03 -05:00
Kevin O'Connor 4115ea128a output_pin: Deprecate static_value parameter
Remove support for configuring "static" pins in output_pin module.  A
"static" pin only saves a few bytes of memory in the micro-controller.
The savings does not justify the increased code complexity.

Deprecate the static_value parameter to warn users.  In the interim, a
static_value parameter will set both value and shutdown_value
parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-23 20:04:03 -05:00
Kevin O'Connor 2e8b54ae5f stm32: Remove product names from bootloader choices menu
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-22 18:58:41 -05:00
Jakub f653db9c88
stm32: Add 36KiB bootloader offset option (#6449)
- This offset is used by Anycubic Kobra 2 Neo bootloader

Signed-off-by: Jakub Przystasz <jakub.przystasz@gmail.com>
2024-01-22 18:55:34 -05:00
BIGTREETECH daf875e6e4
stm32g0: Disable internal pull-down resistors on UCPDx CCx pins, because klipper never uses UCPD (#6462)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2024-01-21 20:23:12 -05:00
Kevin O'Connor d785b396a7 sensor_lis2dw: No need to schedule start of bulk reading
It's simpler and faster to enable the lis2dw in the python code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor d853c19811 sensor_mpu9250: No need to schedule start of bulk reading
It's simpler and faster to enable the mpu9250 in the python code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 6f0e91f69f sensor_adxl345: No need to schedule start of bulk reading
It's simpler and faster to enable the adxl345 in the python code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 2dc4cfc5df bulk_sensor: Don't assume chip_clock is zero on start of queries
Send an explicit clock query in ChipClockUpdater to seed the initial
clock.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 266e96621c sensor_bulk: New C file with helper code for sending bulk sensor measurements
Refactor the low-level "bulk sensor" management code in the mcu.  This
updates the sensor_adxl345.c, sensor_mpu9250.c, sensor_lis2dw.c, and
sensor_angle.c code to use the same "bulk sensor" messages.  All of
these sensors will now send "sensor_bulk_data" and
"sensor_bulk_status" messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor dc6182f3b3 sensor_angle: No need to send messages when stopping queries
Simplify the mcu code as any messages are ignored by the host anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 95e1a290f1 sensor_lis2dw: No need to send messages when stopping queries
Simplify the mcu code as any messages are ignored by the host anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 5ff555a705 sensor_mpu9250: No need to send messages when stopping queries
Simplify the mcu code as any messages are ignored by the host anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 3275614b89 sensor_adxl345: No need to send messages when stopping queries
Simplify the mcu code as any messages are ignored by the host anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 83d0d2f19b mcu: Add send_wait_ack() support to CommandWrapper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-19 11:55:15 -05:00
Kevin O'Connor 94719fe327 docs: Update to mkdocs to use latest jinj2 version
There is a jinja2 security advisory on the current Jinja2 version.
Klipper is not impacted by this advisory (as it does not run jinja2 on
any untrusted data), but there is no harm in updating.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-18 13:36:17 -05:00
Kevin O'Connor 1d92be71da toolhead: Rename note_kinematic_activity() to note_mcu_movequeue_activity()
Rename this function to make it more clear why it is called.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-18 12:25:08 -05:00
Kevin O'Connor 6cc409f6fb toolhead: Rename MoveQueue class to LookAheadQueue
Rename this class so that is is not confused with the mcu "move
queue".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-18 12:16:47 -05:00
Kevin O'Connor d633ef2cfc force_move: Fix missing call to note_kinematic_activity()
Commit 3d3b87f9 incorrectly removed the call to
note_kinematic_activity().  A call to toolhead.dwell() is not
sufficient to wake up the mcu move queue flushing.  The call to
note_kinematic_activity() is needed for that.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-18 11:24:07 -05:00
grnbrg 43d0dba4b4
config: Add Creality Ender 5 S1. (#6455)
Creality released the Ender 5 S1 model in November of 2022.  It
has enough hardware differences from the previous models that
that the existing Ender 5 configs are not compatible.  This
configuration is based on one provided by Creality that was then
tweaked and modified.  I have been using these values (plus some
additional entries) for about 6 months with no issues.

Signed-off-by: Brian Greenberg <grnbrg@grnbrg.org>
2024-01-18 10:13:54 -05:00
Kevin O'Connor 7a74888b43 toolhead: Extend flushing slightly past required time
There is no harm in enabling flushing for a little longer than
necessary.  In contrast, a slight rounding issue causing a message to
not get flushed properly could result in an error.  So, extend the
flushing time slightly to avoid potential issues.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-17 11:28:42 -05:00
Kevin O'Connor 3d3b87f97f toolhead: Ensure full kin_flush_delay after flush_step_generation()
Commit b7b13588 made it possible that the kinematic code could be
restarted after a flush_step_generation() call without a sufficient
delay.

Rename last_sg_flush_time to min_restart_time and use that to ensure
_calc_print_time() always pauses kin_flush_delay time since the last
flush_step_generation() call.

Also, update force_move to invoke flush_step_generation() after any
movements.  This is needed to ensure there is a sufficient delay
should force_move be called on a stepper motor that is part of the
toolhead kinematics and is using a step generation "scan time".

This fixes possible "internal error in stepcompress" reports when
using FORCE_MOVE.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-16 20:40:55 -05:00
Kevin O'Connor 447a88eb08 docs: Update Multi_MCU_Homing.md to note the importance of low-latency
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-16 14:19:11 -05:00
Kevin O'Connor 1ea9f3aa35 mcu: Increase trsync_state reporting during multi-mcu homing
The current code has the mcu report a trsync_state message every 10ms
and expects a time extension within 25ms.  However, this means that if
a single mcu->host report is lost then 20ms would elapse until the
next report, which would allow for only a 5ms round-trip time before a
timeout error is reported.

Increase the trsync_state timing so that a message is sent every
7.5ms.  This increases the total number of messages per second sent
from mcu to host to 133 (from 100).  With this change, a single lost
message would still allow for up to a 10ms round-trip time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-16 14:19:11 -05:00
Kevin O'Connor dab39c02cd mcu: Stagger trsync reporting time during multi-mcu homing
When multiple MCUs are involved in homing, stagger the scheduling of
the trsync_state report messages from each mcu.  Staggering helps
spread the bandwidth, helps reduce locking contention in the host, and
reduces the chance that intermittent latency could result in a
communication timeout.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-16 14:19:11 -05:00
Kevin O'Connor 96ab906946 sensor_mpu9250: Check for overflows on each query_mpu9250_status command
Move overflow detection from mp9250_stop() to
command_query_mpu9250_status().  Currently the host ignores any
contents returned from a stop request, so overflow reporting at that
point has limited utility.

In practice, this change will result in one additional i2c transaction
to the mpu9250 device every 100ms.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-07 11:59:59 -05:00
Kevin O'Connor 84aa3caa45 sensor_mpu9250: Simplify mp9250_query()
The mpu9250 code always reads from the sensor in 48 byte chunks and
always sends an mpu9250_data message immediately after that.  Make
that more clear in the querying code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-07 11:59:59 -05:00
Kevin O'Connor 49315b3cc4 sensor_mpu9250: Fix timing in command_query_mpu9250_status()
Commit 80a7744b optimized the fifo tracking code.  However, it
introduced an error in the time tracking in
command_query_mpu9250_status().  The purpose of that function is to
provide a precise timestamp of the total number of messages produced
at the time of that call.  Thus, the returned fifo value needs to be
the fifo level in the chip at the time of the call (not the value read
during previous checks).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2024-01-07 11:59:59 -05:00