Skip to content
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

TMC2209 needs to be reinitialized after sensorless homing #20

Open
troth530 opened this issue Jan 27, 2025 · 4 comments
Open

TMC2209 needs to be reinitialized after sensorless homing #20

troth530 opened this issue Jan 27, 2025 · 4 comments

Comments

@troth530
Copy link

troth530 commented Jan 27, 2025

Sensorless homing works for a single axis but afterward requires a M122i command before hard limits will work for stall detection when it hits a hard stop. Also, homing X and Y axis for instance in the same cycle ($44=3) will result in sensorless homing not working. What happens is diag pin will trigger on the first axis which hits a hard stop during the seek operation, but diag pin will not trigger on the second axis and the homing operation will not complete. I believe these are part of the same issue. For now my workaround is set $44=1 and $45=2 and after a homing cycle issue M122i. In this case homing completes and hard limits are triggered when it hits a hard stop. This is of course with the correct limit settings as well as the correct thresholds that work for single axis homing.

I am testing on ESP32 S3 on a single pin UART for all 4 drivers.

Thank you!

@terjeio
Copy link
Contributor

terjeio commented Feb 4, 2025

I just have commited an update that may work better, more info here.

I still do not have a board to test StallGuard homing with TMC2209 drivers, they are special in that the diag output is not open drain like the other drivers I have so are not possible to wire-or with regular limit switches.

@troth530
Copy link
Author

troth530 commented Feb 10, 2025

Hi @terjeio, I am unable to test for now as I got stuck on an issue with your latest changes.... seems USB_SERIAL_CDC is now crippled. During linking I get an error, odd that it reports the error a few lines before the function call. Setting USB_SERIAL_CDC to 0 is able to compile, I only get this error when attempting to use USB_SERIAL_CDC = 1 (S3 native USB). I've found UART to USB bridges are unreliable for my application.

Image

Can you please look into this. Thank you!

@terjeio
Copy link
Contributor

terjeio commented Feb 10, 2025

It is a regression from the last PR, move this line to line 33 to fix.

@troth530
Copy link
Author

It is a regression from the last PR, move this line to line 33 to fix.

Thanks, that fixed USB_SERIAL_CDC issue. I will test and report back later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants