"Invalid data" when slicing? G-code is messed up...
Copied over some G-Code settings from Cura to PrusaSlicer for my Cr-10s printer and it doesn't want to slice. Does PrusaSlicer interpret G-Code differently and does anyone know how to make it compatible?
Start G-Code:
M80 192.168.178.35 1 ; Turn on Sonoff to power printer M140 S60; # Heat bed to 60 and wait for it M105; M190 S60; M104 S150; # heat extruder to 150C and wait for it M105; M109 S150; M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration M203 X500.00 Y500.00 Z10.00 E50.00 ;Setup machine max feedrate M204 P500.00 R1000.00 T500.00 ;Setup Print/Retract/Travel acceleration M205 X8.00 Y8.00 Z0.40 E5.00 ;Setup Jerk M220 S100 ;Reset Feedrate M221 S100 ;Reset Flowrate G28 ;Home G29 ; BLTOUCH level bed M190 S{material_bed_temperature_layer_0}; Heat to print temps M109 S{material_print_temperature_layer_0}; Heat to print temps G92 E0 ;Reset Extruder G1 Z2.0 F3000 ;Move Z Axis up G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line G92 E0 ;Reset Extruder G1 Z2.0 F3000 ;Move Z Axis up
End G-Code:
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z
M81 192.168.178.35 1 ; turn off sonoff to turn off printer
Error:
G-code export to C:\Users\Me\AppData\Local\Temp\.11020.gcode failed due to invalid custom G-code sections:end_gcode
Parsing error at line 8: Not a variable nameG1 X0 Y{machine_depth} ;Present print ^start_gcode
Parsing error at line 18: Not a variable nameM190 S{material_bed_temperature_layer_0}; Heat to print temps
hw: PRUSA MINI+, FW 4.3.3 & Cr-10s w/ BLTouch, Ezboard, Hemerasw: PrusaSlicer 2.4, Windows 11
RE:
You have 2 placeholders in your custom gcode that are not available in PrusaSlicer: machine_depth and material_bed_temperature_layer_0
Here is a link to a list of all the placeholders that are available. https://help.prusa3d.com/en/article/list-of-placeholders_205643
Mk3S+,SL1S
RE:
You can replace the line 'G1 X0 Y{machine_depth} ;Present print' with 'G1 X0 Y200'
and you can replace 'M190 S{material_bed_temperature_layer_0}; Heat to print temps' with 'M190 S[first_layer_bed_temperature] ; wait for bed temp' (without the quotes).
This will give you placeholders that are compatible with Prusa Slicer. You make these changes at Printer Settings > Custom g-code.
OR you can most likely just use the default custom g-codes in PrusaSlicer.
Mk3S+,SL1S
RE:
No, you wouldn't use the Prusa Slicer default custom gcode. I forgot that you are printing on the CR-10 when I wrote that last bit.
Mk3S+,SL1S
RE: "Invalid data" when slicing? G-code is messed up...
Perfect, those placeholder changes worked. Now it's slicing just fine.
hw: PRUSA MINI+, FW 4.3.3 & Cr-10s w/ BLTouch, Ezboard, Hemerasw: PrusaSlicer 2.4, Windows 11