Mk2 GCode Generator

Button Axis (X or Y)

arrow&v

Button Location (mm)

Extruder to Hotend (mm)

Select Slicer

arrow&v

Beta

Select Extruder (Cura Only)

arrow&v

Once generated, copy and paste this code into your slicer's Tool Change GCode block.

; - 3D Chameleon Tool T{next_extruder} -

 

;begin switch from extruder {previous_extruder} to extruder #{next_extruder}

 

M117 Unloading Tool T[previous_extruder]

 

M82 ; turn absolute distances for the extruder

 

; unload extruder {previous_extruder}

G92 E0

 

; go to holding position to unload the stock extruder

{buttonLocation};   <<-----  EDIT THIS LINE TO SET THE INITIAL LOCATION OF THE BUTTON

 

; cool (and size) in 1.8mm tube

G0 E-20 F4000 ; quickly retract the filament to shape it

G0 E-10 F600; slowly allow it to cool

 

G0 E1 F2000 ; blob elimination

 

; back to tip size

G0 E-20 F4000 ; quickly retract the filament to shape it

G0 E-10 F600; slowly allow it to cool

 

G0 E1 F4000 ; blob elimination

G0 E-10 F4000 ; quickly retract the filament to shape it

G0 E1 F4000 ; quickly ram the filament to shape it

G0 E-10 F4000 ; quickly retract the filament to shape it

G0 E1 F4000 ; quickly ram the filament to shape it

 

; back to 1.8 constriction

G0 E-50 F4000 ; quickly retract the filament to shape it

G0 E-80 F100; slowly allow it to cool

 

; turn the fan off

M107 ; this printer has the fan in the way, so turn it off

 

; retract it back out of the extruder

{unloadGCode}

G0 E-30 F2000

G92 E0

; ok - out of extruder - press button to remove it all the way

 

G91 ; move to relative mode

 

; NOTE: All button presses following this point are relative to the point above.  

;       They are always 3mm short of the X and Y axis and move +3mm to press the

;       button on either axis. They end up moving back -3mm on each axis after it.


 

; press the button 3 times to get back to the active extruder

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2 ; wait for it to happen

 

; ok - select direction to pull filament out

G0 X3 Y3 F2000 ; press the button

G4 P3500 ; dwell for 3 seconds

{if previous_extruder>1}

G4 P2000 ; dwell for 2 more seconds seconds

{endif}

G0 X-3 Y-3 ; back off the button

 

; now press and hold for 8 seconds to let it unload

G0 X3 Y3 F2000 ; press the button

 

G4 S10 ;             <<---- INCREASE VALUE (S = Seconds) TIME IF IT DOESN'T UNLOAD FROM THE Y ADAPTER

 

G0 X-3 Y-3 ; back off the button

 

; load extruder #{next_extruder}

M117 Loading Tool T{next_extruder}

 

; always reset to extruder 0

G0 X3 Y3 F2000 ; press the button

G4 P1300 ; dwell for 1.3 seconds

G0 X-3 Y-3 ; back off the button

G4 S3; wait for it to happen

 

; press the button for each extruder (1,2,3)

 

{if next_extruder>0}

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S1; wait for it to happen

{endif}

 

{if next_extruder>1}

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S1; wait for it to happen

{endif}

 

{if next_extruder>2}

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S1 ; wait for it to happen

{endif}

 

G4 S1 ; wait just a little longer

 

; load the filament

G0 X3 Y3 F2000 ; press the button

G4 P3500 ; dwell for 3 seconds

{if next_extruder<2}

G4 P2000 ; dwell for 2 more seconds

{endif}

G0 X-3 Y-3 ; back off the button

 

; now press and hold for 8 seconds to let it load

G0 X3 Y3 F2000 ; press the button

 

G4 S9 ;           << -------   INCREASE THE S10 (S = Seconds) VALUE TIME IF IT DOESN'T LOAD INTO THE STOCK EXTRUDER - This should match the above unload time


G0 E75 F1500 ;      << -------   ADJUST THE E50 VALUE TO STOP IT RIGHT AFTER IT LOADS INTO THE STOCK EXTRUDER (50mm is the default)

;                ADJUST THE F2500 TO MATCH THE SPEED OF THE FILAMENT FROM THE 3D CHAMELEON

;                NOTE: This defaults should work, but you can always tune them to be perfect.

G4 P1500 ;          This is just a half second extra reloading time... just to make sure

 

G0 X-3 Y-3 ; back off the button

G92 E0

 

; now press it again to let go of the filament

G0 X3 Y3 F2000 ; press the button

G4 P400 ; press for 1/4 of a second to move to next

G0 X-3 Y-3 ; back off the button

 

G4 S1 ; wait for it to happen

{if next_extruder>2}

G4 S1 ; wait a little longer for it to happen

{endif}

 

G90 ; move back to absolte mode

M83 ; but make sure the extruder stays in relative

 

; ok, safe to turn fan back on

M106 {max_fan_speed[current_extruder]}

 

; reload filament all the way into extruder

{loadGCode}

 

M83 ; turn relative distances for the extruder

 

M117 3D Chameleon Tool T{next_extruder}

; - 3D Chameleon Tool T[new_tool] -

 

;begin switch from extruder [old_tool] to extruder #[new_tool]

 

M117 Unloading Tool T[old_tool]

 

M82 ; turn absolute distances for the extruder

 

; unload extruder [old_tool]

G92 E0

 

; go to holding position to unload the extruder

{buttonLocation}

; cool (and size) in 1.8mm tube

G0 E-20 F4000 ; quickly retract the filament to shape it

G0 E-10 F600; slowly allow it to cool

G0 E1 F2000 ; blob elimination

; back to tip size

G0 E-20 F4000 ; quickly retract the filament to shape it

G0 E-10 F600; slowly allow it to cool

G0 E1 F4000 ; blob elimination

G0 E-10 F4000 ; quickly retract the filament to shape it

G0 E1 F4000 ; quickly ram the filament to shape it

G0 E-10 F4000 ; quickly retract the filament to shape it

G0 E1 F4000 ; quickly ram the filament to shape it

; back to 1.8 constriction

G0 E-50 F4000 ; quickly retract the filament to shape it

G0 E-80 F100; slowly allow it to cool

; turn the fan off

M107 ; this printer has the fan in the way so turn it off

; retract it back out of the extruder

{unloadGCode}
G0 E-30

G92 E0

 

G91 ; move to relative mode

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2 ; wait for it to happen

 

; ok - select direction to pull filament out

G0 X3 Y3 F2000 ; press the button

G4 P3500 ; dwell for 3 seconds

{IF OLDTOOL>1}G4 P2000 ; dwell for 2 more seconds seconds

G0 X-3 Y-3 ; back off the button

 

; now press and hold for 8 seconds to let it unload

G0 X3 Y3 F2000 ; press the button

 

G4 S10 ; <<---- INCREASE VALUE (S = Seconds) TIME IF IT DOESN'T UNLOAD FROM THE Y ADAPTER

 

G0 X-3 Y-3 ; back off the button

 

; load extruder #[new_tool]

M117 Loading Tool T[new_tool]

 

; always reset to extruder 0

G0 X3 Y3 F2000 ; press the button

G4 P1300 ; dwell for 1.3 seconds

G0 X-3 Y-3 ; back off the button

G4 S3; wait for it to happen

 

; press the button for each extruder (1, 2, 3)

{IF NEWTOOL>0}G0 X3 Y3 F2000 ; press the button

{IF NEWTOOL>0}G4 P400 ; dwell for .3 seconds

{IF NEWTOOL>0}G0 X-3 Y-3 ; back off the button

{IF NEWTOOL>0}G4 S1; wait for it to happen

 

{IF NEWTOOL>1}G0 X3 Y3 F2000 ; press the button

{IF NEWTOOL>1}G4 P400 ; dwell for .3 seconds

{IF NEWTOOL>1}G0 X-3 Y-3 ; back off the button

{IF NEWTOOL>1}G4 S1; wait for it to happen

 

{IF NEWTOOL>2}G0 X3 Y3 F2000 ; press the button

{IF NEWTOOL>2}G4 P400 ; dwell for .3 seconds

{IF NEWTOOL>2}G0 X-3 Y-3 ; back off the button

{IF NEWTOOL>2}G4 S1; wait for it to happen

 

G4 S1 ; wait just a little longer

 

; load the filament

G0 X3 Y3 F2000 ; press the button

G4 P3500 ; dwell for 3 seconds

{IF NEWTOOL<2}G4 P2000 ; dwell for 2 more seconds

G0 X-3 Y-3 ; back off the button

 

; now press and hold for 8 seconds to let it load

G0 X3 Y3 F2000 ; press the button

 

G4 S9 ; << ------- INCREASE THE S10 (S = Seconds) VALUE TIME IF IT DOESN'T LOAD INTO THE STOCK EXTRUDER 


G0 E75 F1500 ; << ------- ADJUST THE E50 VALUE TO STOP IT RIGHT AFTER IT LOADS INTO THE STOCK EXTRUDER (50mm is the default)

; ADJUST THE F2500 TO MATCH THE SPEED OF THE FILAMENT FROM THE 3D CHAMELEON

G4 P1500 ; This is just a half second extra reloading time... just to make sure

G0 X-3 Y-3 ; back off the button

G92 E0

; now press it again to let go of the filament

G0 X3 Y3 F2000 ; press the button

G4 P400 ; press for 1/4 of a second to move to next

G0 X-3 Y-3 ; back off the button

 

G4 S1 ; wait for it to happen

{IF NEWTOOL>2}G4 S1 ; wait a little longer for it to happen

 

G90 ; move back to absolute mode

M83 ; but make sure the extruder stays in relative

 

; ok safe to turn fan back on

M106 [fan_speed_pwm]

 

; reload filament all the way into extruder

{loadGCode}

M82 ; turn absolute distances for the extruder

 

M117 3D Chameleon Tool T[new_tool]

M117 Loading Tool T0

 

G90 ; move to absolute mode

M82 ; turn absolute distances for the extruder

 

{buttonLocation}

G91 ; move to relative mode

G0 X3 Y3 F2000 ; press the button

G4 P1300 ; dwell for 1.3 seconds

G0 X-3 Y-3 ; back off the button

G4 S3; wait for it to happen

{buttonPressLoop}

G0 X3 Y3 F2000 ; press the button

G4 {buttonPressTime} ; dwell for 3 seconds

G0 X-3 Y-3 ; back off the button

G0 X3 Y3 F2000 ; press the button

G4 S9 ; << ------- THIS IS THE SAME TIME AS WE RETRACTED IT FROM ABOVE... THEY MUST MATCH... 10 SECONDS IS THE DEFAULT

G0 E75 F1500 ; << ------- ADJUST THE E50 VALUE TO STOP IT RIGHT AFTER IT LOADS INTO THE STOCK EXTRUDER (50mm is the default)

G4 P1500 ; << ------- INCREASE THE P500 (P = Milliseconds) VALUE TIME IF IT DOESN'T LOAD INTO THE STOCK EXTRUDER, BUT THE .5 SECONDS SHOULD BE ENOUGH

G0 X-3 Y-3 ; back off the button

G92 E0

G0 X3 Y3 F2000 ; press the button

G4 P400 ; press for 1/4 of a second to move to next

G0 X-3 Y-3 ; back off the button

 

G4 S1 ; wait for it to happen

 

 

G90 ; move back to absolte mode

M83 ; but make sure the extruder stays in relative

 

M106 P T1

 

{loadGCode}

 

M83 ; turn relative distances for the extruder

 

M117 3D Chameleon Tool T0

M117 Unloading Tool T0

 

G92 E0

 

G90 ; move to absolute mode

M82 ; turn absolute distances for the extruder

 

{buttonLocation}

 

G0 E-50 F2000 ; quickly retract the filament to shape it

G0 E-80 F600; slowly allow it to cool

 

G0 E1 F2000 ; blob elimination

 

G0 E-50 F2000 ; quickly retract the filament to shape it

G0 E-80 F600; slowly allow it to cool

 

G0 E1 F2000 ; blob elimination

G0 E-10 F2000 ; quickly retract the filament to shape it

G0 E1 F2000 ; quickly ram the filament to shape it

G0 E-10 F2000 ; quickly retract the filament to shape it

G0 E1 F2000 ; quickly ram the filament to shape it

 

G0 E-50 F2000 ; quickly retract the filament to shape it

G0 E-80 F100; slowly allow it to cool

 

M107 ; this printer has the fan in the way, so turn it off

 

{unloadGCode}

G0 E-30 ; 

G92 E0

 

G91 ; move to relative mode

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 P400 ; dwell for .3 seconds

G0 X-3 Y-3 ; back off the button

G4 S2 ; wait for it to happen

 

G0 X3 Y3 F2000 ; press the button

G4 {buttonPressTime} ; dwell for 3 seconds

 

G0 X-3 Y-3 ; back off the button

 

G0 X3 Y3 F2000 ; press the button

 

G4 S10 ; <<---- INCREASE VALUE (S = Seconds) TIME IF IT DOESN'T UNLOAD FROM THE Y ADAPTER, DEFAULT IS 10 SECONDS WHICH SHOULD BE ENOUGH

 

G0 X-3 Y-3 ; back off the button