← Back

Arduino Pen-Plotter

From highlevel imageprocessing to optimised instruction encoding to lowlevel highspeed motordrivers
The assembled 3d-printed plotter
The assembled 3d-printed plotter
Goal: sending personalizes 'handdrawn' birthdaycards to friends. Hardware: Arduino Uno, 3 steppermotors and the corresponding CNC shield, 32KB flash memory. What I did: The first thing was getting this machine to draw, therefore I wrote a steppermotor driver in C alongside a fileformat for efficient encoding to even fit a 3 MB pixel image onto the Arduino. There are 4 instructions: END, TOGGLE_PEN, MOVE, SIZE encoded with 2 bits each. The SIZE instruction lets me change the int size on the fly to be able to move across an entire sheet of paper in one MOVE instruction (16 bit int) and to allow for fine movement without using too much space (4 bit ints). I also wrote an image-processing-pipeline in JS and HTML to convert images to vectorpaths and then outputs QUICKSTEP. (no not the dance:) Here I also got to play around with lots of optimization techniques and IP programs I had heard about in class like Canny-Edge-Detection and more. The final product is achieving the goal:)) In the future I will play around with an interrupt driven approach for driving the motors to free up CPU time, write a program to stream instructions via UART and ultimatly use the CPU time to calculate the maximal velocity at which I can drive the motors such that I still make every corner in the forseeable future. This is my favorite timesink of them all.