Tool change script after toolhead change

Post your feature requests here for the developers to see and comment on your favorites
dp90pusika
 
Posts: 4
Joined: Thu May 25, 2017 5:11 am

Tool change script after toolhead change

Thu May 25, 2017 5:25 am

Hy,

The tool change script only allow me to inject custom g codes before a tool change happens.
It would be really useful fo have the option to inject the code after the tool change happened.

I have a dual x carriage machine, like the BCN3d Sigma, these machines need to prime the newly active extruder.
The Sigma does this via a firmware script. But I don't have this option, and it would be much more flexibble if I don't need to mess with the firmware or the eeprom every time I neeed to thange te priming length after every toolhead change.

Right now I need to do this manually with notepad++
it's labor intensive and annoying.

Can you please include the option to put custom g-codes after a tool change happens, in the next release?

I think it would be beneficial for a lot of machines, because you could use this to make a head cleaning protocol or anything else to the printing process.

aubergine18
 
Posts: 4
Joined: Wed May 24, 2017 8:06 pm

Re: Tool change script after toolhead change

Thu May 25, 2017 11:28 am

It would be great if there were separate before/after scripts for each tool IMO. For example, if one tool has a filament that needs some extra attention, I don't want that extra attention applied to both tools. I think free products such as Cura already provide such functionality.

brian442
 
Posts: 1056
Joined: Mon Nov 28, 2016 5:35 am

Re: Tool change script after toolhead change

Sun May 28, 2017 7:33 am

I think you can already do this now. Just put the toolchange in the script yourself, then you can place code on either side of it. For example, here's what your tool change script would look like

; code before tool change
T[new_tool]
; code after tool change

The [new_tool] variable is referenced here:
https://forum.simplify3d.com/viewtopic.php?f=8&t=1959

dp90pusika
 
Posts: 4
Joined: Thu May 25, 2017 5:11 am

Re: Tool change script after toolhead change

Sun May 28, 2017 7:49 am

brian442 wrote:I think you can already do this now. Just put the toolchange in the script yourself, then you can place code on either side of it. For example, here's what your tool change script would look like

; code before tool change
T[new_tool]
; code after tool change

The [new_tool] variable is referenced here:
https://forum.simplify3d.com/viewtopic.php?f=8&t=1959


Thanks for the advice but it doesn't work with this method. Already tried it.
Whatever you do the custom codr will be injected before the "T[new]" code is set out.
With the T[new_Tool] command you could manage to do the purge rutin, but you also have to set up the code to send the old tool to it's home position.
This can be done but it's really inconvenient, and also the tool head will travel with the printing speed of which is much slower than the normal tool charge speed, so the nozzle has time to ooze, defeating the whole point of the priming and wiping.

brian442
 
Posts: 1056
Joined: Mon Nov 28, 2016 5:35 am

Re: Tool change script after toolhead change

Mon May 29, 2017 6:32 am

From your description, I still don't see what wouldn't work. I've used this with several of my printers and it most definitely allows you to run custom code with the old tool before the tool change, perform the tool change, and then run more custom code afterwards. In my mind, that's pretty much everything you would ever need to do with a script like this...

If you need to send the old tool to it's homing position, just put that before the T[new_tool] command. If you want it to travel at a different speed, just add the correct F-value to the command.

dp90pusika
 
Posts: 4
Joined: Thu May 25, 2017 5:11 am

Re: Tool change script after toolhead change

Mon May 29, 2017 6:49 am

Code: Select all
G1 X247.599 Y131.870 E5.0585
G1 X250.380 Y132.614 E5.5330
G1 X249.636 Y131.870 E5.6432
G92 E0
G1 E-2.0000 F1800
G1 Z0.750 F1302
G1 X2 F4000; [THIS IS THE "IF NEWTOOL COMMAND]
 G91
 G1 E10.0000 F480
 G90
T1
; tool H0.350 W0.720
; dense support
G1 X209.890 Y155.051 F10800
G1 Z0.350 F1302
G92 E0
G1 X211.199 Y155.968 E0.1675 F1440
G1 X211.199 Y157.066 E0.2826


In simplify it looks like this:

Code: Select all
{IF NEWTOOL=0}G1 X428 F4000;[THIS IS THE "IF NEWTOOL COMMAND]
{IF NEWTOOL=0} G91
{IF NEWTOOL=0} G1 E10.0000 F480
{IF NEWTOOL=0} G90
{IF NEWTOOL=1}G1 X2 F4000; [THIS IS THE "IF NEWTOOL COMMAND]
{IF NEWTOOL=1} G91
{IF NEWTOOL=1} G1 E10.0000 F480
{IF NEWTOOL=1} G90




This is what a snippet of code looks like, when using the "IF NEWTOOL" command.
This is all fine and good, but I need the code after the T1 command.

I need to inject code after the tool change happens, because the new toolhead sits besides the work area and oozing while the old toolhead prints. Now when a toolhead change happens, the idle toolhead neeeds to extrude some filament to prime the nozzle. This way there is no need for the prime pilar, uses less plastic, and there is no danger that the primepilar brakes of and ruins your print.

brian442
 
Posts: 1056
Joined: Mon Nov 28, 2016 5:35 am

Re: Tool change script after toolhead change

Mon May 29, 2017 7:13 am

Ok, so then just put the [new_tool] command at the end of your previous script and then add the lines you need after that

{IF NEWTOOL=0}G1 X428 F4000;[THIS IS THE "IF NEWTOOL COMMAND]
{IF NEWTOOL=0}G91
{IF NEWTOOL=0}G1 E10.0000 F480
{IF NEWTOOL=0}G90
{IF NEWTOOL=1}G1 X2 F4000; [THIS IS THE "IF NEWTOOL COMMAND]
{IF NEWTOOL=1}G91
{IF NEWTOOL=1}G1 E10.0000 F480
{IF NEWTOOL=1}G90
T[new_tool] ; switch to new tool
G92 E0 ; zero the extruded distance
G1 E10 F240 ; prime the new extruder

dp90pusika
 
Posts: 4
Joined: Thu May 25, 2017 5:11 am

Re: Tool change script after toolhead change

Mon May 29, 2017 7:24 am

Thank you brian442!

This works perfectly. I couldn't figure this out from that old forum post.

So this is only a user friendliness issue. My bad.

thanks for the help!

mmercier9
 
Posts: 1
Joined: Sat Jul 15, 2017 4:41 pm

Re: Tool change script after toolhead change

Sun Jul 16, 2017 3:32 pm

I use the following tool change script with my BCN3D R17 for PLA (Left) PVA (Right) type prints

Notice how the two tools are coded to have different settings

T1 is the Right (PVA) Extruder
T0 is the Left (PLA) Extruder

Script:

;Switch between the current extruder and the next extruder
when printing with multiple extruders.
{IF NEWTOOL=1}T1
'switch to new tool and do these things
{IF NEWTOOL=1}M109 S240 T1 ;heat right tool to 240C before moving
{IF NEWTOOL=1}G1 F800 E-1.0
{IF NEWTOOL=1}G1 F800 E5.0 ;Default purge
{IF NEWTOOL=1}G4 S5 ;Stabilize Hotend's pressure dwell 5 seconds
{IF NEWTOOL=1}G92 E0 ;Zero extruder
{IF NEWTOOL=1}G1 F800 E-1 ;Retract
{IF NEWTOOL=1}G1 F800
{IF NEWTOOL=1}G91
{IF NEWTOOL=1}G1 F12000 Z2
{IF NEWTOOL=1}G90

{IF NEWTOOL=0}T0
; switch to new tool and do these things
{IF NEWTOOL=0}M104 S200 T1 ;let right extruder cool to 200 while unused
{IF NEWTOOL=0}G1 F1200 E-1.0
{IF NEWTOOL=0}G1 F1000 E5.0 ;Default purge
{IF NEWTOOL=0}G4 S2 ;Stabilize Hotend's pressure with dwell for 2 seconds
{IF NEWTOOL=0}G92 E0 ;Zero extruder
{IF NEWTOOL=0}G1 F2400 E-4 ;Retract
{IF NEWTOOL=0}G1 F12000
{IF NEWTOOL=0}G91
{IF NEWTOOL=0}G1 F12000 Z2
{IF NEWTOOL=0}G90

Matt Mercier
Step2Engineering.com

Return to Feature Requests