Basic Information:
Printer Model: TwoTrees SP5 V3
MCU / Printerboard: MKS Robin Nano V3
Host / SBC BTT Pad7
klippy.log
klippy.log (253.5 KB)
Fill out above information and in all cases attach your klippy.log
file (use zip to compress it, if too big). Pasting your printer.cfg
is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there
Describe your issue:
I’m trying to get a handle on macros but I can’t get past the START_PRINT macro throwing an error “Can’t parse command M140 S”. It’s a “borrowed” macro with minor changes, temps and coordinates, by me. As always help is appreciated. Here’s the macro:
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(140)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0
SFS_ENABLE ;ENABLE FILAMENT SENSOR
[gcode_macro CG28] # Home the printer if not already homed
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
M190 S{BED_TEMP} # Wait for bed to reach temperature
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
#reset extruder position
G92 E0
# Leave any oozing behind (hopefully) 4/23/25
G1 Z5 F350 # Move the nozzle near the bed
;G1 E-1 F300
G1 X2 Y0 F2000 #Move nozzle to antioozing :) line start
G1 Z0.15 F300 # Move the nozzle very close to the bed
G1 Y10 F2200
;G1 Y5 E0 F1000
;G1 X5 E0 F3000
G1 Z0.28 F450
G1 X2 Y30 F3000 #Move to prime line start
G92 E0
G1 Y210 E10 F1500 # prime the nozzle #1/25/25
G1 X3 F5000
G92 E0
G1 Y30 E10 F1200 # prime the nozzle #1/25/25
G92 E0
...
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(140)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0
SFS_ENABLE ;ENABLE FILAMENT SENSOR
[gcode_macro CG28] # Home the printer if not already homed
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
M190 S{BED_TEMP} # Wait for bed to reach temperature
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
#reset extruder position
G92 E0
# Leave any oozing behind (hopefully) 4/23/25
G1 Z5 F350 # Move the nozzle near the bed
;G1 E-1 F300
G1 X2 Y0 F2000 #Move nozzle to antioozing :) line start
G1 Z0.15 F300 # Move the nozzle very close to the bed
G1 Y10 F2200
;G1 Y5 E0 F1000
;G1 X5 E0 F3000
G1 Z0.28 F450
G1 X2 Y30 F3000 #Move to prime line start
G92 E0
G1 Y210 E10 F1500 # prime the nozzle #1/25/25
G1 X3 F5000
G92 E0
G1 Y30 E10 F1200 # prime the nozzle #1/25/25
G92 E0
The spaces in line 14 before [gcode_macro ...
should be deleted.
The Start_print macro in the klippy.log looks different that the one you posted.
[gcode_macro START_PRINT]
gcode =
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
M190 S{BED_TEMP}
M109 S{EXTRUDER_TEMP}
G92 E0
G1 Z5 F350
G1 X2 Y0 F2000
G1 Z0.15 F300
G1 Y10 F2200
G1 Z0.28 F450
G1 X2 Y30 F3000
G92 E0
G1 Y210 E10 F1500
G1 X3 F5000
G92 E0
G1 Y30 E10 F1200
G92 E0
I removed the spaces and that solved that issue. I’m still trying to figure out these macros. Now I’m getting an error “Can’t reset SD card from SD card” . So I’ll delve into that today. Start commenting things out until I get an Ah-Ha moment.
As to why the Klippy log shows a different start code the the one in Macros.cfg that’s above my paygrade. I even saved everything, restarted Klipper and downloaded the log and it looks the same as the one you posted. This is the first time I really looked at that log, it’s interesting all that it shows. Now I know why it’s uploaded when posting here.
Thanks again.
1 Like