aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* mcu: Separate trdispatch handling from MCU_endstop classKevin O'Connor2024-04-091-37/+60
| | | | | | | Create a new TriggerDispatch class to track the low-level handling of the trdispatch mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: remove a few unused variable assignments (#6504)Kamil Domański2024-04-059-9/+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>
* toolhead: Populate minimum_cruise_ratio to printer.configfile.settingsKevin O'Connor2024-04-021-6/+7
| | | | | | | | | | | | The default minimum_cruise_ratio setting does not get populated to the printer.configfile.settings information due to the way the max_accel_to_decel backwards compatibility support was implemented. Slightly rework the config reading so that the default for minimum_cruise_ratio is populated there. Reported by @ReXT3D. 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>
* configfile: Add support for reporting runtime_warnings via the API serverKevin O'Connor2024-03-132-4/+14
| | | | | | | Add a new runtime_warning() method that will add a 'runtime_warning' type message to the printer.configfile.warnings object. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Write a warning to the log if an incorrect mcu frequency is detectedKevin O'Connor2024-03-131-0/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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-132-23/+34
| | | | | | | | | 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>
* extruder: Remove deprecated commands and configKevin O'Connor2024-02-151-30/+1
| | | | | | | | 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>
* 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-234-32/+13
| | | | 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-234-48/+9
| | | | | | | | | 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>
* sensor_mpu9250: No need to schedule start of bulk readingKevin O'Connor2024-01-191-10/+16
| | | | | | It's simpler and faster to enable the mpu9250 in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_adxl345: No need to schedule start of bulk readingKevin O'Connor2024-01-191-10/+6
| | | | | | It's simpler and faster to enable the adxl345 in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Don't assume chip_clock is zero on start of queriesKevin O'Connor2024-01-194-9/+13
| | | | | | | Send an explicit clock query in ChipClockUpdater to seed the initial clock. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_bulk: New C file with helper code for sending bulk sensor measurementsKevin O'Connor2024-01-195-69/+40
| | | | | | | | | | 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>
* sensor_angle: No need to send messages when stopping queriesKevin O'Connor2024-01-191-5/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_lis2dw: No need to send messages when stopping queriesKevin O'Connor2024-01-191-6/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: No need to send messages when stopping queriesKevin O'Connor2024-01-191-6/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>