Introduction: X-Y Plotter
Update 12.04.2015 - Have added a step to cover adding a cutting tool.
Thank you for taking the time to check out my instructable for an Arduino based X-Y plotter. I decided to build this as an accompanying piece of work for my 4th year architecture dissertation at the University of Edinburgh the topic of which is open source architecture and the challenges it poses for the architectural profession.
Inspired by Wikihouse founder, Alastair Parvin, and his proposition that “if design’s great project of the 20th century was the democratisation of consumption… design’s great project in the 21st century is the democratisation of production” I set about the task of building a machine that would be capable of printing my own customised open source Wikihouse from the commons at a 1:100 scale.
For the real Wikihouse project you would use a CNC router and 18mm plywood, but due to time constraints I opted to build a smaller more manageable desktop pen plotter which would still plot accurate CAD drawings.
The plotter is comprised of 3 stepper motors each powered by a V4.4 EasyDriver and runs off a 12V DC supply. Since all three axes are running a stepper motor the pen could be replaced with a router and become a CNC milling machine (in theory).
I use grbl with the Arduino to send G-Code to the printer and a really great way to create G-Code is with the totally free software Inkscape, which has a built-in feature, G-Code tools. Inkscape will convert your drawings to G-Code which grbl will interpret and send instructions to the plotter.
With that brief introduction out of the way I will show you how I went about building the plotter, I will provide drawings like the .dwg for the laser cut base however please use the material with caution and check measurements yourself before cutting your precious materials.
This instructable is intended as a resource for people who are thinking about building a similar CNC machine, or have already started and are looking for answers and troubleshooting problems. I would not suggest that people copy this design completely as it was only my second project of this nature as as such has its limitations, but it may serve as a valuable point of research for those interested.
Step 1: X-Axis
So I began by taking apart an old printer that had stopped working as I had seen a few examples of plotters that use running gear from obsolete or broken hardware and liked the idea of using parts that would otherwise go to land fill. I took the bracket that the ink cartridges originally were fixed to and cut away pieces of the black plastic caddy you see in the video until i had a nice clean surface where I would later attach a pen.
Originally there was a motor at one end of the bracket and an idle at the other with a belt in between, had the motor been a stepper motor l would have been able to leave these in place, however I instead removed both and after a fair bit of manipulation I mounted an idle gear at one end and a stepper at the other (these are the gears you see in the video).
The belt would then run between the motor and idle and attached to the black plastic caddy will pull my pen along the x-axis. I mounted a couple of L shaped brackets off the printer component by which I would later suspend the x-axis over the rest of the plotter.
Step 2: Z-Axis
This is not how I ended up doing the Z Axis exactly but I thought it would be good to show alternatives and reasoning as to why it wasn't done this way finally. Here I have mounted a servo off the plastic ink cartridge caddy. I also mounted an old floppy disk component from my mum's computer (please do consult whoever is the owner of the floppy disk drive, chances are they won't need it though) off the caddy and tensioned a belt between the servo and worm gear of the floppy drive.
I didn't end up doing it this way for two reasons. 1: Servos only turn 180º and with the worm gear this allowed very little movement up and down (although probably enough to raise a pen) 2: Later on when we are configuring grbl it is much easier to use all stepper motors rather than servos as well, that said you can manipulate the code to work with a servo.
Step 3: X-Axis Fixed to Base
The basic design of this plotter is such that the X-Axis is suspended over the bed on which the drawing will be made. The Y-Axis pulls the bed perpendicular and underneath the X-Axis. The video here shows the X-Axis mounted to a length of aluminium angle that i picked up from B&Q, this angle then spans between two 8mm threaded rods that are fixed to a 12mm MDF base. Threaded rods are really useful in this context since they allow for essential adjustment.
Step 4: X-Axis Motor Driven
Next I decided to run some tests and see if I could send some instructions to the stepper motor via an Arduino to get the caddy to move up and down the X-Axis. Brian Schmalz's page on example stepper motor code is really helpful if you haven't got experience of using EasyDrivers and stepper motors with the Arduino platform.
Step 5: Y-Axis
The way I decided to set up the Y-Axis was with a stepper motor that would pull the middle of the bed back and forth. The bed would have two linear bearings mounted to it which would run along two 8mmø rails I picked up from B&Q (note I am intending on swapping these aluminium rails out for stronger linear shaft rods)
The rails would need to be lifted from the base so that the bed would run over the top of the motor and the idle. The mounts shown in this picture are not the final method but again good to show the plotter's evolution.
Step 6: Y-Axis Moving
Just as with the X-Axis I decided to test the motor and the way I had setup the running gear. This is where I began to realise the problems with making all of the components thus far by hand. Very minor inaccuracies cause problems and as such you can see in the video that the bed vibrates and shakes, it was shaking more before I put the jockey wheels in that you can see under the bed.
What has been covered up to this step was all done in the limbo between Christmas and New Year at home, in January I would return to Uni and I had plans to remake many of the components with the University's laser cutter 3D printer etc.
Step 7: Laser Cut Base
Back at Uni I drew up a base and bed in AutoCAD to cut on the laser cutter so that I could make my whole setup more accurate. I decided also to place some guides down the side of the base which would ensure the bed could not rotate off course as it had been doing previously. These guides would cause a lot of friction but I know how strong the Y-Axis' stepper is and as such I wasn't worried. The stepper motor linked will fit in the recess that is cut out in the .dwg I have uploaded.
The assembly of the base is very simple, the 6mm MDF boards go one on top of the other, the top one has a recess for the stepper cut out of it as well as a recess for the breadboard and Arduino. The majority of the holes are 6mmø for bolts to go through to hold up things like the mounts for the rails.
The MDF discs are to be wood glued together to form feet for the base so that you don't need to counter sink the bolts (three to a corner, don't throw away the ones that are from the main base)
Use plastic weld to fix the rail mounts together (the toothed pieces below the acrylic bed)
The other acrylic pieces below the bed are to fit over the stepper motor and hold it down
Step 8: Pen Holder
Earlier I showed how the X-Axis was arranged, I swapped out the servo for a little stepper motor. I have linked to the one I bought, a "5V 28BYJ-48". Do not bother with one like this, they are so so slow and as a result printing takes much longer, you have to wait at least two seconds for the stepper to raise the pen by 1mm clear of the paper. This is down to the fact that I have an interesting gear ratio going on with my floppy driver worm gear as much as the stepper motor but anyway, I would recommend using a superior stepper motor or just redesign the way I have set the Z-Axis up.
Anyway, the penholder. I designed a pen holder in Rhinoceros 5 that I 3D printed and glued to the floppy drive component, I have included a .3dm file should you wish to edit the design in Rhino or another software of your choice and I have also included a .stl file ready for 3D printing.
Step 9: Grbl
So now that we have all our axes working the next thing to do is get started with grbl. The best thing to do follow this link and just follow the comprehensive explanation provided. It does seem daunting at first however the information available through their website is great and makes a lot of sense.
Follow the wiring diagram I have uploaded from grbl and get Universal g-code Sender. Universal g-code Sender makes using grbl easier since it allows features such a jogging each axis and visualising the g-code you are sending to your printer.
Step 10: Test Print
Ok so now that we have grbl configured it is time to send some g-code. At this point i didn't actually have my Z-Axis finished so I used a bulldog clip to fix the pen to the X-Axis. My first print was the outline of a gecko, don't ask me why a gecko, it just was. Because I didn't have the X-Axis finished the included piece of g-code has no movement in the Z direction, it is a continuous line.
The first print was painfully slow, this is because I hadn't understood how to properly configure grbl. Playing about with the settings and fine tuning is necessary.
Be wary that if you use the included g-code, your settings for mm/step need to be correct, the gecko is about 12cm long, if your mm/step are incorrect the size maybe too large for the print area you have and unless you have enabled soft limits in grbl you may damage your machine.
Step 11: Creating Your Own G-code
With everything in place you are now ready to make your own g-code. The best way I have found to do this is to use inkscape, it is free and has a built in feature, g-codetools. I found this tutorial really helpful to understand how to use g-codetools.
If you are, like me, wanting to print drawings you made in AutoCAD (.dwg/.dxf) then I found a good free way is to download Apache Open Office, open up you .dxf and then save them as .svg files. These files are then easier to work with in inkscape and can be simply converted to paths which work with g-codetools. I could not get .dxf files imported directly to inkscape to be processed by g-codetools. You may have better luck.
Step 12: Wikihouse Print
So if you set out with the same intentions as me you might like to access the Wikihouse Commons, download a project manipulate it, and print it on your new DIY plotter.
I hope you have found this instructable to be of some use, maybe not all of it will be, but it is hoped that you might take parts, change them and make them better. I would really love to know if you found it helpful or have tried bits out, changed them etc.
Thank you for taking the time to read my first ever instructable.
All the best,
Step 13: Cutting Tool
Following the comments made by "Raitis", "dollarseed" and "dan3008" I went ahead and bought a Silhouette replacement blade from amazon for £8. I had to do a bit of sanding and cutting away of the plastic housing so that it would fit beneath my pen holder.I then araldited a bolt to the housing as the diameter of the plastic was too large to fit inside the holder.
The results of the cut could be better, the blade does drag and the cut lines are therefore not straight, but it did work so I cannot complain. An easy and fairly cheap mod.