aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* gcode: Validate extended g-code command namesKevin O'Connor2024-12-011-0/+4
| | | | | | | Extended g-code command names may only contain A-Z, 0-9, and underscore, and the first two characters may not be digits. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Remove arbitrary constants controlling junction deviationKevin O'Connor2024-11-291-19/+19
| | | | | | | | | | | | | | | | When calculating the junction speed between two moves the code checked for angles greater than 0.999999 or less than -0.999999 to avoid math issues (sqrt of a negative number and/or divide by zero). However, these arbitrary constants could unnecessarily pessimize junction speeds when angles are close to 180 or 0 degrees. Change the code to explicitly check for negative numbers during sqrt and to explicilty check for zero values prior to division. This simplifies the code and avoids unnecessarily reducing some junction speeds. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Use delta_v2 when calculating centripetal forceKevin O'Connor2024-11-291-4/+5
| | | | | | | | | | | As a minor math optimization, it's possible to calculate: .5 * self.move_d * self.accel * tan_theta_d2 using: self.delta_v2 * .25 * tan_theta_d2 because self.delta_v2 is "2. * self.move_d * self.accel". Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* temperature_mcu: Add support for rp2350 MCUsKevin O'Connor2024-11-141-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Fix return type for create_command()Kevin O'Connor2024-11-131-1/+1
| | | | | | | Return an empty list instead of an emptry string if no command found. This improves compatibility within console.py on python3. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* axis_twist_compensation: AXIS_TWIST_COMPENSATION new parameter AUTO for ↵yochiwarez2024-11-121-1/+161
| | | | | | | | autocalibration This commit adds automatic calculation support for compensating X and Y axis twist in the axis_twist_compensation module. Signed-off-by: Jorge Apaza Merma <yochiwarez@gmail.com>
* axis_twist_compensation: Implement Y-axis supportyochiwarez2024-11-121-45/+140
| | | | | | | | This commit implements support for the Y-axis in the axis_twist_compensation module. This update enables the module to handle corrections for printers with a twisted Y rail. Signed-off-by: Jorge Apaza Merma <yochiwarez@gmail.com>
* configfile: Fix comments on same line as [include xxx.cfg] directiveKevin O'Connor2024-11-121-0/+4
| | | | | | | | Commit 9d4ab862 broke support for '#' style comments on the same line as [include] config directives. Fix by adding back in the check for comments in _parse_config(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* resonance_tester: Fix chips selection, add accel_per_hz selection (#6726)MRX80242024-11-121-5/+3
| | | | | | | | | | Corrected issue where accelerometer names were incorrectly prefixed with "adxl345", preventing the selection of other chip types when running TEST_RESONANCES. Implemented support for selecting the `accel_per_hz` parameter when running TEST_RESONANCES. docs: Update TEST_RESONANCES + SHAPER_CALIBRATE with missing parameters and bracket corrections Signed-off-by: Maksim Bolgov <maksim8024@gmail.com>
* sensor_lis2dw: add lis3dh sensor and i2c communicationWulfsta2024-11-122-32/+105
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* fan_generic: fixes missing logging importPedro Lamas2024-11-011-0/+1
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* configfile: Separate access tracking to new ConfigValidate classKevin O'Connor2024-10-301-38/+73
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* configfile: Only check for [include file] directives from main printer.cfgKevin O'Connor2024-10-301-37/+52
| | | | | | | Don't look for includes in autosave data nor from the internal menu, display, and temperature configs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* configfile: Don't read the autosave data if multiple autosave headers presentKevin O'Connor2024-10-301-1/+6
| | | | | | Also, verify new autosave looks valid prior to writing it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* configfile: Split configfile code into three separate classesKevin O'Connor2024-10-301-160/+203
| | | | | | | | | | | | Separate out the low-level parsing code to a new ConfigFileReader() class. Separate out the auto-save handling code to a new ConfigAutoSave() class. This simplifies the main PrinterConfig() class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Log a warning if probe alters stepper kinematic positionsKevin O'Connor2024-10-262-4/+16
| | | | | | | | | After a probe attempt the toolhead position needs to be recalculated to the position that the toolhead ultimately halted at. Check that the position setting wouldn't actually change the internal view of the stepper motor and log a warning if any skew is detected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Only warn about mcu clock frequency if drift is more than 1%Kevin O'Connor2024-10-261-1/+2
| | | | | | This reduces the chance of spurious MCU clock configuration warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ads1220: Add input_mux and vref options to ADS1220 sensor (#6713)Gareth Farrington2024-10-241-4/+33
| | | | | | | | * fix type comparison bug that stopped the sensor from initializing * correct mismatch between docs and code for `sample_rate` (fixed to work same as hx71x) * add input_mux, pga_bypass and vref options * update configuration reference & fix typo Signed-off-by: Gareth Farrington <gareth@waves.ky>
* fan: Fix restart request handlingKevin O'Connor2024-10-011-1/+1
| | | | | | | The change in parameter order introduced in commit f4143af4 failed to update the call _handle_request_restart() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan_generic: Support setting a TEMPLATE on SET_FAN_SPEED commandsKevin O'Connor2024-09-301-3/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Support calling set_speed() without a print_timeKevin O'Connor2024-09-304-13/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Support setting a TEMPLATE on SET_PIN commandsKevin O'Connor2024-09-302-3/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Move template evaluation code from led.py to output_pin.pyKevin O'Connor2024-09-302-95/+113
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* led: Generalize template evaluation so it is not dependent on LEDsKevin O'Connor2024-09-305-75/+76
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Fix typo - config.config_error() instead config.error()Kevin O'Connor2024-09-251-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c: drop i2c_modify_bitsTimofey Titovets2024-09-221-17/+1
| | | | | | No longer used and niche Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* sx1509: drop i2c_modify_bitsTimofey Titovets2024-09-221-7/+5
| | | | | | | According to the datasheet default value is 0000 0000 We do not modify them in other places. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* fan: Wait full kick_start_time even if request is for full speedKevin O'Connor2024-09-181-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Use GCodeRequestQueue to queue updatesKevin O'Connor2024-09-181-16/+17
| | | | | | | This is similar to 7940a6a7, but using gcrq.send_async_request() for requests that could be asynchronous. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Add send_async_request() support to GCodeRequestQueueKevin O'Connor2024-09-161-2/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Improve GCodeRequestQueue timing on duplicate requestsKevin O'Connor2024-09-162-17/+23
| | | | | | | | If there is a duplicate request it is not necessary to add a 100ms delay to the next update. Rework the callback signaling to better report these duplicate updates. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* led: Fix typo in call to unregister_timer()Kevin O'Connor2024-09-161-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Revert "fan: Use GCodeRequestQueue to queue updates"Kevin O'Connor2024-09-131-15/+14
| | | | | | | | | | | This reverts commit 7940a6a728be8f6b4ec36eecfd7c5291da4fdc81. Queing of fan updates via GCodeRequestQueue is only valid if updates originate from gcode commands. The heater_fan, controller_fan, and temperature_fan modules could send updates asynchronously. Revert the fan queuing changes until this issue can be resolved. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Keep flushing GCodeRequestQueue if neededKevin O'Connor2024-09-131-18/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* servo: Use GCodeRequestQueue to queue updatesKevin O'Connor2024-09-121-12/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Use GCodeRequestQueue to queue updatesKevin O'Connor2024-09-121-14/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Introduce new helper to facilitate queuing of gcode requestsKevin O'Connor2024-09-121-14/+52
| | | | | | | Add a new GCodeRequestQueue class that can queue and collate g-code pin requests. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* output_pin: Remove deprecated maximum_mcu_duration and static_valueKevin O'Connor2024-09-121-42/+7
| | | | | | | Remove support for these two config options that were previously deprecated. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* hx71x: Avoid base classes to improve python2 compatibilityKevin O'Connor2024-09-122-17/+15
| | | | | | Also, add a load_cell regression test case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* temperature_probe: add max_valid_temp optionEric Callahan2024-09-011-4/+9
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* bme680: measure gas VOC once a whileTimofey Titovets2024-08-161-8/+24
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* bme680: select mode onceTimofey Titovets2024-08-161-19/+22
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* bme280: use periodic mode for BM[PE]280Timofey Titovets2024-08-161-18/+60
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* bme280.py: drop unused max_sample_timeTimofey Titovets2024-08-161-2/+0
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* bme280.py: iir_filter mask input valueTimofey Titovets2024-08-161-1/+2
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* hx71x: Update api header and docs to correctly note "value" fieldKevin O'Connor2024-08-142-4/+4
| | | | | | | Update both hx71x and ads1220 to reflect that there is a third "value" field in the reported data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode_arc: merge coords gen & G1 emitTimofey Titovets2024-08-121-28/+28
| | | | | | | Chopping lines from arc can take significant time. Merge cycles to make the event loop progress and optimize performance. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* gcode_arc: refactor simplifyTimofey Titovets2024-08-121-20/+22
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* servo: Asynchronous adjustments of servo positionDmitry Butyugin2024-08-031-3/+5
| | | | | | | | | | | This change follows the same approach as implemented for fan control. The change removes the move queue flushing when changing servo position, which does not appear to be necessary. This can be beneficial, for example, for WS7040-based cooling on IDEX setups where the servo can be used to control the air flow between the toolheads, with this change eliminating micro-stutters of the toolhead on servo position adjustment. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* idex_modes: Improved restoring position in RESTORE_DUAL_CARRIAGE_STATEDmitry Butyugin2024-08-031-6/+28
| | | | | | | | Previous implementation could crash the idex carriages into each other. The new code moves the idex carriages together, eliminating this risk and decreasing the time needed to restore the carriages positions. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>