Arduino Based CNC Plotter From Old CD-ROM

Introduction: Arduino Based CNC Plotter From Old CD-ROM

About: M.Tech in CAD/CAM, BE Mechanical Publication in an International Journal Software knowledge : Pro E, Creo, Solidworks,CATIA & Ansys. 40+ Design & Development Projects. Always ready to work on new cha...

Hello Friends.Here I have one more mechanism for you i.e. CNC plotter from old CD rom. Hope you like it.

Step 1: List of Equipments:

For making the movement of tool along vertical & horizontal path, the stepper motor movable platform is required. For the old cd rom stepper motors are used. Two stepper motor along with the platform are taken out from the cd roms. The platform is made using outer cover of the cd rom. The motors are mounted using nut & bolts. The stepper motors are mounted in such a way that they form a right angle which cause movement of one stepper motor in x- direction & other in Y- direction. The mounting is provided on X- direction moving motor for holding the tool i.e. pen for profile drawing & Cutter for cutting. All the Electronics parts along with connected wires are placed at backside. The movement of tool is done by programming which is explained in working.

1) Arduino Uno :

The Arduino Uno is a micro controller board based on the ATmega328 (The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family.). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.

2) Breadboard :

A breadboard also known as protoboard is a type of solderless electronic circuit building.You can build a electronic circuit on a breadboard. A breadboard is used to build and test circuits quickly before finalizing any circuit design. The breadboard has many holes into which circuit components like ICs and resistors can be inserted. A typical breadboard is shown below:

3) Servomotor :

A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors. Servomotors are not a specific class of motor although the term servomotor is often used to refer to a motor suitable for use in a closed-loop control system. Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing.

4) Stepper motor :

A stepper motor or step motor or stepping motor is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any feedback sensor , as long as the motor is carefully sized to the application in respect to torque and speed. Stepper motors are DC motors that move in discrete steps. They have multiple coils that are organized in groups called "phases". By energizing each phase in sequence, the motor will rotate, one step at a time. With a computer controlled stepping you can achieve very precise positioning and/or speed control. For this reason, stepper motors are the motor of choice for many precision motion control applications.

5) Stepper motor controller or driver :

Stepper motor performance is strongly dependent on the driver circuit. Torque curves may be extended to greater speeds if the stator poles can be reversed more quickly, the limiting factor being the winding inductance. To overcome the inductance and switch the windings quickly, one must increase the drive voltage. This leads further to the necessity of limiting the current that these high voltages may otherwise induce.

6) USB power supply cable for Arduino :

USB, short for Universal Serial Bus, is an industry standard initially developed in the mid-1990s that defines the cables, connectors and communications protocols used in a bus for connection, communication, and power supply between computers and electronic devices. It is currently developed by the USB Implementers Forum .USB was designed to standardize the connection of computer peripherals to personal computers, both to communicate and to supply electric power. It has become commonplace on other devices, such as smart phones , PDAs and video game consoles. USB has effectively replaced a variety of earlier interfaces, such as parallel ports, as well as separate power chargers for portable devices.

7) Jump Wires :

A jump wire is an electrical wire or group of them in a cable with a connector or pin at each end , which is normally used to interconnect the components of a breadboard or other prototype or test circuit, internally or with other equipment or components, without soldering. Individual jump wires are fitted by inserting their "end connectors" into the slots provided in a breadboard, the header connector of a circuit board, or a piece of test equipment.

8) L –Clamp :

A clamp is a fastening device used to hold or secure objects tightly together to prevent movement or separation through the application of inward pressure. In the United Kingdom and Australia, the term cramp is often used instead when the tool is for temporary use for positioning components during construction and woodworking; thus a G cramp or a sash cramp but a wheel clamp or a surgical clamp.

Step 2: Dis-assembling the CD Roms

First step to start building this cnc machine is to disassemble two dvd/cd drives and take off them the stepper motors. Use the screwdriver to open them and take off them the rails.

Next step is to choose our base for this CNC machine. We used one surface from remaining dvd 'garbage' stuff. Finally we will need to find something to attach the one of the stepper-rails vertically to our construction. (you will understand what I mean in our next step) Watch the bellow image.

From image we can see that

1. 1st Stepper motor with rails

2. 2nd stepper motor with rails

3. This metal will be our CNC "base"

4. We will cut this plastic to attach on it later one of the stepper-rails.

In first image bellow we will see the Y axis of our CNC machine. Attach it on your surface, in this part you will need some screws and nuts.In second image we will see the X and Y axis. The X axis is attached to two plastic parts that I took from remaining 'garbage' stuff. I cut it to fit the construction.This is an easy procedure. Just make sure to put the Y axis straight to CNC base and the X axis vertically in this (90 degrees).

That's the most difficult part of our construction. You will need something to attach it on X axis, a flat surface. On that surface you will attach the servo motor (Z axis) and the pen base. Pen (or pencil) must be able to move up and down with the help of servo motor.

Now we will have to attach a wood (or plastic) surface on Y axis (5x5cm will be fine). On this we will put the paper piece to print your texts or images!

Now that we have our contraction ready, it's time to build the circuit and test stepper motors (X and Y axis). Watch the above image with breadboard circuit schematic. Steppers motors wiring is something that need patient. On next step you will find a 'testing' code for x and y axis. If yours steppers doesn't work properly you must find correct working combination by changing the cables between them and the L293D ICs.On mine cnc, X axis motor connection are: L293 A: Pins 1 and 3 & B: 2 and 4, but on Y axis motor connection are A: 1 and 2 & B: 3 and 4.

Here is the X and Y axis testing code embedded using code bender!

For X axis:

For Y axis:

(It is at the last)

