3D printing in multiple colours with one extruder

Dual extruder printers are pretty sweet. They have two different independent extruder assemblies attached to the same linear actuator. This means that it's fairly easy to have gcode that controls the two print head feeds separately.

Having two extruders working in the same print job is really handy for a number of reasons. Loading a different colour filament in each is a great way to create prints that are multicoloured. However, there are others ways to print in multiple colours, if a little more limited than a dual setup.

Here is a print I did recently, the npm logo (you should use npm for your javascript package needs, it's really cool and the people who maintain it are very nice smart people):

npm logo

And a bracelet (download stl here):

stretchlet bracelet

So how was this achieved? If your guess is pausing a print mid job, unloading the current filament and switching it for another colour filament, you're on the money!

There are a few ways to do this:

  1. If you're controlling your print with software such as Repetier Host, Pronterface, Octoprint, or Cura, there is a pause/resume button available in the UI while a print job is running. Just watch your print until you're ready to change colours, pause, swap out, and resume.

  2. If watching a print like a hawk is not your thing, or you're padantic about changing colours at the right point, you can automatically inject a few added lines into your gcode while slicing your stl. Some slicing software, such as Cura, have plugins specifically to do this. Just set the height you want to change filament at, and where the extruder head should move to while paused. Easy peasy! I tried the 'Change Filament at Z' plugin for Cura, but was a little unhappy with some incompatibilities with my own printer. I have forked the code and fixed a couple of things to suit my needs, so feel free to check it out and install! Continuing the print is as simple as clicking 'resume', similar to solution 1.

  3. Similar to solution 2, but manually write the gcode yourself. It's pretty simple if you have an example to work with. This will depend on your chosen slicer commenting each new layer within the gcode. This makes finding the correct layer buried in the gcode a lot easier! Here is an example of a 'change filament' block you can paste and tweak, just before the chosen layer begins:

M83 ; turn on relative movement for extruder  
G1 E-5.000000 F6000 ; retract filament 5mm  
G1 X0.000000 Y0.000000 Z4.000000 F9000 ; home X and Y axis leave Z at current height  
M84 E ; release extruder stepper motor from 'holding' position  
@pause ; pause print!
G1 X0.000000 Y0.000000 F9000 ; upon resume, rehome X/Y in case position was bumped out  
G1 X69.080000 Y58.560000 F9000 ; move back to next layer starting position  
G1 E0 F6000 ; reset extruder, ready to push out plastic again  
G1 F9000  
M82 ; set extruder movement back to absolute ready for next layer  

So how do you even change the filament? The plugin/script auto retracts a little to get you started which is nice. But there's no magic - just pull it out and manually load in the next colour as you normally would before kicking off a print from the beginning. There are two different effects you can try though when doing this.

The first is a clean colour change. This means that after your print is paused and new colour filament loaded, the filament is fed continuously (via your 3D printer software) until the new colour feeds out cleanly and without the previous colour mixed into it. This method was used for the npm logo, and the stretchlet bracelet (photos above).

The second is what I call a gradient or gradual colour change. The difference is that instead of feeding the old colour through until the new colour appears in the previous method, you simply resume the print immediately after swapping over the filament. No manual feeding. The effect you'll see is more of a blurred or smooth change in colour over the next 5 - 10 layers, depending on the resolution you're printing at.

You can see this effect on the following fan grate I printed for my Printrbot:

fan grate

Looks pretty cool, huh?

Give it a try and share the results if you like!

Print quality PSA

fan mount comparison Cool your prints! The above photo shows the benefits of this. If you want to see a dramatic improvement in your print quality, adding a cooling fan upgrade is the cheapest and easiest mod you can install on your printer.

All slicing software allows you to fine tune your fan behaviour before exporting gcode. I have the fan off for the first layer to ensure solid adherence to the print bed, then dial it up to 100% speed for every layer after that. I find that gives me the best results for a wide variety of print scales and complexities.

A year of tweaking and lessons

It's been just over a year since I started fiddling with my 3D printer. The Printrbot Junior v1 was serious bang for buck when I bought it, coming in at a mere $400 + shipping. However I've had a lot of fun with improving the quality of prints since I bought it as a 2012 Christmas present to myself.

The goals I had over the last year were the following:

  1. Improve layer placement and reduce 'wobble' on the z-axis.
  2. Produce prints that are 100% accurate in measured size.
  3. Coax the printer to print as reliably and consistent in quality as possible, with minimal hardware or software errors.

I decided to use my nemesis print, the Cushwa Owl as a litmus test to achieve this. There were a couple of reasons for this:

  1. I love owls.
  2. I have had enormous trouble reliably printing this model in the past.
  3. It's commonly used by others to test printer ability.

Let me show you the trouble in the past that I've had with this darn owl:

owl fails

This is only a small sampling of failures, I threw many of them in the bin in a rage at the time. Most of them were either corrupted gcode issues, or the y-axis step slipping. The owl at the back stuck so fast to the bed, that I ruined my print bed and cut my hand pulling it off.

Here are the current results below. Both owls are approximately 80mm high. The owl on the left was printed March 2013, and the owl on the right April 2014 (last week):

owl comparison 1

owl comparison 2

owl comparison 3

I believe the most dramatic comparison above is the side view. You can see I've made good headway at stablising the z-axis wobble. There are details on the right owl that I never knew exisited on the model until I achieved a jump in print quality. The layers line up better, and the proportions are also spot on accurate. The original owl on the left was too wide on the z-axis, as the y-axis was actually incorrectly calibrated.

A more detailed breakdown of what I tweaked over the past year:

Belt and pulley upgrades:

The first upgrade I did was to swap out the pulleys and belts on the X and Y axis' with finer and better quality ones. I ended up using alluminium GT2 20 tooth pulleys, and matching GT2 timing belts, both bought from the friendly peeps at Ultibots. Replacing these is a simple but fiddly matter of taking apart each bearing and pulley assembly. Make sure you secure each belt tightly - you should be able to strum it and produce a musical note. Both axis' run nice and smooth now.

Calibration, calibration, calibration:

If you're using GT2 belts and pulleys (20 tooth), the calibration for both X and Y is M92 X80 and M92 Y80. Math. Eli showed me the light after I'd been manually calibrating with calipers, tsk tsk. You can see that the owl on the left has different (wrong) proportions to the one on the right.

Hotend upgrade:

Do yourself a favour and buy a hotend that takes 1.75mm filament. My original hotend took 3mm. A chunkier filament is more prone to kinks, and the heartbreaking "snap" as a tangle breaks the filament off mid print. The largest nozzle size you should use is .4mm. Go lower if comfortable.

Stablise your filament feed:

Depending on your printer and extrusion setup (Bowen, spring loaded etc), there's some small tweaks you can make to ensure your filament feeds cleanly and consistently. The pieces I installed for my extruder assembly are covered in this blog post.

Fan upgrade:

I installed a fan to point at my printbed while printing. This allows each layer to cool more quickly. This allows for faster printing, and better looking shells. You can use gcode to control when the fan turns on (I have it off for the first layer to ensure it 'sticks' to the print platform) and how fast it blows for different situations. The blog post for this upgrade is here.

Sort out your Z coupler:

I had great results swapping out my wooden sandwich coupler with this 3D printed one here. I then went on to mill one out of alluminium. Having a good quality, and well aligned coupler is very important if you want each printed layer to align with the one below. The job of the coupler is to bind the motor controlling the Z axis to the threaded rod, which turns to adjust the height of the extruder. Make sure it's straight and doesn't 'wobble' when you test the Z axis. I still have some very minor wobble, but it's barely noticable. Jury is still out on whether a rigid or flexible coupler is best, go with what you find works best for your printer.

Get your bed level and your Z end stop perfect:

Oh my god I cannot express this enough. Get your bed as level as possible, and tune that extruder to home a paper's width above the bed surface. This is the single most important adjustment you can make to ensure your printer makes it beyond the first 2 layers of deposition first time, every time. If you're badass, get firmware controlled auto bed levelling going. This is included in the latest version of Marlin. It's next on my list.

Filament temperature:

The broad recommendation for PLA printing temperature is 180°C. That temperature is baked into firmware and slicing software as a default. You should play with higher temperatures to see if it provides you with any benefit in printing quality. This is of course going to vary from filament to filament, colour to colour. The owl on the left was printed at 180°C, the right owl was 210°C.

Bed adhesion:

I started out using 3M blue painters tape. I found that my prints stuck too well to my print bed. I would damage both them and the printer (and my own flesh!) trying to prise finished prints off. I now use the 3M lime green 'hard to stick surfaces' (yeah I know, what?) painters tape, and it sticks well without supergluing your prints to the bed. Peeling prints off the bed is now way easier. No more animal feet breaking off at the ankles, or bent raspberry pi cases.


This is one problem I have yet to solve, but vibrations caused by the frequencies of the stepper movements can be seen on the surface of your prints. Not to mention it produces an incredibly annoying noise! I improved the problem slightly by adjusting the speed upwards when printing solid infill and travelling. In future, I'll be trying a cork stepper dampener like this one on the x motor, as it's directly underneath the print bed.

Use a decent slicing application:

For most of the year, I was using Slic3r. Slic3r is a geek delight, because you can tweak anything and everything to do with your print jobs. Recently though I started looking at other slicer packages, and have settled on Cura. I've noticed that Cura slices very fast, allows cool python plugins, and has much more efficient toolpath generation. Better toolpaths = better quality and faster prints. Some of the shit I saw Slic3r do with toolpaths, I tell you what. Thanks to Eli for passing on his obsession and dismay at inefficient toolpathing, there is no going back now.


With the above improvements to my machine, I'm now able to just hit 'print' and experience the delight of seeing the Printrbot get to work. I rarely ever hold my breath for the first 10 layers anymore (unless I'm printing chainmail!) and I'm proud to show off my prints. There's still some improvements to be made, but for now I just want to take a break and enjoy using my printer.

How are the two owls doing these days? Well, they're getting along just fine:


Just kidding! They kinda hate each other sometimes:


Happy printing!

Take It Back-athon - a hackathon for kicks and giggles

It all started when I attended my first public hackathon - VegasHack. Pawel and I went in saying "I think we should try to win red pants from the Betabrand sponsored category, but either way let's just have fun".

And so we created Fitendo, a web app that tracks your Fitbit steps and converts it into real progress through the video game Super Mario. It was the kind of idea what we'd never justify spending our free time on as Pawel and myself can be rather busy with other things. He's got two kids, and volunteers for numerous local community groups/events. I also volunteer for local communities, and generally keep busy.

In a lovely twist of events, we actually won the Betabrand category and requested our prizes be a pair of charming red velvet pants. I still wear them.

It was such a good first impression of hackathons, that I started attending more. And more. Even ones outside my own town of Las Vegas. But I noticed a trend developing that I intially shrugged off as a strange anomaly --

Commercial API's became the main story, with ideas being molded around them. Sponsors were starting to enforce which API's to use. Large corporations holding hackathons with crazy T&C's such as owning project IP. White dudes seemed to make up the majority of attendees. Limited clarity/distinction between startup/business focussed hackathons, and 'for fun' hackathons. Misleading information on hackathon websites. Excessive focus on project 'monetization' and 'investment potential'.

Almost every demo I witnessed adhered to the following recipe:

  1. Social media login, such as Facebook or Twitter oAuth.
  2. App then hits an API or two for data
  3. ???
  4. Profit

I mean, don't get me wrong - startups and business stuff is cool. There are events specifically for this like Start Up Weekend and Launch Up. But the list of hackathons thrown purely for having fun, and achieving the impossible or equally preposterous, is shrinking, and has been no doubt since even before I even started attending these things.

Full time developers spend all day programming to make someone else money. They need to make said money for their boss, or they're out of a job. Some are moonlighting to change this, by slowly working towards being their own boss, with their own staff of developers to work for them. That's great. But surely there are those who want to code for fun to remind themselves why they got into computer science in the first place, right?

Pawel and I are such people. We talked about throwing a 'Stop Down' (geddit?) hackathon for quite some time. Recently we finally bit the bullet and yesterday we successfully ran our first 'Take it Back-athon'. We changed the name, because we didn't want to be mistaken for being opposed to the startup scene. Instead, we're trying to 'take back' the original hackathon magic. When OpenBSD started running hackathons in 1999, they were among the first to do so. And their events rapidly improved the development of their OS. Community give back is awesome. No $25k prizes being given out there. Similarly, the demoscene dating back to early PC usage threw demo parties, for the developers, no one else. It was about who could pull off amazing feats, and the camaraderie involved in doing so.

It turns out other people felt the same way as us. The Las Vegas Review Journal profiled the event, which was really encouraging.

We had a very healthy sign up for the first Take It Back-athon. And we had an absolute blast on the day. There were no judges, the audience voted for winners via sms poll.

The final list of projects:

'Noob.js' by Austin Hackett
'A javascript adventure through the dark side of hollywood'.
Austin rocks up first thing in the morning and admits he's pretty new to programming. What a star. He made an awesome text and image based adventure through Hollywood. Austin won second place overall.

'Luchadores' by Reuben Burda and Tyson Anderson
'Data Visualization with Wrestling Masks'
luchadores This was so ridiculous in the best way. Tyson and Reuben had never met before prior to the hackathon. They took restaurant data from a number of suburbs in Las Vegas, and generated different wrestling mask designs based on the amount of results, and the aggregrated ratings of the restaurants found. They won first place overall.

'Such Backathon' by Daniel Harden and Max Keener
Dan and Max were going for the big one. They wanted the "most gratuitous use of API's' award. That prize was a giant plush duck. They were hardcore, and completely in over their heads in the best possible way. They combined API's from Twilio, Instagram, TMDB, Bitcoin exchange, and Doge coin exchange to create a memorable doge designed page that tries to guess who you are on the internet. Had to be seen to be believed. Needless to say, that won that award real good. They also won the 'least likely to be successful on kickstarter' prize.

'Suckbot' by Nate Bryant
'Suckbot is an Arduino based line follower robot with a suction fan that creates additional downforce and traction.'
Nate brought in an entire garage worth of tools and useful doodads to work on his robot in progress, the suckbot. It's a robot that can drive itself on a track using infrared vision, with a fan that ensures tight corner handling by 'sucking' the road. Freaking awesome, and he helped everyone else out with tools for their own projects.

'Web-a-Sketch' by Shawn Looker, Ryan Quinn, John Harris, and Steve Lolito
'Putting the internet where it belongs.'
I'll admit it, these dudes were ambitious. They even brought in Shawn Looker's son for his expert knowledge of Lego. Essentially, they hooked up an etch-a-sketch to some servos and were driving it with a Beaglebone. Impressive stuff. John then wrote some software that will take a screenshot of a webpage and convert it into a simple binary style image that the etch-a-sketch can parse and replicate. They had some 5V power issues with the Beaglebone and so didn't get to finish, but solid job for a one day hackathon, guys! They won third place overall.

