MKS-SKIPR icon indicating copy to clipboard operation
MKS-SKIPR copied to clipboard

TMC2209 wiring for use UART and sensorless homing ?

Open Montana758 opened this issue 2 years ago • 23 comments

Hello, I hope you can help me. Which pins from the TMC2209 v1.3 need to be connected to which pin on the board? I would like to use the drivers in uart mode. And use sensorless homing.

Montana758 avatar Dec 19 '22 10:12 Montana758

Use this pins for your jumper beneath the tmc2209 image

G4Cab avatar Dec 21 '22 13:12 G4Cab

Thanks, I set this jumper. But the sensorless homing doesn't work. Do I have to connect a cable from the TMC2209 to one of the pins of "5" Sensorless Homing (on the picture) connector?

180390283-9d4f5b66-5d59-4312-9df9-75b7bc8bc6e0 1

here my printer.cfg:

[stepper_x] step_pin:PC14 dir_pin:!PC13 enable_pin:!PC15 microsteps: 16 rotation_distance: 40 full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper #endstop_pin:!PA14 endstop_pin: tmc2209_stepper_x:virtual_endstop #position_min: 0
position_endstop: 0 position_max: 230 homing_speed:50 homing_retract_dist:0 #homing_positive_dir:true step_pulse_duration:0.000008

[tmc2209 stepper_x] uart_pin: PE6 diag_pin: PA14 run_current: 0.3 hold_current: 0.5 interpolate: True driver_SGTHRS: 10 stealthchop_threshold: 1

Montana758 avatar Dec 21 '22 15:12 Montana758

You need a jumper on the Diags header, then you set the diag_pin to the jumpered endstop pin.

gaby64 avatar Jan 06 '23 02:01 gaby64

Anyone get this working?

Icesythe7 avatar Feb 18 '23 01:02 Icesythe7

Anyone get this working?

Yes

gaby64 avatar Feb 18 '23 02:02 gaby64

