Monday, 30 May 2016

Controlling a 3D Printer with the new Raspberry Pi Zero 1.3


Last year I entered the world of 3D printing by purchasing a second hand RepRap Mendel Mono from eBay, with the initial aim of using it to print custom parts for my robots. The 3D printer has an Arduino based control board that contains the firmware required to drive the motors, heaters, fans and all the other time critical stuff that allows 3D printing to work, but with no LCD or any input controls a computer is required to tell this control board what to do.


I started off using a laptop to control the printer and then, once I was a bit more comfortable with how everything worked, I switched over to a Raspberry Pi B+, connecting to it via VNC. Eventually I started doing longer prints (i.e. the Astro Pi case) and wanted to be able to monitor the printer remotely, so after some research I switched over to using OctoPrint, which allows you to control the 3D printer via a web bowser, and has built in support for recording time lapses of the print itself.

When the Raspberry Pi Zero was originally released I did consider using one to control the printer, but didn't want to lose the camera support. Roll on six months and a new and improved Raspberry Pi Zero model was released, complete with camera connector, so it was time to give it a go.

Software setup

When setting up OctoPrint on the Raspberry Pi B+ I made use of the easily downloadable OctoPi SD card image, which meant it only took a few minutes to get everything up and running. However I wasn't sure it would support the latest board revision so instead followed the comprehensive instructions for building and installing OctoPrint, which took a little while on the Raspberry Pi Zero.

With the main OctoPrint software installed I then moved onto setting up mjpg-streamer for performing the video capture. As usual I'd managed to put the camera connector in upside down, despite checking the correct orientation before plugging the cable in, so ended up opening up the case to more easily flip it over.

Test Print

As the Raspberry Pi Zero only has a single USB port, and I had to connect it to the printer itself whilst simultaneously having a network connection, I needed to make use of a USB Hub. Unfortunately the UUGear Zero4U I recently purchased doesn't quite fit the new Raspberry Pi Zero board, so I ended up making use of a slightly less compact setup with an external USB Hub.



With the Raspberry Pi Zero connected to the printer and the camera positioned I started off with a fairly simple test print that only takes 10-15 minutes to complete, just to make sure everything was working as expected. During the print I kept an eye on the CPU load and memory usage of the Raspberry Pi Zero, just to make sure everything was running happily.


A longer print

With the test print out of the way it was time to try something a bit more time consuming, to see if the Raspberry Pi Zero had the staying power to keep on driving the printer. Something I had been meaning to print for a while was a 5 1/4" to 3 1/2" drive bay adaptor. This was something I had originally thought about buying in a shop, but as I looked at the price of it (around £6 to £7) I realised I should be able to print one at home for a fraction of the cost. A bit of hunting around on the internet had come up with a few designs that people had put together, so I selected one and set it off printing.

Total print time turned out to be just under 4 hours, of which I mostly monitored progress by viewing the video feed from my phone. Whilst the video resolution was the same as I use on the B+, the newer 8MP camera did seem to give a sharper image.

I did, of course, notice that the corners of the print had lifted at one end, but as the resulting item was going to end up inside a computer case I wasn't worried enough about it to stop the print and re-try. Besides, that edge is always a pain to get levelled!


With the 4 hours up the print looked good enough, apart from where the corners had lifted of course, and the Raspberry Pi Zero was still running happily (and still is now, several days later). A couple of times the OctoPrint page seemed to stop updating, but a reload got it working again. After removing the print, and detaching the raft that was supposed to help the print stick to the glass, it was time to see how well it worked. Due to the print lifting on one side I did have to slightly extend the screw holes, but my USB3 front panel fitted in nicely and I soon had it mounted in my PC case.

Conclusion

Based on this quick test am I going to switch over to controlling my 3D printer using a Raspberry Pi Zero? Probably, yes.. at least when I manage to get ahold of more than one of the newer boards!

Not because of the price, after all I already have the B+, but more because it will allow me to create a more compact setup.  I'll need to do something about requiring the external USB hub first, either getting a newer Zero4U that's been updated to work with the revision 1.3 board, wiring the Raspberry Pi's serial port directly to the printer, or by connecting up the networking differently e.g. by using the IoT HAT that I backed recently.

But for now I'll be switching back to the B+, as I have other uses for my singular Raspberry Pi Zero 1.3 board!

Leo


No comments:

Post a comment