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 #16091

Closed
elementfoundry opened this issue Dec 3, 2019 · 17 comments
Closed

[BUG] TMC2209 Sensorless Homing Not Working #16091

elementfoundry opened this issue Dec 3, 2019 · 17 comments

Comments

@elementfoundry
Copy link
Contributor

elementfoundry commented Dec 3, 2019

Hardware: Bigtreetech SKR 1.3, Bigtreetech 2209 V1.2

I've tried enabling sensorless homing with my setup, but the "endstops" never trigger.

Debug info (this was captured during a G28 home all axis)

Send: M122 S1
Recv: axis:pwm_scale/curr_scale/mech_load|flags|warncount
Recv: 		X	Y	Z	E
Recv: Address		0	0	0	0
Recv: Enabled		false	false	false	false
Recv: Set current	1000	1000	1000	1000
Recv: RMS current	994	994	994	994
Recv: MAX current	1402	1402	1402	1402
Recv: Run current	17/31	17/31	17/31	17/31
Recv: Hold current	8/31	8/31	8/31	8/31
Recv: CS actual	8/31	8/31	8/31	8/31
Recv: PWM scale	10	10	10	10
Recv: vsense		0=.325	0=.325	0=.325	0=.325
Recv: stealthChop	false	false	false	false
Recv: msteps		16	16	16	16
Recv: tstep		max	max	max	max
Recv: pwm
Recv: threshold
Recv: [mm/s]
Recv: OT prewarn	false	false	false	false
Recv: OT prewarn has
Recv: been triggered	false	false	false	false
Recv: off time	4	4	4	4
Recv: blank time	24	24	24	24
Recv: hysteresis
Recv: -end		2	2	2	2
Recv: -start		1	1	1	1
Recv: Stallguard thrs	128	128	0	0
Recv: DRVSTATUS	X	Y	Z	E
Recv: stst		*	*	*	*
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: 157C
Recv: 150C
Recv: 143C
Recv: 120C
Recv: s2vsa
Recv: s2vsb
Recv: Driver registers:
Recv: 		X	0x80:08:00:00
Recv: 		Y	0x80:08:00:00
Recv: 		Z	0x80:08:00:00
Recv: 		E	0x80:08:00:00
Recv: 
Recv: 
Recv: Testing X connection... OK
Recv: Testing Y connection... OK
Recv: Testing Z connection... OK
Recv: Testing E connection... OK
[...]
Send: G28
Recv: X:10/8/-|I|	Y:10/8/-|I|	Z:27/17/-||	E:10/8/-|I|
Recv: X:10/8/-|I|	Y:10/8/-|I|	Z:27/17/-||	E:10/8/-|I|
[...]
Recv: X:10/8/-|I|	Y:10/8/-|I|	Z:20/17/-||	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
Recv: echo:busy: processing
Printer seems to support the busy protocol, will adjust timeouts and set busy interval accordingly
Recv: X:44/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
Recv: X:43/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
[...]
Recv: X:44/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
Recv: X:43/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
Recv: echo:busy: processing
Recv: X:44/17/-||	Y:10/8/-|I|	Z:20/17/-|I|	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:18/15/-|I|	E:10/8/-|I|
[...]
Recv: X:43/17/-||	Y:10/8/-|I|	Z:14/12/-|I|	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:12/10/-|I|	E:10/8/-|I|
Recv: echo:busy: processing
Recv: X:44/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
[...]
Recv: X:44/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: echo:busy: processing
Recv: X:43/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: X:44/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
[...]
Recv: X:43/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: X:32/17/-||	Y:10/8/-|I|	Z:10/8/-|I|	E:10/8/-|I|
Recv: Error:Printer halted. kill() called!
@hammerhead2k2
Copy link
Contributor

I think it is necessary to activate Stealth Chop for sensorless homing.
Regarding your log, i think it is disabled.

Recv: stealthChop false false false false

See also issue #15424

@elementfoundry
Copy link
Contributor Author

unless I'm missing something it is enabled in Configuration_adv.h

#define STEALTHCHOP_XY
#define STEALTHCHOP_Z
#define STEALTHCHOP_E

@opiswahn
Copy link

opiswahn commented Dec 4, 2019

Had the same problem on my SKR E3 Mini V1.2... StealthChop is enabled. No triggering of 'endstops' on hit whatsoever.
Any advice would be helpful.

@hammerhead2k2
Copy link
Contributor

Did you double check the wiring, jumpers and settings?

Diag Pin at the driver has to be connected to the Board.

This one is from TMC2209 V1.2 Bigtreetech
image

Unused Diag Pins at Bigtreetech Drivers (maybe E and Z) has to be removed! Otherwise you get in trouble with the endstops! I don't know, if there is an issue with Watterott or Fysetc too.

Fysetc V3.0 seems to have same pinning as BTT
image

This one is from Watterott and the pinning seems to be different.
image

Connected to the Mainboard here:
image

And activated the jumpers for X and Y Endstops over the DIAG Pin. The other ones have to be removed.
image

Disconnect the mechanical endstops:
image

In Configuration.h

#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.

In Configuration_adv.h

#define SENSORLESS_HOMING // StallGuard capable drivers only

@elementfoundry
Copy link
Contributor Author

Upon further investigation it would appear that Marlin is not putting the tmc2209 drivers into stealthchop mode before moving the axes that require them before homing. Setting stealthchop manually before homing seems to work. So I think the solution to this problem is for marlin to check for stealthchop and enable if necessary before any sensorless homing.

@boelle
Copy link
Contributor

boelle commented Dec 7, 2019

@elementfoundry since 2.0 was just released a few days ago has this changed this issue at all?

@elementfoundry
Copy link
Contributor Author

@boelle - this was using marlin 2.0

@uorbe001
Copy link

Upon further investigation it would appear that Marlin is not putting the tmc2209 drivers into stealthchop mode before moving the axes that require them before homing. Setting stealthchop manually before homing seems to work. So I think the solution to this problem is for marlin to check for stealthchop and enable if necessary before any sensorless homing.

@elementfoundry How did you come to that conclusion? any way to test the theory?

I'm having a similar issue (#15848) but in my case sensorless homing always triggers (as soon as it starts) with a threshold value (with my current config 160) but it never does so when I set the number lower than that (159). As far as I can tell I do have stealhchop enabled when it homes:

Driver stepping mode:
M569 S1 X Y Z
M569 S1 T0 E
M569 S1 T1 E

But there may something I'm missing?

@uorbe001
Copy link

I saw your PR (#16153) and tried flashing that to test if it changed anything for me, but no luck, so I'm afraid mine is unrelated 😞

@elementfoundry
Copy link
Contributor Author

@uorbe001 : i came to that conclusion due to the line:

* TMC2209 requires STEALTHCHOP enabled for SENSORLESS_HOMING

in configuration_adv.h, the comment from @hammerhead2k2 at the beginning of the thread, and observing behavior on my printer when manually putting the drivers into stealthchop before homing with sensorless homing turned on.

in your case, it sounds like its a sensitivity issue, which was different from what I had written the patch for.

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

@elementfoundry is the issue still the same with all the updates in the last 9 days?

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

btw, who can confirm there is an issue? use the same configs as OP and the same hardware if possible

@elementfoundry
Copy link
Contributor Author

@boelle - still seems to be an issue with 2.0.1 - sensorless homing fails to trigger when set to spreadcycle with tmc2209 drivers

@Grogyan
Copy link
Contributor

Grogyan commented Dec 28, 2019

TMC2209 requires Stealthchop for sensorless homing

@boelle
Copy link
Contributor

boelle commented Jan 7, 2020

@elementfoundry is this still a problem? btw use bugfix 2.0.x and not 2.0.1, the first one is updated more than the other

@boelle
Copy link
Contributor

boelle commented Jan 14, 2020

Lack of Activity
This issue is being closed due to lack of activity. If you have solved the
issue, please let us know how you solved it. If you haven't, please tell us
what else you've tried in the meantime, and possibly this issue will be
reopened.

@github-actions
Copy link

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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants