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

[BUG] TMC2209 Sensorless Homing not working #14464

Closed
TheNitek opened this issue Jul 1, 2019 · 120 comments
Closed

[BUG] TMC2209 Sensorless Homing not working #14464

TheNitek opened this issue Jul 1, 2019 · 120 comments

Comments

@TheNitek
Copy link
Contributor

@TheNitek TheNitek commented Jul 1, 2019

Description

I installed TMC2209 from Fysetc on my SKR 1.3 of my CoreXY and tried to get sensorless homing to work. UART connection works fine, but X and Y endstops always show as "TRIGGERED".
Jumpers on the SKR are closed any I ensured that there is an electrical connection between the DIAG pin and the endstop.
I varied sensitivity from 0 to 250, but nothing changed.

Steps to Reproduce

Most recent Marlin 2.x bugfix
G28 XY

Expected behavior: Axis home

Actual behavior: Axis don't move, X/Y endstops are triggered

Additional Information

Marlin.zip

@Ludy87
Copy link
Contributor

@Ludy87 Ludy87 commented Jul 1, 2019

try reversing * _ENDSTOP_INVERTING

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 1, 2019

I tried, but the sanity check won't let me:
"SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."

@Ludy87
Copy link
Contributor

@Ludy87 Ludy87 commented Jul 1, 2019

maybe @teemuatlut can say something, why the behavior does not correspond to the TMC2130

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 1, 2019

In SanityCheck.h it says

  // Stall detection DIAG = HIGH : TMC2209
  // Stall detection DIAG = LOW  : TMC2130/TMC2160/TMC2660/TMC5130/TMC5160
  #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209)

so I guess this is as intended. TMC2209 says HIGH is triggered, so I guess the above should be correct

@BioGeekJoey
Copy link

@BioGeekJoey BioGeekJoey commented Jul 1, 2019

Does it work with sensorless homing uncommented in the config? Someone else on a BigTreeTech FB group was having issues with a CoreXY too.

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 2, 2019

Just tried again and now the printer moves (not having a good sensitivity yet). I wonder if a power cycle was necessary. I'll try to investigate further ...

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 2, 2019

Interesting: Resetting the SKR (via the reset button) does NOT reset the TRIGGER state of the TMCs. Right now my Y-Stepper is triggered forever

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 2, 2019

Maybe this is similar to #8890 ?

@BioGeekJoey
Copy link

@BioGeekJoey BioGeekJoey commented Jul 2, 2019

I noticed that after a power cycle (actual unplug, not the reset button) all (any all everything, not just TMC driver settings) are set to 0 even though the correct values are stored in eeprom and loading the eeprom manually (M501 or via lcd) will fix it.

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 3, 2019

I don‘t think this issue is related. After power on my settings are just fine.this is only about the TMCs

@thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Jul 3, 2019

It's possible that the stepper init for 2209 is still missing a step. We'll have to see whether it's a problem with TMCStepper or within tmc_util.* in Marlin.

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 3, 2019

Hey, im having exactly the same issue except my endstops are now reading "open" on X/Y but the motor just stutters as if its sensitivity to sensorless homing is very low?

I have adjusted sensitivity from 0-255 and even taken the belt off my XY but the motor still just turns maybe 2/5mm before stopping on a home command?

this is very bizzare as i can read positive voltage from TMC2209 DIAG1 to Xmin signal pin?

running SKR 1.3 /TMC2209/ COREXY just as OP

heres my M122

14:29:08.452 : X Y E
14:29:08.452 : Address  1 1 1
14:29:08.452 : Enabled  false false false
14:29:08.452 : Set current 800 800 900
14:29:08.561 : RMS current 795 795 887
14:29:08.561 : MAX current 1121 1121 1251
14:29:08.561 : Run current 25/31 25/31 28/31
14:29:08.561 : Hold current 12/31 12/31 14/31
14:29:08.561 : CS actual  12/31 12/31 14/31
14:29:08.671 : PWM scale 35 31 16
14:29:08.671 : vsense  1=.18 1=.18 1=.18
14:29:08.671 : stealthChop true true false
14:29:08.671 : msteps  16 16 16
14:29:08.782 : tstep  max max max
14:29:08.782 : pwm
14:29:08.782 : threshold  29 29 271
14:29:08.782 : [mm/s]  123 123 30
14:29:08.782 : OT prewarn false false false
14:29:08.782 : OT prewarn has
14:29:08.782 : been triggered false false false
14:29:08.782 : off time  4 4 4
14:29:08.891 : blank time 24 24 24
14:29:08.891 : hysteresis
14:29:08.892 : -end  2 2 2
14:29:08.892 : -start  1 1 1
14:29:08.892 : Stallguard thrs 3 4 0
14:29:08.892 : DRVSTATUS X Y E
14:29:08.892 : stst  * * *
14:29:09.000 : olb
14:29:09.000 : ola
14:29:09.000 : s2gb
14:29:09.111 : s2ga
14:29:09.111 : otpw
14:29:09.111 : ot
14:29:09.111 : 157C
14:29:09.222 : 150C
14:29:09.222 : 143C
14:29:09.222 : 120C
14:29:09.222 : s2vsa
14:29:09.222 : s2vsb
14:29:09.222 : Driver registers:
14:29:09.222 : X 0xC0:0C:00:00
14:29:09.222 : Y 0xC0:0C:00:00
14:29:09.223 : E 0x80:0E:00:00
14:29:09.223 : Testing X connection... OK
14:29:09.331 : Testing Y connection... OK
14:29:09.331 : Testing E connection... OK
14:29:09.331 : ok

any help would be appreciated!

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 3, 2019

Interesting, even with a manual switch endstop override im only getting "Open" status, can somebody explain the need for enabling "#define SENSORLESS_HOMING"?

im assuming this is only necessary for the TMC drivers themselves? and does not influence the actual endstop configuration in any way? - i say this because when hooking up a z probe in Z-min for example no software change is necessary?

thanks!

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 5, 2019

Ok that's strange (CODEPENDENT_XY_HOMING off for now):

G1 X1
ok
M119
Reporting endstop status

x_min: open
y_min: TRIGGERED
z_min: open
ok
G1 X1
ok
M119
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
G1 X-1
ok
M119
Reporting endstop status
x_min: open
y_min: TRIGGERED
z_min: open
ok
G1 X-1
ok
M119
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 5, 2019

Next observation:
I did

G1 Y1
M119

a few times (in relative mode) and that's what I got:

ok
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: TRIGGERED
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: TRIGGERED
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: TRIGGERED
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: open
z_min: open
ok
ok
Reporting endstop status
x_min: open
y_min: TRIGGERED
z_min: open
ok

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 5, 2019

I tried to reflash and I got USB not recognised so in the end I returned the board and now have a replacement, I'll check to see if behaviour is the same tomorrow hopefully

@sn4k3
Copy link

@sn4k3 sn4k3 commented Jul 6, 2019

Getting same problem, tried many things but it's always TRIGGERED. However if i return to mechanical endstops it works. If // Stall detection DIAG = HIGH : TMC2209, the pullup doesnt make sense.
Also the TMC2209 on E not working with LIN_ADVANCE ON and SQUARE_WAVE_STEPPING OFF

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 8, 2019

I set up a bench test today with the new SKR 1.3, going to check these, i also have a new revision of TMC2209's (FYSETC V2.1) they seem to be setup differently to my FYSETC V2.0 so ill give them a whirl as well

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Jul 8, 2019

Can you post pictures of V2 and V2.1 so I can compare?

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 8, 2019

So please forgive my potato vision camera: https://imgur.com/a/cGOylQL

the only difference i can see visually on the V2.1 is the two 0 Ohm resistors across the PDN Line jumper pads instead of the single one on the V2.0

However, looking at the IC itself they have done a much better job soldering it on the V2.1 boards i have recieved with the markings clearly visible compared to the V2.0 - i hope they didnt wash these boards lol

also i found latest Marlin 2.0 sometimes when flashed with Platform.io bricks the SKR 1.3 - had to reflash Smoothie binary included in the bigtreetech github folder back to the flash storage and recompile fresh version of marlin 2.0 one setting at a time, not sure if its an actual setting within Marlin yet. kept coming up with unrecognised USB device and i triple checked the serial settings?

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 8, 2019

ok so I think I narrowed it down to #define PIDTEMPBED, enabling this stops my SKR from working? im sure i had it enabled before though.

@VOIDREP
Copy link

@VOIDREP VOIDREP commented Jul 8, 2019

Ok it just gets weirder and weirder, got the V2.1 TMC2209 drivers installed and got no UART on any of them, replaced it with a known good V2.0 and got UART...so I buzzed out the 0 OHM resistors... nothing... no circuit.

solder bridged over the 0 Ohm resistor...all working fine on UART!

id inspect the jumper 0 ohm resistors on the FYSETC TMC2209 boards if your having UART issues

i would check the DIAG resistors/links but its pretty late, If my sensorless endstops still dont work thats the next thing im going to inspect.

@spazwart
Copy link

@spazwart spazwart commented Jul 10, 2019

I kinda have the same sort of problem.
I don't want to use stallguard yet so i have my default ender3 endstops.
The endstops only work when i remove the tmc2209 from my skr1.3
If i hold the endstop, press m119 i see triggered, if i let go it says open, all good
When i add my tmc2209 to the board, do the same thing, the endstop status allways stays open
Stallguard is disabled i guess?
m122: Stallguard thrs 0 0 0 0

@teemuatlut
Copy link
Member

@teemuatlut teemuatlut commented Jul 10, 2019

Pull out the diag jumpers.

@spazwart
Copy link

@spazwart spazwart commented Jul 10, 2019

Pull out the diag jumpers.

Thank you so much!

This solved all my problems, I feel so dumb!
Thanks again!!

@sn4k3
Copy link

@sn4k3 sn4k3 commented Jul 11, 2019

@spazwart What board you use? I have SKR1.3 + ender3 and endstops work without remove diag jumpers. While i have sensorless home ON they don't work and printer react to mechanical endstops. If i remove endstop cable it's always triggering

@spazwart
Copy link

@spazwart spazwart commented Jul 11, 2019

@sn4k3 I have the SKR1.3, I have my config in github.
I put the endstop cables on the SKR in the G and S pins in the endstop min pins.

@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Sep 23, 2019

I fixed the board issue with my skr 1.3. I got sensorless homing working for a while then it stopped working ! I did however have to disable hybrid threshold, Ive subsequently changed around the settings and have toggled it, back to the state where I had previously made it to work, and now its not working. So I can both confirm that it should work, but its not working, and its not in a state where it should work either. I think the issue lies in the firmware as its not reliable at all on the skr 1.3.

@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Sep 23, 2019

@paulpenney I think the fystec rep that was onto you is misinformed, My v2.1s required me to solder a solder connection between the TX and RX pins to get UART working.

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Sep 23, 2019

If I remember correctl the hybrid threshold is set to 0 during (sensorless) homing anyway.

I don‘t think it is the SKRs fault, since sensorless homing works just fine using the Bigtreetech TMC2209. My guess would a (design) problem on the Fysetc drivers.

@3D-DIYde
Copy link

@3D-DIYde 3D-DIYde commented Sep 23, 2019

I can confirm that the Hack suggested by @thisiskeithb works perfectly fine on my MKS SGEN_L with Watterott V2.0 drivers. But I could not manage to get sensorless homing working with the MKS 2209 drivers, no matter what I tried. So I ended up with Watterott drivers on X and Y and MKS drivers on Z and E. UART is no issue on either of the drivers.

Also in the meantime I got a statement from a Makerbase Rep on this issue:

2209 seems to be unable to achieve senorless homing normally. Because before this was only tmc2130 normal function. However, the latest version of marlin2.0 confirmed the option to add 2209 senorless homing. However, after our tests, it seems that this function can not be implemented normally, and some parts may not be able to be implemented normally. After all, the 2209 chip has just been released for several months. We have feedback with marlin, and we are thinking of ways.

@Sjoerd
Copy link

@Sjoerd Sjoerd commented Sep 23, 2019

If I remember correctl the hybrid threshold is set to 0 during (sensorless) homing anyway.

I don‘t think it is the SKRs fault, since sensorless homing works just fine using the Bigtreetech TMC2209. My guess would a (design) problem on the Fysetc drivers.

