-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] UART_ENDSTOPS for TMC2209 #24755
Comments
|
uart to tmc2209 is software serial on most controllers. Ie really slow and cpu intensive... |
@ellensp how about if the sanity check throws a warning if you try to enable it on a non-hw serial based controller? Currently I'm doing testing on an esp32, so it has a dedicated hardware serial port (Serial2 in my case) for both controllers. |
@ellensp when/if teemuatlut/TMCStepper#231 and something such as skruppy@c53622b land, it'll allow a path to avoid the hard dependency on software serial on platforms that can do it in hardware. I have a RAMPS board running quite happily with 4 TMC2209's on hardware UART with: So while it is presently software on many controllers, I think it's a really unfortunate code shortcoming more than anything else. @cryptoAlgorithm presently the TMC library has a dependency on the software serial library. It stops some platforms from using hardware serial even when it's available. The best summary/solution of the issue I have found so far is in the PR above. |
@phizev, great to hear from your experience. I'm currently in the prototype stage with 2 TMC2209s hooked up to nema17 motors and an esp32 on a dev board. Currently im using a haphazard method of hooking up a jumper from the DIAG pin of the jumpers to the end stop pins on the esp32. My config is exactly the same as yours, and as far as I can test, sensorless homing works reliably, albeit with the need of a jumper. Regarding the dependency on the software serial library, wouldn't features such as switching from spreadCycle to stealthChop require the TMC library as well? Doesn't that mean it already stops some platforms from using hw serial for that functionality? If UART communication is already enabled, the TMC library is already used, so using the library to poll the DIAG status thru UART wouldn't incur further functionality loss, no? |
If I'm given the go-ahead, I could try drafting a PR, too |
anyone can create a PR, |
@ellensp Yes, but I wouldn't like spending time on a feature thats flat out not going to be accepted |
Yep, that's the exact reason for teemuatlut/TMCStepper#231 and skruppy@c53622b so that more platforms can use hardware serial instead of software.
Using software serial has a high overhead, it's not that functionality is lost. Marlin cannot be compiled with MONITOR_DRIVER_STATUS for that reason. Unfortunately, I don't think there is anything we can do to speed along an update to the TMC library to allow more platforms to use hardware serial with the TMC drivers. I've found using hardware serial to be far more reliable with TMC 2209's as well. @ellensp would using software serial for stallguard endstops only have an effect while homing by default? Is it common to have endstops always enabled while printing? |
@phizev I believe |
I haven’t checked the code to see if it’s compatible with |
@thisiskeithb the software serial library used by the TMC library is incompatible with ENDSTOP_INTERRUPTS. This means Marlin has to constantly poll when ENDSTOPS_ALWAYS_ON_DEFAULT is used with TMC2209's on AVR, and likely other platforms. I almost abandoned using TMC serial drivers due to this as the performance tanked, and I think having endstops always enabled is a safety necessity. As it stands, TMC2209 and AVR (and other affected platforms which can't brute force with processing power) have the following issues due to unnecessarily forcing software serial:
So when using the TMC library, we can only use endstops while homing on some boards. @ellensp would polling with software serial only while homing be an issue? |
@hisiskeithb the doc comment right above the
|
@phizev I would suppose adding such a feature would make most sense if it was only enabled during homing, if performance while using software serial is as bad as you've described. I suppose, throwing warnings or even errors in the sanity check if this feature is enabled and sw serial is used would be an acceptable mitigation, so the user is well aware that this would very likely tank performance. I believe, with more manufacturers moving to ARM-based boards, this would be less of an issue in the future, hence adding it as a feature now would make it more convenient for future users down the road. |
Yes, but you can still enable |
@thisiskeithb I'm not sure enabling |
My two cents: I think this would be useful for boards with sufficient capabilities (I'm for example using a board with 4 TMC2209 with HW serial, and having the endstop pins available for other things would be a win. I'm also using 115200 baud/s so for X/Y homing on cartesian printers the small delay shouldn't really be an issue. |
Is your feature request related to a problem? Please describe.
Marlin has experimental support for
SPI_ENDSTOPS
, which negates the need for hardwiring a wire from DIAG0 to end stop pins. However, certain Trinamic drivers which also support StallGuard, such as the TMC2209, communicate thru serial and hence does not work with theSPI_ENDSTOPS
feature.Are you looking for hardware support?
Endstop polling thru Serial for Trinamic drivers that communicate thru serial and support StallGuard - e.g. TMC2209
Describe the feature you want
I'm proposing a feature similar to
SPI_ENDSTOPS
, but thru serial. It should require minimal changes, and an additional config flag (SERIAL_ENDSTOPS
or similar). Polling the driver status thru Serial is very similar to polling thru SPI, and would require only very small changes toendstops.cpp
. I can open a PR implementing the changes if need be.Additional context
No response
The text was updated successfully, but these errors were encountered: