aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
Commit message (Collapse)AuthorAgeFilesLines
* replicape: Don't require a host alias for the enable_pin defaultKevin O'Connor2021-03-251-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* menu: changes in tune menu according to #4023 (#4086)Janar Sööt2021-03-231-3/+3
| | | | | | - set 1% as input minimum for speed and flow - set speed maximum from 200% to 500% Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* graph_accelerometer: Support axis-level comparison of adxl345 dataDmitry Butyugin2021-03-201-0/+4
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* shaper_calibrate: Reduced min shaper freqs to match max_accel ~= 1500Dmitry Butyugin2021-03-201-6/+6
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* shaper_calibrate: Ignore vibrations below max_psd / 20 thresholdDmitry Butyugin2021-03-201-8/+16
| | | | | | | | | | | The input shaper can only reduce vibrations by 20x. Therefore, the best-case achievable vibrations level is max(psd) / 20. Any vibrations below that level can be ignored for the prupose of input shaper scoring. This allows tuning script to ignore wide tails of resonances, because it is not helpful to try to reduce them with input shaping. Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* shaper_calibrate: Estimate max_accel to avoid excessive smoothingDmitry Butyugin2021-03-201-8/+34
| | | | Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
* mcu: Update hints for "Timer too close" and "No next step" errorsKevin O'Connor2021-03-191-1/+6
| | | | | | | In practice, these errors are usually due to problems on the host computer instead of problems with communication. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* htu21d: sensor definition fix (#4075)Jon Sanders2021-03-181-0/+3
| | | | | | | | HTU21D sensor class lacked the method `get_report_time_delta` invoked during watermark control loops. This short fix simply adds that method in, calling the `self.report_time` attribute created during class construction. Signed-off-by: Jon Sanders <jonsan@gmail.com>
* tmc2660: Fix typo in seup fieldKevin O'Connor2021-03-181-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Use lowercase for stallguard/coolstep fieldsKevin O'Connor2021-03-181-15/+15
| | | | | | | Use lowercase for the field names so that it matches the tmc2130/tmc5160 field names. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Report SE in DUMP_TMC even if zeroKevin O'Connor2021-03-161-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Report CS_ACTUAL in DUMP_TMC even if zeroKevin O'Connor2021-03-161-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Only check for tmc2130 reset via CS_ACTUAL if IHOLD > 0Kevin O'Connor2021-03-151-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bme280: Add support for BMP280 and BME680 sensors (#4040)Michael Kurz2021-03-151-66/+335
| | | | | | | | | This adds support for BMP280 and BME680 sensor ICs, along with fixing calibration data readout for BME280. Gas sensor readout for the BME680 is just the raw compensated value. To get actual meaningful values, more research is needed. Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* tmc: Improve driver reset check on tmc2130 and tmc2660Kevin O'Connor2021-03-151-9/+23
| | | | | | Use the CS_ACTUAL/SE field to check for a mid-print driver reset. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Move clear_gstat check for tmc2130 to within TMCErrorCheck classKevin O'Connor2021-03-152-7/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Change stallguard flags to better match tmc2130/tmc5160Kevin O'Connor2021-03-151-6/+5
| | | | | | | | | The tmc2660 spec has an ambiguous "SG" field that sometimes refers to the "stallGuard" flag and sometimes refers to the "SG_RESULT" field. The tmc2130 and tmc5160 have similar fields that are not ambiguous, so adopt that naming strategy. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* filament_motion_sensor: Add filament_motion_sensor (#3857)TheJoshW2021-03-141-0/+76
| | | | | Add functionality to support a Filament Motion Sensor for detecting extruder jams as well as runouts. Works by an encoder toggling the switch_pin 0/1 as the filament is pulled through the sensor. Signed-off-by: Joshua Wherrett <thejoshw.code@gmail.com>
* extruder: Support looking up an extruder position from a past timeKevin O'Connor2021-03-131-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Add support for tracking history of queue_step commandsKevin O'Connor2021-03-133-28/+130
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Only load the CAN module if CAN bus is configuredKevin O'Connor2021-03-131-1/+2
| | | | | | | Temporarily postpone loading the CAN module so that moonraker (and similar) can improve upgrade scripts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Add support for connecting to devices on a CAN busKevin O'Connor2021-03-132-6/+43
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add support for connecting via CAN busKevin O'Connor2021-03-131-3/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Add support for communicating over a CAN busKevin O'Connor2021-03-131-1/+46
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Support sending messages over a CAN busKevin O'Connor2021-03-134-30/+80
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc_uart: Limit to only one active uart at a time on an mcuKevin O'Connor2021-03-121-1/+18
| | | | | | | | | | | | | | The tmcuart_send command increases cpu usage on the micro-controller. Should multiple tmcuart_send commands be issued at the same time to a single AVR micro-controller, it could increase the load to the point that it introduces a failure. It could also lead to tmcuart_send transmission errors, which would cause retransmission requests, which further increase the load. Track and share mutexes so that only one tmcuart_send command can be active on a single mcu at a time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Fix broken error report due to missing self.nameKevin O'Connor2021-03-111-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Verify SPI register writesKevin O'Connor2021-03-104-11/+41
| | | | | | | | The tmc2130 (and tmc5160) will respond back with the value written during the next SPI command. Use this feature to verify that the value written matches the value sent. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Do not enable SFILT by defaultKevin O'Connor2021-03-101-2/+1
| | | | | | | None of the other TMC driver enable SFILT by default and it seems enabling SFILT may not be ideal for sensorless homing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* idle_timeout: change standard timeout g-code (#4018)fleinze2021-03-071-1/+3
| | | | | Machines that have no heaters produce an error when the idle timeout occurs. This commit fixes this by checking if there are any heaters to turn off. Signed-off-by: Florian Heinze <florian@heinze.at>
* heaters: Make sure set_temp() command wakes up the idle_timeoutKevin O'Connor2021-03-054-12/+14
| | | | | | | | | Introduce a heaters.set_temperature() command and call that from commands that set a heater temperature. This new function calls toolhead.register_lookahead_callback() so that the idle_timeout gets notification that activity has occurred. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Fix check for duplicate objectsKevin O'Connor2021-03-051-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Add option to enable debug output modeKevin O'Connor2021-03-021-1/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* console: Make baud an optional parameterKevin O'Connor2021-03-021-3/+10
| | | | | | | Make the baud rate an optional parameter to the console.py tool. When not present, it will default to 250000. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Update callers to decide serial fd typeKevin O'Connor2021-03-023-68/+85
| | | | | | | | Don't try to detect a "real serial port" in serialhdl.py. Instead, have the callers invoke either connect_uart(), connect_file(), or connect_pipe(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* st7920: Better support for emulated ST7920 displays (#3979)teeminus2021-03-012-44/+126
| | | | | Added new ST7920E display driver which is better suited for displays with emulated ST7920 Signed-off-by: Christian Kehe <teeminus@posteo.net>
* fan: Minor updates to tachometer handlingKevin O'Connor2021-03-012-5/+3
| | | | | | | | | | | Add new fields to Command_Templates.md. Remove unused self.rpm variable. Use an explicit get_frequency() method in keeping with Klipper's convention of not "peeking into member variables". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* fan: Add tachometer supportAdrian Keet2021-03-012-1/+113
| | | | | | | | | | | | | | This adds new config options for fans: 'tachometer_pin' to specify the GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of signal pulses per revolution. The rpm is also exposed by get_status for command templates and the API server. For fast fans (at least 10000 RPM), the polling interval can be shortened using the 'tachometer_poll_interval' option. There is a new mcu object for a generic edge counter, which repeatedly polls a GPIO pin and periodically reports the count to the host. Signed-off-by: Adrian Keet <arkeet@gmail.com>
* serialqueue: correctly report EOF errorsLasse Dalegaard2021-03-011-1/+4
| | | | | | | | | If `klippy` loses connection to a device, the next `read()` from the device file descriptor will result in a zero-byte result, i.e. an `EOF`. Right now this gives a confusing error message, so this simply handles the special case of `EOF` and outputs a better log message. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* chelper: Move logging_callback() to global scopeKevin O'Connor2021-03-011-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: prevent creation of controlling ttyLasse Dalegaard2021-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | When `serialhdl` opens a terminal device it must prevent the device from becoming the controlling terminal of `klippy`, as such a terminal will send additional messages to the session leader, e.g. a SIGHUP, which would kill `klippy`. See e.g. #3981. pySerial already does this, but for e.g. `klipper_mcu` we were not doing this ourselves. On Linux a process must set `O_NOCTTY` when opening any file that could potentially be a terminal device, to avoid this. Earlier process daemonization tools prevent this from being an issue by double forking, but under `systemd` a process must take steps to avoid opening a controlling terminal. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Fix order of init during sensorless homingKevin O'Connor2021-02-282-4/+11
| | | | | | | | | | | With commit 53b10d3a the setup of sensorless homing could occur before the driver was enabled which would cause the reinitialization of the driver settings to undo the sensorless homing setup. Use set_field() when setting the sensorless homing registers so that it wont conflict with a driver init. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: No need to delay init on a stepper enableKevin O'Connor2021-02-281-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Allow more retries on a TMC UART read error during background checksKevin O'Connor2021-02-281-1/+10
| | | | | | | Allow three retries if we can't contact the TMC driver at all when it is in UART mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc_uart: Minor change - make the baud rate setting more clearKevin O'Connor2021-02-271-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Add support for periodic checking of driver statusKevin O'Connor2021-02-272-2/+78
| | | | | | | | Check the status of all Trinamic stepper motor drivers once a second. If the driver reports an error then invoke a shutdown. Also log any serious warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Reinitialize on every driver enableKevin O'Connor2021-02-271-32/+36
| | | | | | | | | | | | | Send the full TMC stepper motor driver initialization sequence every time the driver is enabled. Don't raise an error on startup if unable to contact a tmc2208/tmc2209 driver. If the driver is still unavailable when it is enabled then a shutdown will be issued. This allows users to troubleshoot (and possibly bring up communication to the driver) prior to enabling the driver. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Fix tmc register readingKevin O'Connor2021-02-271-30/+35
| | | | | | | | | The tmc2660 appears to send responses as soon as the clk starts toggling. That means the 20 bit response is at the top of the 24bit sent message. Also, this implies that RDSEL must already have the correct value in the prior message. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2660: Use common warning/error flag names and descriptionsKevin O'Connor2021-02-271-43/+30
| | | | | | | | Where the tmc2660 flags match other drivers, use lowercase so that the same monitoring code can be used for all the tmc drivers. Also, use the same field formatters where applicable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Merge field formatters into tmc2130.pyKevin O'Connor2021-02-272-5/+1
| | | | | | | | The tmc5160 field formatters were mostly duplicates of the tmc2130 - add the "reset" field to tmc2130.py so both drivers have similar reporting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>