I bought BTT's TMC2209 drivers, will try it later this week :)

@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Sep 23, 2019

If it was a hardware issue it would either work or not work, The fact that I got my Fystec v2.1 to work for a while before reuploading the exact same firmware and it breaking, that would indicate that the issue is an issue in the code, Specificly in the implementation of the Stallguard4 version

@RABZY88
Copy link

@RABZY88 RABZY88 commented Sep 28, 2019

Sensorless-2209

The Red boxes represent the header jumpers to be fitted for X and Y homing
The Orange lines are where they are wired to onboard.

I just checked on my SKR1.3

So thanks to your picture and video I watch I've figured That by soldering 1 pin to the drivers it should work
[
pin (2)
skr1 3
pin (1)

I have watched this video https://www.youtube.com/watch?v=dOJbSrWVu_Q configure everything as he has set the sensitivity to 50 now it works.

](url)

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Sep 28, 2019

Nope, did that, did not work. That‘s just the normal setup you have to do for the SKR and that‘s exactly the setup which doesn‘t work.

@RABZY88
Copy link

@RABZY88 RABZY88 commented Sep 28, 2019

Mine is working I am just setting the right sensitivity now
Screenshot (29)

@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Oct 5, 2019

Can anyone confirm that it works when hybrid threshold is set to 0?

@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Oct 7, 2019

@TheNitek can you enable hybrid threshold for x and y and set them both to 0 then play around with sensorless homing sensitivity. I have mine working around ~65.

@boelle
Copy link
Contributor

@boelle boelle commented Oct 24, 2019

@TheNitek still having issues?

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Oct 24, 2019

I don't know - I switched to Bigtreetech Drivers instead of the Fysetc and it worked. I don't plan to invest more time in crappy drivers.

@boelle
Copy link
Contributor

@boelle boelle commented Oct 24, 2019

so that was the only change? ie the driver itself, what changes in config if any?

@boelle
Copy link
Contributor

@boelle boelle commented Oct 30, 2019

@TheNitek will close this one as it seems mostly to be bad hardware

we can always reopen if there is an issue we can figurre out

@boelle boelle closed this Oct 30, 2019
@michaelduffy123
Copy link

@michaelduffy123 michaelduffy123 commented Oct 31, 2019

@boelle Can you figure out why the sensorless homing will work for me when hybrid threshold is set to 0 only? As Id like to have sensorless homing working and also have hybrid threshold be a thing

@Sjoerd
Copy link

@Sjoerd Sjoerd commented Nov 1, 2019

@michaelduffy123 doesn't work for me..

@bgutsev
Copy link

@bgutsev bgutsev commented Dec 6, 2019

It is working for me (FINALY): The problem was that everywhere it is written to connect Drivers DIAG1 to end stop pin. I have tried DIAG0 (nearest to EN - as advised above #14464 (comment)) and it is working!!! Happy!
Watterott tmc2209 (on X and Y) with RAMPS 1.4.

Configuration.h

#define ENDSTOPPULLUPS

#define X_MIN_ENDSTOP_INVERTING false
#define Y_MIN_ENDSTOP_INVERTING false

#define X_HOME_DIR -1
#define Y_HOME_DIR -1

Configuration_adv.h

#define STEALTHCHOP_XY
#define STEALTHCHOP_Z
#define STEALTHCHOP_E

#define SENSORLESS_HOMING

  //#define HOME_USING_SPREADCYCLE
#define IMPROVE_HOMING_RELIABILITY

@pbathuk
Copy link

@pbathuk pbathuk commented Dec 18, 2019

Hi, I have read this thread & stupidly thought that my TMC2209 from Fystec were the same as mentioned above & tried joining a couple of the pins etc... turns out I have been sent Fystec v3.0 and trying to get them to even work on the BTT SKR 1.3 board.
https://wiki.fysetc.com/Silent2209/
It appears the pins have moved around on the new step drivers:
V2.1:
Pin 3 = NC
Pin 5 = TX
Now it appears to be
V3.0:
Pin 3 = TX - Or UART according to the wiki
Pin 5 = SpreadCycle

The new sticks do come with up & down pins pre-solder :
20191218_203945

So far I have tracked the voltages of each pin and have:
EN: 3V
MS1: 0V
MS2: 0V
SpreadCycle : 3V (when the UART pin is connected on the jumper) - 0V otherwise
RX: 0V
TX: 0V
Step: 0.2V
DIR : 3V

Jumpers I have in place so far:
20191218_204310

I'm kind of stumped as to how to get these connected to the SKR 1.3 board & working with UART as that was the reason I brought them (well I ordered the v2.1 versions).
I know this thread is about sensorless homing on the TMC2209, but was hoping someone with skill can help me at all :)