If you see any movement here that means that the stepper motors wiring is correct! If you don't, try to change the cables...

Step 3: Construction

X and Y axis:

In first image bellow we will see the Y axis of our CNC machine. Attach it on your surface, in this part you will need some screws and nuts.In second image we will see the X and Y axis. The X axis is attached to two plastic parts that I took from remaining 'garbage' stuff. I cut it to fit the construction.This is an easy procedure. Just make sure to put the Y axis straight to CNC base and the X axis vertically in this (90 degrees).

The Z axis:

That's the most difficult part of our construction. You will need something to attach it on X axis, a flat surface. On that surface you will attach the servo motor (Z axis) and the pen base. Pen (or pencil) must be able to move up and down with the help of servo motor.

Watch the image to understand what you need to do to build Z axis. Tip!

Paper base

Now we will have to attach a wood (or plastic) surface on Y axis (5x5cm will be fine). On this we will put the paper piece to print your texts or images!

Remember, printing area is 4x4cm.

Step 4: Circuit Connections

Now that we have our contraction ready, it's time to build the circuit

and test stepper motors (X and Y axis). Watch the above image with breadboard circuit schematic. Steppers motors wiring is something that need patient. On next step you will find a 'testing' code for x and y axis. If yours steppers doesn't work properly you must find correct working combination by changing the cables between them and the L293D ICs.On mine cnc, X axis motor connection are: L293 A: Pins 1 and 3 & B: 2 and 4, but on Y axis motor connection are A: 1 and 2 & B: 3 and 4.

Step 5: Working:

There

are two main steps:

1) Creating g code file in Inkscape from the sketch

2) Uploading g cone cnc file for profile drawing using gctrl controller

1) Creating gcode files in Inkscape

To make gcode files that are compatible with this cnc machine you have to use the Inkscape.

Inkscape is professional quality vector graphics software which runs on Windows, Mac OS X and Linux. It is used by design professionals and hobbyists worldwide, for creating a wide variety of graphics such as illustrations, icons, logos, diagrams, maps and web graphics. Inkscape uses the W3C open standard SVG (Scalable Vector Graphics) as its native format, and is free and open-source software.Download and install Inkscape from here (Important: download 0.48.5 version)Now you need to install an Add-on that enables the export images to gcode files. This add on can be found here with installation notes.

Setup Inkscape for first use

Open the Inkscape, go to File menu and click "Document Properties". See the 1st image above and make the changes, make sure to change first to "cm". Now close this window. We will use the area within 4 to 8 cm. See the 2nd image above.

How to print texts

Put text, change font to Times New Roman and size to 22. Now click on cursor icon and center the text like the 3rd image above. Select Path from menu and "Object to Path".

How to print images

This is more difficult than texts. Images must have a transparent background. Drag and drop the arduino logo image (download it from files) in Inkscape. Click ok to the next window. Now you have to re-size the image to fit our printing area, see the 4th image above. Click Path from menu and "Trace Bitmap".Make changes as the 5th image above. Click ok and close the window. Now, move the gray scale image, and delete the color one behind it. Move the grey image to the correct place again and click from Path menu "Object to path". The 6th image above show how to delete image outline.

Export as gcode

Final, go to file menu, click save as and select .gcode. Click ok on next window. That's it! Ready to go! Use the gctrl.pde app to print the gcode file on your new Arduino CNC.

The steps for creating for design file with extension gcode is as follows:

Refer Images

There are many phases & applications used in working of this system. Starting from first, The profile drawing is done using online open source tool called “Inkscape”. The profile drawn in Inkscape is saved as gcode file format. GCODE is a file format that conveys binary information in ASCII text form. It is commonly used for programming microcontrollers, EPROMs, and other types of programmable logic devices. In a typical application, a compiler or assembler converts a program's source code (such as in C or assembly language) to machine code and outputs it into a GCODE file. The GCODE file is then imported by a programmer to "burn" the machine code into a ROM, or is transferred to the target system for loading and execution.

2) Uploading g cone cnc file for profile drawing using gctrl controller

Uploading the CNC code

Here is the main CNC code embedded using code benderIn this part you will see your pen goes up. If don't, change pen Up and penDown variables that controlling the servo motor. Press the

"Run on Arduino" button and program your board from your browser!

The GCTRL program

Now we are ready to print our first image! To do this we will use the gctrl.pde processing program. This program sends 'gcode' images to the cnc plotter.

What is gcode?

Gcode is a file with X,Y and Z coordinates. Header of this file is set to:

M300 S30.00 (Servo down)

G1 X10.00 Y10.00 F2500.00

G1 X20.00 Y10.00 F2500.00

M300 S50.00 (Servo up)

Download Processing from here, now donwload and open GCTRL.pde application.

Click the "play" icon/button to start the program.

~Watch the above image~

Now press 'p' and select your Arduino serial port.

Press 'g' and select the 'drawing.gcode' file

(If something goes wrong, press 'x' to stop the plotter)

Adruino is programmed for simultaneous working of two stepper motors and one servo motor. The GCODE file produced by Inkscape is opened in GCTRL Controller. Then at last the motion of the tool & platform is controlled using GCTRL Controller. Now, at this stage , we will get our required output file drawn or cut on the piece of paper. The motor which moves in X direction carries a tool with it, i.e. Pen for profile drawing or cutter for cutting as explained in construction. The other motor moves the platform in Y direction. Their combined movement through programming will create an output profile. Power supply & coding is provided through Laptop.

Step 6: Final Images

Step 7: Working Video:

Share

    Recommendations

    • Tiny Home Contest

      Tiny Home Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Metalworking Contest

      Metalworking Contest

    Discussions