Friday, September 18, 2015

3D Printing: Precise Color Changes- Overview

In one of my recent posts, which described how to create gradiented color changes in the middle of 3D prints, I theorized that you could also make a print that was made up of multiple colors that would have instant color changes- from blue directly to orange without any purple or other colors in between.

It turns out that I was right! The main idea is that the printer starts the main print (right side in blue), then deposits the gradient material in an area away from the print (left side), saving it from being a part of the final product. The printer then resumes the normal print (right side in orange), but the final product (entire right side) has a precise change of color.

How does this work? In the g-code- the machine commands fed into the printer- you can splice new code in to control the printer's movements in a different way. By copying g-code from your favorite slicer for the "gradient filler block" print and pasting the code in the middle of the final print, your printer can create a color change effectively.

What you also need to do is to cut the filament as the printer starts the gradient block, and fed in the new color. As long as the filament changes at the right time, then the print should work out flawlessly. PLA, the material that is being used for this print, coheres well to both warm and cold PLA. This makes it easy for a PLA print to have a new warm layer on top of a layer of a different color that was printed a while before.

However, there are also some serious challenges to making this concept work in a real design, instead of in this simple cube print.

One of the main issues is that editing g-code is hard. Not only is it confusing, but a g-code mistake can easily cause your extruder to crash into your print, or cause your printer to jam the extruder or smash the bed glass. Not only do you have to be careful, but there is no slicer laying down rules for exactly the right places that the printer should go.

Here is a quick sample of what g-code looks like:

G1 X50.850 Y76.210 E2.91639 F150.000
G1 X50.850 Y81.210 F2400.000 E0.54139
G1 F1200.000 E0.41639
G1 Z0.620 F3000.000
G92 E0
G1 X56.650 Y69.849 F3000.000
G1 Z0.120 F3000.000
G1 E2.50000 F1200.000
G1 X56.650 Y66.875 E2.52019 F375.000
G1 X57.650 Y66.875 E2.52698
G1 X57.650 Y73.125 E2.56943
G1 X56.650 Y73.125 E2.57622 F375.000
G1 X56.650 Y69.909 E2.59806
G1 X56.250 Y69.909 F3000.000

Unappealing, isn't it? This g-code is what you will find around a layer change. The "G1" commands tell the printer to move different axes (x, y, z, extruder), and the "G92 E0" command tells the printer to discard the previous extruder movements and start counting new extruder movements from 0.

So how did I manage to get this to work? I worked carefully to make sure that no problems would occur. Also, through extensive use of Yet Another Gcode Viewer, I managed to check that the printer would avoid obstacles and act appropriately for each layer. And lastly, I monitored the printer carefully, making sure that it would be easily switched off to avoid any damage.

Interested? Next week, I'll explore the actual process, step-by-step, of how the color changes are done. Using real g-code examples, you'll see how you can create precise color changes in your own prints.