@pbathuk
Copy link

@pbathuk pbathuk commented Dec 19, 2019

Just to close the above : for v3.0 of fystec drivers you have to follow the jumpers mentioned here to even get them to work:
#16220

@m24andrew
Copy link

@m24andrew m24andrew commented Dec 28, 2019

I have the SKR 1.3 board and Fysetc TMC2209 V2.1 driver boards. I have spent all day going round in circles...
I was able to get UART to work correctly by placing a jumper between the Rx and Txpins however sensorless homing didn't work so the motors did not move during homing and M119 showed the two ends stops triggered constantly.

On the Fysetc TMC2209 V2.1 the diag pin is connected to the top of the board and there is no physical connection from the diag pin on the driver board to the header on the SKR board which is connected for senseless homing. The second part of RABZY88's solution above: #14464 (comment) works for the Fysetc TMC2209 V2.1 driver:

I had to desolder the diag pin and invert it on the driver board. This way it now connects the driver board to the SKR board and sensorless homing works correctly.

b4

after

together

@MinSoeVertex
Copy link

@MinSoeVertex MinSoeVertex commented Jan 7, 2020

Yep, I have the same problem with MKS TMC 2209 on MKS SGEN_L. X and Y always triggered.
When I replace it with BTT TMC 2209 all works fine.

@tpre
Copy link

@tpre tpre commented Jan 16, 2020

I am really confused, because with my SKR 1.3 and BTT TMC2209 V1.2 sensoress homing won't work, regardless of what setting i choose. I have Jumper on XST and YST. Printer moves korrekt, but even software endstops won't work. I'm frustrated. This issue cannot be closed. Obviously there are many people with problems using TMC2209 with sensorless homing. Configuring Marlin is very simple, so there is not much magic to get sensorless homing to work.

@slackdna
Copy link

@slackdna slackdna commented Jan 31, 2020

I am really confused, because with my SKR 1.3 and BTT TMC2209 V1.2 sensoress homing won't work, regardless of what setting i choose. I have Jumper on XST and YST. Printer moves korrekt, but even software endstops won't work. I'm frustrated. This issue cannot be closed. Obviously there are many people with problems using TMC2209 with sensorless homing. Configuring Marlin is very simple, so there is not much magic to get sensorless homing to work.

Same setup here SKR 1.3, and BTT TMC2209 v1.2, was having the same problem using source from BTT repositories, my situation was trying to home to XMax and YMax, found 2 possible solution

  1. put a jumper cable directly from diag pin X and Y driver to the Xmax and Ymax endstop pin, because the XST/YST jumper pin only connect diag pin to the Xmin and Ymin!
  2. with jumper pin still in XST and YST, download the source from Marlin main repo, adjust the config accordingly and compile from there.. seems the BTT repo is outdated, no cable jumper required here..

@TheNitek
Copy link
Contributor Author

@TheNitek TheNitek commented Feb 1, 2020

This issue is closed, since it was caused by a hardware issue (PINs are differnt on the Fysetc vs. BTT TMC2209), so it was not a Marlin issue. Using the correct PIN sensorless homing works in general. If you have different problems then open a different issue providing all information needed for it to be debugged.

@coolt5
Copy link

@coolt5 coolt5 commented Apr 14, 2020

Yep, I have the same problem with MKS TMC 2209 on MKS SGEN_L. X and Y always triggered.
When I replace it with BTT TMC 2209 all works fine.

i am trying to build my mks sgen l bored with tmc2209 v3 from fysetc and i am getting error low
did you find a solution for it

@github-actions
Copy link

@github-actions github-actions bot commented Jul 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet