Troubleshooting Closed loop S42C

Basic Information: S42C

Printer Model: Voron 2.4
MCU / Printerboard: BTT octopus
Recv: // Unable to read tmc uart ‘stepper_x’ register IFCNT
Recv: // Once the underlying issue is corrected, use the
Recv: // “FIRMWARE_RESTART” command to reset the firmware, reload the
Recv: // config, and restart the host software.
Recv: // Printer is shutdown
Recv: // Klipper state: Not ready
Recv: !! Unable to read tmc uart ‘stepper_x’ register IFCNT

Describe your issue:

Hi. I’ve tried for days trying to get my printer working with closed loop s42c drivers, but I’m always getting the same error. Any and all searches on the web lead to dead threads, useless youtube videos, or phrazes “it’s plug and play”. But, it’s not plug and play, by just pulling out old tmc 2209 driver and sticking this one in.
I’ve tried changing settings in printer.cfg to A4988, tried with the jumper for TmС and without… nothing works.

[tmc2209 stepper_x]
uart_pin: PC4
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

A Stepper - Right

Connected to MOTOR_1

Endstop connected to DIAG_1

[stepper_y]
step_pin: PG0
dir_pin: PG1
enable_pin: !PF15
rotation_distance: 40
microsteps: 32
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin: PG9
position_min: 0
##--------------------------------------------------------------------

position_endstop: 350
position_max: 355

##--------------------------------------------------------------------
homing_speed: 75 #Max 100
homing_retract_dist: 5
homing_positive_dir: true

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 stepper_y]
uart_pin: PD11
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

#####################################################################

Z Stepper Settings

#####################################################################

Z0 Stepper - Front Left

Connected to MOTOR_2

Endstop connected to DIAG_2

[stepper_z]
step_pin: PF11
dir_pin: PG3
enable_pin: !PG5
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32
endstop_pin: PG10

Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)

(+) value = endstop above Z0, (-) value = endstop below

Increasing position_endstop brings nozzle closer to the bed

After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config

##position_endstop: -0.5
##--------------------------------------------------------------------
position_endstop: 330
position_max: 330

##--------------------------------------------------------------------
position_min: -5
homing_speed: 25
second_homing_speed: 3
homing_retract_dist: 3

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 stepper_z]
uart_pin: PC6
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

Z1 Stepper - Rear Left

Connected to MOTOR_3

[stepper_z1]
step_pin: PG4
dir_pin: !PC1
enable_pin: !PA0
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 stepper_z1]
uart_pin: PC7
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

Z2 Stepper - Rear Right

Connected to MOTOR_4

[stepper_z2]
step_pin: PF9
dir_pin: PF10
enable_pin: !PG2
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 stepper_z2]
uart_pin: PF2
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

Z3 Stepper - Front Right

Connected to MOTOR_5

[stepper_z3]
step_pin: PC13
dir_pin: !PF0
enable_pin: !PF1
rotation_distance: 40
gear_ratio: 80:16
microsteps: 32

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 stepper_z3]
uart_pin: PE4
interpolate: false
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0

#####################################################################

Extruder

#####################################################################

Connected to MOTOR_6

Heater - HE0

Thermistor - T0

[extruder]
step_pin: PE2
dir_pin: PE3
enable_pin: !PD4

Update value below when you perform extruder calibration

If you ask for 100mm of filament, but in reality it is 98mm:

rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100

21.5450035 is a good starting point

rotation_distance: 21.5450035 #Bondtech 5mm Drive Gears

Update Gear Ratio depending on your Extruder Type

Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)

Use 80:20 for M4, M3.1

gear_ratio: 50:10 #BMG Gear Ratio
microsteps: 32
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.75
heater_pin: PA2

Validate the following thermistor type to make sure it is correct

See Configuration reference - Klipper documentation for additional options

sensor_type: ATC Semitec 104GT-2
sensor_pin: PF4
min_temp: 10
max_temp: 300
max_power: 1.0
min_extrude_temp: 110
control = pid
pid_kp = 26.213
pid_ki = 1.304
pid_kd = 131.721

Try to keep pressure_advance below 1.0

pressure_advance: 0.05

Default is 0.040, leave stock

