Hello everyone A4988driver

Hello everyone, I would like to ask what modifications are needed for the A4988 driver? I have already changed the .CFG file, but I am still encountering an error: “TMC stepper_x failed to init: Timeout on wait for ‘tmcuart_response’ response.” The A4988 driver doesn’t have UART, so why am I still getting an error related to the TMC driver?

It would be helpful if you attach the klippy.log log as requested.
How should somebody here know what you did wrong without the log/config?

However it sounds as if you are using the TMC section for a non-TMC stepper driver.

2 Likes

Thank you. This is the log from my machine. The TMC issue has been resolved, but now it stops after printing.Please help me check what is causing the printing to end. Thank you.

=============== Log rollover at Wed Oct 23 08:37:10 2024 ===============
Starting Klippy…
Args: [‘/home/liwei/klipper/klippy/klippy.py’, ‘/home/liwei/printer_data/config/printer.cfg’, ‘-I’, ‘/home/liwei/printer_data/comms/klippy.serial’, ‘-l’, ‘/home/liwei/printer_data/logs/klippy.log’, ‘-a’, ‘/home/liwei/printer_data/comms/klippy.sock’]
Git version: ‘v0.12.0-685-gf504e3c7-dirty’
Modified files: klippy/klippy.py
Branch: master
Remote: origin
Tracked URL: https://gitee.com/miroky/klipper.git
CPU: 8 core 12th Gen Intel(R) Core™ i5-12490F
Python: ‘3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]’
Start printer at Wed Oct 23 08:37:15 2024 (1729643835.7 28.8)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode =

{% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %}
{% set allow_park = client.park_at_cancel | default(false) | lower == 'true' %}
{% set retract = client.cancel_retract | default(5.0) | abs %}

{% set park_x = "" if (client.park_at_cancel_x | default(none) is none)
else "X=" ~ client.park_at_cancel_x %}
{% set park_y = "" if (client.park_at_cancel_y | default(none) is none)
else "Y=" ~ client.park_at_cancel_y %}
{% set custom_park = park_x | length > 0 or park_y | length > 0 %}


{% if printer['gcode_macro RESUME'].restore_idle_timeout > 0 %}
SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro RESUME'].restore_idle_timeout}
{% endif %}
{% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
_CLIENT_RETRACT LENGTH={retract}
TURN_OFF_HEATERS
M106 S0
{client.user_cancel_macro | default("")}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False

SET_PAUSE_NEXT_LAYER ENABLE=0
SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
CANCEL_PRINT_BASE

[gcode_macro PAUSE]
description = Pause the actual running print
rename_existing = PAUSE_BASE
gcode =

{% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %}
{% set idle_timeout = client.idle_timeout | default(0) %}
{% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %}
{% set restore = False if printer.toolhead.extruder == ''
else True  if params.RESTORE | default(1) | int == 1 else False %}

SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"

{% if idle_timeout > 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
{% endif %}
PAUSE_BASE
{client.user_pause_macro | default("")}
_TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {‘restore’: False, ‘temp’: 0}
variable_restore_idle_timeout = 0
variable_idle_state = False
gcode =

{% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set sp_move = client.speed_move | default(velocity) %}
{% set runout_resume = True if client.runout_sensor | default("") == ""
else True if not printer[client.runout_sensor].enabled
else printer[client.runout_sensor].filament_detected %}
{% set can_extrude = True if printer.toolhead.extruder == ''
else printer[printer.toolhead.extruder].can_extrude %}
{% set do_resume = False %}
{% set prompt_txt = [] %}


{% if printer.idle_timeout.state | upper == "IDLE" or idle_state %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False
{% if last_extruder_temp.restore %}

RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }'
M109 S{last_extruder_temp.temp}
{% set do_resume = True %}
{% elif can_extrude %}
{% set do_resume = True %}
{% else %}
RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
{% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
{% endif %}

{% elif can_extrude %}
{% set do_resume = True %}
{% else %}
RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
{% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
{% endif %}
{% if runout_resume %}
{% if do_resume %}
{% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %}
{client.user_resume_macro | default("")}
_CLIENT_EXTRUDE
RESUME_BASE VELOCITY={params.VELOCITY | default(sp_move)}
{% endif %}
{% else %}
RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}'
{% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %}
{% endif %}

{% if not (runout_resume and do_resume) %}
RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!"
{% for element in prompt_txt %}
RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}'
{% endfor %}
RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info"
RESPOND TYPE=command MSG="action:prompt_show"
{% endif %}

[gcode_macro SET_PAUSE_NEXT_LAYER]
description = Enable a pause if the next layer is reached
gcode =
{% set pause_next_layer = printer[‘gcode_macro SET_PRINT_STATS_INFO’].pause_next_layer %}
{% set ENABLE = params.ENABLE | default(1)|int != 0 %}
{% set MACRO = params.MACRO | default(pause_next_layer.call, True) %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE=“{{ ‘enable’: ENABLE, ‘call’: MACRO }}”

[gcode_macro SET_PAUSE_AT_LAYER]
description = Enable/disable a pause if a given layer number is reached
gcode =
{% set pause_at_layer = printer[‘gcode_macro SET_PRINT_STATS_INFO’].pause_at_layer %}
{% set ENABLE = params.ENABLE | int != 0 if params.ENABLE is defined
else params.LAYER is defined %}
{% set LAYER = params.LAYER | default(pause_at_layer.layer) | int %}
{% set MACRO = params.MACRO | default(pause_at_layer.call, True) %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE=“{{ ‘enable’: ENABLE, ‘layer’: LAYER, ‘call’: MACRO }}”

[gcode_macro SET_PRINT_STATS_INFO]
rename_existing = SET_PRINT_STATS_INFO_BASE
description = Overwrite, to get pause_next_layer and pause_at_layer feature
variable_pause_next_layer = { ‘enable’: False, ‘call’: “PAUSE” }
variable_pause_at_layer = { ‘enable’: False, ‘layer’: 0, ‘call’: “PAUSE” }
gcode =
{% if pause_next_layer.enable %}
RESPOND TYPE=echo MSG=‘{“%s, forced by pause_next_layer” % pause_next_layer.call}’
{pause_next_layer.call}
SET_PAUSE_NEXT_LAYER ENABLE=0
{% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER | int == pause_at_layer.layer %}
RESPOND TYPE=echo MSG=‘{“%s, forced by pause_at_layer [%d]” % (pause_at_layer.call, pause_at_layer.layer)}’
{pause_at_layer.call}
SET_PAUSE_AT_LAYER ENABLE=0
{% endif %}
SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode =

{% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set use_custom     = client.use_custom_pos | default(false) | lower == 'true' %}
{% set custom_park_x  = client.custom_park_x | default(0.0) %}
{% set custom_park_y  = client.custom_park_y | default(0.0) %}
{% set park_dz        = client.custom_park_dz | default(2.0) | abs %}
{% set sp_hop         = client.speed_hop | default(15) * 60 %}
{% set sp_move        = client.speed_move | default(velocity) * 60 %}

{% set origin    = printer.gcode_move.homing_origin %}
{% set act       = printer.gcode_move.gcode_position %}
{% set max       = printer.toolhead.axis_maximum %}
{% set cone      = printer.toolhead.cone_start_z | default(max.z) %}
{% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
else False %}

{% set z_min = params.Z_MIN | default(0) | float %}
{% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)] | min %}
{% set x_park = params.X       if params.X is defined
else custom_park_x  if use_custom
else 0.0            if round_bed
else (max.x - 5.0) %}
{% set y_park = params.Y       if params.Y is defined
else custom_park_y  if use_custom
else (max.y - 5.0)  if round_bed and z_park < cone
else 0.0            if round_bed
else (max.y - 5.0) %}

_CLIENT_RETRACT
{% if "xyz" in printer.toolhead.homed_axes %}
G90
G1 Z{z_park} F{sp_hop}
G1 X{x_park} Y{y_park} F{sp_move}
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
{% else %}
RESPOND TYPE=echo MSG='Printer not homed'
{% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode =

{% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %}
{% set use_fw_retract = (client.use_fw_retract | default(false) | lower == 'true') and (printer.firmware_retraction is defined) %}
{% set length = params.LENGTH | default(client.unretract) | default(1.0) | float %}
{% set speed = params.SPEED | default(client.speed_unretract) | default(35) %}
{% set absolute_extrude = printer.gcode_move.absolute_extrude %}

{% if printer.toolhead.extruder != '' %}
{% if printer[printer.toolhead.extruder].can_extrude %}
{% if use_fw_retract %}
{% if length < 0 %}
G10
{% else %}
G11
{% endif %}
{% else %}
M83
G1 E{length} F{(speed | float | abs) * 60}
{% if absolute_extrude %}
M82
{% endif %}
{% endif %}
{% else %}
RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}'
{% endif %}
{% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode =
{% set client = printer[‘gcode_macro _CLIENT_VARIABLE’] | default({}) %}
{% set length = params.LENGTH | default(client.retract) | default(1.0) | float %}
{% set speed = params.SPEED | default(client.speed_retract) | default(35) %}

_CLIENT_EXTRUDE LENGTH=-{length | float | abs} SPEED={speed | float | abs}

[mcu]
serial = /dev/ttyS1
baud = 250000
restart_method = command

[printer]
kinematics = corexy
max_velocity = 200
max_accel = 2000
max_z_velocity = 15
max_z_accel = 45
square_corner_velocity = 6.0

[stepper_x]
step_pin = PB13
dir_pin = PB12
enable_pin = !PB14
rotation_distance = 40
microsteps = 16
full_steps_per_rotation = 200
endstop_pin = ^PC0
position_endstop = 300
position_max = 300
homing_speed = 50
homing_retract_dist = 5
homing_positive_dir = true

[stepper_y]
step_pin = PB10
dir_pin = PB2
enable_pin = !PB11
rotation_distance = 40
microsteps = 16
full_steps_per_rotation = 200
endstop_pin = ^PC1
position_endstop = 300
position_max = 300
homing_speed = 50
homing_retract_dist = 5
homing_positive_dir = true

[stepper_z]
step_pin = PB0
dir_pin = PC5
enable_pin = !PB1
rotation_distance = 4
full_steps_per_rotation = 200
microsteps = 16
endstop_pin = ^PC2
position_endstop = 0
position_max = 250
position_min = 0
homing_speed = 10
second_homing_speed = 3.0
homing_retract_dist = 3.0

[stepper_z1]
step_pin = PB9
dir_pin = PB5
enable_pin = !PB8
rotation_distance = 4
full_steps_per_rotation = 200
microsteps = 16

[stepper_z2]
step_pin = PC12
dir_pin = PC13
enable_pin = !PA15
rotation_distance = 4
full_steps_per_rotation = 200
microsteps = 16

[extruder]
step_pin = PB3
dir_pin = PB4
enable_pin = !PD2
rotation_distance = 22.23
gear_ratio = 50:10
microsteps = 16
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PC8
sensor_type = NTC 100K MGB18-104F39050L32
sensor_pin = PA0
control = pid
pid_kp = 26.213
pid_ki = 1.304
pid_kd = 131.721
min_temp = 0
max_temp = 270
max_power = 1.0
min_extrude_temp = 170
max_extrude_only_distance = 200
pressure_advance = 0.0
pressure_advance_smooth_time = 0.040

[heater_bed]
heater_pin = PC9
sensor_type = NTC 100K MGB18-104F39050L32
sensor_pin = PA4
smooth_time = 3.0
max_power = 1
min_temp = 0
max_temp = 120
control = pid
pid_kp = 58.437
pid_ki = 2.347
pid_kd = 363.769

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

[fan]
pin = PC6
max_power = 1.0
kick_start_time = 0.5
off_below = 0.13
cycle_time = 0.010

[idle_timeout]
timeout = 1800

[homing_override]
axes = z
set_position_z = 0
gcode =
G90
G0 Z5 F600
G28 X Y

G0 X-10 Y-10 F3600

G28 Z
G0 Z10 F1800

[gcode_macro PRINT_START]
gcode =
M117 Homing…
G28 Y0 X0 Z0
Z_TILT_ADJUST
G28 Y0 X0 Z0

G1 Z15.0 F600
G1 X125 Y125 F3000
G92 E0
G1 F9000
M117 Printing...

[gcode_macro PRINT_END]
gcode =

{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}


{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}

{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}

{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}


M400
G92 E0
G1 E-4.0 F3600
G91
G0 Z{z_safe} F3600
G0 X{x_safe} Y{y_safe} F20000

M104 S0
M140 S0
M106 S0
G90
G0 X{max_x / 2} Y{max_y} F3600
M117 Finished!

This is not your klippy.log’.

Can I make a suggestion? As the original issue has been resolved, start a new thread in General Discussion and include all the requested information, including the klippy.log and not what you feel is relevant.

2 Likes

OK,Thank you.

And the klippy.log as a file, do not copy&paste.

Upload

2 Likes

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