[ Arduino ] V-Plotter/Printer + Custom PCB and software build Log
The idea with this machine, is to create an autonomous drawing platform controlled by only two stepper motors. In other words: “A giant non-traditional printer”.
After my first attempt at a plotter using the Raspberry Pi failed, I decided to rebuild the concept on a larger scale. This time I used an Arduino Mega 2560, two large 57BYGH420 (NEMA 23 form) uni-polar stepper motors. These stepper motors are ridiculously powerful and are more than sufficient for our needs; but aren’t cheap at 400ZAR a pop.
Displayed below is the custom PCB, Arduino, breadboard for the solenoid (replacing a dead channel on my pcb-driver), and Marker installed.
The pen-holder below is a cylinder of Vesconite with the same diameter as that of my marker. I have a solenoid attached on top of the cylinder actuating the marker via the control-rod. I have a total of 50 grams hanging from the bottom of the holder. This works to absorb vibrations caused by the stop-start nature of the stepping motors. I’m pretty happy how this is coming along. (Ignore my lack of mouse-drawing ability…)
After knowing what I wanted I did some research and found some other marvelous projects that I have definitely drawn inspiration from:
All the various files involved in this project, including source-code files for both the programmer and the microcontroller, pcb-design files and schematics are listed here for download:
PCB Design Files and pictorial-schematic:
Project Log ( Reverse Chronological Order ) :
I have uploaded the current versions of the software, both Arduino and controller. I have also uploaded all the schematics and details on the driver-PCB.
If anyone plays around with it please let me know how you come along!
The software allows for a few different modes of operations, depending on what you want.
The first is a direct-serial connection where every move you make on the imaging software is imediately plotted.
The second allows for a complete image to be drawn, and only then instruct the plotter to plot. This option saves the instructions into the devices SRAM.
The third option allows a complete image to be uploaded to the devices EEPROM. This is handy as it allows the printer to plot at a later stage, disconnected from a computer or laptop.
The files are available above.
21st September 2013:
Well this week I’ve printed, etched and populated a custom-pcb board. The purpose of this board is to act as a high-amperage stepper driver. It is opto-coupled via cny17f’s to provide a good level of separation between micro-controller and the load. The rest is handled through an array of IRFZ44N MOSFETs. Most channels seem to be working, I think though I managed to damage one of the mosfets whilst soldering (soldering is NOT one my fortes). Etched the boards with Ferric Chloride. First attempt at it really stuffed it up by being impatient. Oh well. Process of learning and endless debugging. The motor return connections (V-) are made via the visible computer molex adaptors. Whilst the positive is supplied via one of the push-connectors. Ultimately I intend on powering the board via a computer power supply, allowing for a total possible load of around 11 amps. Each motor and solenoid has its own voltage rail which can supply 5 amps.
Of course this means a new version of software is required! Ill back to a direct serial connection without saving values on the EEPROM – unless specified to do so. I ultimately wish to utilize an atmega chip and a raspberry pi as the master connection performing the serial connection. I wish to incorporate a web-interface so it will require the raspberry pi to act as web-server as well.
8th September 2013:
I’m still using an office clip as a pen-holder. Added a weight to it to absorb some vibration. The weight helped dramatically, but still some jagged lines are still visible. This addition of weight also prevents the pen from dragging around corners, causing the “round-corners” before:
4th September 2013:
Shown above is the new graphical iteration of the control software for this project that I have written. It uses a combination of Left and Right mouse button clicks to plot a logical sequential path of movements, both drawn and undrawn (allows the pen/spraycan/etc to move from A to B without drawing. This allows for complex images).
Left button clicks add “Drawn-Movement markers” and Right clicks place “No-draw markers”. The respective movement-pathways are displayed in GREEN and RED. This software now not only allows for the drawing of images, but direct programming to the Arduino. The software allows for saving and opening of previously plotted images, for added usefulness.
Of course this software cannot print traditional raster images. I will at some point figure out a way of manipulating raster images to provide us with sequential x,y,z coördinates. For now, drawing is managed through a vector-image based system.
1st September 2013:
As you can see in the picture at the top, I plotted out a grid and have drawn a test shape to plot. Thus far I have managed to successfully plot the diamond shape, it does however come out slightly squat. I suspect this is due to the diameter of the pulley changing as string is drawn or retracted.
57BYGH420 Stepper motor enclosed in Alclad bracket. I made the pulleys out of plywood that I drilled out with a hole-cutter, clamped and glued together. Each pulley consists of 2 large outer circles with a smaller (1/4 in this case) circle in the middle:
Displayed below is a mess. Arduino mega 2560, breadboard populated with TIP102′s, two large power resistors and two large decoupling capacitors (one each of both per motor):
Once I get around to choosing the drawing medium (Marker, spray can, pen, etc), these will be my options for actuation. Either a small servo motor or a solenoid (pull-down solenoid pictured):
I’ve written the control software. It receives command from an array of x,y,z coördinates (z is either 1 or 0 denoting draw or no draw). The software calculates the amount required steps through using the Pythagorean theorem. It calculates the change in the hypotenuses between the original and new X and y values. We know the stepper motors move 200 steps per revolution, we know the diameter of the inner circle of our pulley. Using this information we can work out using simple division how many steps must be preformed to either provide enough string, or retract sufficient string for the given movement. Once we know how many steps we need per motor for a given movement, we can apply a time period to this. This allows us to perform the requisite number of steps for both motors within the same time span. This also ensures control-line tension to always be kept within acceptable bounds.
A logical sequence of required motor steps, and direction (unwind, rewind) is parsed to the Arduino over a serial connection. The Arduino saves the relevant information into its EEPROM for later recall (allows us to include a physical replay button onto the Arduino, allowing operation without a laptop). Additionally I found the Arduino serial library to be rather buggy as it would occasionally crash mid plot. I’m not sure if this is a decoupling issue, I tried all manner of smoothing to no avail. Writing the instructions too and from the EEPROM avoided this issue though.
Below is a screenshot of the Step-calculator/serial programmer:
In the first video (taken 8th Sept.) you can see the pen dragging around corners, preventing the machine from drawing nicely shaped corners.
Additionally the different sized pulleys are still affecting the requisite number of steps per movement.