Mini CNC Plotter using Spare Parts

DOI : 10.17577/IJERTCONV5IS23019

Download Full-Text PDF Cite this Publication

Text Only Version

Mini CNC Plotter using Spare Parts

Yash Soni

Department of Electronics & Communication Vivekananda Institute of Technology, Jaipur Jaipur, India

Abstract: In this paper we are designing a low cost three axis Mini CNC Plotter with a stepper motor, Arduino microcontroller and motor control software. A Canon boring machine or Lathe was invented but it can do only one work at a time and also other disadvantages like requirement of regular monitoring, skilled labours and less accuracy. In 1947 Mr John is a parsons tried to control machine tool motion with three- axis curvature data which was further developed for the invention of the modern CNC machine. But this one is of high cost and its construction is very difficult. In my project I am trying to create a cost effective CNC plotter of small or medium size and an open structure.


Computer numerical control is an advanced form of soft automation developed to control the motion and operation of machine tools. Numerical control machine was invented around in 19th century for reducing the work load; it is a method in which the manufacturing machine uses coded format, digits and letters. Its advantages include high efficiency, high flexibility, high production rate, low cost of production, less working time and less losses in production. It includes three main steps that is receiving data, interpreting data and accordingly control of a machine. Based on special characters letter codes and numbers a form of program called part program (a sequential instruction or coded commands that direct specific machine function)that is used for automatical operation of a manufacturing machine to build a specific part of specific dimension. The program is then converted in to electrical signal to feed as input to motors that run the machine and do the tool movements. A machine control unit (MCU) decides depth of cut, cutting speed etc. Motion of tool is based on Right hand coordinate system. There are three axis of rotation x, y, z for three dimensional motion of tool plus an axis of rotation. The z-axis is one of the three which allows the movement of router in upward and downward direction. This axis is very important because it controls the depth. The y-axis functions as motor mount to move z-axis in addition with slide mechanism, x-axis uses two pieces one for front and one for back which serves as height stands.


To developing a low cost automatic mini CNC machine for PCB drawing and drilling. This system reduces the cost of machine and increases the flexibility.


The G code is interfaced with ATMEGA 328 CNC based controller by FTDI module which is used to convert the code in convenient controller code i.e serial to USB

converter. Hence it acts like interfacing module between PC to Controller. This code is further passed to stepper the motor by easy drivers which converts the code and as per instructions the stepper motor moves. We need three axises X,Y,Z which operates as follows X stepper motor move left and right Y stepper motor moves front and back and Z stepper motor up and down as per given dimensions these axiss will move on.

  1. Main Parts of CNC Plotter

    1. Stepper Motor

      It is the heart of CNC plotter. The size and type of motor speed, accuracy, CNC router precision etc.

      mainly two types of motors are used in CNC machines they are stepper motors and servo motors, within these are also many classifications.

      Fig. 1. Stepper Motor

    2. Arduino Microcontroller:

    It controls the position of stepper motor with help of program. It is a open source prototyping platform based on easy to use hardware and software. They have digital and analog input/output pins that can interface into various expansion boards and other circuits and an Atmel 8, 16 or 32-bit AVR

    Fig. Arduino Controller

    microcontroller with complementary components that helps in programming and incorporation into other circuits. Arduino programs are written in any programming language with a compiler that produces binary machine code.


    Main blocks of this system consists of power supply, Arduino, 3 Easy drivers each connected to stepper motors X, Y, Z. From power supply we get two voltages i.e. +5volt and +12 volt. 5volt which is required to ATMEGA328p, Easy drivers whereas +12volt supply is required to stepper motors. RESET is connected to5v supply through 10k ohms resistors to pull up the voltage thus it act as a pull up resistors. We have used here 16MHz crystal oscillator connected with ATMEGA controller with two capacitors of 22pF.

    The GRBL code from computer is interface with controller using FTDI 232 module i.e. serial to USB converter. The output of FTDI is given to pin no.2 and 3 i.e. RXD and TXD pins of ATMEGA328p. The output of ATMEGA328 is given to three Easy Drivers. Easy Driver consists of 16 pins from which we are using in our project only 9 pins. Four pins are used for two stepper motor coil i.e. coil A and coil

    B. Two pins for input 5volt supply i.e. VCC and GND. Three pins are used for STEP, DIR; GND. STEP is used for micro stepping. DIR is direction input pin which will move stepper motor according to the given dimensions. Third pin is directly grounded. Spindle motor is connected to pin no.

    16 of ATMEGA328. It is used for drilling purpose. According to the dimensions drilling machine will move. When working of motors is completed the dimensions on pc will roll of to again its initial value i.e zero.

    Fig. CNC axis- x y z using right hand coordinate system

    Fig . Unit Control System

    As mentioned earlier input device used isserial communication port DB9. Machine control unit (MCU) consists of data processing unit (DPU) and control loop unit (CLU). On receiving part program DPU interprets and encode it into internal machine codes. Then intermediate position of the motion in Basic length unit (BLU) is calculated by interpolator of DPU. Then it is passed to CLU for further process [2]. To control driving system and to perform required motion data from DPU are converted in to electrical signals in CLU. Machine tool can be of any type, machine slide should be of high accuracy and repeatability and also coated with anti-frictional material.

    Fig. Schematic Arrangement


    To complete the task of entire project three software is used-

    • Inkscape

    • Fritzing

    • Processing

    1. Inkscape 0.48.5-

      Inkscape is used to design the plotted diagram or text. In this project by using this software G-code file of a selected image or text is created. G-code is a commonly used for a numerical control programming language which includes X, Y, Z coordinates. Creating G-Code File Using Inkscape.

      The CNC plotter of our project will work within 20cm×20cm area. So we choose the document properties of the Inkscape 40cmx40cm (Width × Height) which is four times the working area of the plotter because the plotter can draw only in the first quadrant. So we have initially kept the axes at the nearest end of the motors which is considered as origin to easily modify the design. The working area of CNC plotter is shown with the text written in the pre-defined area. The text is selected using cursor and then select object to path from the drop down window to save the Gcode form of the selected text. To create G-code of an image, the file must have a transparent background. The image should be dragged into the selected area then select trace bitmap from drop down window t create a transparent image. Scans are selected as 8 and Edge detection is selected to create black & white image. After adding this transparent image in the predefined area weve used object to path

      command to create the G-code file of the selected image by following the steps described earlier.

    2. Fritzing-

      It is friendly open source circuit simulator software which is mainly used for PCB design. Creating PCB Layout Using Fritzing Using Breadboard option any circuit can be built easily by simply dragging and dropping down different components. Schematic circuit diagram and PCB layout will be generated automatically. In PCB layout we need to choose positions of the components, their layers and establish connections. Then Export for PCB option is selected and choose Etchable SVG (Scalable Vector Graphics). From the saved folder the top layer mirror file is loaded. The file is automatically loaded in Inscape software and from there G-code will be generated as described earlier.

    3. Processing

    Processing is open source programming language software which is used for electronic drawings. GTCRL processing program is used to send G-code file from user interface to CNC plotter machine.

    Fig. Proccesing Softwere

    The port of Arduino Uno is selected by pressing P button on keyboard hence G button is used to upload our desired G-code file. Immediately CNC machine will start sketching selected G-code file. Sketching can be stopped by pressing

    X button. Fig. 6 Uploading G-code file.

    if (e2 >-dx) { err -= dy; x0 += sx; }

    if (e2 < dy) { err += dx; y0 += sy; } } }

    Two stepper motor is used to control X and Y axis, and a servo motor is used to control the Z axis. The test code of Y axis stepper motor is shown below-

    #include const

    int stepsPerRevolution = 20;

    // Connection pins: Stepper myStepperY(stepsPerRevolution, 2,3,4,5); void setup()


    // Set speed: myStepperY.setSpeed(100); // max 250 steps for dvd/cd stepper motor myStepperY.step(160);

    delay(100); } void loop()

    The code for X axis stepper motor is also same except the pin numbers. The Z axis is represented by a servo motor controlled by the PWM pin of the arduino. The full CNC code is uploaded in the arduino then the arduino will wait for G-code file from processing software. When the processing software send command to arduino it will start plotting using the G-code.

    E. G-CODE

    To draw a text file or design a circuit layout by the CNC plotter firstly the files need to be converted into G-Code. G- Code is a set of instruction that contains number of X, Y, Z, coordinates depending on the file. G-Code instructs X axis of the machine to travel from X1 to X2 points with a specific speed and same is true for Y axis, but for Z axis the coordinates are fixed because only vertically up & down movements are involved.

    D. Coding

    Bresenham's Line Algorithm is used for plotting in the CNC plotter. A part of this algorithm is shown below

    F. Calibration

    Fig. G code Generating Method

    void line

    (int x0, int y0, int x1, int y1)

    { int dx = abs(x1-x0), sx = x0dy ? dx : -dy)/2, e2; for(;;){ setPixel(x0,y0);

    if (x0==x1 && y0==y1) break; e2 = err;

    After finishing the complete build-up of the machine, it is necessary to calibrate the movement of the axes. Test code for stepper motor mentioned in the section IV (D) is used where stepper motors steps per revolution was 20 and 160 steps were allowed for the motor to travel. On running the code, it is found that the motor has travelled 26.5 mm which

    indicates that the motor takes 6 steps to cover 1mm. this is how calibration is done for both X and Y axes.


    1. Mechanical Design of Cnc Plotter Machine

      The two dimensional mechanical design of the body of CNC plotter is shown Mechanical design of CNC plotter

    2. Stock Materials

      • Wood

      • Melamine board

      • PVC board

      • Metal rod

    3. Components Required

      To erect the CNC plotter, the required components are listed below: Stepper motor ( 2 pieces)

      • Stepper motor driver module (2 pieces)

      • Servo motor

      • Power supply

      • Arduino uno

      • Gears

      • Pen

      • Hose Clamp

      • Bread board

      • PCB

      • Connectors and Cables

      • Diodes

    4. Mechanical Body Description

    1. Motor Mount

      Two inkjet printers (HP1000) have been disassembled and their printing mechanism units have been collected. One of which will act as X axis and the other as Y axis.

    2. Axis Mount

    Y-axis: A melamine board (61cm X 52cm) has been used for the base. The Y-axis has been mounted on the board maintaining a ground clearance of 4.8 cm because of the height of stepper motor. An A4 size PVC board has been placed on the tray with one end fixed on the tray and the other end on a metal rod so that the tray can easily move with the embedded board to and fro with less friction shown in The level of board has been carefully checked with a meter that it is perfectly horizontal with the base. As a result the pen moves smoothly on the board without interruption.

    Fig. Y-axis movement stepper control

    X-axis: X-axis basically moves the pen to and fro to cover the x-coordinates of the G-code. The X-axis has placed perpendicular to Y-axis lifted up by two wood legs of equal length shown in Fig. 10. A distance of 15 cm is kept from the starting point of the X-axis so that the Z-axis, which is mounted on the X-axis and holds the pen, is positioned at the center of the PVC board where both the axes X and Y has been centered.

    Fig. X-axis movement stepper control

    Z-Axis: A PC DVD drive has been disassembled and its stepper motor has been replaced with a servo motor. A gear has been worn on the spindle of the servo motor. A belt has been used to connect the gear with a pole and the belt has been glued with the moving mechanism of the DVD drive attached to a hose clamp. The Z-axis is mounted with the X- axis on the moving cartridge tray shown in Fig. 11 with caution so that it remains perfectly perpendicular with the X-axis during operation.

    Fig. Z-axis Servo motor holding a pen


    The machine runs in a slow pace and generates excess heat which causes the heat sink to be heated quickly. A slight error may remain on the image file after it has been plotted due to one side of the Y-axis fixed to the moving mechanism and the other end is free to move. The Z-axis is not very rigid so it causes slight vibration.


    The pen of the machine can be replaced by a laser to make it work like a laser engraving or cutting machine. Engraving machine can be used on wood. The pen can also be replaced with a powerful drill so that it can be used for both milling and drilling purposes. The servo can be replaced with a stepper motor and the pen with a 3-D pen to make it a 3-D printer which can print objects with dimensions. By extrapolation of the axes, the working area of the machine can be extended keeping the algorithm unaltered.


    We would like to express our special thanks to our mentors Arun S and Anumodu DM for supporting and guiding us in completion of this project and we would also like to thank Electrical and electronics department, Amal Jyothi College of engineering, Kerala for giving us this wonderful opportunity to express our technical skills through this project.


  1. Madekar, kajal j., et al. "automatic mini cnc machine for pcb drawing and drilling." (2016).

  2. linggarjati, jimmy, and rinda hedwig. "manually interchangeable heads of homemade computer numerical control (cnc) machine." nternetworking indonesia journal 1.1 (2013).

  3. m.r. wright, d.e. platts, d.b. french, g. traicoff, m.a. dupont, andg.a. head,cnc control systempatents, us patent 545393, sep 26,1995.

  4. Torjus spilling self-improving cnc milling machine university of oslo (2014)

  5. Neje 200mw mini diy laser engraving machine cnc laser print er





  10. Dual full-bridge driver. multiwatt15. ordering numbers : l298n (multiwatt vert.) l298hn

  11. Sg90 9 g micro servo. tiny and lightweight with high output power.

  12. Stepper motor sth-39d1126-06 1.8deg/step 2 phase hybrid stepping motor electric motor step motor cnc


  14. W. bosshart, printed circuit boards. new delhi: tata mcgrawhill,1983.

  15. D. christian and f. i. hariadi, "speed control of spindle motor in the designing control module of computer numerical control (cnc) pcb milling machines," teknik elektro, sekolah teknik elektro dan informatika, institut teknologi bandung, bandung, 2014.

Leave a Reply