aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
Commit message (Collapse)AuthorAgeFilesLines
* tmc: Refactor TMCtstepHelper()Kevin O'Connor2024-05-161-37/+22
| | | | | | | Update TMCtstepHelper() to obtain the step_distance, tmc_frequency, and mres fields directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_mesh: Fix adaptive probe count on delta printers (#6600)voidtrance2024-05-151-1/+4
| | | | | | | | | | | | | | Round beds require an odd number of probe points in order to prevent erroneously truncating the mesh. The adaptive mesh algorithm did not consider that and as a result, it was possible to generate adaptive meshes with even number of probe points. This change fixes this by increasing the probe point count by 1 in cases where the adaptive probe points are even. Signed-off-by: Mitko Haralanov <voidtrance@gmail.com>
* tmc: Implement high_velocity_threshold for drivers that support itAlex Voinea2024-05-144-0/+23
| | | | Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
* tmc: Implement coolstep_threshold for drivers that support itAlex Voinea2024-05-145-0/+22
| | | | Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
* tmc: Implement CoolStep fields for all driversAlex Voinea2024-05-142-0/+12
| | | | Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
* tmc2130: implement missing HighVelocity fields in the configAlex Voinea2024-05-141-0/+2
| | | | Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
* tmc: Do not pass the frequency directly to the helpersAlex Voinea2024-05-146-7/+8
| | | | | | Use the new get_tmc_frequency() instead. Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
* adxl345: Fix read_axes_map() for non-adxl345 accelerometersKevin O'Connor2024-04-293-6/+6
| | | | | | | | | | | Commit 3f845019 unified the reading of the axes_map configuration variable, but broke the per-sensor scaling capabilities. Pass the scale parameters to read_axes_map() so that it can be implemented per-sensor. Reported by @Neko-vecter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Fix typo in activate/deactive error messagesKevin O'Connor2024-04-271-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bme280: Add BMP388 sensor support to BMxx80 (#6576)林玮 (Jade Lin)2024-04-241-2/+151
| | | | | | Extends the BMxx80 category with support for the BMP388 sensor, providing temperature and pressure output similar to the existing BMxx80 class of sensors. Signed-off-by: 林玮 (Jade Lin) <linw1995@icloud.com>
* sht3x: Add sht31 support (#6560)Timofey Titovets2024-04-202-0/+167
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* bulk_sensor: Rename BulkDataQueue methodsKevin O'Connor2024-04-202-9/+9
| | | | | | | | Rename pull_samples() to pull_queue() and rename clear_sample() to clear_queue(). This avoids confusion between the queue of response messages and the larger list of samples stored within those messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Rework ChipClockUpdater class into FixedFreqReaderKevin O'Connor2024-04-205-93/+66
| | | | | | | Move the sensor_bulk_data message queuing into the class, and then rename that class. This simplifies the users of the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Refactor ChipClockUpdater constructorKevin O'Connor2024-04-205-45/+31
| | | | | | | Build the clock_sync and struct.Struct() in the ChipClockUpdater constructor. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ldc1612: Use extract_samples() for sample timestamp calculationKevin O'Connor2024-04-201-22/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Use extract_samples() for sample timestamp calculationKevin O'Connor2024-04-201-30/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lis2dw: Use extract_samples() for sample timestamp calculationKevin O'Connor2024-04-201-33/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Move sample timestamp calculation to reusable codeKevin O'Connor2024-04-202-31/+44
| | | | | | | | | | Add a new extract_samples() method to the ChipClockUpdater class that calculates the sample timestamp for each sample in a list of bulk sensor reports. Update the adxl345 code to use that extract_samples() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtual_sdcard: Define a default for on_gcode_errorKevin O'Connor2024-04-151-1/+7
| | | | | | | If on_gcode_error is not specified, default to running the TURN_OFF_HEATERS command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing_override: Adds rawparams supportPedro Lamas2024-04-121-0/+1
| | | | Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
* manual_stepper: Revert "manual_stepper: Add basic status. (#6527)"Kevin O'Connor2024-04-101-5/+0
| | | | | | | | | This reverts commit b029d0466841b90b54279500f70a92deacfd6c5a. The MCU_Stepper class does not have a is_motor_enabled() method, so the change above results in an internal exception. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe_eddy_current: Use sensor value at halt position for "trigger" positionKevin O'Connor2024-04-091-0/+44
| | | | | | | | Calculate the sensor Z position after the probe halts and return that as the "probed position". This sensor position provides a more accurate measurement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe_eddy_current: Initial support for PROBE commandKevin O'Connor2024-04-092-1/+125
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe_eddy_current: Support calibrating Z height to sensor frequencyKevin O'Connor2024-04-092-3/+190
| | | | | | | Add a calibration tool that can be used to correlate sensor frequency to bed Z height. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ldc1612: Add LDC_CALIBRATE_DRIVE_CURRENT calibration commandKevin O'Connor2024-04-091-3/+45
| | | | | | Add a command to calibrate the sensor DRIVE_CURRENT0 register. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ldc1612: Initial host support for reading ldc1612 bulk sensor dataKevin O'Connor2024-04-091-0/+154
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* probe: Add a probing_move() wrapper to low-level mcu_probe classKevin O'Connor2024-04-093-7/+15
| | | | | | | This allows the low-level probe class more control on the probing implementation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: remove a few unused variable assignments (#6504)Kamil Domański2024-04-054-4/+1
| | | Signed-off-by: Kamil Domański <kamil@domanski.co>
* manual_stepper: Add basic status. (#6527)Viesturs Zariņš2024-04-041-0/+5
| | | | | Adding position and enabled in manual_stepper status. Enabled is already available through stepper_enable object. But this makes it more straightforward to access it. Signed-off-by: Viesturs Zarins <viesturz@gmail.com>
* virtual_sdcard: Fix handling of unicode characters on Python2Kevin O'Connor2024-04-021-3/+6
| | | | | | | | Commit 600e89ae fixed unicode handling on Python3, but broke Python2 support. Use an alternate implementation that should work for both Python3 and Python2. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* motion_report: Don't negate step_distance on steppers with inverted dir pinKevin O'Connor2024-04-021-2/+0
| | | | | | | | | | When querying the stepper motion queue, the resulting "interval", "count", and "add" are already normalized to the correct direction. That is, the "count" field will be positive if moving in a positive axis direction and negative if moving in the reverse direction. So, negating the step_distance field just complicates the readers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2240: add ADC voltage formattersKamil Domański2024-03-201-0/+2
| | | | Signed-off-by: Kamil Domański <kamil@domanski.co>
* heaters: Clarify reported stats after a shutdownKevin O'Connor2024-03-131-1/+6
| | | | | | | | | | The pid logic can continue after a shutdown, even though the pin commands sent to the mcu are ignored. However, this behavior can result in confusing "stats" messages in the log. Explicitly disable updates after a shutdown event so that the log statistics are more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pid_calibrate: Fix PID_CALIBRATE command when used with heater_genericKevin O'Connor2024-03-132-8/+12
| | | | | | | Make sure the SAVE_CONFIG command saves the calculated PID parameters to the correct config name. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Replace max_accel_to_decel with minimum_cruise_ratioKevin O'Connor2024-03-131-5/+5
| | | | | | | | | The user facing max_accel_to_decel setting is complicated and confusing. Replace it with a new minimum_cruise_ratio parameter. Internally this user-facing parameter will calculate the existing low-level "accel_to_decel" mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* shaper_calibrate: Fixed crashes in SHAPER_CALIBRATE and TEST_RESONANCESDmitry Butyugin2024-02-172-12/+16
| | | | | | | Fixed crashes due to wrong parameter passed to the shaper selection function and when the custom FREQ_END is specified. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* scripts: Added shaper tuning parameters to calibrate_shaper scriptDmitry Butyugin2024-02-162-17/+47
| | | | | | | | | | | | | | | 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>
* bed_mesh: Remove deprecated relative_reference_indexKevin O'Connor2024-02-151-36/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* heaters: Remove deprecated thermistor "NTC 100K beta 3950"Kevin O'Connor2024-02-152-8/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bed_mesh: add ZFADE parameter to BED_MESH_OFFSETEric Callahan2024-02-151-3/+10
| | | | | | | | 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>
* bed_mesh: fix profile_name reporting in get_status()Eric Callahan2024-01-281-10/+8
| | | | | | | | | | | | | | 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>
* bed_mesh: fix manual mode point generationEric Callahan2024-01-281-5/+8
| | | | | | | 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>
* virtual_sdcard: fix virtual SD file position count (#6472)Kiswich2024-01-271-1/+1
| | | Signed-off-by: Zhang Qiwei <zxy16305@gmail.com>
* bed_mesh: Implement adaptive bed mesh (#6461)voidtrance2024-01-261-2/+112
| | | | | | | | | | | | | | | | | | | | 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>
* mcu: Remove support for set_pwm() cycle_time parameterKevin O'Connor2024-01-233-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwm_cycle_time: New module for output pins with dynamic cycle timesKevin O'Connor2024-01-232-15/+133
| | | | | | | | | 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>
* output_pin: Deprecate the maximum_mcu_duration parameterKevin O'Connor2024-01-231-0/+1
| | | | | | | 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>
* mcu: Remove support for "static" pinsKevin O'Connor2024-01-233-24/+7
| | | | | | | | | 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>
* output_pin: Deprecate static_value parameterKevin O'Connor2024-01-231-19/+20
| | | | | | | | | | | | 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>
* sensor_lis2dw: No need to schedule start of bulk readingKevin O'Connor2024-01-191-11/+7
| | | | | | It's simpler and faster to enable the lis2dw in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>