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

[Bugfix 1.1.x] TMC2130 sensorless homing doesn't work after movement in spreadcycle mode #9903

Closed
golobodo opened this issue Mar 3, 2018 · 7 comments
Labels
C: Configuration F: Trinamic T: Question Questions, generally redirected to other groups.

Comments

@golobodo
Copy link

golobodo commented Mar 3, 2018

  • Description: My setup have watterott TMC2130 drivers for X and Y and LV8729 for Z and E0, installed on a RAMPS1.4. I'm using a 600W stepup converter to apply 24V to the motor drivers exclusivly. I've also soldered one 220uF capacitor near to the stepper drivers. The system is powered by a Seasonic SSP-300TGS TFX PSU.
  • Expected behaviour: movement to physical min position during sensorless homing after movement of X and/or Y, as some commits of bugfix1.1.x before.
  • Actual behaviour: after movement of X and/or Y, movement to its physical min position during sensorless homing doesn't work during the same power on session. So it doesen't move during homing and takes the actual position as min position. I also tried M502 + M500, but same behavior.
  • Steps to reproduce:
    • Using latest bugfix_1.1.x HEAD cd4c35c
    • TMC2130stepper library v2.1.5
    • G28 X0 Y0
    • G28 X0 Y0
Configuration and Pins

Configuration_adv.h TMC section:

#define HAVE_TMC2130
#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
  #define X_IS_TMC2130
  #define Y_IS_TMC2130
  #define R_SENSE           0.11  // R_sense resistor for SilentStepStick2130
  #define HOLD_MULTIPLIER    0.7  // Scales down the holding current from run current
  #define INTERPOLATE       true  // Interpolate X/Y/Z_MICROSTEPS to 256
  #define X_CURRENT          600  // rms current in mA. Multiply by 1.41 for peak current.
  #define X_MICROSTEPS        16  // 0..256
  #define Y_CURRENT          650
  #define Y_MICROSTEPS        16

  //#define STEALTHCHOP

  #define MONITOR_DRIVER_STATUS

  #if ENABLED(MONITOR_DRIVER_STATUS)
    #define CURRENT_STEP_DOWN     50  // [mA]
    #define REPORT_CURRENT_CHANGE
    #define STOP_ON_ERROR
  #endif

  //#define HYBRID_THRESHOLD

  #define SENSORLESS_HOMING   // TMC2130 only

  #if ENABLED(SENSORLESS_HOMING)
    #define X_HOMING_SENSITIVITY  8
    #define Y_HOMING_SENSITIVITY  8
    #define Z_HOMING_SENSITIVITY  8
  #endif

  #define TMC_DEBUG

  //#define TMC_Z_CALIBRATION

  #define  TMC_ADV() {  }

pins_ramps.h, Steppers section:

//
// Steppers
//
#define X_STEP_PIN         54
#define X_DIR_PIN          55
#define X_ENABLE_PIN       38
#ifndef X_CS_PIN
  #define X_CS_PIN         66
#endif

#define Y_STEP_PIN         60
#define Y_DIR_PIN          61
#define Y_ENABLE_PIN       56
#ifndef Y_CS_PIN
  #define Y_CS_PIN         44
#endif

#define Z_STEP_PIN         46
#define Z_DIR_PIN          48
#define Z_ENABLE_PIN       62
#ifndef Z_CS_PIN
  #define Z_CS_PIN         65
#endif

#define E0_STEP_PIN        26
#define E0_DIR_PIN         28
#define E0_ENABLE_PIN      24
#ifndef E0_CS_PIN
  #define E0_CS_PIN        42
#endif

#define E1_STEP_PIN        36
#define E1_DIR_PIN         34
#define E1_ENABLE_PIN      30
#ifndef E1_CS_PIN
  #define E1_CS_PIN        40
#endif
Detailed Output Here

Terminal Output divided into steps, i did:

Initial Power On (only 5V active)

Send: M122
Recv: 		X	Y
Recv: Enabled		false	false
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	8	8
Recv: DRVSTATUS	X	Y
Recv: stallguard
Recv: sg_result		0	0
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x80:0E:00:00
Recv: 	Y = 0x80:0F:00:00

Raise Z+1 to automatically enable 12V on PSU

Recv: 		X	Y
Recv: Enabled		false	false
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	8	8
Recv: DRVSTATUS	X	Y
Recv: stallguard
Recv: sg_result		0	0
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x80:0E:00:00
Recv: 	Y = 0x80:0F:00:00

G28 X0 Y0 (works as expected)

Recv: X:0 |0b1000| 	Y:0 |0b1000|
Send: G28 X0 Y0
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b1100| 	Y:0 |0b0|
Recv: X:0 |0b1100| 	Y:0 |0b0|
Recv: X:0 |0b1100| 	Y:0 |0b0|
Recv: X:0 |0b1100| 	Y:0 |0b0|
Recv: X:-35.00 Y:-19.00 Z:2.00 E:0.00 Count X:-3500 Y:-1900 Z:3200
Recv: ok
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Send: M122
Recv: 		X	Y
Recv: Enabled		true	true
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	8	8
Recv: DRVSTATUS	X	Y
Recv: stallguard		X	X
Recv: sg_result		673	557
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x81:0E:02:B7
Recv: 	Y = 0x81:0F:02:70
Recv: 
Recv: 
Recv: ok
Recv: X:0 |0b1100| 	Y:0 |0b1100|

