7
$\begingroup$

So, I have a Raise3D Pro2, and I'm looking to perfect a tool change script for it, the goal of which is to reduce or eliminate the excess plastic that tends to build up on the nozzle when using the dual extruder. The printer uses the Marlin G-code flavor, and although I'm not sure this matters, I'm slicing in ideaMaker. The script is supposed to flow as follows:

  • Retract current tool
  • Move to X30 Y300
  • Check if the new active tool is T0
    • If T0, wipe nozzle 2mm circle
    • If T0, cool T1 to 165C
    • If T0, heat T0 to 230C
    • If T0 and not layer 1, recover
    • If T0, wipe nozzle again, this time for the new tool
  • Check if the new active tool is T1
    • If T1, wipe nozzle 2mm circle
    • If T1, cool T0 to 165C
    • If T1, heat T1 to 230C
    • If T1 and not layer 1, recover
    • If T1, wipe nozzle again, this time for the new tool

The current script I have looks like this:

; extruder switch gcode start
G10 S1; Retract for current nozzle
G1 X30 Y300 F6000; Move to X:30 Y:300
[if {new_extruder}=0]; LEFT Extruder is active (T0)
[if {new_extruder}=0]G12 P2 R2; Clean inactive nozzle 2mm circle
[if {new_extruder}=0]M104 S165 T1; Cool inactive extruder to 165c (T1)
[if {new_extruder}=0]M109 S230 T0; Heat active extruder to 230c (T0) and wait.
[[if {new_extruder}=0] and [{layer_index} NE 1]]G11; Recover current nozzle when not first layer
[if {new_extruder}=0]G12 P2 R2; Clean active nozzle 2mm circle
[if {new_extruder}=1]; RIGHT Extruder is active (T1)
[if {new_extruder}=1]G12 P2 R2; Clean inactive nozzle 2mm circle
[if {new_extruder}=1]M104 S165 T0; Cool inactive extruder to 165c (T0)
[if {new_extruder}=1]M109 S230 T1; Heat active extruder to 230c (T1) and wait.
[[if {new_extruder}=1] and [{layer_index} NE 1]]G11; Recover current nozzle
[if {new_extruder}=1]G12 P2 R2; Clean active nozzle 2mm circle
; extruder switch gcode end

The issue is that, when I run a print with this, it doesn't seem to run all of the commands. It does the move, and the cooling/heating, but the retract/recover and nozzle wipe doesn't seem to read. I'm not sure if that's because of a printer or syntax issue, or because those commands don't work the way I think they do.

EDIT: (by Pᴀᴜʟsᴛᴇʀ2 - Added new code and logic back in)

New logic:

  • Retract current tool
  • Move to X30 Y300
  • Check if the new active tool is T0
    • If T0, wipe nozzle 2mm circle
    • If T0, cool T1 to 165C
    • If T0, heat T0 to 230C
    • If T0 and not layer 1, recover
    • If T0, wipe nozzle again, this time for the new tool
  • Check if the new active tool is T1
    • If T1, wipe nozzle 2mm circle
    • If T1, cool T0 to 165C
    • If T1, heat T1 to 230C
    • If T1 and not layer 1, recover
    • If T1, wipe nozzle again, this time for the new tool

The new script I have looks like this:

; extruder switch gcode start
G10 S1; Retract for current nozzle
G1 X30 Y300 F6000; Move to X:30 Y:300
[if {new_extruder}=0]; LEFT Extruder is active (T0)
[if {new_extruder}=0]G12 P2 R2; Clean inactive nozzle 2mm circle
[if {new_extruder}=0]M104 S165 T1; Cool inactive extruder to 165c (T1)
[if {new_extruder}=0]M109 S230 T0; Heat active extruder to 230c (T0) and wait.
[[if {new_extruder}=0] and [{layer_index} NE 1]]G11; Recover current nozzle when not first layer
[if {new_extruder}=0]G12 P2 R2; Clean active nozzle 2mm circle
[if {new_extruder}=1]; RIGHT Extruder is active (T1)
[if {new_extruder}=1]G12 P2 R2; Clean inactive nozzle 2mm circle
[if {new_extruder}=1]M104 S165 T0; Cool inactive extruder to 165c (T0)
[if {new_extruder}=1]M109 S230 T1; Heat active extruder to 230c (T1) and wait.
[[if {new_extruder}=1] and [{layer_index} NE 1]]G11; Recover current nozzle
[if {new_extruder}=1]G12 P2 R2; Clean active nozzle 2mm circle
; extruder switch gcode end
$\endgroup$
7
  • $\begingroup$ Welcome to 3D Printing! In your example, I'm not seeing the "S" value, which should indicate the number of repetitions of the pattern you're looking to print. I'm thinking your line should look like: G12 P2 S1 R2 ; (after the "if" statement, of course). Also, where is your G11 command after the G10? From what I'm reading, the G10 will be ignored if it isn't followed by the G11 command. $\endgroup$ Oct 3 '18 at 22:07
  • $\begingroup$ @Pᴀᴜʟsᴛᴇʀ2, The G11 is in the lines "[[if {new_extruder}=0] and [{layer_index} NE 1]]G11;", should be lines 8 and 14 in that code snippet. As for the S value, I'll give that a go and see if it changes anything. $\endgroup$
    – Nerevar
    Oct 3 '18 at 22:44
  • $\begingroup$ I see the G11 now ... sorry I missed it. BTW, I'm no expert on this stuff, just kinda poking around. Hope it works for you. $\endgroup$ Oct 3 '18 at 22:50
  • 1
    $\begingroup$ One other thought ... if you have inactivated the nozzle, wouldn't giving it commands conflict with the assignment you've given it (ie: inactive)? (or is your comment at end of the G12 command (line 5) inaccurate and supposed to state "Clean active nozzle ...") $\endgroup$ Oct 3 '18 at 22:59
  • $\begingroup$ @Pᴀᴜʟsᴛᴇʀ2 has a good point: try reorganizing so you send commands only to the currently active extruder, even if you have to add extra "activate" commands. $\endgroup$ Oct 4 '18 at 14:13
3
$\begingroup$

As far as I can recognize, the g-code file cannot be evaluated by printer firmware.

It is expected that slicer software will be aware of tool head selection and process tool changes according to g-code provided in an on-tool change in most slicers.

The best way to think about g-code (in RepRap word) is a one-way communication as the file is not treated as a script that can read and evaluate parameters on the go. (firmware capabilities).

references:

RepRap G-code list Printer quick start guide

$\endgroup$
4
  • $\begingroup$ @CarlWitthoft thanks for your remark & may I see an example? as per reprap.org/wiki/G-code, I did not find that in a RepRap 3d printing word, also provided printer manual does not mention that. So at this stage, if the printer producer is not mentioning that in firmware capabilities I am treating that printer as a RepRap like one, therefore I am threating g-code as read-only. I edited my text to direct to firmware capabilities not GCode itself $\endgroup$
    – profesor79
    Oct 5 '18 at 14:10
  • $\begingroup$ and the referece here: cdn.shopify.com/s/files/1/1069/4816/files/… $\endgroup$
    – profesor79
    Oct 5 '18 at 14:16
  • $\begingroup$ Ok, fair enough. Please move your references into the answer? $\endgroup$ Oct 5 '18 at 14:18
  • $\begingroup$ So... The commands can't be read by the printer then? Figures. I'll just see if using a prime tower fixes my issues. I'm trying to do this with ABS/HIPS, and the print I want to get off has some complex geometry, and will take at least 8-14 hrs, so I can't run that until I'm sure it won't screw up at 50% of the way. Thanks for the help guys. $\endgroup$
    – Nerevar
    Oct 5 '18 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.