CNC Plotter/Machine

One of the most fascinating aspects of technology is the manufacturing of objects that can complete human functions. A CNC Machine can do exactly that by drawing.

Engineer

Vijaya K.

Area of Interest

Business, Engineering

School

Lynbrook High

Grade

Incoming Sophomore

Reflection

Simply put, Bluestamp was a pretty great time. I’m still hesitant about which field I’ll go down but through this program I’ve experienced different sides to engineering like mechanical, engineering, and programming, and I’m starting to comprehend how I feel about each side.

Before the six weeks, I was so exciting about constructing a machine that draws. Six weeks later I can genuinely say that this project still just as exciting. I’ve learned that engineering is a process with highs and lows, but the highs always triumph the lows and make the entire process worth it.

I’ve learned-

  • Arduino code
  • Gcode
  • About inkscape
  • How to test out ways to find the most efficient
  • The value of independence
  • And so much more

I can say without a doubt that Bluestamp has been an experience that will shape the rest of my engineering path and has made this summer amazing.

A Closer Look

Materials

The main components of the project include:

  • DVD Drive (2)
  • L293D Motor Shield
  • Arduino Uno
  • Acrylic, Wood, or any type of sturdy material
  • Servo
  • Pen

Aside from that, tape, glue (hot and super!), power tools, screws, wire, and nuts are required.

Build Plan

Around a week or two before the program started, I wrote my projected build plan. Though I didn’t end up constructing my project tin this order, my milestones are either similar or the same, and this plan is vaguely the way anyone should go about this project.

Motor Shield

The CNC machine requires an Arduino Uno and on top of that, the motor shield manages the amount of current/voltage. The eight yellow wires screwed in are connected to the stepper motors.

Pen Setup

This aspect of the project is called the “x axis”. The little blue container is a servo motor and when this motor rotates, it’s blade causes the white plate to move up and down by pushing it along the gears. By this process, the pen has the ability to move up and down.

Arduino

The Arduino code is constantly running on the machine. I used code from online however changed parts of it to suit my robot. For example, I changed the positions for the “penZUp” and “penZDown”, so it would suit my machine. This code sets the baselines for the plotter. It tells the machine what to do “if…”. It tells the machine what position to be in at certain times as well. In the image, only segments of the code are shown like parts of the void setup and void loop.

Full Code: CNC Arduino Code

GCode

Gcode is a programming language for machines. This code was what ultimately allowed my machine to draw. I ran this code through a software program called Processing over the Arduino code. The image is a segment of the entire code.

Full code: Gcode

Inkscape!

Inkscape is an exciting graphics editor program which allowed me to upload any image of my choice or text of my choice to upload to my machine. It makes my code files and is the basis of creativity in this project.

Download Inkscape here

Schematic

If this was made with a breadboard, this is the schematic to follow (taken from Instructables):

Drawings

Final Milestone

Process

My final milestone, though the easiest, took the most time. Soon after completing my second milestone, I learned and ran gcode, which is a programming language used for controlling automated machines. The problem was obvious; the pen was unstable and the up and down movement wasn’t reliable enough for it to actually function as the machine drew. The gears were loose and the pen would slide down randomly. I had to take the project back some steps and remove the pen mount. I used a different section of my second drive to use as my z axis. It took me a couple of days to glue, mount, and also figure out the position of my servo. I re-ran gcode and well, one of my stepper motors wouldn’t run. After testing out a couple of factors and changing the motor shield, they worked. I ran the gcode, and it worked. I also use Inkscape to make my own gcode. Inkscape is a graphics editor that’s used in my project to upload images, texts, and drawing for machines.

Plans

If time permits, I would like to clean up the wiring on my CNC machine and maybe make a pen holder.

Third Milestone

Process

My third milestone was simply to set up my “z axis” which is the servo motor powering the pen to move up and down. This was by far one of the most challenging constructional aspects. I started by deciding what parts to use to hold the pen and shift it up and down. After referring to some YouTube videos I used the dremel and saw to cut out a part from the scraps of my DVD drives. This part contains gears and a plate that I attached my pen to. I would say the challenging part had been figuring out where to mount the servo so it doesn’t disrupt any other parts. I also had to make sure that the gear on the motor was in close proximity to the gear that controls the pen. After playing around with cardboard and a whole lot of tape, I created a prototype. Currently the parts aren’t quite stable, so in my modification I aim to stabilize everything.

