MKS Gen L 2.1 UART TMC2208

Basic Information:

Printer Model: artillery Sidewinder x1
MCU / Printerboard: MKS Gen L 2.1
Host / SBC
klippy.log

logs-20241215-123733.zip (94.2 KB)

I try to Use UART on my new MKS Gen2.1 Board:

Hey guys.

I got the artillery Sidewinder x1 and Upgraded it with an MKS gen L 2.1 Board.

I tried to use my new TMC2208 stepper driver in UART mode but its not working for any reason. hope you can help me.

If I try to run TMC_dump code my output is this:

"TMC_Dump code"

01:10

Unable to read tmc uart ‘stepper_x’ register GCONF

01:10

========== Queried registers ==========

01:10

TPOWERDOWN: 00000014 tpowerdown=20

01:10

TPWMTHRS: 00000000

01:10

IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8

01:10

========== Write-only registers ==========

01:10

DUMP_TMC STEPPER=stepper_x

my Printer.cfg is this:

printer.cfg

[include mainsail.cfg]
[include resonance.cfg]
[include macros.cfg]
[include speedtest.cfg]
#SWX1

Updated 2021-12-21

[stepper_x]
step_pin: ar54
dir_pin: !ar55
enable_pin: !ar38
microsteps: 16
rotation_distance: 40
endstop_pin: ^!ar3
position_endstop: 0
position_max: 310
homing_speed: 40.0

[tmc2208 stepper_x]
uart_pin: PK1 # Verwende RX oder einen beliebigen freien UART-Pin
tx_pin: PG1
run_current: 0.68
stealthchop_threshold: 99999
#use_software_uart: true

