I don't quite remember when it started, but I think around 1999 or so. Me and a friend that was into everything robotics and electronics was discussing building a robot for drawing on whiteboards. Of course we never had time to do anything serious back then, the ecosystem for hobbyist micro controllers was not what it is today.
In 2002 my friend showed me the awesome work of Jürg Lehni and Uli Franke - Hektor. I was very pleased to see something similar to what we had been dreaming to build actually be constructed and shared with the world! I was at peace.
Some time later I remember showing the Hektor project website to someone presenting how fantastic I thought it was. This time though I started looking more at the details realising it lacked one property I had initially envisioned a wall plotter to have. I wanted it to be self-contained, everything in one unit with just wires connecting it to the wall. If I recall it correctly, I looked into stepper motor weights at this point realising that my idea was not going to fly.
Time passed and things happened in the space of hobbyist robotics. It was 2014 and I had been using Arduinos and RC-servos for various camera control projects, I had access to 3D-printing and actually some spare time (!?!). After stumbling over the dirt cheap 28BYJ-48 stepper motor I knew exactly what I was going to build:
The cheapest possible minimalistic wall plotter.First Attempt
After waiting forever, five weeks or so, for parts ordered from China I got into starting construction of the plotter. I tried to make an as compact as possible skeleton to fit an Arduino Uno, steppers, servo and a battery. I cannot remember how many stupid, I mean less smart, designs I made in OpenSCAD before the penny dropped. You must cross the strings!
Having the crossing geometry comes with a huge benefit in maintaining the correct position on the wall. The downside is that you get less stability from rotation around the vertical axis. This was remediated by adding some zip-ties to the corners of the plotter, adjusted so that they prevent the rotation.
The first plotter hardware came to look like the picture below. In my quest for cheapest possible parts I chose to use sewing thread for navigation and gravitation cancellation. The threads crossed at the top of the 3D-printed chassis through small holes in the print. As can (almost) be seen It is a challenged geometry to get the threads to run clean from the pen and wires (cabling from Arduino to right stepper driver is missing in the picture, so it looks less bad than it was). The pen is lifted from the drawing surface by an RC-servo pushing the entire plotter away from the wall.
This first plotter had a hard-coded design written in its program on the Arduino. Setup of the plotter was done by having one meter of thread rolled out on each side and fastening them one meter apart. By this setup the plotter knew the coordinate system when powering up and could start drawing the paths in its memory. It worked, but it was a mess to use. Having to re-flash the Arduino when changing design was not enjoyable. Also being restricted to the one meter disparity setup was frustrating.
It was a good platform for better understanding the problem space though. A few quick learnings:
- The stepper motors are not that strong - The spools were too big.
- Tip of pen offset from crossing of strings - Wicked Wobbliness
The good thing about these problems was that they forced me to put some effort into implementing a reasonable acceleration and braking...Evolution
Plotter number two (the white one in the cover image) got a few improvements:
- Smaller spools.
- Spools moved above pen for better routing of thread and less pendulum motion.
- Electronics more accessible.
- SD-card for storing what to plot.
- New setup process allowing variable distance between anchor points.
- IR-receiver for being able to control it all from a remote.
Adding a SD-card reader and IR-receiver was a lot easier than I first anticipated. It was one of these "why didn't I do this from the start"-moments. The new setup process worked quite nicely and gave a lot more flexibility for drawing both big and small. Biggest plot done yet was about 2.5 meters wide.
The setup is done by navigating the plotter with the remote control. First marking position A, then moving over to position B and marking that. I put 20 cm markers on the left and right sewing thread to avoid needing any manual measurement. The distance m is given just counting the steps on the left stepper while moving from A to B. Once the plotter knows d and that its current location is at B you can move around and plot wherever you like in the space between and below the anchor points.
Plotter number three (the orange one in the video below) is very similar to its predecessor, just a few changes:
- All electronics built as a shield for the Arduino.
- Battery level watchdog, allowing "pause - change battery - resume".
This was all good intentions, but. Putting stepper driver IC:s directly on the shield, skipping the drivers shipped with the steppers, meant no more blinking leds. It is sad to watch. Super boring. Also the on-board led of the Arduino is hidden behind the shield hiding the convenient blinks you get when the IR-receiver is receiving, thus making you uncertain whether you pressed that calibration button or not. Battery level measurement seemed like a good idea, but in reality I always resorted to doing long running plots with cabled power anyway.
Plotter number four (The fabulous one!) was built as a birthday gift to my brother. It is by far the most good looking one built with shield-style electronics but leaving the blinking drivers visible in all their glory. Note that cables are left unnecessarily long just for the looks!
Plotter number five (MacGyver edition) was actually built just as a proof of concept for this project description. I wanted to show that you can build a plotter like this without any fancy tools. I sat down in my garage and looked around at what ı could build it from. Tie-wire (soft metal wire used for connecting rebar) was my first obvious choice. When looking for it I found a roll of duct-strap and figured that would save me time and give more stability. Zip-ties and gaff-tape were also on my list but was not needed. The only thing I couldn't really figure out was how to make some good spools with not too much work. I went back in the house for coffee and there it was, the cap for a milk container! It honestly took less time building the frame for plotter five than the time it takes to 3D-print the original design. And it works just as fine (almost at least) as the other ones I built.
Plotter number six
Wait, what? Somehow I happened to build another one. Couldn't help it. A few things that had bothered me needed to be adressed. Also improvements thanks to some comments here.
- The 3D-print size of the plotter was just too big and slow.
- Moving the pen rather than the entire plotter seemed like at least worth a try.
- Moving Servo and IR-receiver to the "analog" pins would allow serial debugging! (Thanks jrcTexas for pointing out that I could!)
So, here is the result:
So, how well does this new thing work? Good and bad. The changes feel good overall but there is one problem. Since the pen is not fixed to the frame it wiggles a little when plotting. This makes the accuracy worse than for the previous generation. The huge benefit is clearing digital IO pins 0-1 so they can be used for debugging. This makes life so much easier!
I also started doing some stress testing on the steppers to figure out how to not miss steps:
What was figured out from the stress testing was that I needed to slow down a bit to have enough torque. I also calculated the actual pull on the strings depending on where the plotter is on the wall:
I might follow up on the stress testing to figure out how different step sequencing and voltage plays in as well. Some day.Using the Plotter
I make a video showing how the setup and plotting works in real life and real time.
As can be seen from the video the setup is pretty straight forward and takes little time. The typical challenge setting up is to find good anchor points. For whiteboards I've mostly used small suction cups to which I glued a loop of sewing thread or similar to then hang the plotter with a paper clip. One important aspect of the anchor point is to get the thread in as close to the wall as possible, to get better pressure from the pen to the wall.
Another caveat is plotting high up on wide plots. When too more torque is required to pull the thread the steppers will start missing steps, thus making the plotter loose track of its exact location since there is no encoders to help. So general advice is: Hang high, print low.
Building the plotter is pretty straight forward and looks a lot like most other Arduino projects. You have an Arduino Uno, some components you want it to use and a bunch of cables to connect it all.
As can be seen in the schematics you will use pretty much all of the digital pins and then possibly some analog if you eg. wish to monitor battery levels. One caveat with this is that you'll end up using pin 0-1 which doubles as TX/RX. To avoid frying things you will be needing to disconnect whatever you connected there when you program the Arduino! This is the reason I built my more recent plotters with all electronics on a shield that I could just detach when programming.
The RC-servo could be pretty much any servo of any dimension. You'll just have to be creative and mount it in a way so that it can push the plotter away (or not) from the wall.
The stepper motors and drivers could potentially be switched to some other kind but the small 28BYJ-48 ones are so convenient. They are not that powerful though and I'd love to build a plotter that is much faster some day. The motors are rated 5V but I have happily ignored this and provided them with everything between 5-9V without problem. They do run hot but I haven't fried any, yet.
The micro-sd-card module is straight forward to connect to the Arduino, either via the SPI-interface pins or digital pins 10-13.
IR-receiver TSOP 4838 also plays nicely directly connected to the Arduino.
My third and fourth plotter had a battery level watchdog by a resistor voltage divider added to an analog input. I also thought I was going to have temperature monitoring of the steppers added in a similar fashion. My advice, just skip it.
I would highly recommend that you build and test one thing at a time. Don't assemble everything, put your graphics on the SD and hope to plot straight away. I'd recommend doing the following:
- Start by testing the IR-receiver. Use the IRRecvDump example that comes with IRRemote library. You will need this to record the codes for your remote keys anyway.
- Test your servo. For instance use the Sweep example from the Servo library.
- Test your SD card. Play around with the examples for the SD library.
- Test controlling the steppers. Play around with the samples for the Stepper library.
- When you feel comfortable with the above parts, flash the plotter program onto the Arduino and then connect all components. (don't assemble and make anything pretty yet)
- Power up the Arduino and see what happens. If everything works the servo should to a little sweep right after power up.
- Try controlling the steppers from the remote. make sure you figure out which stepper is left and which is right. Make sure you have them wired up so that "REEL_IN" button actually pulls in string and not the opposite. I give you 50% chance that you need to flip the order of the pins either in software or hardware. (not worth bothering too much, it's so easy to just turn the connectors around. Trust, but verify!
- When you feel confident that all of the above works you are ready to assemble everything into plotter-like form and try it hanging from a wall!
I'll not give any super detailed instructions on assembly of parts here. It is better that you explore your hardware and find solutions that work for you. Be inspired by the "MacGyver" plotter above, keep it simple. You can always go fancy and perfect later. Below is a very non-coherent video of me talking about some things hardware. You will also need to familiarise yourself with the software and making a file for plotting, se further below.Plotter Software
All of the software is available here on GitHub. I apologise for the state of the code, it is truly a hack. Maybe I will take my time and clean it up, but it is very likely that you will look at it before that happens. Sorry.
The software on the plotter pretty much does two things:
- Allow navigation and setup from the remote
- Draw the contents of a.svg file stored on the SD card.
As the program memory on the Arduino Uno is quite limited there have been many ugly shortcuts taken to fit the code into memory. This was particularly true for the first plotter that lacked the SD card and the graphics also needed to be programmed directly into the Arduino. The parsing of.svg is extremely limited and can only handle paths with lines (no curves) and requires it to be a specific dialect of.svg which I have used INKSCAPE to output.
The.svg files are stored in the top level folder of the SD card as 1.svg, 2.svg, and so on. The file to be drawn is selected by pressing the corresponding button on the remote. This allows me to have the plotter prepared with a few favourites that I can quickly enrich peoples whiteboards with.
The Arduino IDE has been used for building and programming the controller. The only additional library used is IRRemote (by shirriff).Creating a Plottable File
There are probably hundreds of ways to create a.svg-file that will plot, but I'm only going to describe one here:
- Use INKSCAPE
- Draw whatever you want and convert it to paths "Path->Object to path"
- Choose "Edit paths by nodes (F2)"
- Select all individual paths and nodes. Ctrl-A two times
- Convert to lines by "Extensions->Modify Path->Flatten Beziers"
- Save as "Inkscape SVG"
- Run in the simulator, see below
One more thing! There is a simulator. It is more or less mandatory to run any plot you want to do through the simulator before trying to print it. This is mostly required since the.svg-parsing is so bad that chances are high something will not be interpreted properly by the plotter.
The simulator works by compiling the plotter code for osx or linux and replacing the "digitalWrite" calls with prints to stdout (timestamp, pin, state) which is then piped into a visualisation UI.
The simulator was written after I had a bug causing a 2-hour print to screw up miserably after 95% or so. I was at a complete loss as of what had happened and realised I needed some way of debugging it. It turned out to be a float parsing bug caused by one number in the.svg having ridiculous amounts of decimals. (I did my own parsing since library functions would not fit in memory). It was a great bug because it forced me to make the simulator.
Using the simulator while developing can help a lot. It can be run much, much faster than realtime which is very convenient. Also it outputs how long the plot will actually take when run in real time. There is a readme in next to the simulator code on how to use it.Future Improvements
Here is a list from the top of my mind on what could be improved:
- Stop parsing.svg on the plotter, have a real parser on the computer and create a good format for the plotter instead.
- Better breaking, current software only read one line segment ahead which sometimes is too little if a slight turn turns into a sharp one.
- Encoders or some type of feedback for avoiding getting lost when missing steps..
- Write proper clean software.
- Use WiFi enabled controller and use phone instead of remote.
As you probably understand by now I spent quite some time with this project, mostly a long time ago. I still think it is fun to play around with and I have tons of ideas of what to improve, new variations and new walls to decorate. However I simply don't have time, there are so many other projects and things like family and work.
What I really would love is if some of you fine people on the internet get something out of reading this and get inspiration for your own projects. I would also be happy if some of you build your own plotters and make them work!
Although I think I succeeded in building a minimalistic plotter, I did not manage to get the cost under $10 as I had set as a target for myself. But as parts keep getting cheaper it is probably there in a year or so...
Oh, one more thing. Please don't kill me over the spaghetti code. It was never written to be shared, I was busy drawing on the wall at the time and couldn't care less about code. I decided to share it anyway, so be happy over that instead.