Académique Documents
Professionnel Documents
Culture Documents
Submitted By
Names
1
2
3
4
ABSTRACT
5
6
Table Of Contents
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Computer Numerical Control (CNC) . . . . . . . . . . . . . . . . . . . 7
1.3 Cartesian Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 2D Robitic plotter . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 9
1.5 Aim of the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Organisation of the Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Software . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . 15
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Inkscape (0.48.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 Inkscape Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.2 Inkscape Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.3 Generating gcode les using inkscape . . . . . . . . . . . . . .. 19
7
4 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2 Arduino NANO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . 27
4.2.3 Power . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . .. . . .. 27
4.2.4 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.5 Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
4.2.6 programming .. . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 28
4.3 Driver interfacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4 Servo Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
4.4.1 Working principle of Servo Motors. . . . . . . . . . . . . . .31
4.4.2 Controlling Servo Motor . . . . . . . . . . . . . . . . . . . . . . .32
4.5 Stepper Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
6 Applicatons . . . . . . . . . . . . . . .. . . . . . . . .. .. . .. . . . . . . .. . . . . . . . 41
8
9
List of Figures
1.1 Intersecting lines form right angles and establish the zero point (Allen-
Bradley) . . . . . . . . .. . . . . . . .. . . . .. . . . . .. . . . . . . .. . . . . . . .. . . . . .7
1.2 The three-dimensional coordinate planes (axes) used in CNC. (The Superior
Electric Company) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 The quadrants formed when the X and Y axes cross are used to accurately
located 11 . . . . . . . . .. . . . . . . . . . .. . . . . . . .. . . . .. . . . .. . . .. 9
10
1
1
Chapter 1
Introduction
12
Chapter 1
Introduction
1.1 Introduction
CNC stands for Computer Numeric Control and typically refers to a machine whose
operation is controlled by a computer. The most common usage of CNC, and the one
relevant to us, is the name given to devices that, under computer control are able to
cut, etch, mill, engrave, build, turn and otherwise perform manufacturing operations
on various materials. Typically, a CNC machine has the ability to move a cutting or
3D printing head in 2 to 6 axes, meaning that it can position that tool head at a
precise point in or on the material to create the cut or operation desired at that point.
By moving the head through multiple points, the cutting head can cut or sculpt the
design represented by a data stream of positioning points being sent by the PC. By
controlling a CNC machine through a PC it is possible for the user to design a
product on-screen, convert it to CNC-readable code and then send that data to the
CNC machine for it to produce a physical copy of the item designed.
13
Figure 1.1: Intersecting lines form right angles and establish the zero point (Allen-
Bradley)
Figure 1.2: The three-dimensional coordinate planes (axes) used in CNC. (The
Superior Electric Company)
14
The operating commands which control the machine tool are executed
automatically with amazing speed, accuracy, efficiency, and
repeatability. The ever-increasing use of CNC in industry has created a
need for personnel who are knowledgeable about and capable of
preparing the programs which guide the machine tools to produce parts
to the required shape and accuracy.
15
16
the vertical tool motion. The plus (+) and minus (-) signs indicate the direction from
the zero point (origin) along the axis of movement. The four quadrants formed when
the XY axes cross are numbered in a counterclockwise direction (Fig. 1.3). All
positions located in quadrant 1 would be positive (X+) and positive (Y+). In the
second quadrant, all positions would be negative X (X-) and positive (Y+). In the
third quadrant, all locations would be negative X (X-) and negative (Y-). In the fourth
quadrant, all locations would be positive X (X+) and negative Y (Y-). In Fig. 1.3 ,
point A would be 2 units to the right of the Y axis and 2 units
Figure 1.3: The quadrants formed when the X and Y axes cross are used to accurately
located
above the X axis. Assume that each unit equals 1.000. The location of point A would
be X + 2.000 and Y + 2.000. For point B, the location would be X + 1.000 and Y -
2.000. In CNC programming it is not necessary to indicate plus (+) values since these
are assumed. However, the minus (-) values must be indicated.
APPLICATIONS
A general idea of CNC Models.
18
1.6 Motivation
Computer Numeric Control (CNC) refers to a wide variety of machines which are
controlled electronically and have many uses, including milling, drawing, extruding,
cutting, and lathing. CNC machines are really expensive. They are widely used in the
fabrication of both electronic and mechanical parts of large machines .So our group
has decided to do a model to know about theoretical and practical knowledge about
this concept [2D Robotic Plotter].
Chapter 1 : Introduction
In this chapter, brief introduction of the project, literature review, motivation
and organization of the project has been presented.
Chapter 6 : Applications
19
Chapter 2
Project Description
20
Chapter 2
Project Description
2.1 Introduction
The three main sections of Robotic 2D Plotter:
Hardware
Software
Industrial Design
2.2 Hardware
Electronic hardware consists of interconnected electronic components which perform
analog or logic operations on received and locally stored information to produce as
output or store resulting new information or to provide control for output actuator
mechanisms. Electronic hardware can range from individual chips/circuits to
distributed information processing systems. Well designed electronic hardware is
composed of hierarchies of functional modules which inter-communicate via
precisely defined interfaces The XY-plotter consists of two axes operating
orthogonally to each other. Each axis includes a CD drive system that is driven by an
appropriate means. Additionally, a third axis, with limited motion capability is used
to actuate the write head.
2.3 Software
Computer software, or simply software, is that part of a computer system that
consists of encoded information or computer instructions, in contrast to the physical
hardware from which the system is built. The software used in this project comes
under open source. Open-source software (OSS) is computer software with its source
code made available with a license in which the copyright holder provides the rights
to study, change, and distribute the software to anyone and for any purpose. Open-
source software may be developed in a collaborative public manner. Open-source
software is the most prominent example of open-source development.
21
2.4 Industrial Design
Industrial design is a process of design applied to products that are to be
manufactured through techniques of mass production. Its key characteristic is that
design is separated from manufacture: the creative act of determining and defining a
product's form takes place in advance of the physical act of making a product, which
consists purely of repeated, often automated, replication. The mechanical part is
taken fully from CD-drive.
22
23
Chapter 3
Software
24
Chapter 3
Software
3.1 Introduction
Engineering as a discipline often requires more integration than large amounts of
original development. In a typical project, writing new code presents significant
challenges, and the number of features shared between projects means that it is
possible to create shared components which implement common features. A library
or an existing module allows the use of a well developed and tested component,
which saves significant resources in the implementation of the project. The drawback
of components is the need to integrate various potentially connecting interfaces, and
the need to understand a complex system in order to effectively use the component.
2. Arduino IDE.
3. Processing 3.0.2.
3.2 Inkscape
There are two basic types of graphic images: bitmap (or raster) images and vector
images. In the first case, the image is defined in terms of rows and columns of
individual pixels, each with its own color. In the second case, the image is defined in
terms of lines, both straight and curved. A single straight line is described in terms of
its two end points.
25
The difference in these types of graphic images becomes readily apparent when a
drawing is enlarged. The same line is shown on the left and right. On the left it is
displayed as a bitmap image, while on the right it is displayed as a vector. In both
cases, the line has been scaled up by a factor of four from its nominal size.
When the bitmap resolution of a drawing matches the display resolution, the objects
in the drawing look smooth. The same drawing, but defined as a bitmap image on the
left and a vector image on the right. If the output device has the same resolution as
the bitmap image, there is little difference between the appearance of the two images.
If the bitmap resolution is significantly less than the display resolution, the display
will show jagged lines. The head of the gentleman in the above drawings has been
scaled up by a factor of five. Now one can see a difference in the quality of the
bitmap drawing (left) and the vector drawing (right). Note that the bitmap image uses
anti-aliasing, a method of using grayscale to attempt to smooth the drawing.
All output devices, with few exceptions, use a raster or bitmap image to display
graphics. The real difference between drawing with bitmap graphics and vector
graphics is the point at which the image is converted into a bitmap. In the case of
vector graphics, this conversion is done at the very last step before display, ensuring
that the input image matches exactly the resolution of the output device.
The Command Bar, Snap Bar, Tool Controls, and Tool Box are detachable by
dragging on the handles (highlighted in blue) at the far left or top. They can be
returned to their normal place by dragging them back. New in v0.48: Some of the
bars change position depending on which option is selected at the bottom of the View
menu. When Default is selected, the Command Bar is on the top while the Snap Bar
is on the right. When Custom is selected, the Command Bar and the Snap Bar are
both on the top. When Wide is selected, the Command Bar and the Snap Bar are both
on the right. By default, Default is used if you are not using a \Wide Screen" display
while Wide is used if you are. A width to height aspect ratio of greater than 1.65 is
26
depend to be wide. These bars, as well as the Palette and Status Bar, can be hidden
using the View Show/Hide submenu.
As Inkscape has grown more complex, the area required to include icons and entry
boxes for all the various items has also grown leading to problems when Inkscape is
used on small screens. The Command Bar, Snap Bar, Tool Controls, and Tool Box
have variable widths or heights. If there are too many items to be shown in the width
(height) of the Inkscape window, a small down arrow will appear on the right side or
bottom of the bars. Clicking on this arrow will open a drop-down menu with access
to the missing items.
The goal of the writers of Inkscape is to produce a program that can take full
advantage of the SVG standard. This is not a small task. A link to the road map for
future development can be found on the Inkscape website [http://
www.inkscape.org/].
10. 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".
11. Final, go to le menu, click save as and select .gcode. Click ok on next window.
GCode Tools: Gcodetools is an open source Inkscape extension, to export gcode for
use with a CNC machine, written in the Python programming language. Inkscape
extensions work in the standard Unix IO model, taking SVG on standard input, and
output transformed SVG on standard output. The Gcodetools extension generates G-
Code from the SVG input and writes it to a le as a side e ect of the SVG
transformation. This python extension can be easily downloaded as a .ZIP le from
https://github.com/martymcguire/inkscape-unicorn
28
29
30
3.4 Arduino IDE
The Arduino project provides the Arduino integrated development environment
(IDE), which is a cross-platform application written in the programming language
Java. It originated from the IDE for the languages Processing and Wiring. It is
designed to introduce programming to artists and other newcomers unfamiliar with
software development. It includes a code editor with features such as syntax
highlighting, brace matching, and automatic indentation, and provides simple one-
click mechanism to compile and load programs to an Arduino board. A program
written with the IDE for Arduino is called a "sketch".
The Arduino IDE supports the languages C and C++ using special rules to organize
code. The Arduino IDE supplies a software library called Wiring from the Wiring
project, which provides many common input and output procedures. A typical
Arduino C/C++ sketch consist of two functions that are compiled and linked with a
program stub main() into an executable cyclic executive program:[.2cm]
setup(): a function that runs once at the start of a program and that can
initialize settings.
After compiling and linking with the GNU toolchain, also included with the IDE
distribution, the Arduino IDE employs the program avrdude to convert the executable
code into a text le in hexadecimal coding that is loaded into the Arduino board by a
loader program in the board's rmware.
3.5 Processing
Processing is a simple programming environment that was created to make it
easier to develop visually oriented applications with an emphasis on animation and
providing users with instant feedback through interaction. The developers wanted a
means to \sketch" ideas in code. As its capabilities have expanded over the past
decade, Processing has come to be used for more advanced production-level work in
addition to its sketching role. Originally built as a domain-specific extension to Java
targeted towards artists and designers, Processing has evolved into a full-blown
31
design and prototyping tool used for large-scale installation work, motion graphics,
and complex data visualization.
Processing is based on Java, but because program elements in Processing are fairly
simple, you can learn to use it even if you don't know any Java. If you're familiar
with Java, it's best to forget that Processing has anything to do with Java for a while,
until you get the hang of how the API works. The latest version of Processing can be
downloaded at http://processing.org/download.
An important goal for the project was to make this type of programming accessible to
a wider audience. For this reason, Processing is free to download, free to use, and
open source. But projects developed using the Processing environment and core
libraries can be used for any purpose. This model is identical to GCC, the GNU
Compiler Collection. GCC and its associated libraries (e.g. lib) are open source under
the GNU Public License (GPL), which stipulates that changes to the code must be
made available. However, programs created with GCC (examples too numerous to
mention) are not themselves required to be open source.
32
Processing consists of:
Advanced programmers need not use the PDE, and may instead choose
to use its libraries with the Java environment of choice. However, for a
beginner, it's recommended to use the PDE to gain familiarity with the
way things are done. While Processing is based on Java, it was never
meant to be a Java IDE with training wheels. The conceptual model
(how programs work, how interfaces are built, and how les are handled)
is somewhat di erent from Java.
33
Figure 3.2: Processing Window
34
35
Chapter 4
Hardware
36
Chapter 4
Hardware
4.1 Introduction
In this hardware system consists of a metallic frame, on which is mounted three axis
of motion in a standard Cartesian coordinate system. X and Y axis is driven by a
stepper motor driven by a motor driver L298D circuit. Z axis is driven by a servo
motor.
37
What is Open Source Hardware?
License
Schematics
PCB layout data
Bills of Sale (component distributors...)
Arduino is open source hardware: the Arduino hardware reference designs
are distributed under a Creative Commons Attribution Share-Alike 2.5 license,
available on the Arduino Web site.
Layout and production files for some versions are also available.
The source code for the IDE is available and released under the
GNU General Public License, version 2
1. Power
- It's an electrical component, so of course you have to give it power. But like
many ICs, the voltage used to operate it needs to be controlled relatively precisely.
There are three commonly used ways for controlling the voltage supplied to
microcontrollers:
I. A voltage regulator
II. A regulated power supply
III. Battery power
2. I/O
- Input and output, some way to communicate with the chip. This is generally
done through some kind of connection to the chip's pins. Breadboards are handy.
I. Limited
II. shields
III. Roll your own.
3. Programming Interface
- Some way to write programs and download them to the chip and run them.
We will be using the same microcontroller used on the Arduino board, a popular chip
made by the Atmel corporation -the Atmega 168 or 328. (These are 28 pin ICs with
identical pin designations, but the 328 has more memory.) The hardware interface
we'll be using is perhaps the simplest (and cheapest): connecting to it on a standard
breadboard.
38
4.2 Arduino NANO
Types Of Arduino :
39
(Arduino Nano Front) (Arduino Nano Back)
4.2.1 Overview:
The Arduino Nano is a small, complete, and breadboard-friendly board based on the
ATmega328 (Arduino Nano 3.x) or ATmega168 (Arduino Nano 2.x). It has more or
less the same functionality of the Arduino Duemilanove, but in a different package. It
lacks only a DC power jack, and works with a Mini-B USB cable instead of a
standard one. The Nano was designed and is being produced by Gravitech.
4.2.2 Specifications:
-Microcontroller Atmel ATmega168 or ATmega328
-Operating Voltage (logic level) 5 V
-Input Voltage (recommended) 7-12 V
-Input Voltage (limits) 6-20 V
-Digital I/O Pins 14 (of which 6 provide PWM output)
-Analog Input Pins 8
-DC Current per I/O Pin 40 mA
-Flash Memory 16 KB (ATmega168) or 32 KB (ATmega328) of which 2 KB used by
bootloader
-SRAM 1 KB (ATmega168) or 2 KB (ATmega328)
-EEPROM 512 bytes (ATmega168) or 1 KB (ATmega328)
-Clock Speed 16 MHz
-Dimensions 0.73" x 1.70"
-Length 45 mm
-Width 18 mm
-Weigth 5 g
4.2.3 Power:
The Arduino Nano can be powered via the Mini-B USB connection, 6-20V
unregulated external power supply (pin 30), or 5V regulated
external power supply (pin 27). The power source is automatically selected to the
highest voltage source
4.2.4 Memory
The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is used
for the bootloader); the ATmega328 has 32 KB, (also
with 2 KB used for the bootloader). The ATmega168 has 1 KB of SRAM and 512
bytes of EEPROM
40
- SRAM : memory for storing your data which are processed during the run time
(including also the registers, stack, etc.) - volatile memory
- FLASH : memory which your program stored - non volatile
- EEPROM : memory which can be used for storing non volatile data and changeable
during run-time. (for example: setting values, etc.)
-Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial
chip.
- PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
-LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Nano has 8 analog inputs, each of which provide 10 bits of resolution (i.e. 1024
different values). By default they measure from ground to 5 volts, though is it
possible to change the upper end of their range using the analogReference() .
41
-I2C: A4 (SDA) and A5 (SCL). Support I2C (TWI) communication using the Wire
library
(http://wiring.org.co/reference/libraries/Wire/index.html) (documentation on the
Wiring website).
4.2.6 Programming
The Arduino Nano can be programmed with the Arduino software (download
(//www.arduino.cc/en/Main/Software)). Select "ArduinoDiecimila, Duemilanove, or
Nano w/ ATmega168" or "Arduino Duemilanove or Nano w/ ATmega328" from the
42
4.3 Driver interfacing
THIS CONNECTION CANOT BE DUE TO
The Microcontroller pin can't give more than 25mA in PIC16f877a, and there is
no motor with this low current, so if a 100mA motor connected it will damage
the pin.
The motor may not be a 5 voltage motor, what if I want to control a 24v motor?
so we need low power device that we can control the micro controller and the
motor ,this device is DUAL FULL-BRIDGE DRIVER (L298).
43
DESCRIPTION
BLOCK DIAGRAM
If you measure a low resistance between two of its leads, then these two
leads are connected to the first coil, and the other two leads are connected
to the second coil.
The motor can be connected to L298 H bridge module as shown in this
example:
44
figure 4.5 shows interfacing of Driver and Motor
is same as external signal provided. At this condition, there will be no output signal
from the amplifier to the motor input as there is no difference between external
applied signal and the signal generated at potentiometer, and in this situation motor
stops rotating.
Servo motor works on PWM (Pulse width modulation) principle, means its angle of
rotation is controlled by the duration of applied pulse to its Control PIN. Basically
servo motor is made up of DC motor which is controlled by a variable resistor
(potentiometer) and some gears. High speed force of DC motor is converted into
torque by Gears. We know that WORK= FORCE X DISTANCE, in DC motor Force
is less and distance (speed) is high and in Servo, force is High and distance is less.
Potentiometer is connected to the output shaft of the Servo, to calculate the angle and
stop the DC motor on required angle. Servo motor can be rotated from 0 to 180
degree, but it can go up to 210 degree, depending on the manufacturing. This degree
of rotation can be controlled by applying the Electrical Pulse of proper width, to its
Control pin. Servo checks the pulse in every 20 milliseconds. Pulse of 1 ms (1
millisecond) width can rotate servo to 0 degree, 1.5ms can rotate to 90 degree
(neutral position) and 2 ms pulse can rotate it to 180 degree.
48
Chapter 5
Overall View of the Project
49
Chapter 5
Overall View of the Project
5.1 Introduction
The complete mechanical system was designed in the metallic CD drive cover.
The designs in the project are :
X-Y Direction.
Pen setup.
Frame.
Final Setup
Y-axis: basic axis carries X-axis move from front to back.
X-axis: carries Z-axis move from left to right.
Z-axis: carries pen part move up and down.
50
Figure 5.1: Lens Frame in CD Drive (Containing Stepper Motor.
51
5.3 Frame
The stand holding all the parts are made by the outer metallic cover of the cd drive.
Two covers are welded together perpendicularly for holding the x and y axis.
52
Figure 5.4: View 1
The following steps shows the building stages of a low cost mini cnc plotter. For X and Y
axis, the stepper motors from CD drive is used. Servo motor is used for z axis. Inkscape,
Processing and Arduino IDE gives the command from the computer as G-code to the
arduino board to get the plotted output
Main Block Diagram:
53
Figure 5.6: Main Block Diagra
54
5.6 Steps Involved in the Project
2. The outer metallic cover of cd drive is welded perpendicularly to make the stand
holding the x and y axis.
3. Attach the cd drive stepper motor setup as x and y axis. And make sure that the
Y axis is straight to CNC base and the X axis vertically to it.
4. Z axis (pen setup) is attached to the x axis. The pen setup is made up of HDF, the
servo motor is attached to it and the pen is setup inside the ber using screw and
spring.
5. A metallic base is attached to the Y axis for using as paper base. Then a paper is
put above it with the help some magnets.The printing area is 4x4cm.
Step 2-Arduino and Stepper Motor Setup
1. The adafruit L298D motor driver sheild compactible with the Arduino board is
mounted on it.
2. The Arduino is connected the computer port.
3. Check the stepper motors and the servo motor.
4. The stepper motors and the servo motor are connected to the motor shield.
5. The external power is connected. (Trainer Kit 12v,3A)
3. Then use the gctrl.pde processing program. This program sends 'gcode' images
to the cnc plotter.
4. Plotting of the image is done.
55
5.7Result
Integrating the software along with the hardware and mechanical systems makes up
an e ective 2D plotter.
56
Chapter 6
Applications
57
Chapter 6
Applications
The main applications of CNC machines comes in industrial field. Some of them are
discussed
below:
Metal Removal Applications { CNC machines are extensively used in industries
where metal removal is required. The machines remove excess metal from raw
materials to create complex parts. A good example of this would be the
automotive industries where gears, shafts and other complex parts are carved
from the raw material. CNC machines are also used in the manufacturing
industries for producing rectangular, square, rounded and even threaded jobs. All
processes, such as milling, grinding, turning, boring, reaming, etc, can be
controlled and carried out by these CNC machines using speci c machine tools
for each task.
Metal Fabrication Industry { Many industries require thin plates for di erent pur-
poses. These industries use CNC machines for a number of machining
operations such as plasma or ame cutting, laser cutting, shearing, forming and
welding to create these plates. CNC plasma or laser cutters are used for shaping
metal, while CNC turret presses are used for operations like punching holes.
Other operations like bending metal plates can also be carried out with very high
precision using CNC press brakes.
58
4
59
4