Homing via LCD (doesn't work as expected, no movement to min position. Movement to the middle works. But it is not the middle)

Recv: echo:enqueueing "G28"
Recv: X:0 |0b100| 	Y:0 |0b100|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b100| 	Y:0 |0b1100|
Recv: X:0 |0b100| 	Y:0 |0b1100|
Recv: X:0 |0b1100| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b0| 	Y:0 |0b1100|
Recv: X:0 |0b0| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b100|
Recv: X:0 |0b0| 	Y:0 |0b1100|
Recv: X:0 |0b0| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:111.00 Y:85.00 Z:0.05 E:0.00 Count X:11073 Y:8500 Z:80
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Send: M122
Recv: 		X	Y
Recv: Enabled		true	true
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	8	8
Recv: DRVSTATUS	X	Y
Recv: stallguard			X
Recv: sg_result		640	708
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x80:0E:02:89
Recv: 	Y = 0x81:0F:02:D6

M914 X19 Y19 (decreasing sensitivity)

Send: M914 X19 Y19
Recv: X driver homing sensitivity set to 19
Recv: Y driver homing sensitivity set to 19
Recv: ok
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Recv: X:0 |0b1000| 	Y:0 |0b1100|
Send: M122
Recv: 		X	Y
Recv: Enabled		false	false
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	19	19
Recv: DRVSTATUS	X	Y
Recv: stallguard			X
Recv: sg_result		84	713
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x80:0E:00:54
Recv: 	Y = 0x81:0F:02:C9

Homing via LCD (doesn't work as expected, no movement to min position. Movement to the middle works. But it is not the middle)

Recv: echo:enqueueing "G28"
Recv: X:0 |0b0| 	Y:0 |0b1100|
Recv: X:0 |0b100| 	Y:0 |0b100|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b0| 	Y:0 |0b0|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b0|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b0| 	Y:0 |0b1000|
Recv: X:111.00 Y:85.00 Z:0.05 E:0.00 Count X:11073 Y:8500 Z:80
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Recv: X:0 |0b1000| 	Y:0 |0b1000|
Send: M122
Recv: 		X	Y
Recv: Enabled		true	true
Recv: Set current	670	725
Recv: RMS current	642	703
Recv: MAX current	905	991
Recv: Run current	20/31	22/31
Recv: Hold current	14/31	15/31
Recv: CS actual		14/31	15/31
Recv: PWM scale	0	0
Recv: vsense		1=.18	1=.18
Recv: stealthChop	false	false
Recv: msteps		16	16
Recv: tstep		1048575	1048575
Recv: pwm
Recv: threshold		0	0
Recv: [mm/s]		-	-
Recv: OT prewarn	false	false
Recv: OT prewarn has
Recv: been triggered	false	false
Recv: off time		5	5
Recv: blank time	24	24
Recv: hysterisis
Recv: -end		2	2
Recv: -start		3	3
Recv: Stallguard thrs	19	19
Recv: DRVSTATUS	X	Y
Recv: stallguard
Recv: sg_result		657	578
Recv: fsactive
Recv: stst		X	X
Recv: olb
Recv: ola
Recv: s2gb
Recv: s2ga
Recv: otpw
Recv: ot
Recv: Driver registers:	X = 0x80:0E:02:99
Recv: 	Y = 0x80:0F:02:5E
@teemuatlut
Copy link
Member

Is the problem that homing doesn't work after a G1 movement
or is the problem that homing doesn't work through the LCD?

@golobodo
Copy link
Author

golobodo commented Mar 3, 2018

  • Power On
  • G1 X10 moves 10mm
  • G28 X0 makes no movement. Only the hissing sound changes in frequency.

Output:
Send: G28 X0
Recv: X:-35.00 Y:85.00 Z:2.00 E:0.00 Count X:-3500 Y:8500 Z:3200

@thinkyhead thinkyhead added T: Question Questions, generally redirected to other groups. F: Trinamic C: Configuration labels Mar 4, 2018
@thinkyhead
Copy link
Member

@golobodo — Does G28 by itself work after G1?

@golobodo
Copy link
Author

golobodo commented Mar 4, 2018

  • Power On
  • G1 X10 Y10 <-- this works
  • G28 <-- only Z is correctly homing

Edit: Problem found. I had different configurations. So the problem is now, that homing works, when stealthchop is activated. In spreadcylce mode, G28 didn't work.

@golobodo golobodo changed the title [Bugfix 1.1.x] TMC2130 sensorless homing doesn't work after movement [Bugfix 1.1.x] TMC2130 sensorless homing doesn't work after movement in spreadcycle mode Mar 4, 2018
@golobodo
Copy link
Author

golobodo commented Mar 4, 2018

Looks like, my problem is already discussed in this issue: #8890

@BenBlv
Copy link

BenBlv commented Mar 4, 2018

I got almost same problem in here with spreadCycle on

  • on stealth mode G28 works as expected without any issues.
  • on spreadCycle mode G28 doing it all wrong.

with spreadCycle On after a power cycle:

  • X-axis homing correctly
  • Y-axis going to the opposite direction
  • Z-axis homing correctly

After the first G28, another G28 will result:

  • X-axis doesn't move to 0 position (hot homing) but moving to the opposite direction until it hits the end of axis/motor stuttering/ thinks it got to the center (depends where it is)
  • Y-axis sometimes moving back and sometimes forward (depends with the position). its doesn't make the homing motion.
  • Z-homing correctly.

Motherboard: Gen-L 1.0, tmc2130
v1.1.8 bug fix (today) 4/3 + updated 2130 libraries.
SPI configured and communicates / correct address.
Z safe homing enabled
sensorless homing enabled
BLtouch enabled
Debug tmc enabled

@golobodo golobodo closed this as completed Mar 4, 2018
@github-actions
Copy link

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 Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: Configuration F: Trinamic T: Question Questions, generally redirected to other groups.
Projects
None yet
Development

No branches or pull requests

4 participants