Skip to content

Instantly share code, notes, and snippets.

@mikejr83
Last active July 28, 2022 19:47
Show Gist options
  • Save mikejr83/fa3bbd32c5b5d4217281881ceab9dfa5 to your computer and use it in GitHub Desktop.
Save mikejr83/fa3bbd32c5b5d4217281881ceab9dfa5 to your computer and use it in GitHub Desktop.
Various Custom G-Code for the Artist-D in Prusa Slicer
G91 ;Relative positioning
G0 E-2 F2700 ;Retract a bit
G0 E-2 Z0.2 F2400 ;Retract and raise Z
G0 X5 Y5 F3000 ;Wipe out
G0 Z10 ;Raise Z more
G90 ;Absolute positionning
G0 Y310 ;Present print
M106 S0 ;Turn-off fan
M104 S0 T0 ;Turn-off hotend 1
M104 S0 T1 ;Turn-off hotend 2
M140 S0 ;Turn-off bed
G28X ; Home x-carriages
M605 S1 ; Reset to auto-park
M84 X Y E ;Disable all steppers but Z
G91 ;Relative positioning
G0 E-2 F2700 ;Retract a bit
G0 E-2 Z0.2 F2400 ;Retract and raise Z
G0 X5 Y5 F3000 ;Wipe out
G0 Z10 ;Raise Z more
G90 ;Absolute positionning
{if current_extruder==0}
G0 X0 Y310 ;Present print
{else}
G0 X310 Y310 ;Present print
{endif}
M106 S0 ;Turn-off fan
M104 S0 T0 ;Turn-off hotend 1
M104 S0 T1 ;Turn-off hotend 2
M140 S0 ;Turn-off bed
G28X ; Home x-carriages
M84 X Y E ;Disable all steppers but Z
; -- BEGIN - DUPLICATION MODE INITIALIZATION --
M605 S1 ; AUTO-PARK MODE
T0 ; SET TOOL 0
G28 ; HOME ALL AXIS
M605 S2 X155 ; SET DUPLICATION MODE AND NOZZLE OFFSET
G28 X ; HOME X AXIS
G1 X77.5 ; SET BOTH EXTRUDERS TO THE MIDDLE OF THEIR PRINT AREA
; -- END - DUPLICATION MODE INITIALIZATION
M140 S[first_layer_bed_temperature] ; Set Heat Bed temperature
M104 S[first_layer_temperature] ; Set Extruder temperature
M190 S[first_layer_bed_temperature] ; Wait for Heat Bed temperature
G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X10 Y20 Z0.3 F5000.0 ; Move to start position
M109 S[first_layer_temperature] ; Wait for Extruder temperature
G1 X10 Y200.0 Z0.2 F1500.0 E15 ; Draw the first line
G1 X10.3 Y200.0 Z0.2 F5000.0 ; Move to side a little
G1 X10.3 Y20 Z0.2 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 X14 Y20 Z0.2 F5000.0 ; Move over to prevent blob squish
; -- BEGIN - MIRROR MODE INITIALIZATION --
M605 S1
T0
G28
M605 S2 X155
G28 X
G1 X77.5
M605 S3 X155
; -- END - MIRROR MODE INITIALIZATION
M140 S[first_layer_bed_temperature] ; Set Heat Bed temperature
M104 S[first_layer_temperature] ; Set Extruder temperature
M190 S[first_layer_bed_temperature] ; Wait for Heat Bed temperature
G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X10 Y20 Z0.3 F5000.0 ; Move to start position
M109 S[first_layer_temperature] ; Wait for Extruder temperature
G1 X10 Y200.0 Z0.2 F1500.0 E15 ; Draw the first line
G1 X10.3 Y200.0 Z0.2 F5000.0 ; Move to side a little
G1 X10.3 Y20 Z0.2 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 X14 Y20 Z0.2 F5000.0 ; Move over to prevent blob squish
M605S1 ; Set to auto-park
T[initial_tool]
M140 S[first_layer_bed_temperature] ; Set Heat Bed temperature
M104 S[first_layer_temperature_[initial_tool]] ; Set Extruder temperature
G28 ;Home
M190 S[first_layer_bed_temperature] ; Wait for Heat Bed temperature
G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X10 Y20 Z0.3 F5000.0 ; Move to start position
M109 S[first_layer_temperature_[initial_tool]] ; Wait for Extruder temperature
G1 X10 Y200.0 Z0.2 F1500.0 E15 ; Draw the first line
G1 X10.3 Y200.0 Z0.2 F5000.0 ; Move to side a little
G1 X10.3 Y20 Z0.2 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 X14 Y20 Z0.2 F5000.0 ; Move over to prevent blob squish
; TOOL CHANGE ---START---
T[next_extruder]
{if current_extruder != next_extruder}
M104 S175 T[current_extruder]
{endif}
{if layer_num==0}
M109 S[first_layer_temperature_[next_extruder]] T[next_extruder] ; Wait for Extruder temperature
{else}
M109 S[temperature_[next_extruder]] T[next_extruder] ; Wait for Extruder temperature
{endif}
; TOOL CHANGE ---END---
@mikejr83
Copy link
Author

mikejr83 commented May 5, 2021

Using Custom G-Codes in PrusaSlicer

For use with the Artist-D standard or pro

Each of the "files" above represents different custom g-code sections in PrusaSlicer. The three main files and their corresponding sections are:

  • PrusaSlicer-Start.gcode - Start G-code - Used for "Auto-Park" IDEX mode. This g-code will put the printer into "Auto-Park" mode. This sets the printer up to print and takes into account if you're using multiple extruders during the print.
  • PrusaSlicer-End.gcode - End G-code - Used for presenting the print at the end and cooling down the bed and extruders.
  • PrusaSlicer-ToolChange.gcode - Tool change g-code - Used for switching between extruders during a multi-material print. This code is enhanced when using the community firmware for the Artist-D (only available on the standard edition)

When setting up the printer in PrusaSlicer I created a base version of the printer and set it up with two extruders. You can then use g-code listed above. I then created two more versions of the printer. Each of these had the bed sized changed to 155mm on the X. This was for mirror and duplication mode.

Use PrusaSlicer-StartMirror.gcode to in the "Start G-code" section for this new printer and it will automatically set the printer to mirror the printed model. Create a third printer for duplication. Use PrusaSlicer-StartDuplication.gcode to put the printer into duplication mode. For both of these printers the "End G-code" is the same. Use PrusaSlicer-End-Mirror-Duplication.gcode to return the printer back to "Auto Park" IDEX mode.

@jpswensen
Copy link

Do you happen to have the rest of your profile? Even this part is immensely useful, and I can spend the time comparing the Cura settings provided by JGMAKER to transfer them over to PrusaSlicer, but if you are willing to share the full profile I would greatly appreciate it.

@gabr42
Copy link

gabr42 commented Jul 18, 2022

@jpswensen
Copy link

Thank you so much! I think that will help me get up and running quickly. I am going to try and tune some of them for PLA and PVA dissolvable support. I will come back and post my results here if I get a good combination.

@mikejr83
Copy link
Author

@jpswensen We have a good set of guys running the artist over on our Discord: https://discord.gg/vJ6GxxKW "3D Misfits". Please come and ask any questions. We'll be glad to help you out.

@jpswensen
Copy link

@mikejr83 , I tried to join that group and it just gave a "Whoops. Unable to accept invite" error. I am wonder if the group has been closed?

@mikejr83
Copy link
Author

mikejr83 commented Jul 18, 2022 via email

@jpswensen
Copy link

jpswensen commented Jul 19, 2022 via email

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