'Pedalino 1.0' by Lauren Atchley
'An arduino guitar pedal!'
Let me just say that Lauren is a general resident badass. She brings in an Arduino and a completely blank guitar pedal etched circuit all ready for soldering. She had soldered only once before. I turn my back for an hour or two and when I come back she's got dozens of little components all neatly soldered onto the board. Wow. She's got some technical issues to sort out before it will work 100%, but hats off lady - it takes patience and fine motor control in those fingers to do what you did.

Cool turnout, huh?
We want to run more of these, and we want to see this movement spread. Visit our website, or fork the github repo.

Thank you to our fabulous sponsors on the day:
+ Jimmy Jacobson
+ George Moncrief
+ Mark Walker
+ John Hawkins

and of course our indispensable volunteers:
+ Jacquee De Jesus
+ Song-I Yang
+ George Moncrief

Pawel and Song-I took some great photos here.
Some photos and videos I took of the day are below:




song-i and pawel


roobs and tyson

ryan and john



thank you notes and prizes


P.U.R.R. - Personal Ultimate Reassurance Response


A few weeks ago I attended the AT&T Dev Summit Hackathon at Palms Casino, Las Vegas. I had a tonne of fun. It was the largest hackathon I've attended. There were 106 teams in the end, and the presentations (90 seconds each), took 6 hours to get through!

Naturally I was kinda terrified to be in a room of so many people (and be a minority), so I just put my head down and started working. My goal for the weekend was to create a wearable piece from end to end. Yep, that meant producing the housing, soldering a bunch of stuff, and then programming the wearable and the server it connects to.

I am one of those cheeky people who chooses the technology first, and then bends an idea around it to fit. I know that's not what you're meant to do, but whatever. I wanted to use the excellent Tinyduino from Tiny Circuits, and make a bracelet that did something. The rules from AT&T were that you needed to use one of their API's in some shape or form. After checking out what a free developer account gets you, I decided to use their in-app messaging service. Afterall, a bracelet that can send messages to your phone is pretty cool, right? This is where the idea for PURR blossomed.

My day to day life is generally consumed by both social anxiety, and generalised anxiety. It saps my energy and brain capacity managing the symptoms, and it's pretty exhausting pretending to be normal at both work and play. I try so hard in fact, that most people I meet have no idea the amount I suffer every day, or are surprised to learn that I'm on medication.

Generally on a bad day, I need to sleep off my anxiety. Otherwise, I pace tracks in my carpet at home and resort to coping mechanisms what aren't always healthy. It's incredibly frustrating, as I always want to get a lot done in my personal time, and often have to accept that I'll never really be able to run at full capacity like other lucky people can.

One day when I was having a particularly bad night, I was insistent on staying awake and riding it out. A friend of mine tweeted this picture at me:

capybara and cat

It is a capybara attempting to cuddle with a cat (I found out later his name is Gary). Sensory overload hit me, and I started breaking down the picture. "Look how genuine that capybara is being, he loves that cat," and "the cat is having none of it," and "I wonder how many times this happens, and if the cat is ever ok with a giant ginea pig wanting a cuddle", and "do you think that closed eyes means that a capybara is content, or being aggressive, or is just getting ready to dodge claws from that cat?" etc etc. This went on for several minutes. By the time I "came to", I realised that my panic attack has eased ever so slightly. I actually felt better.

Now, something like looking at cute pictures is certainly never going to fix someone's anxiety, at least not in my case. However, what if you could let yourself know in advance if a panic attack was coming on, so you could take a moment to be mindful and aware?