pressure_advance_smooth_time: 0.040

E0 on MOTOR6

Make sure to update below for your relevant driver (2208 or 2209)

[tmc2209 extruder]
uart_pin: PE1
interpolate: false
run_current: 0.5
sense_resistor: 0.110
stealthchop_threshold: 0
printer.cfg (15.1 KB)

Please put such long code fragments between Preformatted text tags:
preformatted

This makes it much easier to read and keeps the page clean.

3 Likes

PLEASE upload the klippy.log as file to your next post.

The code sippet of the printer.cfg you included as text is of not much use:

  • It is crippled
  • It is not formatted as code
  • You attached the printer.cfg file anyway.

You may check the UART wires
You may swap the TMC drivers

2 Likes

Not sure it your issue has been fixed… see my working config (still in progress but prints fine) … I have X and Y as closed loop. S42B

Hi. I’m very new to this, and I can’t seen to find klippy.log

You can find the klippy.log here: /tmp/klippy.log

1 Like

Your printer.cfg looks completely different from mine )).
And in your settings it looks like you have TMC set up. How did you manage to get the S42B drivers working?
I either case, thanks for your help. I’m sure as I deep dive in to this, your file will be quite usefull.

Thank you.
Found it

[Starting Klippy…
Args: [‘/home/pi/klipper/klippy/klippy.py’, ‘/home/pi/printer.cfg’, ‘-l’, ‘/tmp/klippy.log’]
Git version: ‘v0.11.0-279-g7bd32994’
Branch: master
Remote: origin
Tracked URL: GitHub - Klipper3d/klipper: Klipper is a 3d-printer firmware
CPU: 4 core ARMv7 Processor rev 3 (v7l)
Python: ‘2.7.18 (default, Jul 14 2021, 08:11:37) \n[GCC 10.2.1 20210110]’
Start printer at Thu Nov 2 00:22:36 2023 (1698877356.2 11.9)
===== Config file =====
[mcu]
serial = /dev/serial/by-id/usb-Klipper_stm32f446xx_3C000E001850344D30353320-if00
restart_method = command

[neopixel sb_leds]
pin = PB0
chain_count = 10
color_order = GRB
initial_red = 1.0
initial_green = 1.0
initial_blue = 1.0
initial_white = .0

[gcode_macro _sb_vars]
variable_colors = {
‘logo’: {
‘busy’: {‘r’: 0.4, ‘g’: 0.0, ‘b’: 0.0, ‘w’: 0.0},
‘cleaning’: {‘r’: 0.0, ‘g’: 0.02, ‘b’: 0.5, ‘w’: 0.0},
‘calibrating_z’: {‘r’: 0.8, ‘g’: 0., ‘b’: 0.35, ‘w’: 0.0},
‘heating’: {‘r’: 0.3, ‘g’: 0.18, ‘b’: 0.0, ‘w’: 0.0},
‘homing’: {‘r’: 0.0, ‘g’: 0.6, ‘b’: 0.2, ‘w’: 0.0},
‘leveling’: {‘r’: 0.5, ‘g’: 0.1, ‘b’: 0.4, ‘w’: 0.0},
‘meshing’: {‘r’: 0.2, ‘g’: 1.0, ‘b’: 0.0, ‘w’: 0.0},
‘off’: {‘r’: 0.0, ‘g’: 0.0, ‘b’: 0.0, ‘w’: 0.0},
‘printing’: {‘r’: 1.0, ‘g’: 0.0, ‘b’: 0.0, ‘w’: 0.0},
‘standby’: {‘r’: 0.01, ‘g’: 0.01, ‘b’: 0.01, ‘w’: 0.1},
},
‘nozzle’: {
‘heating’: {‘r’: 0.8, ‘g’: 0.35, ‘b’: 0.0, ‘w’:0.0},
‘off’: {‘r’: 0.0, ‘g’: 0.0, ‘b’: 0.0, ‘w’: 0.0},
‘on’: {‘r’: 0.8, ‘g’: 0.8, ‘b’: 0.8, ‘w’:1.0},
‘standby’: {‘r’: 0.6, ‘g’: 0.0, ‘b’: 0.0, ‘w’:0.0},
},
‘thermal’: {
‘hot’: {‘r’: 1.0, ‘g’: 0.0, ‘b’: 0.0, ‘w’: 0.0},
‘cold’: {‘r’: 0.3, ‘g’: 0.0, ‘b’: 0.3, ‘w’: 0.0}
}
}
variable_logo_led_name = “sb_leds”
variable_logo_idx = “1”
variable_nozzle_led_name = “sb_leds”
variable_nozzle_idx = “2,3”
gcode =

[gcode_macro _set_sb_leds]
gcode =
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = params.LED|string %}
{% set idx = (params.IDX|string).split(‘,’) %}
{% set transmit_last = params.TRANSMIT|default(1) %}
{% for led_index in idx %}
{% set transmit=transmit_last if loop.last else 0 %}
set_led led={led} red={red} green={green} blue={blue} white={white} index={led_index} transmit={transmit}
{% endfor %}