Plans

My final milestone is just to upload g-code and make the machine draw text or images.

Second Milestone

Process

My second milestone was to complete mounting my stepper motors onto acrylic. This was done by drilling four holes on each acrylic slab and using screws, spacers, and nuts. Figuring out the right screws on either side and the amount of spacers so that the stepper motors would be level took the most time in this milestone. A crucial step was glueing the x-axis to the y-axis with a hot glue gun. I had to be cautious that I was glueing them in a 90 degree angle or else the future drawings could be inaccurate. That was one of my largest challenges and took me about 30 minutes. The only element supporting the two axises is the glue, so I’m considering adding more support in my next milestone. Then I mounted an interim drawing platform with cardboard on my x-axis and attached a marker to the y-axis with an L bracket and tape. I developed some basic code for the markers to draw a square with the stepper motors.

Plans

My future plans include adding in the z-axis, or the servo motor, to control the up and down movement of my pen. I plan to add more support and stabilization in the structure and pen setup. I’ll also be creating a permanent drawing platform for the x-axis. Last, I’ll be uploading g-code to draw more complex images.

First Milestone

Process

My first milestone was coding and preparing my stepper motors to run. The stepper motors run the x and y axises in my final project. The parts required to complete this milestone included a L293D motor shield, an Elegoo Uno R3, stepper motors, and a few other bits. I started by disassembling my DVD drives and pulling out the stepper motors and their frames. Then I took out the motor so I could solder the motor to the motor shield. I had to solder four wires onto the motor and made sure none of them touched, even though the same current was running through certain pairs. During my first try, the solder job wasn’t precise enough and caused the circuit to short, and the motors didn’t run. After desoldering and re-soldering, the motors worked. Past that, it was just figuring out Arduino code. The motor shield is a critical part of the circuit deign and allowed me to use a higher amount of current. An advantage of the motor shield is that they eliminate the need for a breadboard which makes wiring simple.

Plans

My next milestone will include mounting my stepper motors onto slabs of acrylic and finishing the physical structure of the plotter. Also, I aim to set up the z axis, which is the servo motor which controls the up and down motion of the pen.

Starter Project

My Starter Project is the MiniPOV4 (Mini Persistence of Vision) which is a battery powered light painting kit. The LED lights turn on by a switch. The lights flash and create light trails. Another feature of the MiniPOV4 is its ability to receive images from a computer through a USB and recreate them by waving around the device.

The components include ten 47ohm resistors, an 8-bit microcontroller, four 2.2k resistors, a 0.1uF ceramic capacitor, two 100uF/6V capacitors, three transistors, a 28-pin socket, a 12MHz ceramic oscillator, two 3.6v diodes, a USB jack, eight LEDs, a MiniPOV4 PCB, a 10k breadboard trim potentiometer, and a 3AAA battery holder.

The PCB is where the majority of components are placed on. Some of the 2.2k resistors in the MiniPOV4 let the computer know that the USB is plugged in, while others control the amount of energy going through the transistors, so they’re not overloaded. The 47ohm resistors set the brightness for the LEDs, so they don’t burn out. The diodes control the direction of the current, and in this case keep the voltage stable in the USB. The ceramic capacitor and the two electrolyte capacitors make the battery voltage smooth. The transistors work as amplifiers to increase current and support the LEDs. The potentiometer is a dial like object that can control the speed of the LEDs by adjusting the amount of energy through the oscillator, while the 12MHz crystal “tracks” time and flashes the LEDs at a consistent speed. The battery pack powers the LEDs.

Overall, the MiniPOV4 is simple and unproblematic, but I did run into a couple of problems. One of the pins on the chip broke which may account for a dim LED on the device. Also, both the red and black wire broke because I didn’t back them up with tape, so solder got stuck in the copper holes. Fixing that consumed hours. Through this project, I learned about various parts and how they work together.

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering