Hi guys , I have been working on building a 3d printer with swappable

Hi guys ,

I have been working on building a 3d printer with swappable hotends, similar to the E3D machine. I would like to know how the Tool change G code works in slic3r or Simplyfy 3D to add custom g code scripts. If any one knows where I can learn about conditional statements for g code scripting it will helpful.

Thanks
Hussain!

I can’t comment on using those slicers but using Kisslicer’s material and tool change scripts along with the Duet’s (the controls e3d used) built in scripting for tool changes would be easiest in my experience. I have a machine with 4 RDD extruders (not a tool swapper but that would be easy to implement from a scripting standpoint). Simplify 3D is not good at managing custom material properties imo. I think Slicer could be used but doesn’t have quite what I wanted as far as custom material gcode for each material at every tool change.

My current gripe with Slic3r is that it does not have a custom material gcode that can be called at will (unless I misunderstand the token system). You can see how I have set my tool change gcode script in Kisslicer to call the custom material code at each tool change. Slic3r is great for customizing regions of prints though and I would like to use it eventually.

From a quality of life standpoint of plating and supporting prints, S3D is great, but I got so frustrated trying to get it to automatically associate settings with a material rather than an extruder that I gave up on it, ie temperature. I’m sure it can be managed if you set up enough processes in it but it still lacks custom g code for each material. Pressure advance being an important custom property for example.

I have a lengthy post in this thread that attempts to explain how I have mine set up so that Kisslicer implements the proper settings for each material at tool changes etc. https://forum.duet3d.com/topic/2959/wiping-filament-procedure/2

There are no conditional statements in gcode. It’s as simple as that.

@ThantiK No conditional statements in 3d printing gcode… they’re pretty common in production milling systems.

@Ryan_Carlyle you might be talking about a canned cycle, but I am unaware of any production milling machine that has conditional statements (if then else) in gcode.

If it exists in production machinery (we have a HAAS CNC 4 axis @ my hackerspace), then people have a tendency to ignore and not use it.

@ThantiK I don’t personally have any experience with it, but it’s a common thing in CNC gcode tutorials and manuals and such. Eg https://www.cnccookbook.com/cnc-g-code-macro-conditions-looping/

I’ve done conditional statements to adjust parameters and conditional branching on my machine control but it’s not part of a standard. What I used looked a lot like what’s in the CNC cookbook page linked above.

Oooooo

@Ben_Malcheski Hi Ben,

First off thanks for the detailed post.

I have downloaded the kisslicer and am looking at getting a Duet from the USA.

Would like to know where i can read about Tfree , Tpre and Tpost commands. I am unable to wrap my head around it.

My aim is that when there is a tool change it needs to dock the current hotend , release the hotend via turning off a electromagnet . Then move into position and pick up the other hotend by turning on the electro magnet.

If you do know anyone working on this, would like to connect with them as well.

Regards,
Hussain

@ThantiK Lot of slicers have started implimenting conditional statements such as If , else commands that can be used during tool change processes or layer change processes.

check out the video at 9:50 he shows his tool changing scipts where he uses conditional statements

what am trying to do is this. The hardware part is doable by me, I am unable to get the slicer working.

@Hussain_Bhavnagarwal

There is a TFree etc file for each tool. The three files are automatically executed when reprap firmware receives a T# command that differs from the currently active tool number. The wiki has tons of info and a complete list of gcodes. The forum has a lot of info too.

A section of this article has some details.

@Ben_Malcheski

Hi Ben,

Thanks for the link.

From what I understand these are macros that are available on the duet firmware. Will continue reading the Rep rap documention. But I guess most of the understanding will happen only once I get my hands on a duet board.

Would like to know if you have built a similar system, from what I read on the forum you have mentioned earlier that your machine has 4 independent extruders. How do you get it to work without tool change ?

(Something absolutely irrelevant)

Is that you sailing a Catamaran in your display picture ? .

@Hussain_Bhavnagarwal

Yes, the tfree etc files are macros that you write on the Duet. They don’t support conditional stuff, but I don’t think you need conditionals. Let’s say your active tool is T0. Your Gcode sends T1 to switch extruders. The firmware will then execute T0free.g. This is where you tell it to park T0 and execute any other switching etc. T0 is made inactive (ie there is no tool selected). Then the firmware will execute T1pre.g which is where you tell the machine how to go about picking up T1. T1 is then made active. Next T1post.g is executed, this is where you would purge/prime/wipe and then continue printing. Most of your tool change scripts will be the same, except for the coordinates to drop off and pick up each tool.

I have a total of 12 unique tool change scripts (3 per tool). The awesome thing is that you can tweak scripts during prints and the macros get updated on the fly. The next step I have been planning is to have a material macro file so I can set and tweak all the custom parameters on the fly rather than in Kisslicer which requires me to resave out a file every time a small change is made. Kisslicer’s matl gcode tab would simply call the material macro file then. This would help to make the printer more gcode agnostic. I’m kind of going off the toolchain model that $stratasys has where the slicer really only does coordinates, line widths, and layer heights. The minutia of the motor commands, pressure advance and things of that nature, are actually done on the fly as the machine prints.

Sorry, by independent I meant that they are not cyclops/chimera/diamond type. All of my nozzles are on the print head at all times. So all of my scripts are set up to heat and cool appropriately as well as purge and wipe. I have 4 Flex3Drives which would also be great for a multi-carriage (IDEX) or tool changing system as well. They are much more user-friendly than bowden in my opinion.

Lastly, yes that is my Tornado. In my opinion it’s still the best small catamaran class. My father and I were on the US Sailing team in 2006 for the Tornado class. I don’t sail nearly as much anymore but I still love the boat.

Looks like your family is into Lasers? I’ve had some fun on them but never raced one. The class is impressively competitive.

@Ben_Malcheski

Thanks for the detailed reply !

Looks like I will be able to execute this project once I have a duet !

Also would be nice to take a look at your machine and setup !!
Do you have a youtube video of it running ??

I sailed the optimist and laser 4.7 , but that was a long time back.