Skip to content

Instantly share code, notes, and snippets.

@JohnScottUK
Last active June 5, 2025 17:14
Show Gist options
  • Save JohnScottUK/de30eb8c22993c4405e6afbd9b5db113 to your computer and use it in GitHub Desktop.
Save JohnScottUK/de30eb8c22993c4405e6afbd9b5db113 to your computer and use it in GitHub Desktop.
Ender 3 S1 Pro Optimal Start/Stop GCode for OrcaSlicer Software.
; Creality Ender-3 S1 Pro Optimal Start GCode for OrcaSlicer Software.
; By John Scott, 2023. https://gist.github.com/JohnScottUK/de30eb8c22993c4405e6afbd9b5db113
;M117 Set Movement...
G90; Use absolute positioning.
;M117 Heating Bed...
M140 S[bed_temperature_initial_layer_single]; Start heating bed.
;M117 Homing Axis...
G28; Home all axis to know where everything is.
; Bed Mesh - Use one of M420 or G29. Uncomment if/as required.
;M420 S1 Z10; Use saved bed mesh, fading out over 10 layers. Quicker and reduced machine wear.
; Alternative - Generate new bed mesh this print.
;M117 Awaiting Bed+Nozzle...
;M104 S150; Start pre-heating nozzle without oozing filament.
;M190 S[bed_temperature_initial_layer_single]; Wait for bed temperature when creating new bed mesh.
;M109 S150; Wait for hotend pre-heat temperature to create new bed mesh with everything warm.
;M117 Generating Bed Mesh...
;G29; Create new bed mesh for this print.
;M117 Ready Nozzle...
G1 Z2.0 F3000; Move Z Axis up to avoid bed.
G1 X2.0 Y10 F5000; Move above purge-line start, so any hotend oozing is out the way.
G1 Z0.28; Drop and wait for temperature.
;M117 Awaiting Bed+Nozzle...
M104 S150; Start pre-heating nozzle without oozing filament.
M190 S[bed_temperature_initial_layer_single]; Wait for bed temperature before printing.
M109 S[nozzle_temperature_initial_layer]; Set and wait for nozzle to reach temperature.
;M117 Purging Nozzle...
G92 E0; Reset extruder.
G1 X2.0 Y140 Z0.28 F1500 E10; Draw the first line.
G1 X2.3 Y140 Z0.28 F5000; Move to side a little.
G1 X2.3 Y10 Z0.28 F1500 E20; Draw the second line.
;M117 Printing...
; Creality Ender-3 S1 Pro Optimal End GCode for OrcaSlicer Software.
; By John Scott, 2023. https://gist.github.com/JohnScottUK/de30eb8c22993c4405e6afbd9b5db113
;M117 Printing Finished...
G91; Relative positioning.
G1 Z0.2 E-2 F2400; Retract extruder a little and raise Z.
G1 X5 Y5 F3000; Wipe out.
G1 Z10; Raise Z more.
;M117 Presenting Print...
G90; Absolute positioning.
G1 X0 Y200; Present print.
;M117 Stopping...
M140 S0; Turn off bed.
M104 S0; Turn off hotend.
M106 S0; Turn off fan.
M84; Disable all steppers.
;M117 Printing Complete.
; Sonic Pad Ender-3 S1 Pro Optimal Start GCode for OrcaSlicer Software.
; By John Scott, 2023. https://gist.github.com/JohnScottUK/de30eb8c22993c4405e6afbd9b5db113
; Set Movement...
G90; Use absolute positioning.
; Heat Bed...
M140 S[bed_temperature_initial_layer_single]; Start heating bed.
; Home Axis...
G28; Home all axis to know where everything is.
; Bed Mesh - Use one of CALIBRATE or PROFILE LOAD. Uncomment if/as required.
;M104 S150; Start pre-heating hotend without oozing filament.
;M190 S[bed_temperature_initial_layer_single]; Wait for bed temperature when creating new bed mesh.
;M109 S150; Wait for hotend pre-heat temperature to create new bed mesh with everything warm.
;BED_MESH_CALIBRATE
;BED_MESH_PROFILE LOAD=default
; Ready Nozzle...
G1 Z2.0 F3000; Move Z Axis up to avoid bed.
G1 X2.0 Y10 F5000; Move above purge-line start, so any hotend oozing is out the way.
G1 Z0.28; Drop and wait for temperature.
; Await Bed+Nozzle...
M104 S150; Start pre-heating hotend without oozing filament.
M190 S[bed_temperature_initial_layer_single]; Wait for bed temperature before printing.
M109 S[nozzle_temperature_initial_layer]; Set and wait for hotend to reach temperature.
; Purge Nozzle...
G92 E0; Reset extruder.
G1 X2.0 Y140 Z0.28 F1500 E10; Draw the first line.
G1 X2.3 Y140 Z0.28 F5000; Move to side a little.
G1 X2.3 Y10 Z0.28 F1500 E20; Draw the second line.
; Print...
; Sonic Pad Ender-3 S1 Pro Optimal End GCode for OrcaSlicer Software.
; By John Scott, 2023. https://gist.github.com/JohnScottUK/de30eb8c22993c4405e6afbd9b5db113
; Print Finished...
G91; Relative positioning.
G1 Z0.2 E-2 F2400; Retract extruder a little and raise Z.
G1 X5 Y5 F3000; Wipe out.
G1 Z10; Raise Z more.
; Present Print...
G90; Absolute positioning.
G1 X0 Y200; Present print.
; Stop...
M140 S0; Turn off bed.
M104 S0; Turn off hotend.
M106 S0; Turn off fan.
M84; Disable all steppers.
; Print Complete.
@PFeims
Copy link

