Commit Graph

2453 Commits

Author SHA1 Message Date
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
Kevin O'Connor 22ee889f41 serialqueue: Rename stalled_bytes stat to upcoming_bytes
The stalled_bytes counter refers to the number of bytes that are not
yet eligible for transmission.  However, the naming leads to confusion
as it could be interpretted as an inability to transmit data.  Rename
to upcoming_bytes to try to avoid that confusion.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-07 15:17:43 -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
D4SK 0d5b96a601 reactor: Fix typo
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2023-03-14 22:08:13 -04:00
D4SK 136283bd14 reactor: Fix typo
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
2023-03-14 22:08:13 -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
Kevin O'Connor d881171739 mcu: Move lookup_command_tag() to CommandWrapper class
Use mcu.lookup_command().get_command_tag() instead of
mcu.lookup_command_tag().  This improves error reporting on a protocol
mismatch.  It also enables support for a msgtag that is negative.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-02-22 11:34:36 -05:00
Kevin O'Connor 69dcda1696 mcu: Code movement in mcu.py
This is code movement and comment updates only - no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-02-22 11:34:31 -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
Jordan Woyak 1e7057e917
configfile: Make getlists return an empty list on empty string. (#6042)
Signed-off-by: Jordan Woyak <jordan.woyak@gmail.com>
2023-02-09 21:41:09 -05:00
Pedro Lamas da8d4b0231 extruder: store currently sync'ed motion queue name
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
2023-02-09 16:51:47 -05:00
CODeRUS 791ad6162a
extruder: Add extruder name to extruder_stepper respond message (#6020)
Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
2023-02-03 18:50:56 -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
Kevin O'Connor bca2671efb toolhead: Flush in chunks from flush_step_generation()
If note_kinematic_activity() has a time far in the future it could
result in a single flush attempt of that time range.  Be sure to break
up that range into small chunks using the normal _update_move_time()
mechanism.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-08 10:40:52 -05:00
Kevin O'Connor 52b33c1b81 toolhead: Rename last_kin_flush_time to force_flush_time
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-08 10:40:52 -05:00
Kevin O'Connor bd2a849566 toolhead: Fix note_kinematic_activity()
It was possible a note_kinematic_activity() call could increase
last_kin_move_time, but _process_moves() could reset it.  Fix by
making sure _process_moves() only ever increases last_kin_move_time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-08 10:40:52 -05:00
Kevin O'Connor f1203d56f6 chelper: Minor declaration movement in __init__.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 23:17:37 -05:00
Kevin O'Connor 4ea11dbb4f trapq: Minor code movement in trapq.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 14:13:00 -05:00
Kevin O'Connor 01f90e8f28 console: No need to import pins module
The pins module is no longer used in console.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-07 12:00:16 -05:00
Kevin O'Connor 4395ae96a7 serialhdl: Add a get_serialqueue() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-06 11:59:35 -05:00
Kevin O'Connor a564824009 serialqueue: Add comment to do_write()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-01-05 03:09:43 -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
janherich 29ba5ab05a delta: Better delta build volume constraint check
Existing code uses very restrictive build volume constraint checking
with just narrow cone on top of fully cylinder for delta printers.

Code here implements more permissive and still safe build volume
constraint checks.

Signed-off-by: Jan Herich <jan.herich@gmail.com>
2022-12-30 21:39:32 -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
Kevin O'Connor 336cc92a0a parsedump: Support running on both python2 and python3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-07 14:31:03 -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