I set the jumper on the board under the driver, set the jumper on diag, set it in config still wont trigger :(

step_pin:PC14
dir_pin:!PC13
enable_pin:!PC15
microsteps: 64
rotation_distance: 40
full_steps_per_rotation: 200
endstop_pin: tmc2209_stepper_x:virtual_endstop
homing_retract_dist: 0
position_endstop: 120
position_max: 120
homing_speed: 40

[tmc2209 stepper_x]
uart_pin: PE6
diag_pin: ^PA14
run_current: 0.55
sense_resistor: 0.110
stealthchop_threshold: 0
interpolate: false
driver_SGTHRS: 90 # 255 is most sensitive value, 0 is least sensitive```

nema 17's using ez2209 drivers from btt

Icesythe7 avatar Feb 18 '23 02:02 Icesythe7

Screenshot_2023-02-06_155013

Assuming you put a jumper on that diags header in the lower right. First, I would remove the pullup (^) on the diag pin, diag_pin: PA14. Second I would increase the driver_SGTHRS value to 130 until you have a successful trigger.

Any reason you are running a high microstepping? 16 should be adequate with less torque loss.

gaby64 avatar Feb 18 '23 05:02 gaby64

The motors won't even move now, removing the pull up resistor as u said just make it auto trigger endstop, inverting diag with ! also makes it auto trigger engstop, currently if I home nothing happens yet it says i homed and i can move as per normal with the arrows yet I never actually homed so position is wrong

Icesythe7 avatar Feb 18 '23 06:02 Icesythe7

Lower driver_SGTHRS until it does not trigger Lower the homing speed also

gaby64 avatar Feb 18 '23 06:02 gaby64

https://www.klipper3d.org/TMC_Drivers.html#find-highest-sensitivity-that-successfully-homes

gaby64 avatar Feb 18 '23 07:02 gaby64

@gaby64: Where did you get the pinout document? I try to find some documents like this but without succsess.

zu3st-de avatar Mar 17 '23 08:03 zu3st-de

@gaby64: Where did you get the pinout document? I try to find some documents like this but without succsess.

https://github.com/makerbase-mks/MKS-SKIPR/blob/main/hardware/MKS%20SKIPR%20V1.0_002/MKS%20SKIPR%20V1.0_002%20PIN.pdf

gaby64 avatar Mar 17 '23 19:03 gaby64

Has anyone managed to resolve? I tested with the settings you mentioned and it didn't work for me. I am using TMC2226. And I can't get the Z-axis endstop to work. I'm using the structure of an Ender3 and the Z-axis goes down until it locks on the table.

prondz avatar Mar 21 '23 00:03 prondz

I have sensorless homing working on 4 steppers. Here is my config:

[stepper_x]
step_pin: STEP_1
dir_pin: !DIR_1
enable_pin: !EN_1
endstop_pin: tmc2209_stepper_x:virtual_endstop
rotation_distance: 40
microsteps: 64
full_steps_per_rotation: 200
#gear_ratio:
step_pulse_duration: 0.000000100
position_min: -2.5
position_endstop: -2.5
position_max: 600
homing_speed: 50
homing_retract_dist: 0
#homing_retract_speed:
#second_homing_speed:
#homing_positive_dir:

[tmc2209  stepper_x]
uart_pin: UART_1
diag_pin : ^EndStop_1
interpolate = True
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 500
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 20
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 0
driver_HSTRT: 5
driver_PWM_AUTOGRAD: True
driver_PWM_AUTOSCALE: True
driver_PWM_LIM: 12
driver_PWM_REG: 8
driver_PWM_FREQ: 1
driver_PWM_GRAD: 14
driver_PWM_OFS: 36
driver_SGTHRS: 70

[stepper_y]
step_pin: STEP_2
dir_pin: DIR_2
enable_pin: !EN_2
endstop_pin: tmc2209_stepper_y:virtual_endstop
rotation_distance: 40
microsteps: 16
full_steps_per_rotation: 200
#gear_ratio:
step_pulse_duration: 0.000000100
position_min: -3.5
position_endstop: -3.5
position_max: 515
homing_speed: 25
homing_retract_dist: 0
#homing_retract_speed:
#second_homing_speed:
#homing_positive_dir:

[tmc2209  stepper_y]
uart_pin: UART_2
diag_pin: ^EndStop_2
interpolate = True
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 500
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 20
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 0
driver_HSTRT: 5
driver_PWM_AUTOGRAD: True
driver_PWM_AUTOSCALE: True
driver_PWM_LIM: 12
driver_PWM_REG: 8
driver_PWM_FREQ: 1
driver_PWM_GRAD: 14
driver_PWM_OFS: 36
driver_SGTHRS: 45

[stepper_y1]
step_pin: STEP_3
dir_pin: !DIR_3
enable_pin: !EN_3
endstop_pin: tmc2209_stepper_y1:virtual_endstop
rotation_distance: 40
microsteps: 16
full_steps_per_rotation: 200
#gear_ratio:
step_pulse_duration: 0.000000100
# position_min: 0
# position_endstop: 0
# position_max: 550
# homing_speed: 50
# homing_retract_dist: 0
#homing_retract_speed:
#second_homing_speed:
#homing_positive_dir:

[tmc2209  stepper_y1]
uart_pin: UART_3
diag_pin: ^EndStop_3
interpolate = True
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 500
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 20
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 0
driver_HSTRT: 5
driver_PWM_AUTOGRAD: True
driver_PWM_AUTOSCALE: True
driver_PWM_LIM: 12
driver_PWM_REG: 8
driver_PWM_FREQ: 1
driver_PWM_GRAD: 14
driver_PWM_OFS: 36
driver_SGTHRS: 45

[stepper_z]
step_pin: STEP_4
dir_pin: DIR_4
enable_pin: !EN_4
#endstop_pin: tmc2209_stepper_z:virtual_endstop
endstop_pin:!EXP1_7
rotation_distance: 8
microsteps: 64
full_steps_per_rotation: 200
#gear_ratio:
step_pulse_duration: 0.000000100
position_min: 0
position_endstop: 0
position_max: 80
homing_speed: 1
homing_retract_dist: 0
#homing_retract_speed:
#second_homing_speed:
#homing_positive_dir:

[tmc2209  stepper_z]
uart_pin: UART_4
diag_pin: EndStop_4
interpolate = True
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 500
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 20
driver_TBL: 2
driver_TOFF: 3
driver_HEND: 0
driver_HSTRT: 5
driver_PWM_AUTOGRAD: True
driver_PWM_AUTOSCALE: True
driver_PWM_LIM: 12
driver_PWM_REG: 8
driver_PWM_FREQ: 1
driver_PWM_GRAD: 14
driver_PWM_OFS: 36
driver_SGTHRS: 35

[board_pins]
aliases:
    # EXP1 header
    EXP1_1=PB2,  EXP1_3=PE11, EXP1_5=PD9, EXP1_7=PE15, EXP1_9=<GND>,
    EXP1_2=PE10, EXP1_4=PD10, EXP1_6=PD8, EXP1_8=PE7,  EXP1_10=<5V>,
    # EXP2 header
    EXP2_1=PA6, EXP2_3=PE9, EXP2_5=PE8, EXP2_7=PD13,  EXP2_9=<GND>,
    EXP2_2=PA5, EXP2_4=PA4, EXP2_6=PA7, EXP2_8=<RST>, EXP2_10=<3.3v>,
    # Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "ssp1"

    # See the sample-lcd.cfg file for definitions of common LCD displays.

    STEP_1=PC14, DIR_1=PC13, EN_1=PC15, EndStop_1=PA14, UART_1=PE6,
    STEP_2=PE5, DIR_2=PE4, EN_2=PD14, EndStop_2=PA15, UART_2=PE3,
    STEP_3=PE1, DIR_3=PE0, EN_3=PE2, EndStop_3=PB15, UART_3=PB7,
    STEP_4=PB5, DIR_4=PB4, EN_4=PB6, EndStop_4=PA13, UART_4=PB3,
    STEP_5=PD6, DIR_5=PD5, EN_5=PD7, EndStop_5=PC5, UART_5=PD4,
    STEP_6=PD2, DIR_6=PD1, EN_6=PD3, EndStop_6=PB14, UART_6=PD0,
    STEP_7=PC7, DIR_7=PC6, EN_7=PC8, UART_7=PD15,

eldeeb91 avatar Apr 17 '23 06:04 eldeeb91

Thank you so much, reading your code I was able to find out where I was going wrong. My printer is live again

prondz avatar Apr 19 '23 02:04 prondz

Could someone send the sensorless configuration? did you have to put any jumpers on the board?

mruviaro avatar Jun 09 '23 02:06 mruviaro

you could send this config?

mruviaro avatar Jun 12 '23 22:06 mruviaro

read the previous comments! its all there

gaby64 avatar Jun 12 '23 23:06 gaby64

leia os comentários anteriores! está tudo aí

From what I understand the configuration would be... ...but don't works...

[stepper_y] step_pin: PE5 dir_pin: !PE4 enable_pin: !PD14 microsteps: 16 rotation_distance: 40 full_steps_per_rotation: 200 #set to 400 for 0.9 degree stepper endstop_pin: tmc2209_stepper_y:virtual_endstop position_endstop: 0 position_max: 310 homing_speed: 50 homing_retract_dist: 0 homing_positive_dir: false step_pulse_duration: 0.000008

[tmc2209 stepper_y] uart_pin: PE3 diag_pin: PA15 driver_SGTHRS: 0 run_current: 0.8 hold_current: 0.5 interpolate: True

mruviaro avatar Jun 12 '23 23:06 mruviaro

Did you set the jumpers as indicated in previous comments?

What do you mean by it does not work? What does it do?

driver_SGTHRS: 0 This value would never trigger, it will crash.

gaby64 avatar Jun 12 '23 23:06 gaby64

sorry, i'm used this (sgthrs 0 and 255) config before to test, but now is 130....

mruviaro avatar Jun 12 '23 23:06 mruviaro

Thanks so much. never considered X- and Y- were the pins I was trying to find

moswald14 avatar Sep 16 '23 03:09 moswald14

Same problem. My setup looks like it should work, but doesn't. Extremely frustrating. I guess I need to start switching all my 2209s and 2226s into X socket to test if any of them work.

BETLOG avatar Apr 11 '24 11:04 BETLOG