PFeims commented Oct 14, 2024

using the Sonic pad and Orca slicer, after the purge Nozzle (lines 31-34) i get an error code on the sonic pad noting the printer timed out. When using your same start Gcode for prusaslicer I am not getting that error. Any ideas why?

@JohnScottUK
Copy link
Author

using the Sonic pad and Orca slicer, after the purge Nozzle (lines 31-34) i get an error code on the sonic pad noting the printer timed out. When using your same start Gcode for prusaslicer I am not getting that error. Any ideas why?

That’s odd as it’s the last lines of the start gcode. Assuming the nozzle has been up and down the bed so is definitely completed line 34. do you have any start layer or start filament gcode in orcaslicer?

@PFeims
Copy link

PFeims commented Oct 20, 2024

It was so odd it has never happened again! Sorry i meant to write a follow up. Everything is running perfectly! thank you!

@JohnScottUK
Copy link
Author

Ah this might be the USB cable into the Sonic Pad. I have seen people with lots of random connectivity issues. Especially with the side USB ports.

@mmoroun
Copy link

mmoroun commented Oct 20, 2024

Hi John, i've used your gcodes before and i'm switching to orca right now. i'm somewhat new to this.. why do you provide 2 slightly different start/stop codes?

@PFeims
Copy link

PFeims commented Oct 20, 2024

@mmoroun There are two variants, one basic ender 3 s1 and the other is for the ender 3 s1 when using the sonic pad.

@JohnScottUK
Copy link
Author

@PFeims is correct. If you have a Sonic Pad use that one (especially the commands for bed mesh which need to be uncommented - ie ; removed). If you use stock firmware use the creality ones. If you have Thomas Toka firmware you can uncomment the M117 lines so the screen gets updated with progress.

@mmoroun
Copy link

mmoroun commented Oct 21, 2024

@JohnScottUK i can't believe i didn't notice that. i wonder which one i was using when i was running Cura lol

i'm now on Orca - hence why i'm on this post - but it seems like it's not using the start g-code. all my prints start fine but i have it on bed_mesh_calibrate option and it doesnt do it at the start of the print... makes me wonder if it's pulling a start g-code from somewhere else? any ideas?

@JohnScottUK
Copy link
Author

@mmoroun did you uncomment lines 14-17 so they don’t start with a ;

depending on whether you want to calibrate each print or load a saved mesh you need to uncomment 14-17 or just line 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment