top of page

Mk3 Mode 2 GCode Generator

Button Axis (X or Y)

Button Location (mm)

Extruder to Hotend (mm)

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

Mk3 Theory of Operation

The Mk3 Firmware uses a new method to allow color changing with a single button press.

It works by timing (with vibration feedback every .5 seconds) to allow you to "count" the command.

By default, there are two modes of operation.

1) Loader/Unloader Mode (default) - where the 3D Chameleon is used in conjunction with your stock extruder.  This is the easiest method of installation, but is a little slower.

2) Direct Drive Mode - where the 3D Chameleon is replacing your stock extruder (but using the stock motor and wiring) and all filament motions or pauses are skipped to allow stock extruder commands to move the filament.  This is a harder installation, but allows for much faster color changes.

Color changing always works the same in either mode.  To select a color, simply press the button .5 seconds per color.  So, pressing the button for .5 seconds selects the first color, 1 second selects the second color, 1.5 seconds selects the 3rd color and 2 seconds selects the 4th color.  In Loader/Unloader Mode, it will automatically unload the current filament, switch to the new filament and reload it to the extruder.

While the button is pressed, each half of a second, the selector motor will vibrate, indicating the pointer to the next command.

The commands are as follows.

1st Pulse - Unload current and load T0 (or Color 1)
2nd Pulse - Unload current and load T1 (or Color 2) 
3rd Pulse - Unload current and load T2 (or Color 3)
4th Pulse - Unload current and load T3 (or Color 4)


5th Pulse - Home and load T0 - can be used in Start GCode to load the first filament
6th Pulse - Unload current and Home - can be used in the End GCode to unload the last used filament

7th Pulse - Home Only (no filament movements)

8th and 9th Pulse - No action preformed

10th Pulse - Mode Switch (direct drive / loader-unloader mode - responds with 1 vibration or 2 indicating which mode it is in mode - default is 2)

11th Pulse through 14th Pulse- No action preformed

15 - Record New Time Interval, 1st press should be for 1x time duration, 2nd press is 2x duration(default time is .5 seconds) 

 - System responds with 3 vibrations after initial command, 1 after the first press and 2 after the second press.  (This time can be as short as 5ms using digital I/O pins instead of the switch.)  An example is pressing the button and counting 15 pulses... unit will respond with 3 more... user press for 1 second... unit responds with 1 vibration... user presses for 2 seconds... unit responds with 2 vibrations.  The time interval between vibrations is now 1 seconds.  This allows for hysteresis in a mechanical system... the time interval is actually 2 seconds - 1 seconds = 1 seconds.  If there is hysteresis in a system, it will present itself equally in both button presses and be cancelled out, leaving only the original time constant, which is used for all future interactions.

- In Direct Drive mode, 5, 6 and 7 pulse commands are identical, as they all home, but they don't move the filament.


- Pulse counts beyond 16 are ignored.
 

; - 3D Chameleon Mk3 Tool T{next_extruder} -

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

M117 Unloading Tool T[previous_extruder]

M302 S0;

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

; if this is the first load, then don't unload

G91 ; move to relative mode

M82

{if previous_extruder>-1}

; cool (and size) in 1.8mm tube

;<<< Start Of Tip Shaping! >>>

G0 E-20 F500 ;

M109 R180; cool down to prevent swelling

M302 S0 ; enable cold extrusion

M106 S255

G0 E20 F1500 ;

G0 E-5 F500 ;

M109 R165; cool down to prevent swelling

G0 E5 F1500 ;

G0 E-1 F500 ;

M109 R155; cool down to prevent swelling

G0 E1 F1500 ;

G0 E-25 F500 ;

G0 E24 F1500 ; last tip dip with cold tip

M109 R150; cool down to prevent swelling

G0 E-24 ; last tip dip with cold tip

M109 R180; ok... go back up in temp so we can move the extruder

G0 E-24 F500 ; back out of the extruder

G92 E0

M104 S[temperature];

;<<< End Of Tip Shaping >>>

; 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

M82

; we skipped to here if it was extruder -1

{endif}

; load extruder #{next_extruder}

M117 Loading Tool T{next_extruder}

; press the button to select the new extruder

G0 X3 Y3 F2000 ; press the button

{if next_extruder==0}

G4 P500 ; dwell for .5 seconds - adjust this to match your machines single pulse time

{endif}

{if next_extruder==1}

G4 P1000 ; dwell for 1.0 seconds - adjust this to match your machines two pulse time

{endif}

{if next_extruder==2}

G4 P1500 ; dwell for 1.5 seconds - adjust this to match your machines three pulse time

{endif}

{if next_extruder==3}

G4 P2000 ; dwell for 2.0 seconds - adjust this to match your machines four pulse time

{endif}

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

G4 S15; wait for it to happen ; adjust this time to match the actual tool change time - subtract the time it takes to load for the last 1" into the 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 F1500 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

G92 E0

G90 ; move back to absolute mode

M83 ; but make sure the extruder stays in relative

; reload filament all the way into extruder

{loadGCode}

M83 ; turn relative distances for the extruder

M302 S180;

M117 3D Chameleon Tool T{next_extruder}

Note: At this time, the Mk3 only supports PrusaSlicer.  PrusaSlicer is the only slicer that is continuiously updated to include fantastic features for multi-material and multi-color users.  See below for the Theory of Operations.

; - 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

bottom of page