Commit Graph

1408 Commits

Author SHA1 Message Date
Kevin O'Connor 03f69cd81a tmc: Query latest value during _init_registers()
The set_register() code may block, and it therefore may be possible
that the loop in _init_registers() could occur in parallel with other
updates.  That could result in a "OrderedDict mutated during
iteration" error.

Avoid the error by querying the latest value during each iteration of
the loop.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-11-28 21:24:41 -05:00
Andrei Ignat ea2f6bc0f5
exclude_object: Don't use gcmd.respond_error() (#6407)
gcmd.respond_error() has been deprecated: 61524542d2

Signed-off-by: Andrei Ignat <andrei@ignat.se>
2023-11-22 11:53:38 -05:00
Kevin O'Connor bb4711c5d3 tmc5160: Increase maximum current error check
It's possible to build and configure tmc5160 drivers with external
mosfets that support more than 3 amps.  The actual maximum for tmc5160
drivers is dependent on how the board is wired and the mosfets used.
Increase the error check to 10 amps.  This error checking is primarily
intended to catch "obvious misconfigurations" (eg, specifying
milli-amps instead of amps), and the new value of 10 amps should
suffice for this task.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-11-20 18:15:46 -05:00
vaxxi 3c8f202dfa
bmp280: Add support for BMP180 sensor (#6370)
Extends the BMxx80 category with support for the older BMP180 sensor, providing temperature and humidity output.

Signed-off-by: VAXXi Popescu <github@vaxxi.net>
2023-11-16 22:27:44 -05:00
Kevin O'Connor 29b7550ce5 pwm_tool: Add support for high-speed PWM pin updates
The output_pin module is only capable of updating an output pin at
most once every 100ms.  Add a new pwm_tool module that is capable of
queuing updates in the micro-controller and thus allowing for much
higher update rates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-11-16 22:07:15 -05:00
Thijs Triemstra 4688c21c54
klippy: Replace deprecated logger.warn with logger.warning (#6385)
Replace deprecated logger.warn with logger.warning

logger.warn will be removed in Python 3.13

Signed-off-by: Thijs Triemstra <info@collab.nl>
2023-11-16 22:06:13 -05:00
Pedro Lamas 9e765daeed bed_screws: Reset on move error
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-11-02 13:08:53 -04:00
Kevin O'Connor f7567a0db9 Revert "toolhead: Use dict for step generation flush times. (#6303)"
This reverts commit 6749985302.

A defect was found in the above commit (the input shaper code calls
note_step_generateion_scan_time() for many steppers, so the
input_shaper class can't be used as the index).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-10-21 15:46:08 -04:00
Viesturs Zariņš 6749985302
toolhead: Use dict for step generation flush times. (#6303)
Makes the API to extruder and input shaper more robust, avoiding the need to track the old delay.

Signed-off-by: Viesturs Zariņš <viesturz@gmail.com>
2023-10-19 13:28:16 -04:00
DavidvtWout 8ef0f7d7e3
spi_temperature: Limit maximum temperature in MAX31865.calc_adc() to melting point of platinum (#6320)
Limit the maximum temperature in MAX31865.calc_adc() to the melting
point of platinum. Above this temperature the Callendar-Van Dusem
formula does not make sense. The default value for max_temp is
99999999.9 and at this temperature the result of this formula is
negative. This sets max_sample_value to 0 which causes the mcu
to shutdown.

Set max adc value to (1<<15)-1 .  This is needed because the max value of the adc register
of the MAX31865 is 0b1111 1111 1111 1110 which represents
32767 and not 32768.

Signed-off-by: David van 't Wout <github@yoctobyte.nl>
2023-09-10 18:51:14 -04:00
FrY Sennberg 2acfa28294
tmc2240: Adding UART interface support to tmc2240 (#6305)
Signed-off-by:  Christoph Frei <fryakatkop@gmail.com>
2023-09-10 14:41:59 -04:00
bigtreetech ec1dcf3bd2 lis2dw12: Add support for lis2dw12 accelerometer
lis2dw12 is an accelerometer from STMicroelectronics(https://www.st.com/resource/en/datasheet/lis2dw12.pdf)
With better performance than the ADXL345 according to the datasheet.

Signed-off-by: XM.Zhou from BigTreeTech zhouxm@biqu3d.com
Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
2023-08-21 14:26:46 -04:00
Pedro Lamas ed66982b8e heaters: adds temperature monitors
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-08-01 20:32:03 -04:00
Michael Jäger 6f7c743615
temperature_combined: A class that can combine several other temperature sensors (#6230)
Signed-off-by: Michael Jäger <michael@mjaeger.eu>
2023-08-01 13:18:03 -04:00
Philippe Daouadi 039daecb4f
axis_twist_compensation: Add X twist compensation module (#6149)
Implements AxisTwistCompensation, and Calibrater

Supports calibration of z-offsets caused by x gantry twist

Modify PrinterProbe._probe function to check if the probed z value should be adjusted
based on axis_twist_compensation's configuration

Add documentation for [axis_twist_compensation] module

Signed-off-by: Jeremy Tan <jeremytkw98@gmail.com>
2023-08-01 13:08:53 -04:00
Stefan Dej ea330717cd screws_tilt_adjust: add max_deviation to report status
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-08-01 12:14:15 -04:00
Zarrsito d725dfd309
screws_tilt_adjust: Added Support for M6 Screws (#6287)
Added support for M6 Screws

Signed-off-by: Sascha Petersen <Zarrsito@gmail.com>
2023-07-16 22:30:37 -04:00
Eric Callahan b9247810b9 virtual_sdcard: reset file position and size to integer zero
This resolves an issue with API server clients that always
expect these values be be integers.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-06-23 20:33:42 -04:00
Eric Callahan d32a833455 bed_mesh: fix fade regression
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-21 21:17:17 -04:00
Eric Callahan 1ad4c0fd6e bed_mesh: improve zero reference offset
The relative_reference_index will now refer to a coordinate that is
static and cannot be changed at runtime.  If new mesh parameters
are specifed and the reference lies outside of the mesh then the
reference location will be probed.

Additionally this introduces a 'zero_reference_position' option which
accepts a specific X/Y coordinate.  This may be used in place of the
relative_reference_index.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-06-20 11:48:17 -04:00
Eric Callahan 775092fc01 bed_mesh: generate new points before each calibration
When mesh parameters change the substituted indices need to be
updated, even when using the default point set.   Always generate
new points to perform this update rather than cache
the "orig_points".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-20 11:48:17 -04:00
Alex Voinea 5ee72d320c tmc: Configurable `multistep_filt`
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-06-16 16:38:42 -04:00
BIGTREETECH 645a1b8364
i2c_software: Implementation of software i2c (#6141)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2023-06-07 20:55:46 -04:00
Dmitry Butyugin e15bad4844 input_shaper: Fixed tracking of step_generation_scan_time
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2023-06-06 20:17:49 -04:00
Dmitry Butyugin 345934bd68 idex_modes: Native input shaping support with dual carriages
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2023-06-06 20:17:49 -04:00
Eric Callahan 0539e9f266 bme280: use consistent report time for BME680
Sample the BME680 every .8 seconds, matching that of the
BME280.  This resolves an issue where `get_report_time_delta()`
returns a value that doesn't match the actual delta.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-05-31 13:43:07 -04:00
Dmitry Butyugin 624d360a34 resonance_tester: Apply input shaper params on SHAPER_CALIBRATE
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2023-05-25 12:52:29 -04:00
Dmitry Butyugin 16c53992d6 resonance_tester: Support CHIPS= parameter in SHAPER_CALIBRATE command
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2023-05-25 12:48:17 -04:00
Scott Mudge 10e816979e aht10: update comments and docs for AHT20/AHT21 support
The control bytes for the AHT20 and AHT21 are identical to the AHT10, but I had not been able to test just yet to ensure the sensor code supported the other sensors. I've wrapped up testing and updated the comments/docs to reflect this additional support.

Signed-off-by: Scott Mudge <mail@scottmudge.com>
2023-04-24 11:10:00 -04:00
Dr. Matthew Swabey 80a7744b42
sensor_mpu9250: Fix or improve reliability (#6170)
Fixes common MPU-9250 accelerometer issues for RPi Linux MCU and
improves reliability on all other architectures by adjusting the MPU-*
reading algorithm to only read whole Klipper messages' worth of
data from MPU-* and eliminating many unnecessary checks of the MPU FIFO
fill-level that consumed bus bandwidth needed for data transfer. Fixes
intermittent "Lost communication with MCU 'rpi'" due to "Timer too
close" and transposed / corrupted data due to FIFO overrun/data loss
when using MPU-* accelerometers. In addition FIFO overrun checks are
performed by testing the MPU interrupt flag vs. inferring from the FIFO
fill level.

Stress tested for 13hrs with two MPU-6500 attached to one I2C bus on RPi
    and one on a PR2040
Stress tested for 23hrs with two MPU-6500 attached to one I2C bus on RPi
    and one on a ATmega328P (Seeduino Nano)

Signed-off-by: Matthew Swabey <matthew@swabey.org>
2023-04-19 12:34:22 -04:00
Justin Schuh c2fe372925 gcode_macro: Catch variable encoding errors
Catch parsing and json encoding errors at variable assignment.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2023-04-19 12:22:20 -04:00
vcore85 c2b2278a49
tmc5160: add DRV_CONF Register for TMC5160 (#6154)
In some condition ,“drvstrength 2” does not work. According to page 17, some mosfets need “drvstrength” set to 0 .

From datasheet rev1.15, the DRVSTRENGTH reset default is 0 .  (instead of 2)

Signed-off-by: Albert Lin <vcore85@gmail.com>
2023-04-11 11:43:19 -04:00
Kevin O'Connor 83308a1051 tmc: Support reporting tmc2240 temperature in driver get_status()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 15:20:40 -04:00
Scott Mudge acca55b074
aht10: Added support for AHT10 ambient temperature sensor (#6138)
This commit adds support for the I2C-based AHT10 ambient temperature sensor. The sensor comes pre-calibrated and has a fairly simple command interface, so the interface class is in-turn relatively simple. So far this has been tested on a BTT GTR 1.0 MCU board (STM32F4), and seems to work fine.

Signed-off-by: Scott Mudge <mail@scottmudge.com>
2023-04-07 13:41:06 -04:00
Alex Voinea c9731a6fe2 tmc: DUMP_TMC optional REGISTER parameter
Add an optional REGISTER parameter to DUMP_TMC so that the output is more filtered/cleaner for manual TMC calibration.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-30 11:41:51 -04:00
BIGTREETECH 346e3901f6
tmc: Enable sg_angle_offset for smooth switching from Stealthchop to Spreadcycle (#6123)
Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
2023-03-27 21:18:06 -04:00
Alex Voinea 73f4c6cd00 tmc: SET_TMC_FIELD VELOCITY
Ability to specify `VELOCITY` as a parameter for SET_TMC_FIELD. Useful for configuring at runtime the TSTEP based fields of the driver.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-20 10:58:25 -04:00
Alex Voinea 0469710a69 tmc: Implement TMCtstepHelper
Implement a helper for calculating velocity based thresholds for tmc drivers. This code was written in such a way that it can be used with more fields than just tpwmthrs.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-20 10:58:25 -04:00
Kevin O'Connor c54d83c9f1 tmc: Initialize self.coolthrs in TMCVirtualPinHelper constructor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-15 16:46:35 -04:00
Alex Voinea a9feeaa9eb tmc: Do not override tcoolthrs if it is configured
If tcoolthrs is configured (not the default 0), then do not force
the value of tcoolthrs=0xfffff during homing. This way, tcoolthrs
can be set to a custom value during homing.

`tpwmthrs` and `en_pwm_mode`/`en_spreadcycle` are now also
correctly restored if they were changed after startup.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-15 16:45:36 -04:00
Alex Voinea dd39091388 tmc: Enable `multistep_filt` for drivers that support it
`multistep_filt` was not configured at all on tmc2240 and tmc5160. As such, it would default to the value of 0 when the GCONF field was sent to the driver. However, that field has a default value of 1 in the driver, so klipper was overriding the defaults by accident.
This field improves the stability of velocity based thresholds (it's effectively TSTEP filtering) and it also improves the current regulation stability in stealthchop2 (according to the datasheet).
This field was already set to 1 correctly in the tmc2208/tmc2209 driver code.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-15 11:09:10 -04:00
Alex Voinea 117c1d42ac tmc2209: Remove duplicate `pdn_disable` initialization
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-15 11:06:24 -04:00
Pedro Lamas 87f109984a probe: expose name on status report
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-03-14 21:11:33 -04:00
Lasse Dalegaard ca6e5fe514 probe: Allow overriding horizontal_move_z on gcode
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2023-03-14 21:01:40 -04:00
Alex Voinea 4b1536d62f tmc: Beautify initialization code
Purely esthetic. Make all tmc driver init code similar to one another. The various fields were grouped based on the register which they affect or the function they perform.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-07 10:57:01 -05:00
Alex Voinea bee1c67416 tmc5160: allow changing the globalscaler at runtime
Previously, the globalscaler was calculated during the config parsing and set to a fixed value. If the current was changed for any reason after the initialization, only IRUN and IHOLD would be changed. This however caused issues:
- If the new current was lower, then the resolution of the possible current values would be low since there are only 32 IRUN/IHOLD steps.
- If the new current was higher, it wouldn't actually work since IRUN and IHOLD are capped at 31, so it wouldn't be possible to increase the current without increasing globalscaler.

With this commit, the globalscaler is recalculated whenever necessary in order to ensure the correct range of IRUN/IHOLD is used.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-07 10:55:44 -05:00
Alex Voinea e6307ca9fe tmc: Fix s2vs field formatters
Rename the field formatter text for tmc2208/tmc2209 and implement it also for tmc5160.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2023-03-07 10:52:52 -05:00
Alex Voinea 6b75f54e50 tmc2240: initial implementation
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-03-01 20:43:53 -05:00
Pedro Lamas 4b5d056421 stepper_enable: report status
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-02-13 12:16:17 -05:00
Pedro Lamas fa78e6b8fb screws_tilt_adjust: status result as dictionary
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-02-03 18:16:19 -05:00
Eric Callahan 4df1adeb2e bed_mesh: do not load a profile on startup
Some users may not desire this behavior and others
may wish to initialize to a profile not named default.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-01 11:07:16 -05:00
Kevin O'Connor 6026a99ad8 replicape: Only call note_pwm_enable() in main thread
The pca9685_pwm set_pwm() code can be called from a background thread
(when the pin controls a heater).  Propagate updates to the main
thread for enable tracking.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-17 18:39:47 -05:00
Kevin O'Connor 86acee6e8b z_tilt: Improve python3 compatibility
Sort using comparison on only first item in list to avoid greater/less
than comparison of stepper objects (which causes an error on Python3).

Reported by discourse user salbang.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-17 18:11:57 -05:00
Clifford Roche 40d8c2ef16 palette2: Fix errors with bad handling of NoneType in a few locations
Issue specific to Python 3, NoneType is being used to compare heartbeat time (actually caused by invalid condition operator), and by returning NoneType in timer functions.

Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
2022-12-31 21:03:37 -05:00
Alex Voinea 9b60daf62d
tmc: Configurable microstep lookup table (#5920)
Make all the microstep lookup table registers configurable via the
config file. It also loads the default values.
TMC220x and TMC2660 do not support this feature.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
2022-12-21 21:23:23 -05:00
janherich f078a27905 manual_probe: Add Z_OFFSET_APPLY_ENDSTOP for delta
Current Z_OFFSET_APPLY_ENDSTOP command only works for printers
with cartesian architecture which have separate Z axis defined.
But this functionality (persisting Z babystep value to endstops)
is exactly as convinient for delta printers, therefore this
PR implements it.

Signed-off-by: Jan Herich <jan.herich@gmail.com>
2022-12-19 13:14:06 -05:00
Keyan Mobli 8621ebbed2
bed_mesh: Allow bedmeshing at 1mm spaced intervals (#5918)
Signed-off-by: Keyan Mobli <keyan@kmobli.com>
2022-12-19 11:14:45 -05:00
theophile 2a25733cd8
screws_tilt_adjust: Add get_status() method (#5921)
Signed-off-by: Christopher Meredith <chmeredith@gmail.com>
2022-12-17 11:39:25 -05:00
maze 347dfa58ea
gcode_arcs: Allow either one of I, J, K to be default-zero on G2/G3 (#5939)
Signed-off-by: Wijnand Modderman-Lenstra <maze@pyth0n.org>
2022-12-14 12:06:11 -05:00
Justin Schuh 201f715b55 save_variables: Verify filename path is writeable at startup
Signed-off-by: Justin Schuh <code@justinschuh.com>
2022-12-11 21:07:47 -05:00
Kevin O'Connor ba365aff96 gcode_arcs: No need to import gcode module to access Coord()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-11 20:59:02 -05:00
Andrew Mirsky 0c5c87d7c0 gcode_arcs: support XY, XZ and YZ planes
add G17, G18 and G19 commands to select arc planes
enhance G2/G3 to support arc moves in XY, XZ and YZ planes

Signed-off-by: Andrew Mirsky <andrew@mirsky.net>
2022-12-11 20:55:59 -05:00
bigtreetech a42f615881 stm32: add STM32H723 support
Signed-off-by: Chen.BJ from BigTreeTech chenbj@biqu3d.com
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-02 13:55:23 -05:00
Matt Baker c5d56f4438 stm32g4: implement build,usb,can,i2c,spi,serial,adc.
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-12-02 11:31:42 -05:00
redstone99 14eec15267
safe_z_home: Fix final z hop to use relative z coordinates (#5879)
After a G28 z-axis homing, there is a final z hop.
It was hoping to height z_hop as an absolute z height rather than relative.

If the z-axis home leaves the head at a z height higher than z_hop,
e.g. because you were using a probe to do z homing,
this meant that it was z hopping in the negative z direction, which
could result in crashing the toolhead.

Signed-off-by: Joshua Redstone <redstone@gmail.com>
2022-11-22 18:55:43 -05:00
Yifei Ding d17ef95a3c
mpu9250: add MPU6500 (#5767)
Signed-off-by: Yifei Ding <yifeiding@protonmail.com>
2022-11-19 09:58:24 -05:00
Eric Callahan 5e34b45063 bed_mesh: disallow null profile names
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-11-11 14:27:47 -05:00
Grigi 342d3f1414 menu: Conditional display of common Control utils
This will hide features in the Klipper Display menu that isn't applicable
for the machine, therefore we can add extra alignment tools in the Control
menu as well.

Also conditionally displays Setup/Calibration options.

Signed-off-by: Nickolas Grigoriadis <nagrigoriadis@gmail.com>
2022-11-03 16:05:24 -04:00
Dmitry Butyugin 96ea871b35 adxl345: Apply correct scaling for X,Y and Z axes
According to ADXL345/ADXL343 datasheets, at 3.3V supply voltage,
which is most frequent in the various boards, the sensitivity of
X and Y axes changes to 265 LSB/g from 256 LSB/g at 2.5V.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2022-10-25 14:41:00 -04:00
Kevin O'Connor bdf79caac4 atsamd: Add Kconfig definitions for same51j19 and same54p20 chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 11:27:14 -04:00
Stefan Dej b0ffb269d2
print_stats: add `SET_PRINT_STATS_INFO` G-Code for pass slicer variables to Klipper (#5726)
This adds a gcode command that can be used insight the slicer to pass the total layer count and current layer information.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2022-10-05 15:02:28 -04:00
alchemyEngine a2482d4f95 z_thermal_adjust: get_temp hotfix
M105 expects get_temp method. Module crashes when gcode_id parameter
is set and M105 called. Add methods as hotfix.

Signed-off-by: Robert Pazdzior <robertp@norbital.com>
2022-09-30 11:19:01 -04:00
alchemyEngine 34870d3e2a
z_thermal_adjust: Add Z thermal adjuster module (#4157)
Use a frame-coupled temperature probe to compensate for thermal
expansion in real-time.

Signed-off by: Robert Pazdzior <robertp@norbital.com>
2022-09-25 12:39:14 -04:00
Kevin O'Connor 51da02b7f8 thermocouple: Only shutdown on multiple consecutive sensor errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-23 11:56:20 -04:00
Kevin O'Connor ec5719585e spi_temperature: Separate out fault handling from temperature calculation
Introduce a new handle_fault() method to handle processing of sensor
faults.  This simplifies the calc_temp() methods.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-23 11:56:18 -04:00
Kevin O'Connor 4e930294b8 thermocouple: Report fault information in fault field
Send the fault information explicitly in the query_thermocouple fault
field for max6675, max31855, and max31865.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-23 11:55:43 -04:00
Matt Baker d9c917b950 stm32l4: add stm32l412 support with adc,i2c,spi,usb
Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
2022-09-15 11:51:26 -04:00
Pedro Lamas f4440267e6 virtual_sdcard: read new lines as-is
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2022-09-11 21:43:43 -04:00
Kevin O'Connor f6a166cb67 tmc: Improve error on missing stepper section
If a tmc driver can't find the stepper config section it reports a
"missing microsteps" error which can be confusing.  Provide a more
explicit error message.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-09-05 13:55:19 -04:00
dalegaard 9f8f3cd77d
fan: add enable_pin option (#5732)
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2022-09-03 12:23:55 -04:00
jake-b ae6c16422f
mcp4018: Add SET_DIGIPOT command to mcp4018 implementation (#5737)
Added a SET_DIGIPOT command to the mcp4018 implementation.
Previously the mcp4018 was read only, and set at the time of
configuration.  This allows you to change the value during a
print, which is needed for some older printers that need to
lower the stepper current during preheating.

Signed-off-by: Jake Bordens <jake@allaboutjake.com>
2022-09-02 10:30:06 -04:00
Dmitry Butyugin 5d9ff75d02 extruder_stepper: Support configuring pressure advance from config
Also added status report for extruder_stepper objects with the
current pressure advance parameters values.

Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2022-09-01 14:53:12 -04:00
MapleLeafMakers 83ab6fbae5 save_variables: Do not write to console when variables are saved
Removes a call to gcmd.respond_info which writes 'VARIABLE SAVED' to the
console every time the SAVE_VARIABLE command is called.

Signed-off-by: Andre LeBlanc <mapleleafmakers@gmail.com>
2022-09-01 13:18:55 -04:00
Clifford Roche ce27d35924 palette2: Fix UART encoding
Raised from issue #5645, UTF-8 encoded symbols or other unexpected symbols on the UART raise an exception which causes klipper to stop. This change support UTF-8 encoded characters (from file names) as well as ignoring unexpected bytes.

Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
2022-08-19 14:12:51 -04:00
Kevin O'Connor 2293e1506f canbus_ids: Use 4 as the first nodeid to reduce id bitstuffing
Starting with nodeid 4 instead of nodeid 0 can reduce bitstuffing of
the id field in common configurations.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-29 11:40:54 -04:00
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
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
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
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