[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
microsteps: 16
rotation_distance: 40
endstop_pin: ^!ar14
position_endstop: 0
position_max: 310
homing_speed: 40
homing_positive_dir: false

[tmc2208 stepper_y]
uart_pin: PK2 # Verwende TX oder einen beliebigen freien UART-Pin
tx_pin: PF5
run_current: 0.68
stealthchop_threshold: 99999
#use_software_uart: true

[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_min: -3
position_max: 400
homing_speed: 10
second_homing_speed: 1

[tmc2208 stepper_z]
uart_pin: PK3 # Verwende TX oder einen beliebigen freien UART-Pin
tx_pin: PL7
run_current: 0.68
stealthchop_threshold: 99999
#use_software_uart: true

[stepper_z1]
step_pin: ar36
dir_pin: ar34
enable_pin: !ar30
microsteps: 16
rotation_distance: 8

[tmc2208 stepper_z1]
uart_pin: PB6 # Verwende TX oder einen beliebigen freien UART-Pin
tx_pin: PD1
run_current: 0.68
stealthchop_threshold: 99999
#use_software_uart: true

[extruder]
step_pin: ar26
dir_pin: !ar28
enable_pin: !ar24
microsteps: 16
rotation_distance: 7.35
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: ar10
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog13
min_extrude_temp: 190
min_temp: 5
max_temp: 300
max_extrude_only_distance: 101
max_extrude_cross_section: 2.0
pressure_advance: 0.08

[tmc2208 extruder]
uart_pin: PK4 # Verwende TX oder einen beliebigen freien UART-Pin
tx_pin: PL5
run_current: 0.68
stealthchop_threshold: 99999
#use_software_uart: true

[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
min_temp: 5
max_temp: 150

[fan]
pin: ar9
kick_start_time: 0.500

[heater_fan my_nozzle_fan]
pin: ar7
heater: extruder
heater_temp: 50.0
fan_speed: 1.0

[mcu]
#make sure this reflects your serial port you found when flashing klipper
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0

[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 3000
max_z_velocity: 50
max_z_accel: 100
square_corner_velocity: 5

[bltouch]
sensor_pin: ar19
control_pin: ar11
x_offset: 31
y_offset: -36
#z_offset: 0
speed: 10
set_output_mode: 5V
samples: 3
samples_result: median
sample_retract_dist: 2
lift_speed: 50

[safe_z_home]
home_xy_position: 122,183
speed: 100
z_hop: 20
z_hop_speed: 20

[bed_mesh]
speed: 800
mesh_min: 31,31
mesh_max: 270,270
probe_count: 5,5
mesh_pps: 2,2
algorithm: bicubic
bicubic_tension: 0.2
move_check_distance: 3.0
split_delta_z: .010
fade_start: 1.0
fade_end: 5.0

[bed_screws]
screw1: 55,55
screw1_name: front left
screw2: 255,55
screw2_name: front right
screw3: 255,255
screw3_name: back right
screw4: 55,255
screw4_name: back left
speed: 100.0

[screws_tilt_adjust]
screw1: 22,83
screw1_name: front left
screw2: 222,83
screw2_name: front right
screw3: 22,283
screw3_name: back left
screw4: 222,283
screw4_name: back right
speed: 100.0
screw_thread: CW-M5

#uncomment the following lines to use Z_TILT_ADJUST and uncomment G34 Macro to use G34
#[z_tilt]
#z_positions:

10,155

270,155

#points:

10,155

270,155

#speed: 100
#horizontal_move_z: 10

[gcode_macro G29]
gcode:
BED_MESH_CLEAR
G28
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE=x1

#[gcode_macro G34]
#gcode:

G28

Z_TILT_ADJUST

[gcode_macro G35]
gcode:
G28
SCREWS_TILT_CALCULATE

[gcode_macro START_PRINT]

gcode:
# Reference klipper/docs/Command_Templates.md at master · Klipper3d/klipper · GitHub
# On how to override default parameters
{% set BED_TEMP = 60 %}
{% set EXTRUDER_TEMP = 200 %}
# Home the printer
G28
#Probe Everytime
G29
#load saved mesh at print start instead of probe. Uncomment to use but comment out G29
#BED_MESH_PROFILE LOAD=x1
# Use absolute coordinates
G90
# Move the nozzle near the bed
G1 X0 Y0 Z5 F3000
# Move the nozzle very close to the bed
G1 Z0.15 F300
G92 E0 ;Reset Extruder
G1 X20 Y5 Z0.3 F5000.0
G1 Z0.3 F1000
G1 X200 Y5 F1500.0 E15
G1 X200 Y5.3 Z0.3 F5000.0
G1 X5.3 Y5.3 Z0.3 F1500.0 E30
G1 Z3 F3000
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
G92 E0

[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z30 F3000
G90
# Disable steppers
M84

[pause_resume]
recover_velocity: 50.

#[filament_switch_sensor my_sensor]
#Move filament runout sensor from TFT to X+ endstop pin. Uncomment all but this line if you want to use this
#pause_on_runout: False
#runout_gcode: PAUSE
#insert_gcode: RESUME
#switch_pin: ar2

Arduino aliases for atmega2560/1280 (Arduino mega) boards

[board_pins arduino-mega]
aliases:
ar0=PE0, ar1=PE1, ar2=PE4, ar3=PE5, ar4=PG5,
ar5=PE3, ar6=PH3, ar7=PH4, ar8=PH5, ar9=PH6,
ar10=PB4, ar11=PB5, ar12=PB6, ar13=PB7, ar14=PJ1,
ar15=PJ0, ar16=PH1, ar17=PH0, ar18=PD3, ar19=PD2,
ar20=PD1, ar21=PD0, ar22=PA0, ar23=PA1, ar24=PA2,
ar25=PA3, ar26=PA4, ar27=PA5, ar28=PA6, ar29=PA7,
ar30=PC7, ar31=PC6, ar32=PC5, ar33=PC4, ar34=PC3,
ar35=PC2, ar36=PC1, ar37=PC0, ar38=PD7, ar39=PG2,
ar40=PG1, ar41=PG0, ar42=PL7, ar43=PL6, ar44=PL5,
ar45=PL4, ar46=PL3, ar47=PL2, ar48=PL1, ar49=PL0,
ar50=PB3, ar51=PB2, ar52=PB1, ar53=PB0, ar54=PF0,
ar55=PF1, ar56=PF2, ar57=PF3, ar58=PF4, ar59=PF5,
ar60=PF6, ar61=PF7, ar62=PK0, ar63=PK1, ar64=PK2,
ar65=PK3, ar66=PK4, ar67=PK5, ar68=PK6, ar69=PK7,
analog0=PF0, analog1=PF1, analog2=PF2, analog3=PF3, analog4=PF4,
analog5=PF5, analog6=PF6, analog7=PF7, analog8=PK0, analog9=PK1,
analog10=PK2, analog11=PK3, analog12=PK4, analog13=PK5, analog14=PK6,
analog15=PK7,
# Marlin adds these additional aliases
ml70=PG4, ml71=PG3, ml72=PJ2, ml73=PJ3, ml74=PJ7,
ml75=PJ4, ml76=PJ5, ml77=PJ6, ml78=PE2, ml79=PE6,
ml80=PE7, ml81=PD4, ml82=PD5, ml83=PD6, ml84=PH2,
ml85=PH7

## <---------------------- SAVE_CONFIG ---------------------->
#
# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
##
#
# [extruder]
## control = pid
#
# pid_kp = 21.465
## pid_ki = 0.980
#
# pid_kd = 117.521
##
#
# [heater_bed]
## control = pid
#
# pid_kp = 48.362
## pid_ki = 0.638
#
# pid_kd = 915.854
##
#
# [bltouch]
## z_offset = 1.777
#
#
## [bed_mesh default]
#
# version = 1
## points =
#
# 0.000000, 0.032500, 0.040000, 0.105000, 0.195000
## -0.037500, -0.045000, -0.005000, 0.045000, 0.112500
#
# -0.002500, -0.015000, 0.005000, 0.062500, 0.145000
## 0.115000, 0.077500, 0.055000, 0.080000, 0.080000
#
# 0.072500, 0.035000, 0.020000, 0.015000, 0.055000
## x_count = 5
#
# y_count = 5
## mesh_x_pps = 2
#
# mesh_y_pps = 2
## algo = bicubic
#
# tension = 0.2
## min_x = 30.0
#
# max_x = 270.0
## min_y = 30.0000000001
#
# max_y = 270.0
##
#
# [bed_mesh x1]
## version = 1
#
# points =
## 0.000000, 0.032500, 0.040000, 0.105000, 0.195000
#
# -0.037500, -0.045000, -0.005000, 0.045000, 0.112500
## -0.002500, -0.015000, 0.005000, 0.062500, 0.145000
#
# 0.115000, 0.077500, 0.055000, 0.080000, 0.080000
## 0.072500, 0.035000, 0.020000, 0.015000, 0.055000
#
# x_count = 5
## y_count = 5
#
# mesh_x_pps = 2
## mesh_y_pps = 2
#
# algo = bicubic
## tension = 0.2
#
# min_x = 30.0
## max_x = 270.0
#
# min_y = 30.0000000001
#*# max_y = 270.0

these are my stepper driver : TMC2208 Driver

I hope you can help me. I appreciate any hint

I’m running my DIY MMU with this board and I’m also using UART and I’m not familiar with mainsail.
From my point of view, PG and PK are not valid pin names for this arduino.
Here an example of one of my stepper (mult mcu config)

[tmc2208 manual_stepper gear_stepper]
uart_pin: mmboard:ar40
microsteps: 16
run_current: 0.5
hold_current: 0.350
interpolate: False
sense_resistor: 0.110

[manual_stepper gear_stepper]
step_pin: mmboard:ar26
dir_pin: !mmboard:ar28
enable_pin: !mmboard:ar24
step_distance: .00606
velocity: 20
accel: 1000
endstop_pin: ^mmboard:ar2 # PINDA X+

i got the pinning from this side mks gen l 2.1 git

OK, checked this, maybe the difference depends to the older klipper version, which I’m using, sorry.

… I’m running a single wire uart, not the rx/tx solution with Y cable and resistor.
I can remember I started with something like that, but it don’t know when and ahy I changed that…

This board likely follows the RAMPS 1.4 pin layout, but it seems your pins are correctly set up. Otherwise, the error message would be different.

Make sure the jumpers on the board are correctly configured: Drivers_MKS_TMC2225_2208 · makerbase-mks/MKS-GEN_L Wiki · GitHub


thats what i did i placed it on the right slot

is it possible that my drivers are incompatible for this board in uart mode?

Looks correct but I do not know the board in detail.

Yes. On very ancient drivers this was even common, but today it should no longer be the case.
Depending on the driver it might look something like this:

You would need to manually solder the correct bridges. As shown in the picture, usually on the bottom side, roughly in the middle

1 Like

I put them in my request, there is my amazon link what type i boought. I am not sure if this is necessary

Unfortunately, the pictures there do not show this side of the driver, nor does the link contain any related instructions.

I found something in commentary section. Ty my friend. I will reply after i soldered it.

1 Like

Ummm… I just noticed that the brand for these steppers is “DollaTek” and I can’t find a schematic for them.

You may be able to move the jumper (or solder the two pins as noted in the comment) and everything will be fine but I honestly think you might be better off buying a stepper module from a “known” brand (like BTT or MKS).

If you are going to try to solder them, make sure you have an iron with a needle tip and you are working with lead-free solder.

those are gilent2208 v1.2 driver dollatek is only the seller name in amazon

Sorry, I can’t find a schematic for that either.

I guess my message should have been go ahead and try the modification but remember that instructions found in an Amazon review isn’t the most reliable source of information.

1 Like

ok guys, tmc dump gets an answer now. its working! ty!

But now i have this problem with z1. this was the same before.

Unable to read tmc uart ‘stepper_z1’ register IFCNT…

i checked the soldering it looks ok. i dont know why there is a problem now.

here are the tmc dump console outputs:

tmc dump console output

22:04

Unable to read tmc uart ‘stepper_z1’ register GCONF

22:04

========== Queried registers ==========

22:04

TPOWERDOWN: 00000014 tpowerdown=20

22:04

TPWMTHRS: 00000000

22:04

IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8

22:04

========== Write-only registers ==========

22:04

DUMP_TMC STEPPER=stepper_z1

22:03

PWM_AUTO: 000e0024 pwm_ofs_auto=36 pwm_grad_auto=14

22:03

PWM_SCALE: 00000018 pwm_scale_sum=24

22:03

PWMCONF: c80d0e24 pwm_ofs=36 pwm_grad=14 pwm_freq=1 pwm_autoscale=1 pwm_autograd=1 pwm_reg=8 pwm_lim=12

22:03

DRV_STATUS: c0150000 cs_actual=21 stealth=1 stst=1

22:03

CHOPCONF: 14030053 toff=3 hstrt=5 tbl=2 vsense=1 mres=4(16usteps) intpol=1

22:03

MSCURACT: 00f7000c cur_a=12 cur_b=247

22:03

MSCNT: 00000008 mscnt=8

22:03

TSTEP: 000fffff tstep=1048575

22:03

FACTORY_CONF: 00000019 fclktrim=25

22:03

IOIN@TMC220x: 20000141 enn=1 pdn_uart=1 sel_a=1(TMC220x) version=0x20

22:03

OTP_READ: 00000019 otp_fclktrim=25

22:03

IFCNT: 00000006 ifcnt=6

22:03

GSTAT: 00000001 reset=1(Reset)

22:03

GCONF: 000001c0 pdn_disable=1 mstep_reg_select=1 multistep_filt=1

22:03

========== Queried registers ==========

22:03

TPOWERDOWN: 00000014 tpowerdown=20

22:03

TPWMTHRS: 00000000

22:03

IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8

22:03

========== Write-only registers ==========

22:03

DUMP_TMC STEPPER=stepper_z

22:03

PWM_AUTO: 000e0024 pwm_ofs_auto=36 pwm_grad_auto=14

22:03

PWM_SCALE: 00000018 pwm_scale_sum=24

22:03

PWMCONF: c80d0e24 pwm_ofs=36 pwm_grad=14 pwm_freq=1 pwm_autoscale=1 pwm_autograd=1 pwm_reg=8 pwm_lim=12

22:03

DRV_STATUS: c0150000 cs_actual=21 stealth=1 stst=1

22:03

CHOPCONF: 14030053 toff=3 hstrt=5 tbl=2 vsense=1 mres=4(16usteps) intpol=1

22:03

MSCURACT: 00f7000c cur_a=12 cur_b=247

22:03

MSCNT: 00000008 mscnt=8

22:03

TSTEP: 000fffff tstep=1048575

22:03

FACTORY_CONF: 00000018 fclktrim=24

22:03

IOIN@TMC220x: 20000141 enn=1 pdn_uart=1 sel_a=1(TMC220x) version=0x20

22:03

OTP_READ: 00000018 otp_fclktrim=24

22:03

IFCNT: 00000006 ifcnt=6

22:03

GSTAT: 00000001 reset=1(Reset)

22:03

GCONF: 000001c0 pdn_disable=1 mstep_reg_select=1 multistep_filt=1

22:03

========== Queried registers ==========

22:03

TPOWERDOWN: 00000014 tpowerdown=20

22:03

TPWMTHRS: 00000000

22:03

IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8

22:03

========== Write-only registers ==========

22:03

DUMP_TMC STEPPER=stepper_y

22:03

PWM_AUTO: 000e0024 pwm_ofs_auto=36 pwm_grad_auto=14

22:03

PWM_SCALE: 00000018 pwm_scale_sum=24

22:03

PWMCONF: c80d0e24 pwm_ofs=36 pwm_grad=14 pwm_freq=1 pwm_autoscale=1 pwm_autograd=1 pwm_reg=8 pwm_lim=12

22:03

DRV_STATUS: c0150000 cs_actual=21 stealth=1 stst=1

22:03

CHOPCONF: 14030053 toff=3 hstrt=5 tbl=2 vsense=1 mres=4(16usteps) intpol=1

22:03

MSCURACT: 00f7000c cur_a=12 cur_b=247

22:03

MSCNT: 00000008 mscnt=8

22:03

TSTEP: 000fffff tstep=1048575

22:03

FACTORY_CONF: 00000019 fclktrim=25

22:03

IOIN@TMC220x: 20000141 enn=1 pdn_uart=1 sel_a=1(TMC220x) version=0x20

22:03

OTP_READ: 00000019 otp_fclktrim=25

22:03

IFCNT: 00000008 ifcnt=8

22:03

GSTAT: 00000001 reset=1(Reset)

22:03

GCONF: 000001c0 pdn_disable=1 mstep_reg_select=1 multistep_filt=1

22:03

========== Queried registers ==========

22:03

TPOWERDOWN: 00000014 tpowerdown=20

22:03

TPWMTHRS: 00000000

22:03

IHOLD_IRUN: 00081515 ihold=21 irun=21 iholddelay=8

22:03

========== Write-only registers ==========

22:03

DUMP_TMC STEPPER=stepper_x

22:03

The value ‘stepper_extruder’ is not valid for STEPPER

22:03

DUMP_TMC STEPPER=stepper_extruder

Can you post your latest klippy.log?

The most likely cause is that you haven’t set your jumpers correctly or you haven’t specified the right UART pin for the socket.

yeah i understand but i double and triple checked the uart pins. but here is the photo:


and here is the klippy.log:
logs-20241216-222241.zip (104.8 KB)

allright i found the issue for the last problem. 2 of the driver are broken. i resoldered it but no connection. i swapped places and tried to configure.

i guess i will replace them with 2100 tmc and standalone for z axis.

thanks for oyur help guys. this can be closed!

2 Likes

Congratulations and happy printing!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.