Commit Graph

2574 Commits

Author SHA1 Message Date
Pedro Lamas b725d971db bed_screws: report status
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-07-28 20:43:19 -04:00
Pedro Lamas 282d1113e4 manual_probe: report status
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-07-21 22:03:31 -04:00
Kevin O'Connor a283e0f7d4 webhooks: Close clients that become unresponsive
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 09:54:44 -04:00
Kevin O'Connor 7b9583391e webhooks: Use reactor to watch for writable fds
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 09:54:44 -04:00
Kevin O'Connor 02dd0742c4 reactor: Add support for waiting on fds becoming writable
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 09:54:44 -04:00
chestwood96 167736ad1c
respond: No forced spaces (#5152)
Signed-off-by: Adrian Joachim <adi.joachim12@gmail.com>
2022-06-30 13:56:35 -04:00
adelyser 84b2bfe313
stm32: Add MCU temp for Stm32h7 (#5606)
Added mcu temperature to the stm32h7 processor.

Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2022-06-27 10:16:09 -04:00
Kamil Trzciński 045455648a klippy: properly set log level when logging to stderr
The `logging.basicConfig` does not reconfigure default logger.
This results in printing only warnings/errors to stderr
instead of also info (or debug).

This fixes the issue by setting log level on root logger.

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
2022-06-27 10:14:27 -04:00
Eric Callahan a431900f7f display_status: Implement SET_DISPLAY_TEXT command
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-06-27 10:09:02 -04:00
Kevin O'Connor 247a409335 mpu9250: Inline twos_complement() code
Calling python functions can have high overhead.  Inline the
twos_complement code in the _extract_samples() inner loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 12:41:24 -04:00
Kevin O'Connor f6734d83b3 mpu9250: Use adxl345.AccelCommandHelper directly
The MPU9250CommandHelper() class is nearly a duplicate of
ADXL345CommandHelper().  Rename ADXL345QueryHelper() to
AccelCommandHelper and remove user facing references to "adxl345". Use
it directly from mpu9250.py .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 12:41:24 -04:00
Kevin O'Connor 4a7b429115 mpu9250: Use adxl345.ClockSyncRegression directly
The mpu9250.ClockSyncRegression() class is a duplicate of
adxl345.ClockSyncRegression().  Remove the duplicate copy and use the
code from adxl345.py .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 12:41:24 -04:00
Kevin O'Connor f0ba3a8c52 mpu9250: Use adxl345.AccelQueryHelper directly
The MPU9250QueryHelper() class is a duplicate of ADXL345QueryHelper().
Rename ADXL345QueryHelper() to AccelQueryHelper() and use it directly
from mpu9250.py .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-20 12:41:24 -04:00
Kurt Haenen f2a5800cea
configfile: Expose options awaiting to be saved (#5270)
Adds a save_config_pending_items to the status reported by
configfile reflecting the items and values that a future
SAVE_CONFIG would actually persist.

Signed-off-by: Kurt Haenen <kurt.haenen@gmail.com>
2022-06-20 12:10:57 -04:00
Eric Callahan 78454dd3b1 bed_mesh: cache mesh status
Prevent calls to `get_status()` from creating a new
status dict on each request.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-06-17 09:06:21 -04:00
bluesforte f55b9d3e57 mpu9250: Adding support for MPU-9250 (and MPU-6050) accelerometer
Add support for mpu9250 accelerometer over I2C bus.

Signed-off-by: Harry Beyel <harry3b9@gmail.com>
2022-06-16 11:09:33 -04:00
Kevin O'Connor 7f9ea231b7 delta_calibrate: Fix Python3 error in DELTA_ANALYZE
Reported by @CODeRUS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-13 13:51:07 -04:00
functionpointer 33ecc6d62e
ds18b20: fix string conversion error on startup (#5559)
Signed-off-by: Lorenzo Pfeifer <Lorenzo.Pfeifer+github@googlemail.com>
2022-06-08 18:05:27 -04:00
Kevin O'Connor d61d3ade23 ds18b20: Don't propagate incorrect temperature on a fault
Just log an error on a fault.

Remove the host check for min/max temperature as the micro-controller
code already implements that check.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-08 12:48:40 -04:00
functionpointer 2dc20c011d ds18b20: Allow some read errors
Allows a limited number of DS18B20 read failures
before stopping the printer. This is designed to
tolerate spurious read errors, while still stopping
for serious issues.

The printer will stop when the sensor

fails to report a value five times in a row.

Implementation works as follows:
The MCU reports any read errors using a new "fault"
parameter in its answers.
The Python code tracks the number of errors
and triggers the shutdown. This paves the way for
more sophisticated error handling in the future,
as well as an example for other sensors to follow.

Signed-off-by: Lorenzo Pfeifer <Lorenzo.Pfeifer+github@googlemail.com>
2022-06-08 12:39:12 -04:00
Kevin O'Connor 04eb72dcd5 virtual_sdcard: Fix merge error
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-06-03 14:23:56 -04:00
Frank Tackitt 89c59b035e exclude_objects: initial implementation
Adding Klipper functionality to support cancelling objects while
printing.

This module keeps track of motion in and out of objects and adjusts
movements as needed.  It also tracks object status and provides that to
clients.

The Klipper module is relatively simple, and only provides one piece of
the workflow. Moonraker already supports processing uploaded files to
insert the required gcode markers for cancelling objects, using
https://github.com/kageurufu/cancelobject-preprocessor. This library is
also available as an executable for use in slicers, and pip
installations also include the script as a callable.

Mainsail has integrated support, and code changes for Fluidd are
available. Support in other interfaces is planned, and we've spoken to
several other developers about integrating frontend support in their
projects.

Signed-off-by: Troy Jacobson <troy.d.jacobson@gmail.com>
Co-authored-by: Franklyn Tackitt <git@frank.af>
Co-authored-by: Eric Callahan <arksine.code@gmail.com>
2022-06-03 14:12:04 -04:00
Troy Jacobson 04952db1e8 tuning_tower: add is_active() method
Signed-off-by: Troy Jacobson <troy.d.jacobson@gmail.com>
Co-authored-by: Franklyn Tackitt <git@frank.af>
2022-06-03 14:12:04 -04:00
Troy Jacobson 2e04be4451 virtual_sdcard: Add reset_file event
Signed-off-by: Troy Jacobson <troy.d.jacobson@gmail.com>
Co-authored-by: Franklyn Tackitt <git@frank.af>
2022-06-03 14:12:04 -04:00
Pedro Lamas c16eab212e virtual_sdcard: Adds on_error_gcode
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-06-03 11:26:34 -04:00
Mikkel Schmidt af38d708cb
adxl345: Support recording data from multiple ADXL345's in one run, and more. (#5224)
Add PROBE and CHIP to TEST_RESONANCES

Since it's possible to specify more than one chip
in TEST_RESONANCES the CHIP parameter has been
renamed to CHIPS

Signed-off-by: Mikkel Schmidt <mikkel.schmidt@gmail.com>
2022-05-23 19:56:58 -04:00
Kevin O'Connor 8268478006 homing: Fix bug in multi_complete()
Reported by @skrogh.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-13 13:53:17 -04:00
Kevin O'Connor a94146b554 pins: Improve pin description checks
Make sure whitespace isn't in the pin description.  Also make sure an
alias doesn't map to an invalid pin.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-09 16:33:46 -04:00
Kevin O'Connor 7e76bd561a klippy: Minor changes to message protocol error
Minor indentation and variable name changes.

Don't remove linebreaks from message_protocol_error lines.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-06 21:06:13 -04:00
Felicia Hummel b18786bc91
klippy: Reworked the MCU protocol error message (#5470)
The MCU protocol error message often confuses users, especially after getting bombarded with the config format error line. This PR tries to improve it and has the following goals:

- Put the technical error at the end to prevent confusion and avoid the immediate jump to help channels instead of continuing to read
- Inform the user first what the type of error is (In this case: MCU Protocol error) and not at the end of the long error message
- Give the users a clear instruction what to do (pretty much unchanged), but possibly more approachable because the user is not confused by the technical error anymore
- Shows the version numbers of Klipper separate from all MCU version numbers so that it is more obvious that this is the version of Klipper
- Separates the version numbers between outdated MCUs and up-to-date MCUs, so that it becomes obvious if a MCU flash failed because the MCU doesn't disappear from the outdated list
- Previously, when viewing the errors in a web frontend, additional line breaks made it extremely hard to read the message, sometimes with as little as one word on one line. The error messages are now formatted to not have rogue line breaks, improving readability.

Signed-off-by: Felicia Alexa Hummel <felicia@drachenkatze.org>
2022-05-06 20:51:34 -04:00
Kevin O'Connor de14d106a1 shaper_calibrate: Add missing import
Reported by @Ludy87.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-23 21:49:50 -04:00
Martin Hierholzer 7793784640 spicmds: Allow inversion of CS pin for SPI busses
Signed-off-by: Martin Hierholzer <martin@hierholzer.info>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-22 13:25:03 -04:00
Kevin O'Connor fb3bae4531 neopixel: Simplify color_order parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 12:55:32 -04:00
Kevin O'Connor 260fd7d367 pca9632: Fix color_order assignment
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 11:07:05 -04:00
Kevin O'Connor fb02e2b577 neopixel: Fix color_order assignment
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 10:55:35 -04:00
Kevin O'Connor 5f0885958d neopixel: Support chains with a mix of color_order
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 10:16:10 -04:00
Kevin O'Connor 53a7f1dd76 led: Remove has_white check from LEDHelper
There is no harm in checking for a white config setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 09:34:25 -04:00
Kevin O'Connor 630d3b3444 led: Fix SET_LED TRANSMIT=1 handling
If the final update in a series of SET_LED update commands didn't
alter a color than the transmit would not occur - even if prior
commands did make color changes.  Refactor the update code and fix.

Reported by @mstansberry.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-18 08:55:21 -04:00
Uli 240f8ea60b
htu21d: SI7021 is has id 0x15 (#5375)
This is most probably the result of a copy paste error. All vendor documentation for SI7021 (e.g. https://www.silabs.com/documents/public/data-sheets/Si7021-A20.pdf) points to 21 and it actually only works when adapted to 0x15 (=21).

Signed-off-by: Uli Wolf <github+klipper@wolf-u.li>
2022-04-11 10:33:41 -04:00
Dmitry Butyugin 76b22b3125 smart_effector: Initial support of programmable SmartEffector
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2022-04-09 19:04:57 -04:00
Kevin O'Connor 22297229b7 temperature_fan: Fix divide by zero error when pid_Ki is zero
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-07 12:11:54 -04:00
Kevin O'Connor 647a1cd8ca temperature_fan: Remove deprecated pid_integral_max option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-07 12:10:48 -04:00
Kevin O'Connor 555ac58a3f pca9632: Add support for configurable color_order
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-07 11:48:25 -04:00
Kevin O'Connor f0700c0985 pca9632: Support using hardware I2C
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-07 11:43:52 -04:00
Kevin O'Connor dc7b02f329 neopixel: Support arbitrary RGBW strings in color_order config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-04-06 09:27:36 -04:00
Kevin O'Connor e6bfc4c9aa led: Support setting display_template parameters via SET_LED_TEMPLATE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 1ab3ac39e4 led: Support automated LED updates based on display_template results
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor a6ab56c0a6 display: Add a new PrinterDisplayTemplate class for tracking template macros
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 2001eecd5e pca9533: Add support for 4 brightness levels
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 47828b4056 pca9533: Update to use LEDHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 271c2ac95b pca9632: Update to use LEDHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 0c425cf014 mcp4018: Support setting minclock and reqclock in SoftwareI2C class
This is in preparation for pca9632 changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 9136a29196 dotstar: Update to use LEDHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 8b8818c0f7 neopixel: Update to use LEDHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor 96795def9c led: Add support for PWM controlled LEDs
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-31 13:08:12 -04:00
Kevin O'Connor c08f83ff47 pid_calibrate: Improve Python3 compatibility in debug file output
Reported by @kpishere.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:37:03 -04:00
Kevin O'Connor 4d1c3478ab angle: Add support for reading tle5012b chip registers (for debugging)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Kevin O'Connor 1275281ab6 angle: Initialize tle5012b chip variants to same configuration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Kevin O'Connor 1b08553a42 angle: Report tle5012b temperature
Export the tle5012b temperature readings when performing measurements.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Kevin O'Connor f9d505e376 sensor_angle: Support TLE5012b frame counter for timing
Use the tle5012b internal frame counter to calculate the time of each
measurement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Kevin O'Connor aec742ece4 angle: Initial support for angle sensor calibration
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Kevin O'Connor 74937326d3 sensor_angle: Add support for bulk querying of spi angle sensors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-29 20:34:46 -04:00
Alex Maclean 8049243221 atsam: Add support for SAM E70
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
2022-03-26 11:59:27 -04:00
Justin Schuh 1390b4d600 virtual_sdcard: Allow spaces in file path for M23
Also makes M23 work normally with rename_existing.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2022-03-18 11:44:33 -04:00
Kevin O'Connor 98d3fffd79 palette2: Fix typo (gmcd vs gcmd)
Reported by @Ludy87.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-17 20:53:07 -04:00
Kevin O'Connor a43973b0e0 skew_corrections: Fix typo (gmcd vs gcmd)
Reported by @Ludy87.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-17 20:52:10 -04:00
Ricardo Alcântara 0761026e36
pca9632: LED module for FlashForge Dreamer 3D printer (#4654)
Added PCA9632 LED module support using software I2C from MCP4018
modulo drive the LED strip of a FlashForge Dreamer 3D printer.
Based on the PCA9533 module. 

Signed-off-by: Ricardo Alcantara <ricardo@vulcanolabs.xyz>
2022-03-14 14:28:42 -04:00
Stefan Dej 12e304fbec temperature_fan: add missing round function to get_status temperature
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2022-03-14 13:48:38 -04:00
electron2410 02d770ae3c
neopixel: add BGR for neopixel (#5160)
Signed-off-by: Thomas Liebold <electron2410@gmail.com>
2022-03-14 12:30:58 -04:00
Pedro Lamas 38b992532a display_status: stops M73 from setting progress to 0 if P missing
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-03-08 14:20:35 -05:00
Kevin O'Connor fe2974b8ec extruder: Verify trapq is unmodified on default SET_PRESSURE_ADVANCE
Check that a SET_PRESSURE_ADVANCE without an explicit EXTRUDER
parameter isn't done after the user disables or reassociates the
extruder stepper motor (via SYNC_EXTRUDER_MOTION).  Otherwise, it
could lead to very confusing results.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-04 13:38:59 -05:00
Kevin O'Connor 4815a946c2 extruder_stepper: Do not default to synching with "extruder" at startup
With recent changes, the extruder_stepper may be used for new
purposes, and synchronizing to the "extruder" motion queue at startup
may become a confusing default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-04 13:38:59 -05:00
Kevin O'Connor 6627d036ac extruder: Allow an extruder object to be created without a stepper
This may be useful for dual hotend printers that have only one
stepper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-03-04 13:20:35 -05:00
Andrei Ignat 682d38f590
delta: Multiple steppers on delta tower (#5217)
Updated tower rail setup to support multiple steppers per tower.

Signed-off-by: Andrei Ignat <andrei@ignat.se>
2022-02-28 23:14:25 -05:00
Andrei Ignat bbd1ddadd1
corexy: Multiple steppers per axis on CoreXY (#4886)
Allowing multiple steppers per axis.

Signed-off-by: Andrei Ignat <andrei@ignat.se>
2022-02-28 23:11:50 -05:00
Lorenzo 7c964e5fdf
dac084S085: SPI DAC DAC084S085 implementation (#5134)
Alligator Board Rev2 tested config sample.
Add example configuration file for Alligator board rev.3.

Signed-off-by: Lorenzo Franco <lorenzo.franco@lorenzing.com>
2022-02-22 10:28:28 -05:00
Kevin O'Connor b0a24a4458 motion_report: Ensure startstop_cb is called atomically
Make sure APIDumpHelper() does not invoke the startstop callback while
it is already running.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-21 22:22:14 -05:00
Misterke 8b0c6fcb08 bed_mesh: Report actual mesh profiles as status
Report the actual profiles available via BED_MESH_PROFILE
via the status for use by clients.

Signed-off-by: Kurt Haenen <kurt.haenen@gmail.com>
2022-02-16 13:42:19 -05:00
Kevin O'Connor 1c594ef27a bed_mesh: Fix integer division issue on Python3
Reported by @CODeRUS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 14:09:15 -05:00
Kevin O'Connor 2e17519a7e extruder: Deprecate old extruder commands and shared_heater config option
Deprecate SET_EXTRUDER_STEP_DISTANCE and SYNC_STEPPER_TO_EXTRUDER.
Recommend using SET_EXTRUDER_ROTATION_DISTANCE and
SYNC_EXTRUDER_MOTION.

Deprecate the extruder "shared_heater" option and reocmmend using
extruder_stepper config sections to obtain the same functionality.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 13:25:16 -05:00
Kevin O'Connor 2af8c5aa86 extruder: Add new SYNC_EXTRUDER_MOTION command
This command is a rename of SYNC_STEPPER_TO_EXTRUDER.  This change is
in preparation for the removal of SYNC_STEPPER_TO_EXTRUDER.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 13:24:21 -05:00
Kevin O'Connor 9ec9742484 extruder: Add support for reversing the direction of extruder stepper movement
Extend SET_EXTRUDER_ROTATION_DISTANCE to support reversing the
direction of extruder movement.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 13:24:21 -05:00
Kevin O'Connor 189188e3ca extruder: Add a SET_EXTRUDER_ROTATION_DISTANCE command
Support altering the extruder distance using the higher-level
rotation_distance.  This is in preparation for removal of the
SET_EXTRUDER_STEP_DISTANCE command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-02-10 13:24:21 -05:00
cbc02009 54646c77dc
bme280: fix integer handling for python3 in bme280.py (#5237)
Singed-off-by: Christopher Conroy <cbc02009@gmail.com>
2022-02-06 12:15:35 -05:00
Nick Douma 28b568a6ac
gcode_arcs: detect CW / CCW move with renamed G2/G3 command (#5096)
The G2 / G3 command might be renamed using `gcode_macro` + `rename_existing`. This change allow detecting clockwise / anti-clockwise moves when the command gets renamed.

Signed-off-by: Nick Douma <n.douma@nekoconeko.nl>
2022-01-22 20:47:51 -05:00
D4SK 2f1edac922
tmc: Fix number of arguments in phase endstop warning (#5184)
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2022-01-22 20:41:44 -05:00
Kevin O'Connor f97fd7c6e3 gcode: Handle M117 and M118 commands that start with a special character
Commit 7ef7bf60 broke the special handling for M117 commands that
start with a number or special character.  Fix that support and extend
to M118 as well.

Also improve handling of commands not separated by a space (eg,
"M117HELLO").

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-18 11:34:40 -05:00
Kevin O'Connor 02d5f9754f extruder: Support disassociating a stepper from all extruders
Support SYNC_STEPPER_TO_EXTRUDER commands with an EXTRUDER parameter
set to an empty string.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor eb2a67cb95 extruder: Support SYNC_STEPPER_TO_EXTRUDER on extruder objects
Refactor the extruder_stepper support so that it uses the
ExtruderStepper class defined in extruder.py.

Support the SYNC_STEPPER_TO_EXTRUDER command on steppers defined in
either extruder_stepper or extruder config sections.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor ffbd2698fe extruder: Separate extruder stepper tracking to new ExtruderStepper class
Move the stepper handling (including pressure advance handling) to a
new class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor 29724a7411 extruder: Don't store pressure_advance value in trapq moves
Store the pressure_advance value in "struct extruder_stepper" instead
of in the trapq's "struct move".  This makes it possible for multiple
stepper motors to have different pressure advance values while still
using the same trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:01:15 -05:00
Kevin O'Connor 34a1ce4837 tmc2130: Rework current selection to prefer vsense=1
It is preferable to program the tmc drivers with an irun (or cs)
setting near 31, as otherwise the driver may have reduced microstep
precision.  It was possible for the driver to be programmed with
irun=16 or irun=17 when it could have been configured with irun=31
with vsense=1 instead.  This would occur on tmc2130/tmc2208/tmc2209
drivers for values around 0.900 to 1.000 amps (when using a typical
sense_resistor settings of 0.110 Ohms).

Change the code to prefer using vsense=1 to avoid this issue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-01-16 19:00:00 -05:00
individ-divided 538f09a2da
pause_resume: Do not clobber default state name by accident (#5156)
Previously accidentally used 'default' state name instead of the
stated one ('PAUSE_STATE'). This might collide with user usage of the
SAVE_GCODE_STATE macro.

Signed-off-by: David Grundberg <individ@acc.umu.se>
2022-01-16 13:00:24 -05:00
Tim Abraham babb067b60
neopixel: Update neopixel.py to add BRG color order (#5110)
Add BRG color option.
Document BRG color option.

Signed-off-by: Timothy Abraham <Timothyabe93@gmail.com>
2022-01-12 12:18:08 -05:00
Stephen Hurd f8afe49a2f
toolhead: Fix toolhead stop on SET_VELOCITY_LIMIT (#5053)
This fixes issue #5050

Signed-off-by: Stephen Hurd <deuce@synchro.net>
2021-12-30 18:56:24 -05:00
Kevin O'Connor 1c24317380 stm32: Enable ADC support on stm32g0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-23 22:15:26 -05:00
Kevin O'Connor 62cfc2527f statistics: Improve Python3 compatibility
Reported by @vladimir-poleh .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-12-15 11:27:08 -05:00
Kevin O'Connor 520273e5ab stepper: Support step_pulse_duration even on TMC drivers in UART/SPI mode
Commit 689231df changed the default step_pulse_duration to 100ns for
TMC drivers that are configured in UART/SPI mode, but it failed to
document that change in Config_Changes.md and Config_Reference.md.
Update those documents to reflect that change.

Update the code so that a user may specify a custom
step_pulse_duration even on TMC drivers that are configured in
UART/SPI mode.  This may be useful for drivers that use a level
shifter on the step pin that requires more than a ~300ns to detect a
level change.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-29 16:56:29 -05:00
Nitram 54acca37ba
delta: max z-accel and speed ratio calculation for deltas (#4689)
Adding a possibility to use a lower z- acceleration.

Signed-off-by: Martin Malmqvist <volcomosq@gmx.com>
2021-11-29 13:21:26 -05:00
Alex Zellner 05a8aca0a8
gcode: Allow rename_existing also for register_mux_command (#4843)
Signed-off-by: Alex Zellner <alexander.zellner@googlemail.com>
2021-11-22 11:22:12 -05:00
Kevin O'Connor faea45e60f mcu: Add checks to ensure pin max_duration doesn't overflow 32bit counter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-22 10:11:09 -05:00
Kevin O'Connor d1e13b7e12 mcu: Verify start value equal to shutdown value when using max duration
The mcu can only enforce the max duration if the start value is the
same as the shutdown value, so verify that before configuing the mcu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-22 10:08:56 -05:00
Dennis Marttinen 83889ac435 print_stats: Fix exception when canceling in/as first G-code
Signed-off-by: Dennis Marttinen <twelho@welho.tech>
2021-11-21 08:01:43 -05:00
Pedro Lamas 7ef7bf608a gcode_macro: Add "rawparams" pseudo-variable
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2021-11-19 11:22:36 -05:00
Eric Callahan 46381e03a4
gcode_macro: fix reference issues to the variables attribute (#4925)
Create a copy of the dictionary prior to updating the the variable field.
This fixes an issue where webhooks holds a reference to the variables
dict returned by get_status().

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-19 02:01:16 -05:00
Geoffrey Young 5dcc377cde temperature_sensors: add ATC Semitec 104NT-4-R025H42G thermistor
module: extras/temperature_sensors.cfg

this thermistor is the 104NT-4 resold by Trianglelab (and others on Ali),
as well as the 300 degree resold by Slice Engineering, both of which use the
same RT table (TL even links to the ATC Semitec website)

see the 300 C tab on the Slice spreadsheet:
  https://docs.google.com/spreadsheets/d/1904x5JK-Sup-cX5DqHiiZWaFVTK6_PQBFxgi_6yXEJw/edit#gid=934228925
as well as the TL product page:
  https://www.aliexpress.com/item/32843785247.html
in addition to the RT table provided in temperature_sensors.cfg

Signed-off-by: Geoffrey Young <geoffrey.young@gmail.com>
2021-11-15 23:14:32 -05:00
Kevin O'Connor c179db3d43 temperature_sensors: Deprecate "NTC 100K beta 3950" thermistor
It seems the common "beta 3950" thermistors generally follow a
temperature table defined by the new "Generic 3950" definition.  Using
a table that actually follows the "beta 3950" temperature curve is
generally less accurate.  Deprecate the existing "NTC 100K beta 3950"
definition to avoid this common issue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:56:51 -05:00
Kevin O'Connor 19aac4055d temperature_sensors: Add a new "Generic 3950" thermistor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor c0909d2f7f temperature_sensors: Define default thermistors in config
Move the definitions of the default thermistors from thermistors.py to
the temperature_sensors.cfg file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor 596cd21751 temperature_sensors: Define default sensors in new config file
Move the default list of sensor modules from heaters.py to a new
temperature_sensors.cfg config file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-10 18:52:55 -05:00
Kevin O'Connor d4aee4f55e mcu: Make a minor change to the protocol to require mcu update
Commit 9ecddd1b fixed a serious error (introduced in 7d95a004).  Force
a protocol version change so users are aware of the need to update the
mcu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-06 18:47:44 -04:00
Kevin O'Connor 689231df3a stepper: Add support for stepping on both edges of a step pulse
Add an optimized step function for drivers that support stepping on
both rising and falling edges of the step pin.  Enable this
optimization on 32bit ARM micro-controllers.  Automatically detect
this capability in the host code and enable on TMC drivers running in
SPI/UART mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 4acfd8d7c8 stepper: Make step pulse duration customizable at run-time
Remove the STEP_DELAY Kconfig option and replace it with a per-stepper
step_pulse_duration printer.cfg config option.

The AVR code will continue to have optimized code to step and "unstep"
in the same function (which is automatically activated when the step
delay is 40 ticks or less).  This change removes the Kconfig option
for single function step/unstep on 32bit processors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 8bfcedfb42 heaters: Remove support for deprecated pid_integral_max option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 6e0431907d gcode_macro: Remove support for deprecated features
Remove support for default_parameter_xxx config options.  Remove
support for direct access to command parameters.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 0382ffbf68 pins: Remove support for deprecated pin_map option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor 1699f378de console: Remove support for PINS command
Remove support for builtin pin aliases from the console.py tool.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor b79a51c383 temperature_host: Remove support for deprecated rpi_temperature alias
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor eea0137bf0 stepper: Remove support for deprecated step_distance option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 12:45:11 -04:00
Kevin O'Connor d23c1b06c6 gcode: Fix Python3 syntax error
Fix error introduced in d6c3aaad.  Also, go back to only accepting
ascii characters on input.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 14:15:32 -04:00
Kevin O'Connor ccee189f99 palette2: Use regular str() types for input on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor 1dee974aea serialhdl: Use regular str() type for stats on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor fc5353364a util: Use regular str() type in get_git_version() on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor 7a6fd1a1aa console: Use regular str() types for commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor d6c3aaad8a gcode: Use regular str() types for g-code commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Also, accept utf8 on gcode input (instead of just ascii).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:51:52 -04:00
Eric Callahan d90c3bc57a idle_timeout: exit the timer if the printer is shutdown
This resolves an issue where the timer can get stuck
in an attempt to transition from Ready to Idle if
the printer is shutdown.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-29 18:39:47 -04:00
Kevin O'Connor cf4bfb1119 tmc: Rename handle_stepper_enable() method to _handle_stepper_enable()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:56:44 -04:00
Kevin O'Connor 14bdc8e569 stepper: Remove unused _dist_to_time() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:41:59 -04:00
Kevin O'Connor 86fee2d517 tmc: Track requested hold_current so SET_TMC_CURRENT doesn't reduce it
The code automatically reduces the hold_current so that it is no
greater than the run_current.  However, this could lead to confusing
behavior if one reduced and then increased the run_current via
SET_TMC_CURRENT commands.  To avoid that, this change adds support for
tracking the requested hold_current - thus changes to run_current
don't subtly alter the hold_current.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:13:38 -04:00
Kevin O'Connor 573fceefeb input_shaper: Fix python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 20:01:33 -04:00
Kevin O'Connor b62171f350 input_shaper: Restore shaper_type config option
The shaper_type config option got removed in commit d5a7a7f0 - restore
that option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 18:06:11 -04:00
Dmitry Butyugin 54e21a7c26 input_shaper: Factored out AxisInputShaper class
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Dmitry Butyugin d5a7a7f00f input_shaper: Define input shapers in a single place in Python code
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Eric Callahan ec2116b4f7 temperature_sensor: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan cd58a945e2 temperature_host: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan bf598d0922 lm75: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan 916ef4483a htu21d: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan e65b2593c6 heaters: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan 1153803360 ds18b20: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan c499451ab8 bme280: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Dmitry Butyugin 91466ebd43 adxl345: Renamed decode_samples and fixed/added checks on empty data
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-13 11:56:52 -04:00
Philipp Temminghoff 64e4649877
tmc: add current values to get_status() (#4696)
Signed-off-by: Philipp Temminghoff <philipptemminghoff@gmail.com>
2021-10-11 12:03:08 -04:00
Kevin O'Connor afd1058af6 delta: Don't limit XY+Z moves to max_z_velocity
Scale the max_z_velocity limit by the amount of movement in the Z.
This should improve bed_mesh and vase mode prints on delta printers.

Reported by @hywelmartin and @dalegaard.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-11 11:53:00 -04:00
Rufo Sanchez b336a21fe7 button: Support half-stepping encoders
Adds support for half-stepping encoders (encoders that only emit two
steps per detent, instead of four). Incorporates the feedback from
@susisstrolch's PR: https://github.com/KevinOConnor/klipper/pull/4202
, which was itself built upon a previous PR from @nickbrennan01:
https://github.com/KevinOConnor/klipper/pull/730

Uses the table from the Rotary Arduino library linked in buttons.py:
6b784cca67/Rotary.cpp (L21-L40)

Signed-off-by: Rufo Sanchez <rufo@rufosanchez.com>
2021-10-11 11:29:53 -04:00
Kevin O'Connor c56c34fa1c configfile: Use Python2's ConfigParser when running on Python2
The backport of Python3's configparser causes issues when there is
unicode characters in the config file.  To avoid introducing new
errors, go back to using the Python2 version of ConfigParser when
running on Python2.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-09 19:37:48 -04:00
Kevin O'Connor 21d5a34d22 console: Fix Python2 compatibility
Make sure to import util prior to reactor.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-08 13:00:11 -04:00
Kevin O'Connor 5251bf23f1 configfile: Workaround for non-ascii comments on Python2
Explicitly specify the comment_prefixes as regular Python2 strings -
otherwise the configparser wont ignore non-ascii characters in
comments.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-08 00:23:31 -04:00
Kevin O'Connor 64cb8d9820 ds18b20: Improve Python3 compatibility
Reported by @matthewlloyd.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-07 14:47:49 -04:00
Dmitry Butyugin 2822680eb4 adxl345: Expanded invalid adxl345 id message
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-06 21:17:56 -04:00
Dmitry Butyugin bd5dc03317 adxl345: Renamed debug commands to fix their parsing by Klipper
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-06 21:16:31 -04:00
Kevin O'Connor c7b65f50e3 configfile: Ignore trailing comments starting with a semicolon
Newer versions of configparser no longer default to ignoring trailing
comments that start with a semicolon.  Add that setting explicitly to
avoid breaking existing config files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 14:07:32 -04:00
Kevin O'Connor cc63fd51b2 scripts: Use backport of a recent Python3 configparser on Python2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-04 15:10:46 -04:00
Kevin O'Connor 41d42a07bf klippy: Add a build import test tool
Add a test case to verify that every optional module successfully
loads on both Python2 and Python3.  This is intended to catch syntax
and module imports that are not compatible between Python versions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-04 14:36:08 -04:00
Kevin O'Connor f1747b5118 klippy: Add Python2 module wrappers and use Python3 module naming
Add wrappers for some common Python modules so that the code can run
on both Python2 and Python3.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-04 14:36:08 -04:00
Kevin O'Connor b8c91914b7 webhooks: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-04 14:36:08 -04:00
Kevin O'Connor adeb869f56 gcode: Convert to Python3 string encoding
The error checking is not complete in this change - the code should
handle the case where an input string is not valid utf8.

The code will continue to run on Python2 after this change, however
the execution time on Python2 is measurably slower after making this
change.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 21:00:03 -04:00
Kevin O'Connor 8714282570 console: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor b3a39bebd4 virtual_sdcard: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor 0da3d84a87 configfile: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor b859c11378 util: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor 2978771ce5 mcu: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:22:13 -04:00
Kevin O'Connor fa25986adc reactor: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:18:58 -04:00
Kevin O'Connor 0fc52f9496 serialhdl: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:12:42 -04:00
Kevin O'Connor de38ef4290 kinematics: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:12:30 -04:00
Kevin O'Connor 68b939c756 display: Convert to Python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-01 19:12:21 -04:00
Kevin O'Connor bcbdc983a8 screws_tilt_adjust: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-30 13:14:20 -04:00
Kevin O'Connor 01ab8267a6 hybrid_corexy: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-30 13:10:45 -04:00
Kevin O'Connor af86c5f306 fan: Improve python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-30 13:10:45 -04:00
Kevin O'Connor 164060ccfe stepper: Make sure to report an error if endstop_pin is not defined
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-29 20:10:57 -04:00
Kevin O'Connor 1eecd412ef motion_report: Fix typo causing error reports to not propagate
The APIDumpHelper._start() method should propagate errors to its
caller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-26 12:21:36 -04:00
Kevin O'Connor 46167cae67 configfile: Add support for reporting deprecated options
Add a new printer.configfile.warnings with a list of config features
that are deprecated.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-16 13:44:54 -04:00
Kevin O'Connor c89db2480d configfile: Setup get_status() results after check_unused_options()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-16 13:44:54 -04:00
Kevin O'Connor c84956befe heaters: Change default smooth_time from 2 seconds to 1 second
A larger smooth_time results in a slower reaction time for the PID.
This increased delay can cause temperature oscillations with high
power heaters.  Many boards produce good results without any
smoothing.  So, it seems a smooth_time of 1 second is a better
default.

Reported by @ReXT3D.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-03 18:11:05 -04:00
github@matthewlloyd.net 830c80a88a tuning_tower: Add STEP_DELTA and STEP_HEIGHT parameters as alternate tuning tower syntax
Signed-off-by: Matthew Lloyd <github@matthewlloyd.net>
2021-09-02 12:05:31 -04:00
github@matthewlloyd.net 286cc1becc tuning_tower: Add SKIP parameter
Signed-off-by: Matthew Lloyd <github@matthewlloyd.net>
2021-09-02 12:05:31 -04:00
Kevin O'Connor d7b04aa18f delta: Make the 'arm_length' description more clear in save_state()
Reported by @conlank.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-02 11:46:33 -04:00
Stefan Dej 3a497d04ac
toolhead: change SET_VELOCITY_LIMIT respond (fixed) (#4620)
Returns only the current values if no new ones have been passed.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-08-31 13:37:48 -04:00
Lasse Dalegaard caec91b149 stepper: detect duplicate endstops
When adding steppers to a `PrinterRail`, detect duplicated `endstop_pin`
settings and add them to the already-registered endstop.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-08-31 13:23:04 -04:00
Kevin O'Connor dcf8cb82a3 tmc: Fix typo in get_status()
Fix missing variable assignement introduced in commit 5fd1c985.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 14:17:42 -04:00
Kevin O'Connor 0b4fbc78a8 adxl345: Allow multiple simultaneous clients
It is now possible to have multiple tools gathering adxl345 data at
the same time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:26:39 -04:00
Kevin O'Connor 404b64fd62 adxl345: Change default chip name from "default" to "adxl345"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:26:36 -04:00
Kevin O'Connor 22167f9510 adxl345: Compress each sample from 6 bytes to 5 bytes
Transmit data from mcu to host using 5 bytes per sample and up to 10
samples per message block.  This improves bandwidth efficiency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor e34137582d adxl345: Implement timing via new adxl345_status messages
Query the adxl345 message counter every 100ms so that accurate timing
can be obtained during measurements.  This allows the adxl345 data to
be exported with timestamps while captures are running.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor dd95f80d9d adxl345: Support querying accelerometer data from webhooks interface
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor d87f7a77c3 adxl345: Add new start_internal_client() function and use in callers
Introduce a new start_internal_client() function and change all client
code to use that instead of manually calling start_measurements() and
finish_measurements().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor 8cfaed441d adxl345: Always initialize device on start_measurements() call
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor e03e0e9dac adxl345: Move g-code commands to new helper class
Separate out the G-Code command handlers to a new ADXLCommandHelper()
class.  This helps separate the sensing code from the user interface
code.

Deprecate the RATE parameter of the ACCELEROMETER_MEASURE command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:45 -04:00
Kevin O'Connor 6999ff6256 motion_report: Add helper tool for internal subscribers of data
Add support for internal clients to "subscribe" to data like external
clients.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:12:11 -04:00
Kevin O'Connor 5fd1c9853d tmc: Add support for a get_status() method
Export mcu_phase_offset and drv_status information.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:00:46 -04:00
Kevin O'Connor 950477849d mcu: Support multi-mcu homing
Support endstops and probes attached to a different micro-controller
than their associated steppers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-28 16:08:57 -04:00
Kevin O'Connor 2e131497ca homing: Fix error in retract move causing "must home axis" errors
It's possible for the original homing move of an axis to alter the
position of other axes.  Make sure those other axes are not requested
to move on a subsequent second home retract move, as that could cause
an error if those other axes have not been homed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-28 15:45:11 -04:00
Kevin O'Connor 8d4d16d51a manual_stepper: Add missing calc_position() wrapper call
Commit 3814a132 added code to homing.py to call calc_position() - add
that function to manual_stepper.py .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-26 12:23:12 -04:00
Kevin O'Connor 84ac5b0146 configfile: Support config.getchoice() with integer keys
If the choice mapping uses integer keys then lookup the config option
using self.getint().  This simplifies the callers and improves the
encoding of the printer.configfile.settings export.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-25 10:36:45 -04:00
Kevin O'Connor 75183bfb86 Revert "toolhead: change SET_VELOCITY_LIMIT respond behavior"
This reverts commit 9f75e348b0.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-24 12:34:00 -04:00
stefand 9f75e348b0 toolhead: change SET_VELOCITY_LIMIT respond behavior
Returns only the current values if no new ones have been passed.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-08-24 10:49:31 -04:00
Kevin O'Connor 2fdd8a420d motion_report: Add support for dumping steps/trapq via API server
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor cf2e941aec webhooks: Add register_mux_endpoint() helper function
Add ability to register an endpoint that invokes a handler based on a
parameter in the request.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor 809f1ccea6 stepper: Add mcu_to_commanded_position() method
Convert stepper.get_past_commanded_position() to the more general
stepper.mcu_to_commanded_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 11:10:19 -04:00
Kevin O'Connor f2d10b5729 tmc: Use config.getint() when reading microstep setting
Don't use config.getchoice() as that results in a string reported by
printer.configfile.settings.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-22 10:50:18 -04:00
Kevin O'Connor e5d5c25154 bed_mesh: Use config lists
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor fe1b2f5124 tmc_uart: Use config.getlist() for select_pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 31564f3b43 static_digital_output: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 92e1821423 multi_pin: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor e784c19a96 duplicate_pin_override: Use config.getlist() for pins config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8f7eedd95e board_pins: Use config list helpers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8a59de9431 z_tilt: Use config.getlists() for z_positions config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d0e4b03739 safe_z_home: Use config.getfloatlist() for home_xy_position config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d82dc1e844 resonance_tester: Use config.getlists() for probe_points config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 2461b30a6a quad_gantry_level: Use config.getlists() for gantry_corners config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8a556f2581 homing_heaters: Use config.getlist() for heaters and steppers config options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 65fb494e77 heater_fan: Use config.getlist() for heater config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 8f85786b3f gcode_button: Use config.getfloatlist() for analog_range config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 7f82dcb442 endstop_phase: Use config.getintlist() for trigger_phase config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 58dedb6b16 menu_keys: Use config.getfloatlist() for analog_range_ config options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor ab023bb61d delta_calibrate: Use config.getfloatlist() for parsing "stable positions"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor 99b0cacf3b controller_fan: Use config.getlist() for heater and stepper config parameters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:11 -04:00
Kevin O'Connor d3484efe73 probe: Use config.getlists() for points config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 673ecec6a2 screws_tilt_adjust: Use config.getfloatlist() for coordinates config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor a546415884 bed_screws: Use config.getfloatlist() for coordinates config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 3ef6e2ba56 adxl345: Use config.getlist() for axes_map config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor 67d99fe8a8 stepper: Use config.getlists() for gear_ratio config option
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Kevin O'Connor f9ca5b9098 configfile: Add helpers for parsing list of parameters from the config
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-21 18:08:10 -04:00
Eric Callahan c64ea474d7 webhooks: log client requests on shutdown
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-08-21 15:00:29 -04:00
Kevin O'Connor 65ed55a43b endstop_phase: Calculate phase based on trigger position
Update the endstop_phase code to use the phase of the stepper motor at
the endstop trigger time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:35:59 -04:00
Kevin O'Connor 3814a13251 homing: Calculate homing position based on trigger time
Calculate the "homing position" using the endstop trigger time instead
of the position of the steppers.

This is in preparation for multi-mcu homing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:35:59 -04:00
Kevin O'Connor 1dc2ab048f mcu: Return time of trigger from home_wait()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 22:01:23 -04:00
dawidmpunkt b4ee93043a
htu21d: Update htu21d.py (#4520)
Line 202: should be self.humidity instead of self.temp

Signed-off-by: Dawid Murawski <dawid.m@gmx.net>
2021-08-17 15:52:47 -04:00
Randell Hodges f313a2294a
bed_mesh: Added PROFILE name option (#4522)
Added optional PROFILE parameter to allow bed_mesh_calibrate to
save the mesh directly into the provided profile name instead of
default. If omitted, it will be stored in default.

Signed-off-by: Randell L Hodges <rhodges@taxfodder.com>
2021-08-17 15:30:14 -04:00
Pascal Pieper 73a7840697 output_pin: fix time difference calculation
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
2021-08-17 14:45:53 -04:00
chrenderle afd80c1de9
bed_screws: Finish bed_screws_adjust after n consecutive accepts (#4521)
Changed the bed_screws_adjust command so that it finishes after 4
consecutive accepts. Before if you had 4 screws and adjusted the
first one you had to accept 7 times to finish the bed_screws_adjust.

Signed-off-by: Christian Enderle <mail@chrenderle.de>
2021-08-17 13:56:43 -04:00
Kevin O'Connor 1aa4becc60 bed_mesh: Fix off-by-one error in faulty region error report
Reported by @craiglink.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 12:05:59 -04:00
Kevin O'Connor e3cf8fc819 motion_report: Fix typo causing incomplete queries
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-17 00:10:44 -04:00
Kevin O'Connor cf3c7cd99a avr: Rename the analog-only PE0/PE1 pins on atmega168/328 to PE2/PE3
The atmega328pb has officially named these pins as PE2 and PE3, so use
that naming scheme instead of the previous Klipper invented names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-14 22:00:17 -04:00
Kevin O'Connor f759df3cd7 endstop_phase: Convert to using tmc mcu_phase_offset
Now that the TMC drivers track the phase offset, use that to implement
endstop phase.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-08 22:28:10 -04:00
Kevin O'Connor 06b8169f56 tmc: Track offset between tmc driver and mcu position
Track the offset between driver phase and mcu position.  This offset
should be constant as long as neither the driver nor the mcu is reset.
If the offset ever changes, log a warning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-08 22:28:10 -04:00
Kevin O'Connor c2bfeb60aa tmc: Move stepper phase reading code to TMCCommandHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 13:12:49 -04:00
Kevin O'Connor 24586f0c31 stepper: Query the stepper mcu position during startup
Try to keep the host mcu_position synchronized with the
micro-controller by querying during startup and after every homing
event.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 13:12:49 -04:00
Kevin O'Connor 33dcb38297 tmc: Consistently use lower case for all TMC field names
The Trinamic specs aren't consistent with upper vs lower case, which
can be confusing.  Improve clarity by using lower case names
consistently in the code.  Register names will continue to use all
upper case naming in the code.

Update the SET_TMC_FIELD command to automatically convert field names
to lower case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 13:12:49 -04:00
Kevin O'Connor a52a627893 tmc2208: Send pdn_disable UART setup as first command to chip during init
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 13:12:49 -04:00
Kevin O'Connor fa7a91a38b homing: Improve error messages on a printer shutdown during homing
If a shutdown occurs during homing, make sure any follow up errors are
clear that the cause of the error is the shutdown.  This suppresses
the confusing "Unable to obtain 'trsync_state' response" messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 13:05:09 -04:00
Kevin O'Connor afada5e79e trapq: Prune interrupted moves from history on trapq_set_position()
It is possible for a homing move to not fully complete.  Fixup the
trapq history to make processing of the history easier for callers.
Similarly, do not add artificial "null" moves to the trapq history.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 12:22:07 -04:00
Kevin O'Connor b17ec3d2e9 stepcompress: Pass clock to stepcompress_set_last_position()
Using sc->last_step_clock for the last position marker does not work
properly, because the stepper.py code calls stepcompress_reset() prior
to calling stepcompress_set_last_position().  Fix by passing an
explicit clock to stepcompress_set_last_position().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-06 11:19:36 -04:00
shiftingtech 36e3969219
probe: bugfix to z_offset_apply_probe (#4553)
Command was accessing the wrong variable for the existing z offset,
leading to bad behavior.

Signed-off-by: Ben Eastep <shifting@shifting.ca>
2021-08-02 16:08:19 -04:00
Tircown a143921534
idex_modes: Fix get_status (#4550)
Fix get_status to be called without eventtime parameter.

Signed-off-by: Fabrice GALLET <tircown@gmail.com>
2021-08-01 15:10:45 -04:00
Kevin O'Connor 69d9497df3 webhooks: Remove spaces from json messages sent on api server
Reduce the bandwidth slightly by removing unnecessary spaces in
messages.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:54:21 -04:00
Kevin O'Connor 60aa05829f motion_report: Add get_status() method with current requested toolhead position
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:53:32 -04:00
Kevin O'Connor 38766c367f motion_report: Add new extras module for low-level motion diagnostics
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor f0dbeb0493 stepper: Simplify helper module registration of stepper motors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor c632b377ca mcu: Support returning the mcu reported shutdown time
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00
Kevin O'Connor cbd5680ae0 extruder: Add get_trapq() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-29 16:35:30 -04:00