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 · 110 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

This comment has been minimized.

Copy link
Contributor

@Ludy87 Ludy87 commented Jul 1, 2019

try reversing * _ENDSTOP_INVERTING

@TheNitek

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

@Ludy87 Ludy87 commented Jul 1, 2019

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

@TheNitek

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

@TheNitek TheNitek commented Jul 2, 2019

Maybe this is similar to #8890 ?

@BioGeekJoey

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

@TheNitek TheNitek commented Jul 8, 2019

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

@VOIDREP

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

@teemuatlut teemuatlut commented Jul 10, 2019

Pull out the diag jumpers.

@spazwart

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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.

@miserovitch

This comment has been minimized.

Copy link

@miserovitch miserovitch commented Sep 5, 2019

Hi,
@TheNitek , did solution proposed by @thisiskeithb is working for you?
I have exactly the same issue, SKR1.3, TMC2209 V2.0 from Fysetc.
I am not sure the TMC2209 from Watterott and Fysetc are the same.

Thanks for your help, you are doing a great job.

BR
LC

@thisiskeithb

This comment has been minimized.

Copy link
Contributor

@thisiskeithb thisiskeithb commented Sep 5, 2019

I am not sure the TMC2209 from Watterott and Fysetc are the same.

You'll have to track that down to confirm if you need to mod your board like I did.

Edit: Here's a post from Fysetc's forum and the user just had to solder some pads on the driver to get them working on the SKR 1.3.

@michaelduffy123

This comment has been minimized.

Copy link

@michaelduffy123 michaelduffy123 commented Sep 5, 2019

@thisiskeithb I can confirm that this doesnt work, since the issue is still present on the v2.1 version of the fystec 2209s

@miserovitch

This comment has been minimized.

Copy link

@miserovitch miserovitch commented Sep 6, 2019

Arg! Thanks for the feedback.
In the meanwhile I will put back all endstops on my printer...

@vyruz1986

This comment has been minimized.

Copy link

@vyruz1986 vyruz1986 commented Sep 9, 2019

From the comments here I seem to conclude that when using sensorless homing, one should connect the DIAG pin of the TMC2209 to the endstop pin of the relevant axis, is that correct?
I was trying to get this working on my SKR Mini E3 board, but didn't yet change my hardware connection. I thought MarlinFW would just poll the UART to see if an axis had stalled, and trigger endstop that way.

@michaelduffy123

This comment has been minimized.

Copy link

@michaelduffy123 michaelduffy123 commented Sep 10, 2019

@vyruz1986 For clarification use this for what you propose.
skr1 3

@michaelduffy123

This comment has been minimized.

Copy link

@michaelduffy123 michaelduffy123 commented Sep 10, 2019

Ok So I have checked for Ω, There seems to be no continuity on my board between the diag pin and the jumper as shown , I think that has solved my issue, I will report back
skr1 3revised

@Grogyan

This comment has been minimized.

Copy link
Contributor

@Grogyan Grogyan commented Sep 11, 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 on board.

I just checked on my SKR1.3

@Sjoerrdd

This comment has been minimized.

Copy link

@Sjoerrdd Sjoerrdd commented Sep 22, 2019

Any progress in fixing this?

@paulpenney

This comment has been minimized.

Copy link

@paulpenney paulpenney commented Sep 22, 2019

@michaelduffy123

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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.

@Sjoerrdd

This comment has been minimized.

Copy link

@Sjoerrdd Sjoerrdd 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

This comment has been minimized.

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

@boelle boelle added the F: Trinamic label Sep 24, 2019
@RABZY88

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

@RABZY88 RABZY88 commented Sep 28, 2019

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

@michaelduffy123

This comment has been minimized.

Copy link

@michaelduffy123 michaelduffy123 commented Oct 5, 2019

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

@michaelduffy123

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

@boelle boelle commented Oct 24, 2019

@TheNitek still having issues?

@TheNitek

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

@Sjoerrdd

This comment has been minimized.

Copy link

@Sjoerrdd Sjoerrdd commented Nov 1, 2019

@michaelduffy123 doesn't work for me..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.