-
-
Notifications
You must be signed in to change notification settings - Fork 372
Slicer G code Scripts
Miguel Risco-Castillo edited this page Dec 3, 2022
·
22 revisions
This is only a general suggestion; the exact parameters depend on your hardware setup and preferences. These scripts assume a standard Ender 3 V2/S1 with a bed of 220x220 mm or similar.
M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration
M203 X500.00 Y500.00 Z20.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
G92 E0 ; Reset Extruder
G28 ; Home all axes
M420 S1 Z2; Use Level Mesh up to 2mm;
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
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 positioning
G1 X0 Y220 ;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
M201 X500.00 Y500.00 Z100.00 E5000.00 ;Setup machine max acceleration
M203 X500.00 Y500.00 Z20.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
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
; Setup firmware retraction settings
M207 F{ retract_speed[0] * 60} S[retract_length_0] Z[retract_lift_0]
M208 F{ deretract_speed[0] * 60} S[retract_restart_extra_0]
G28 ; home all
M420 S1 Z2 ; Active mesh leveling
G1 Z2 F240
G1 X2 Y10 F3000
G1 Z0.28 F240
G92 E0
G1 Y190 E15 F1500 ; intro line
G1 X2.3 F5000
G92 E0
G1 Y10 E15 F1200 ; intro line
G92 E0
{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+2, max_print_height)} F600{endif} ; Move print head up
G1 X5 Y170 F{travel_speed*60} ; present print
{if max_layer_z < max_print_height-10}G1 Z{z_offset+min(max_layer_z+70, max_print_height-10)} F600{endif} ; Move print head further up
M140 S0 ; turn off heatbed
M104 S0 ; turn off temperature
M107 ; turn off fan
M84 X Y E ; disable motors
For run a mesh leveling on each print replace the line:
M420 S1 Z2; Use Level Mesh up to 2mm;
With
G29 ; Run mesh leveling on every print (non UBL)
or
G29 P1 ; Run mesh leveling on every print (UBL)
You can automatically close the mesh viewer with a C108 in a new line after the G29. For load and tilt mesh leveling in UBL use:
G29 L0 ; Load mesh from slot 0 (or use any other previously saved slot)
G29 A ; Activate UBL
G29 J ; Auto tilt mesh
This Wiki and the included images were created under the Creative Commons License CC BY-NC-SA
Get the latest firmware here: https://github.com/mriscoc/Ender3V2S1/releases/latest