Comprehensive GCode Sharing Repo

In an attempt to encourage sharing and experimentation with GCode, I figured we should have a consolidated location to store what works and also respond to requests. Post your gcode below and complete the description below. I will then consolidate the GCode into the respective posts.

Description of Gcode:
Printer:
Modifications:
Firmware:
Will this work on a Stock Machine?:
Experimental or stable:
Post Gcode using code tags below

Stable Gcodes

Starting Gcodes:

Auto Level with Purge
Description of Gcode: Heats bed, then extruder, homes with G28, Auto Levels bed with G29, Moves off platform and purges nozzle, wipes the extruded plastic and begins printing.
Printer: TAZ 5
Modifications: Inductive leveling sensor installed
**Firmware:**Sebastians 1.1 Marlin
Will this work on a Stock Machine?: NO
**Author:**Discojon
Post Gcode using code tags below

G91 ; switch to relative positioning
G1 Z10 ; safe raise of z axis to ensure probe doesn't hit bed clamp
G90 ; switch back to absolute positioning
G28 ; home all axes
G29 ; level print bed
G1 X298 Y137 Z2 F5000 ; move to wait position right hand side of the table
G1 Z0.4 ; position nozzle
G1 E25 F300 ; purge nozzle
M400 ; wait for purge to complete
G1 X285 F1200 ; slow wipe
G1 Z0.5 F1200 ; lift

If you don’t have auto leveling enabled you can append this to the end of your start gcode to do the purge and wipe.

G1 X298 Y137 Z2 F5000 ; move to wait position right hand side of the table
G1 Z0.4 ; position nozzle
G1 E25 F300 ; purge nozzle
M400 ; wait for purge to complete
G1 X285 F1200 ; slow wipe
G1 Z0.5 F1200 ; lift

Filament Change GCode

Filament change with XY home
Description of Gcode: Inserted manually into gcode to trigger a pause and filament change. This should be inserted after the last line / prior to first line of the new color you want to use. I use octoprint and to resume the print I click resume on the GUI. The Extruder will lift, move to front left of bed, beep to indicate it’s ready for intervention. At this point the motors are still locked so do not manually move the extruder carriage. Swap filament, purge old color, click resume. The XY axis will home, and printing will resume with new color.
Printer: TAZ 5
Modifications: Inductive leveling sensor installed
**Firmware:**Sebastians 1.1 Marlin
Will this work on a Stock Machine?: Yes
**Author:**Discojon
Post Gcode using code tags below

;Pause Code
G91	;Set Relative Mode
G1 E-5.000000 F500	;Retract 5mm
G1 Z15 F300	;move Z up 15mm
G90	;Set Absolute Mode
G1 X20 Y20 F9000	;Move to hold position
G91	;Set Relative Mode
G1 E-40 F500	;Retract 40mm
M300 ;Beep
M0	;Idle Hold
G90	;Set Absolute Mode
G1 F5000	;Set speed limits
G28 X0 Y0	;Home X Y
M82	;Set extruder to Absolute Mode
G92 E0	;Set Extruder to 0

Experimental Gcodes

Requested Gcode

I think I understand basically what the above does, but I am having trouble finding the exact point in the GCode where I am to insert it.

Basically, I want to print a text object on top of an object in a different color. I assume that one “splices” the above code into the end of the print part of the first object, then I “splice” the printing GCode (not including any setup code) from the second object - in this case, the text object’s GCode - onto the end of the current GCode leaving the close statements in place to properly finish the print.

Surely it can’t be that easy? I find that “assuming” can lead to massive failure… In this case I “assume” that printing will restart on a new layer at the position indicated in the second printing object’s GCode…

…and yes, I am using the same type filament - ColorFabb ABS Black and Orange

Printer: TAZ6
Print GUI: Cura 21.03

So, is my logic flawed?

I use my slicer (S3D) to identify the layer where I want the color change to occur. Lets say I want to change color after layer 20. I slice and save as normal, the open the gcode in a text editor and search for “layer 21”. Insert the code above layer 21, and print.


Start code
Layer 1
Layer 2

Layer 20
Insert Pause Code Here
Layer 21

Thanks, discojon for the GCode script!

I have to admit that I realized I was being a whiney beatch a few minutes after posting…

So I got off my butt and started poking around…

I generated a GCode script file in Cura, then used my trusty Windows Notepad app to poke around in the script.

I discovered the Layer comments then went back to Cura and viewed the file in the slicer mode to determine exactly when the text part of the object started. Armed with that information (layer 17, I believe), I went back to Notepad and did a “Find” for the “Layer 17” comment.

I plugged in your code above the comment, saved and then printed.

It was Magical!

My own 3D printing version of “Hello World”!

Thanks!

Glad you got it working