aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* config: Add Creality Ender 5 S1. (#6455)grnbrg2024-01-182-0/+171
| | | | | | | | | | 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>
* toolhead: Extend flushing slightly past required timeKevin O'Connor2024-01-172-6/+6
| | | | | | | | | 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>
* toolhead: Ensure full kin_flush_delay after flush_step_generation()Kevin O'Connor2024-01-162-4/+5
| | | | | | | | | | | | | | | | | | | | 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>
* docs: Update Multi_MCU_Homing.md to note the importance of low-latencyKevin O'Connor2024-01-161-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Increase trsync_state reporting during multi-mcu homingKevin O'Connor2024-01-161-2/+2
| | | | | | | | | | | | | | | 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>
* mcu: Stagger trsync reporting time during multi-mcu homingKevin O'Connor2024-01-161-5/+10
| | | | | | | | | | 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>
* sensor_mpu9250: Check for overflows on each query_mpu9250_status commandKevin O'Connor2024-01-071-10/+12
| | | | | | | | | | | | 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>
* sensor_mpu9250: Simplify mp9250_query()Kevin O'Connor2024-01-071-14/+10
| | | | | | | | 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>
* sensor_mpu9250: Fix timing in command_query_mpu9250_status()Kevin O'Connor2024-01-071-8/+9
| | | | | | | | | | | | 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>
* mpu9250: Fix incorrect use of time.sleep()Kevin O'Connor2024-01-071-3/+7
| | | | | | | | | | | It is not valid to call time.sleep() in the host python code (it could causes glitches in other processing, and it does not ensure there is a pause between operations on the mcu). Use minclock instead of time.sleep() to ensure there is a sufficient pause during chip startup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Fix typo in Bed_Mesh.md (#6450)marbocub2024-01-061-1/+1
| | | | | the meaning and the illustration shows 13x9 mesh however the text was 13x8. Signed-off-by: Mitsunori YOSHIDA <marbocub@gmail.com>
* config: I3DBEEZ9 New board (#6447)I3DBeeTech2024-01-022-0/+226
| | | Signed-off-by: Venkata Kamesh <i3dbee@gmail.com>
* buttons: Fix possible ordering issue if a callback blocksKevin O'Connor2023-12-301-12/+12
| | | | | | | | | | Invoke button callbacks directly from the background thread. This ensures that button notifications are delivered and delivered in the correct order. Previously, if a callback blocked, it was possible a new update could start before the previous update was completed, which could lead to lost events or out of order events. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Make sure to flush history when in debug output modeKevin O'Connor2023-12-301-9/+11
| | | | | | | | When in debugging "batch mode", use the existing method of keeping the last 30 seconds of history from the furthest planned move time. This avoids keeping all moves in memory during a batch test. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Avoid calling reactor.monotonic() on each _advance_flush_time()Kevin O'Connor2023-12-301-6/+7
| | | | | | | Move calculation of clear_history_time to the callers of _advance_flush_time() as a minor processing optimization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Keep stepcompress move history relative to current time (#6439)Francois Chagnon2023-12-3010-27/+54
| | | | | Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon <fc@francoischagnon.net>
* bulk_sensor: Fix missing logging importKevin O'Connor2023-12-281-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Add some module level documentationKevin O'Connor2023-12-261-0/+31
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Simplify the registration of internal clients in BatchBulkHelperKevin O'Connor2023-12-265-69/+69
| | | | | | | | | | | | | | | Previously, the BatchBulkHelper class was designed primarily to register webhook clients, and internal clients used a wrapper class that emulated a webhooks client. Change BatchBulkHelper to support regular internal callbacks, and introduce a new BatchWebhooksClient class that can translate these internal callback to webhooks client messages. This makes it easier to register internal clients that can process the bulk messages every batch interval. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Rework APIDumpHelper() to BatchBulkHelper()Kevin O'Connor2023-12-266-124/+112
| | | | | | | The APIDumpHelper class is mainly intended to help process messages in batches. Rework the class methods to make that more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Minor code reorg to _stop() in APIDumpHelper()Kevin O'Connor2023-12-261-19/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: New add_mux_endpoint() helper function in APIDumpHelperKevin O'Connor2023-12-266-53/+38
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Move APIDumpHelper() from motion_report.py to bulk_sensor.pyKevin O'Connor2023-12-266-103/+104
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* angle: Define BYTES_PER_SAMPLE and SAMPLES_PER_BLOCKKevin O'Connor2023-12-261-5/+10
| | | | | | This makes the code a little more readable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Add a read_axes_map() helper functionKevin O'Connor2023-12-263-18/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: No need to implement is_measuring()Kevin O'Connor2023-12-264-34/+0
| | | | | | | The APIDumpHelper class already ensures that the start/stop callbacks will only be called when needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Add new ChipClockUpdater helper classKevin O'Connor2023-12-264-106/+80
| | | | | | | All the accelerometers use a standard response for their query_status messages. Create a common helper class to process those responses. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Add new BulkDataQueue classKevin O'Connor2023-12-265-65/+41
| | | | | | | Move the bulk sample queue collection to a new helper class in bulk_sensor.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: New file with helper code for reading bulk sensorsKevin O'Connor2023-12-264-65/+73
| | | | | | | Move the ClockSyncRegression class from adxl345.py to a new bulk_sensors.py file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Simplify _advance_flush_time() sg_flush_time calculationKevin O'Connor2023-12-261-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Fix _calc_print_time() after G4 and SET_PRESSURE_ADVANCEKevin O'Connor2023-12-261-2/+4
| | | | | | | | | | | | Commit b7b13588 changed the internal flush time tracking, but introduced the possibility of motion restart occurring too close to the last motion end in some rare cases. This could result in internal stepcompress errors. Track the last step generation flush time (last_sg_flush_time) and use when recalculating the next print_time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix CAN for STM32G4Alex Maclean2023-12-212-3/+6
| | | | Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* stm32: Fix ADC for STM32G4Alex Maclean2023-12-211-2/+3
| | | | | | | | At least STM32G4 requires four ADC clock cycles between hardware clearing ADCCAL and setting ADEN or the write disappears. Make a tenacious write attempt. Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* stm32: Fix STM32G4 USBAlex Maclean2023-12-211-1/+6
| | | | | | STM32G4 USB controller requires 8 or 16-bit access, not 32-bit Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* pwm_tool: Fix error reportingKevin O'Connor2023-12-191-5/+6
| | | | | | | References to pins.error are not valid as the pins module is not imported. Reported by @Piezoid. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* hall_filament_width_sensor: max filament diameterSami Haahtinen2023-12-173-2/+12
| | | | | | | | | Add support for maximum filament diameter to hall filament width sensor. If the diameter of the filament diameter is larger than the limit, the virtual runout sensor will trigger. The default value is set to maximum flow adjustment threshold to prevent oversized filament from clogging. Signed-off-by: Sami Haahtinen <ressu@ressukka.net>
* pwm_tool: Add support for maximum_mcu_durationKevin O'Connor2023-12-162-27/+53
| | | | | | | Implement the maximum_mcu_duration config parameter along with its associated queue flushing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Add support for registering callbacks during move queue flushKevin O'Connor2023-12-161-11/+17
| | | | | | | Support notification callbacks each time the mcu move queue is flushed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Track separate time for flush_step_generation() and need_flush_timeKevin O'Connor2023-12-161-5/+9
| | | | | | | | Introduce a new step_gen_time variable for flush_step_generation(). This allows need_flush_time to be set to future times without interfering with flush_step_generation(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: add rp2040 to internal temp sensor list (#6426)Razor2023-12-131-1/+1
| | | Signed-off-by: Levi Szabo <iamrazorshark@gmail.com>
* gcode: expose status with available commandsPedro Lamas2023-12-112-0/+19
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* adxl345: Simplify sequence and limit_count upconversionKevin O'Connor2023-12-103-33/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* angle: Simplify sequence upconversionKevin O'Connor2023-12-101-11/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Simplify ack upconversion codeKevin O'Connor2023-12-101-4/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* clocksync: Simplify 32bit clock upconversion codeKevin O'Connor2023-12-101-8/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Simplify sequence number upconversionKevin O'Connor2023-12-071-4/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwm_tool: Notify the toolhead that the move_queue needs to be flushedKevin O'Connor2023-12-071-0/+2
| | | | | | | | | | Call toolhead.note_kinematic_activity() on each pin update to ensure that those updates will be flushed properly. This fixes "Timer too close" errors on SET_PIN commands that are issued when the toolhead is idle. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Support flushing even while lookahead queue is idleKevin O'Connor2023-12-071-26/+45
| | | | | | | | Track a "NeedPrime" queue state instead of the "Flushed" state, and continue running the background flushing timer as long as there may be data in any of the move queues. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Rework flushing to be based on mcu flush timeKevin O'Connor2023-12-071-35/+38
| | | | | | | | | | Rename last_kin_move_time to need_flush_time and rename force_flush_time to last_flush_time to improve variable name clarity. Move low-level flushing to new _advance_flush_time() so that it is possible to flush the queues without needing to advance print_time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Separate out priming flush notification to its own timerKevin O'Connor2023-12-071-4/+21
| | | | | | | | Simplify the code by introducing a separate lookahead priming flush timer. After this change, the flush_timer is not active in any of the special queuing states. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>