Hello everyone, first post here, not the first time around the forum.
The new AMS (Automatic Material System) things have catch my attention and since I’m not the type of guy that likes just to spend the money if I can do it myself, here I am showing how I was able to print multi color prints (not just changing by layers, full multicolor) on a stock Ender-3 with the help of some extra parts and a Rapberry pi with Octoprint on it (but this last part is optional and there are workarounds).
The concept:
Having multiple (2 in this proof of concept) motors to feed different colours to the hot tip and using some g-code and 4 relays to “connect” or “disconnect” the motor we want to use to feed the correct color.
Summary of how I did it:
I use custom g-code to retract all the way out the currently used filament, then octoprint with a plugin and some python code to, using a g-code to activate or deactivate al relays to choose the correct color, then move the filament to the hot tip and continue the printing.
I can be more specific an share code and parts used for this if there is interest here.
Hello, this is pretty cool, I was wondering what you used to control this. Did you use the 3d printers board or a separate microcontroller (etc. arduino)?
Yes to both, I use the 3D printer board to drive the motors, but I use a raspberry pi, which I have set up for octoprint, connected to the relays (board with blue boxes in the pictures) to select which is the motor “wired” (active) to the ender board.
I recently made some changes and now it’s 4 colours, same idea, more relays and motors
Kind of a micro controller to choose the color you wanna print, in my case I’m using Raspberry pi with octoprint and some software configuration in octoprint, but a ESP32 with a physical switch, will work too.
PC4-M6 PC4-M10 Pneumatic Fitting for the tubing to route the filament
Bowden Extruder PTFE tube
For each extra color you want to add you need:
1 Four channels relay module compatible with your micro controller/rpi
1 for 2 colours
2 for 3 colours
3 for 4 colours ** You might need a 4th one if your microcontroller is not capable of managing so many relays, which is my case, I have 1 connected to the rpi and that one drives all other 3 (see image below)
1 Stepper Motor, the kind your printer uses
1 Extruder Drive Feed Kit, the kind your printer uses
In text, there is a 4 module relay which is connected to the rpi which I use to give 5V straight from an external source to the other 3 modules, one module directs the connection from the 3D printed mainboard to the final module for motors 1/2 or motors 3/4 and the other two modules select the desired motor to be on.
Software:
PrusaSlicer is needed to print in multi-color, my recommendation is to follow the 3dChamaleon guide on setting up PrusaSlicer (https://www.3dchameleon.com/mk3-mode-3-gcode-generator) and use their gcode generator to get a bootstrap. I’ve made many many changes to my custom g-code already, but that is really custom to my setup and printer.
This is awesome and exactly what I’ve been looking to try out on my ender. Is it possible you can provide a simple diagram of how the 2 motors 4 wire attaches to the relay? I would love to try and make this!
I have the whole color change macro setup in klipper and have gotten it to print with 2 colors while I test it but the problem I’m having right now is with clogging which my guess would be that it’s from the PTFE splitter I chose being scaled to low on my printer making it difficult for filament to be forced through. So far though this idea works well, and what I’m going to do next using my klipper firmware is run the 4 extruder motors off of a second SKR mini board to at least get the setup more compact plus they will all have independent drivers
In my experience, pulling the first few mm of filament as slow as possible makes the tip of the filament thinner and avoids clogs on the way out and the way back in.
This looks great, I’ll add to my list of projects…
One question though, couldn’t you reduce the number of relays by only switching one half of the wires?
E.g. If Green-Black is one coil (B+ and B-) respectively then for two steppers you put the Green through a relay. The black wires just get joined together. If the green isn’t connected/live, then the motor won’t operate.
Hello man, i am getting luck replicating this, but i am using an old laptop and an arduino to switch. I am having horrible time by calibrating retraction for filament change, any chance you know temperature and retraction speed? Did you leave it all to the slicer? In my setup I have to define them all gcodecally, its been hard but i think your idea is genius, it took me 2 weeks to get to see it running, i love it
I’m not really familiar with what cable does what on a stepper motor but what I understood, which I could be wrong…, is that you need to connect all 4 cables to the controller and not mess with them, otherwise the controller won’t operate the motor correctly. You can try it out and let us know if that could be an improvement, since reducing the amount of relays will make everything more efficient and simple
Happy to see you are having luck replicating this set-up glad to know it’s useful for someone.
Regarding retraction filament for changing and such, it took me days of try and error to dial it up and since there is no standard for tube length etc, it’s difficult to just give you the correct setup, but I’ll do my best to explain how I do it to see if you can find the info you need.
First of all, I left all the pulling and pushing filament to the slicer, I’m using PrusaSlicer (PrusaSlicer | Impresoras 3D Original Prusa vendidas directamente por Josef Prusa) since I inspired myself on the 3DChamaleon project and that’s the slicer they recommend to use. Unfortunately I don’t have my “3d printing laptop” with me, the one with the slicer configured on it, so I can’t just extract my config and paste it here for now.
To configure PrusaSlicer I’m going to copy/past from 3DChamaleon website and modify to what I did:
Download PrusaSlicer.
Create a printer profile and validate that it works with your printer.
Measure Distance between Extruder and Hotend (Use a piece of filament.)
Configure Printer Profile to include 4 extruders in a Single Shared Hot End arrangement
Enter those 3 values into the Mk4 GCode Generator and Copy/Paste the Generated GCode into the Custom GCode|Tool Change block of your Printer Settings profile. (DNG Note: start with that and tune it up as needed)
Add custom code to filament change setup on the extruder config
Add 4 identical small objects to the build plate
Assign a unique color to each extruder
Assign each object to a unique extruder
Slice and confirm 4 color show in the sliced view
Print it!
Key things and conceptual need-to-knows:
PrusaSlicer is capable of retract filament and push it back when you configure multiple extruders in a single hot end, you just have to set up different variables on it, like retracting distances and such. I like that more than adding that as custom code, since PrusaSlicer will slowdown and speed up the filament for better pull and push
Avoid as much as you can adding custom G-code to PrusaSlicer you’ll probably find later on that was an option in the config for that which works way better than your G-code (learned that hard way). You’ll have to add the custom G-code to change the status of the relays, that’s for sure, but most of all other custom things you have to do, if you look for it you will find the config parameter.
Try and fail, that’s the way of learning it… start with tiny multi-color objects with a lot of color changes, that’s the best way of testing the set-up correctly.
It’s slow! do not try to speed things up to much or you’ll regret it (again, hard way…)
When you have everything configured for multi-color, you then will notice that printing on just 1 color doesn’t work anymore… you can custom G-code configure it, but now, thinking it after I did that way… you can just use a different slicer or slicer profile for that… up to you!
I am like you. I was dreading having to buy a new printer right now. Thank you for this! I will defiantly be using your design set-up for my current printers!