My hackathon idea was complete. I could make a bracelet that monitors your pulse. If it picks up on the pulse becoming rapid (assuming you don't wear this while exercising), it can warn you that a panic attack may be coming on. The bracelet could txt you with a distracting picture to remind you that everything is ok. After a little research, I ended up ordering this nifty pulse sensor.

I mentioned that I wanted to create the bracelet itself at the hackathon, so I brought my trusty ultra portable Printrbot Junior. It was freshly upgraded with a new coupler, extruder and controller board recently, so I was excited to put it through its paces.

The first thing I started on was designing the bracelet in Blender. I printed out a couple of quick primitive 'boxes' to see if they were the correct dimensions. The first test printed really well, and the Tinyduino fit!

First prototype of housing

Next I tried to round out the design a little, and I included a hole in the bottom for the battery to poke out, slimming down the profile of the housing and allowing for easy battery replacement. By now it was after lunchtime, so I just stuck with an unfinished design (so bulky!) and moved on to soldering. After soldering the pulse sensor to the Tinyduino prototyping board, I was ready to start coding.

I needed two Arduino libraries: the pulse sensor lib, and the Tinyduino wifi module lib, which just happens to be borrowed from one of Adadruit's wifi modules. The Arduino sketch is still a little sloppy, but it got the job done. Effectively the Tinyduino seeks out a configured wifi network. Once it connects, it starts to measure your heartbeat. If the heartbeat rate stays above 90 BPM for a few minutes, it'll kick off a request to a server to send the message to the recipient's phone.

I was obviously missing the server at this point, so this is where I moved next. I threw up a nodejs file on my personal hosting to handle a POST request, and upon this it hits the AT&T API. After staying up til 2am with an AT&T developer (thank you, thank you, kind gentleman) we got the image sending to my phone. In the end we had to send it as base64 and hardcoded a bunch of stuff, but hey this was a hackathon!

The next day was about assembling it all together. I ended up modifying some watch band links from Thingiverse to have holes tunneled through them. I printed a bunch of them out and strung them together with some elastic threaded through each link.

Here is the final bracelet, finished up just twenty minutes before the demos began:


bracelet 2

bracelet sms

Tony Rappa kindly filmed my demo, you can watch it below:

The AT&T Dev Summit Hackathon was super fun, but I definitely didn't feel like I belonged there. It was a little too corporate for my liking, and the sheer amount of people there made me a little uneasy. Everyone was so lovely though, and I made some new friends from all over the US. There were some really cool projects demoed, I felt pretty inspired overall.

You can have a look at the rather fragile hackathon code and 3D files on Github.

A fancy new coupler for the Printrbot Jr

final coupler

I've always admired how Brook Drumm manages to bring down the cost of his Printrbot range. In particular, he tries to use laser cut wood as much as he can as it's fast to produce, and cheap.

One of the wooden features on my Printrbot Jr is the Z-axis coupler, that binds the screw rod to the stepper motor. Two pieces of wood bind the rod and the shaft together. It works well enough, however it requires some fiddling to keep it cailbrated, and the rod takes a beating when I'm fitting it into my Pelican case.

This is it:

wooden coupler

A while ago I printed a plastic coupler to replace it, but that wasn't perfect either:

plastic coupler
Photo credit

When Eli and I first met, he mentioned that he should lathe me a metal coupler. I batted away this idea because I was being too proud and defensive of my little machine. I eventually came around to the idea though, haha! Sorry Eli.

I've always wanted to learn how to use a lathe, so this seemed like the perfect project to get started. Here is the initial sketch we worked on:

Eli sketch

Eli was an awesome teacher. He got me to do a little bit of everything on the coupler, which taught me a variety of skills like tapering, milling/drilling, cutting down the diameter of the stock, and adding decorative details. We had a great time working on this one together.

Here is a video of me tapering an edge:

The first prototype looked great, but the motor shaft fitted too loosely.

first coupler

Back to the drawing board! Eli recreated the coupler, drilling the shaft tunnel on the mill instead. This worked a lot better, and gave a tighter fit.

I thought it would look prettier if we cut some decorative lines into the barrel. I had a lot of fun learning how to precisely do this, and was happy with the final result. Here is the finished coupler installed on the printer, complete with set screws to prevent any slipping:

final coupler

After a quick test print, I'm super happy with the results. It's a lot sturdier, and improves the accuracy of the Z-axis. Thanks again to Eli for all of his help and good ideas!