[gcode_macro _set_sb_leds_by_name]
gcode =
{% set leds_name = params.LEDS %}
{% set color_name = params.COLOR %}
{% set color = printer[“gcode_macro _sb_vars”].colors[leds_name][color_name] %}
{% set led = printer[“gcode_macro _sb_vars”][leds_name + “_led_name”] %}
{% set idx = printer[“gcode_macro _sb_vars”][leds_name + “_idx”] %}
{% set transmit = params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={color.r} green={color.g} blue={color.b} white={color.w} idx=“{idx}” transmit={transmit}

[gcode_macro _set_logo_leds]
gcode =
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer[“gcode_macro _sb_vars”].logo_led_name %}
{% set idx = printer[“gcode_macro _sb_vars”].logo_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx=“{idx}” transmit={transmit}

[gcode_macro _set_nozzle_leds]
gcode =
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer[“gcode_macro _sb_vars”].nozzle_led_name %}
{% set idx = printer[“gcode_macro _sb_vars”].nozzle_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx=“{idx}” transmit={transmit}

[gcode_macro set_logo_leds_off]
gcode =
{% set transmit=params.TRANSMIT|default(1) %}
_set_logo_leds red=0 blue=0 green=0 white=0 transmit={transmit}

[gcode_macro set_nozzle_leds_on]
gcode =
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds_by_name leds=“nozzle” color=“on” transmit={transmit}

[gcode_macro set_nozzle_leds_off]
gcode =
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds_by_name leds=“nozzle” color=“off” transmit={transmit}

[gcode_macro status_off]
gcode =
set_logo_leds_off transmit=0
set_nozzle_leds_off

[gcode_macro status_ready]
gcode =
_set_sb_leds_by_name leds=“logo” color=“standby” transmit=0
_set_sb_leds_by_name leds=“nozzle” color=“standby” transmit=1

[gcode_macro status_busy]
gcode =
_set_sb_leds_by_name leds=“logo” color=“busy” transmit=0
set_nozzle_leds_on

[gcode_macro status_heating]
gcode =
_set_sb_leds_by_name leds=“logo” color=“heating” transmit=0
_set_sb_leds_by_name leds=“nozzle” color=“heating” transmit=1

[gcode_macro status_leveling]
gcode =
_set_sb_leds_by_name leds=“logo” color=“leveling” transmit=0
set_nozzle_leds_on

[gcode_macro status_homing]
gcode =
_set_sb_leds_by_name leds=“logo” color=“homing” transmit=0
set_nozzle_leds_on

[gcode_macro status_cleaning]
gcode =
_set_sb_leds_by_name leds=“logo” color=“cleaning” transmit=0
set_nozzle_leds_on

[gcode_macro status_meshing]
gcode =
_set_sb_leds_by_name leds=“logo” color=“meshing” transmit=0
set_nozzle_leds_on

[gcode_macro status_calibrating_z]
gcode =
_set_sb_leds_by_name leds=“logo” color=“calibrating_z” transmit=0
set_nozzle_leds_on

[gcode_macro status_printing]
gcode =
_set_sb_leds_by_name leds=“logo” color=“printing” transmit=0
set_nozzle_leds_on

[printer]
kinematics = corexy
max_velocity = 350
max_accel = 4000
max_z_velocity = 50
max_z_accel = 350
square_corner_velocity = 10.0

[stepper_x]
step_pin = PF13
dir_pin = PF12
enable_pin = !PF14
rotation_distance = 40
microsteps = 32
full_steps_per_rotation = 200
endstop_pin = PG6
position_min = 0
position_endstop = 350
position_max = 350
homing_speed = 100
homing_retract_dist = 5
homing_positive_dir = true

[tmc2209 stepper_x]
uart_pin = PC4
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[stepper_y]
step_pin = PG0
dir_pin = PG1
enable_pin = !PF15
rotation_distance = 40
microsteps = 32
full_steps_per_rotation = 200
endstop_pin = PG9
position_min = 0
position_endstop = 350
position_max = 360
homing_speed = 75
homing_retract_dist = 5
homing_positive_dir = true

[tmc2209 stepper_y]
uart_pin = PD11
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[stepper_z]
step_pin = PF11
dir_pin = PG3
enable_pin = !PG5
rotation_distance = 40
gear_ratio = 80:16
microsteps = 32
endstop_pin = PG10
position_max = 330
position_min = -5
homing_speed = 75
second_homing_speed = 3
homing_retract_dist = 3
position_endstop = 1.000

[tmc2209 stepper_z]
uart_pin = PC6
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[stepper_z1]
step_pin = PG4
dir_pin = !PC1
enable_pin = !PA0
rotation_distance = 40
gear_ratio = 80:16
microsteps = 32

[tmc2209 stepper_z1]
uart_pin = PC7
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[stepper_z2]
step_pin = PF9
dir_pin = PF10
enable_pin = !PG2
rotation_distance = 40
gear_ratio = 80:16
microsteps = 32

[tmc2209 stepper_z2]
uart_pin = PF2
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[stepper_z3]
step_pin = PC13
dir_pin = !PF0
enable_pin = !PF1
rotation_distance = 40
gear_ratio = 80:16
microsteps = 32

[tmc2209 stepper_z3]
uart_pin = PE4
interpolate = false
run_current = 0.8
sense_resistor = 0.110
stealthchop_threshold = 0

[extruder]
step_pin = PE2
dir_pin = PE3
enable_pin = !PD4
rotation_distance = 22.1913536
gear_ratio = 50:10
microsteps = 32
full_steps_per_rotation = 200
nozzle_diameter = 0.400
filament_diameter = 1.75
heater_pin = PA2
sensor_type = ATC Semitec 104GT-2
sensor_pin = PF4
min_temp = 10
max_temp = 300
max_power = 1.0
min_extrude_temp = 140
pressure_advance = 0.05
pressure_advance_smooth_time = 0.040
control = pid
pid_kp = 20.471
pid_ki = 0.858
pid_kd = 122.057

[tmc2209 extruder]
uart_pin = PE1
interpolate = false
run_current = 0.5
sense_resistor = 0.110
stealthchop_threshold = 0

[heater_bed]
heater_pin = PA3
sensor_type = Generic 3950
sensor_pin = PF3
max_power = 0.6
min_temp = 0
max_temp = 120
control = pid
pid_kp = 38.900
pid_ki = 1.402
pid_kd = 269.868

[probe]
pin = PG15
x_offset = 0
y_offset = 25.0
z_offset = 0
speed = 10.0
samples = 3
samples_result = median
sample_retract_dist = 3.0
samples_tolerance = 0.006
samples_tolerance_retries = 3

[fan]
pin = PA8
kick_start_time = 0.5
off_below = 0.10

[heater_fan hotend_fan]
pin = PE5
max_power = 1.0
kick_start_time = 0.5
heater = extruder
heater_temp = 50.0

[controller_fan controller_fan]
pin = PD12
max_power = 0.9
kick_start_time = 0.5
heater = heater_bed

[idle_timeout]
timeout = 1800

[safe_z_home]
home_xy_position = 233,350
speed = 100
z_hop = 10

[quad_gantry_level]
gantry_corners =
-60,-10
410,420
points =
50,25
50,275
300,275
300,25
speed = 350
horizontal_move_z = 10
retries = 5
retry_tolerance = 0.0075
max_adjust = 10

[board_pins]
aliases =
EXP1_1=PE8, EXP1_2=PE7,
EXP1_3=PE9, EXP1_4=PE10,
EXP1_5=PE12, EXP1_6=PE13,
EXP1_7=PE14, EXP1_8=PE15,
EXP1_9=, EXP1_10=<5V>,
EXP2_1=PA6, EXP2_2=PA5,
EXP2_3=PB1, EXP2_4=PA4,
EXP2_5=PB2, EXP2_6=PA7,
EXP2_7=PC15, EXP2_8=,
EXP2_9=, EXP2_10=<5V>

[display]
lcd_type = uc1701
cs_pin = EXP1_3
a0_pin = EXP1_4
rst_pin = EXP1_5
encoder_pins = ^EXP2_3, ^EXP2_5
click_pin = ^!EXP1_2
contrast = 63
spi_software_miso_pin = EXP2_1
spi_software_mosi_pin = EXP2_6
spi_software_sclk_pin = EXP2_2

[neopixel btt_mini12864]
pin = EXP1_6
chain_count = 3
initial_red = 0.1
initial_green = 0.5
initial_blue = 0.0
color_order = RGB

[delayed_gcode setdisplayneopixel]
initial_duration = 1
gcode =
SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3

[gcode_macro G32]
gcode =
G28
QUAD_GANTRY_LEVEL
G28
G0 X175 Y175 Z30 F3600

[gcode_macro PRINT_START]
gcode =
G32 ; home all axes
G1 Z20 F3000 ; move nozzle away from bed

[gcode_macro PRINT_END]
gcode =
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
SAVE_GCODE_STATE NAME=STATE_PRINT_END
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-5.0 F1800 ; retract filament
TURN_OFF_HEATERS
G90 ; absolute positioning
G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
M107 ; turn off fan
BED_MESH_CLEAR
RESTORE_GCODE_STATE NAME=STATE_PRINT_END

Extruder max_extrude_ratio=0.266081]

Is this the part you were talking about?

Sorry I do not know how to respond… They just work. Notice I do not have any driver for the X or the Y only the definition is needed. For my 2 Z axes and the extrudes that are TMCxxx. I have changed a few things in my config, but that is for the encoder runout sensors… I still can not get all three of them to work, or get one of them to work more then once. But that is for a different post else were…

Hm… That just may be the answer to all things. ))
I’m afraid to do any more experiments on current printer, since I had a brick sitting on the table for over 2 months and things to print were just piling up.
Planning on buying another voron kit and go crazy on that one.
Thanks againg for your help.

I have to ask a dumb question …. did you go thought the stepper’s calibration and setting in the stepper themselves ? they are dumb until you do.

If you mean the calibration using the 3 buttons on the pcb that is screwed to the back of the motor, then the answer is yes.
It calibrated doing a full rotation and all was good.
Problems start as soon as I send g28.

please make sure you test it without the steppers in the printer to see it they move in the correct direction. , or if you have the good direction tested and then when it tries to home, try just the x or y only. to make sure it is not the core xy vs core yx it it moves then crashes check the endstops.

Remember troubleshooting first starts with power that you have… them cut the config to the minimal possible. Save you current config, rename it, start with a blank one and just do the x and y steppers. (maybe z) then add back to it

PLEASE: Always upload things like a klippy.log as a file.

DO NOT paste it in like a text.

At lease formate it as Preformatted text with the </> symbol in the editors tool bar.

A: It is way too long
B: Spaces get lost

Did you have had a look on your post?

@LifeOfBrian already told you to do so.

2 Likes

I heard your advice and tried uploading as a file, but it was 8.2 mb and would not upload.
Then I cut out the top part of the file and tried using the Preformatted text tab, hit enter and this happened :expressionless:
Then I tried to edit and added [ ], didn’t help.
I’m sure that I didn’t do something right, just haven’t figured out what yet.

If files are too big just zip them and upload the zipped file.
We are mostly dealing here with text files that can be compressed quite well.

Regarding preformatted text you can test it here in the reply window and should see the result on the right hand side.
Test it with a single word or small text to get familiar with it and then fire it up! :wink:

2 Likes

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