Post on 24-Dec-2015
description
transcript
DESIGN AND FABRICATION OF A
CNC MACHINE FOR ENGRAVING AND DRILLING
Group Members:
MUHAMMAD ZAEEM ABBAS (090404)
SADDAM JAVED (090407)
UBADAH MEHTAB (090450)
AUMAIR AZEEM MALIK (090456)
AMMAR IKRAM (090474)
BE MECHATRONICS (2009-2013)
Project Supervisor
Liaquat Ali Khan
Assistant Professor
DEPARTMENT OF MECHATRONICS ENGINEERING
FACULTY OF ENGINEERING
AIR UNIVERSITY, ISLAMABAD
ii
DESIGN AND FABRICATION OF A CNC MACHINE FOR
ENGRAVING AND DRILLING
FINAL YEAR PROJECT REPORT
(2009-2013)
DEPARTMENT OF MECHATRONICS ENGINEERING
iii
DESIGN AND FABRICATION OF A CNC MACHINE
FOR ENGRAVING AND DRILLING
Submitted By:
MUHAMMAD ZAEEM ABBAS (090404)
SADDAM JAVED (090407)
UBADAH MEHTAB (090450)
AUMAIR AZEEM MALIK (090456)
AMMAR IKRAM (090474)
Project Supervisor
____________________________
Assistant Professor Liaquat Ali Khan
iv
ACKNOWLEDGEMENT
We express our humblest gratitude to Allah Almighty who has given us the
direction to accomplish our goals. The love and support provided by our parents
and family has been a source of strength and comfort through our work. We are
thankful to Assistant Professor Liaquat Ali Khan for providing us with valuable
material and also guiding us on this project. He has been indeed a source of
inspiration, support and encouragement for us.
v
ABSTRACT
The aim of our project is to design and fabricate a 3 axis CNC machine for
engraving, drilling and particularly routing PCB (Printed Circuit Boards).
Keeping in mind the requirements of a modern CNC router micro steeping and
frictionless linear guide mechanism is integrated into the machine to ensure
optimum engraving results without compromising on the speed of operation.
vii
List of figures
Figure 1.1: A CNC Engraver………………………………………………………………………………….1
Figure 1.2: Improper Design of Circuits……………….………………………………………………..3
Figure 1.3: Circuits in Non-Corrosion Resistant Material Casing……………….….4
Figure 1.4: Untidy Design of Circuit Boards………………………………………………………….4
Figure 1.5: Linear Guide Mechanism…………………………………………………………………….5
Figure 2.6: Flow Chart of Typical CNC Machine………………………………………………….9
Figure 2.7: Typical CNC Machine………………………………………………………………….…..10
Figure 2.8: Close-Up Views of Ball Screw Mechanism………………………………….…..13
Figure 2.9: Sectioned Ball Screw Mechanism………………………………………………….…14
Figure 2.10: V - Shaped Cutting Tool………………………………………………………………...15
Figure 2.11: Unipolar Winding Arrangement……………………………………………………..19
Figure 2.12: Bipolar Winding Arrangement………………………………………………………..19
Figure 2.13: Engraving Using Absolute Coordinate System………………………………..24
Figure 2.14: DB-25 Pin Diagram…………………………………………………………………………25
Figure 4.15: AutoCAD Model Showing Isometric View……………………………………..36
Figure 4.16: Top View of AutoCAD Model………………………………………………………..37
Figure 4.17: Front View of AutoCAD Model………………………………………………………38
Figure 4.18: Side View of AutoCAD Model……………………………………………………….39
Figure 5.19: Application Specific 3-Axes CNC Controller………………………………….41
Figure 5.20: Overall System Block Diagram……………………………………………………….42
vii
List of Tables
Table 2.1: PMDC Comparison……………………………………………………………………………16
viii
Nomenclature
BLDC Brushless Direct Current Motor
CAD Computer Aided Drawing
CAM Computer Aided Manufacturing
DC Direct Current
mm millimeter (10-3)
NC Numerical Control
PCB Printed Circuit Board
PM Permanent Magnet
PMDC Permanent Magnet Direct Current Motor
rpm revolutions per minute
VR Variable Reluctance
μ Micron (10-6)
ix
Table of Contents:
Chapter 1: Introduction 1
1.1 Background 1
1.2 Objectives 2
1.3 Drawbacks in pre-existing CNC Machine 2
1.4 Improvements 6
1.5 Methodology 6
Chapter 2: Description 7
2.1 Introduction to Numerical Control 7
2.2 Advantages of CNC Machines 8
2.3 Disadvantages of CNC Machines 8
2.4 CNC Operation Flow Diagram 9
2.5 Structure of Typical CNC Engraver 10
2.5.1 Base, Frame and Y Axis Gantry 11
2.5.2 Three Axes Linear Motion System 11
2.5.3 Three Axes Linear Drive System 12
2.5.4 Ball Screw Mechanism 13
2.5.5 Cutting Tool and Spindle 15
2.5.6 Actuators 16
2.5.6.1 DC Motor 16
2.5.6.2 Stepper Motor 18
2.6 Software and Human Machine Interface 22
x
2.7 CNC Programming 23
2.8 Coordinates 24
2.8.1 Absolute Coordinates 24
2.8.2 Relative Coordinates 25
2.9 Interfacing 26
2.9.1 Serial Communication 26
2.9.2 Parallel Communication 26
Chapter 3: Mathematical Modeling 29
3.1 Mechanical Modeling 29
3.2 Electrical Modeling 29
3.3 Spindle Motor Power Calculations 31
3.4 Spindle Motor Modeling 32
3.5 Ball Screw Calculations 35
Chapter 4: Design 36
4.1 Mechanical Model 36
4.2 Mechanical Drawings 37
4.3 Mechanical Features of Machine 40
4.4 Application Specific 3- Axes CNC Controller 41
4.5 Overall System Block Diagram 42
Chapter 5: Conclusions and Recommendations 43
5.1 Conclusions 43
5.2 Recommendations 43
xi
Appendix A
Appendix B
Bibliography
1
Chapter # 1: Introduction
1.1 Background:
Engraving is the process in which a design is inscribed on to a hard, usually flat
surface, by cutting grooves into that surface. Historically, it was an important
method of producing images on paper.
In manufacturing of PCB, etching is a very important old process and it also takes
very long time. This machine is a substitution to the old manual process. In the
era of rapid technological development PCB’s are very important components as
they are attached to every electronic device as well as mechanical too, to make
them work efficiently.
An example image of a PCB engraving and drilling machine is shown below:
Figure 1.1: A CNC Engraver
INTRODUCTION
2
Etching is a standard process for making PCB’s but it has several drawbacks:
High production cost
Lengthy process
Accuracy and effectiveness problems
Human errors
Corrosive action of FeCl3 (etching chemical liquid)
On the other hand this automatic engraving machine is a substitute to the manual
process and one can reduce production cost in terms of labor cost and time cost.
1.2 Objectives
Our main goal is the improvement of a pre-existing CNC machine made by a
previous batch (2006-2010) of Department of Mechatronics Engineering.
1.3 Drawbacks in the Pre-Existing Machine:
The method of job clamping used is quite primitive; drilling in four corners of job
is done manually and then with the help of screws tightened on the wooden table.
Play is also found in linear guide motion of machine during inspection of
mechanical structure. The pitch of the lead screws used is also high while the
same lead screws of low pitch can easily be fabricated and installed. This would
greatly improve its precision in addition to this the guiding/connecting rods of
linear guide motion are also of Iron which is non-corrosion resistant material. The
performance of drilling tool can also be improved by changing the DC motor with
one of high power rating. The control unit of the machine is made of Iron which is
Design & Fabrication of a CNC
Machine for Engraving & Drilling
3
a non-corrosion resistant material. PCB’s are poorly designed with lots of jumper
wires used.
In a nutshell the problems found were:
This CNC machine is capable of engraving on wood but with a very low
accuracy due to flaws in mechanical design.
The stepper motors and DC motors needs to be replaced.
Electronic control unit is poorly routed with results in poor performance of
actuators.
Primitive method of job clamping is employed.
The speed of cut is not up to the mark.
Incapability of engraving complex contours.
Some pictures of the pre-existing CNC machine are shown on next page
emphasizing on the problems discussed above:
Figure 1.2: Improper Design of Circuits
INTRODUCTION
4
Figure 1.3: Circuits in Non-Corrosion Resistant Material Casing
Figure 1.4: Untidy Design of Circuit Boards
Design & Fabrication of a CNC
Machine for Engraving & Drilling
5
Figure 1.5: Linear Guide Mechanism
There are several key points to be explored in this project:
Designing the CNC router mechanical motion and driving system
Improving the accuracy and precision by improving the pitch of lead screws
Generating CAM file from the design software and interpretation into co-
ordinates
Coding of serial data communication.
Implementing a user friendly Human Machine Interface.
Synchronizing the whole system
INTRODUCTION
6
1.4 Improvements to be made:
To improve the accuracy of the machine by employing low pitch ball screw
mechanism.
To improve the overall mechanical design.
To replace old actuators with more application specific ones for high speed
engraving.
To design and fabricate better and neatly routed electronic circuits.
To introduce a mechanism of job clamping.
To introduce a mechanism for automatic chip removal from workspace.
To ensure the capability of CNC machine to engrave complex contour.
1.5 Methodology:
Research and consultation with lectures and course work.
Brainstorming of ideas for electrical, mechanical and programming.
Design of mechanisms.
Implementation of efficient power supply.
Design of efficient CNC Control Unit
Fabrication of mechanical components like lead screws etc.
Chapter # 2: Description
2.1 Introduction to Numerical Control:
The concept of numerical control was proposed in 1947. John C. Pearson of
Pearson Corporation, a rotor blade manufacturer. This concept was further
carried in 1949 when the United States Air Force realized that parts of war
planes and missiles were becoming complex with time and with improvements
in the older designs the production was sluggish. United States Air Force
decided to grant a study contract to Pearson Corporation. Subcontractor was
the famous Servo Mechanism Laboratory at Massachusetts Institute of
Technology (MIT). The prototype of first NC machine, was successfully
demonstrated in 1952.
These early servomechanisms were integrated with analog and digital systems
which gave birth to modern CNC (Computer Numeric Control) system which
was a revolutionary change in the machining process. In modern CNC systems
the component design is highly automated using computer-aided
design (CAD) and computer-aided manufacturing (CAM) programs like Fanuc
Control, Siemens, GSK and Mach 3 etc. With the help of these programs a file
is produced that interprets the commands (in most cases G-codes and M-
codes) to operate the particular machine via a postprocessor. These commands
are generated automatically by the software in present day CNC systems.
Many different types of CNC machines are used in industry such as:
Machining Centers
Turning Centers
Mills
Lathes
Surface grinders
DESCRIPTION
8
Drilling Machines
Hot wire foam cutters
EDM Sinker and wire cut Machines
Water Jet Profilers
Flame and Laser-Cutting Machines
2.2 Advantages of CNC Machines:
High Repeatability and Precision e.g. PCB routing and Aircraft parts etc.
High volume of production.
Complex shapes and contours can be manufactured.
Safer and automated operation.
Better quality than conventional machining.
Less paper work and faster prototype production.
2.3 Disadvantages of CNC Machine:
High initial setup cost.
Requires skilled operators.
Computer programming knowledge is a pre-requisite for operator.
Maintenance is comparatively difficult.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
9
2.4 CNC Operation Flow Diagram:
Figure 2.6: Flow Chart of Typical CNC Machine
DESCRIPTION
10
2.5 Structure of a Typical CNC Engraver:
A typical CNC Engraving Machine consists of the following parts:
X-axis linear drive system
Y axis linear drive system
Z-axis linear drive system (plunge arm)
Y-axis gantry
Cutting table
Spindle
Base and Frame
CNC Control Unit
Computer
Figure 2.7: Typical CNC Machine
Design & Fabrication of a CNC
Machine for Engraving & Drilling
11
2.5.1 The Base, Frame and Y-axis Gantry Design:
Mostly the CNC routers are of two types:
1. Stationary gantry with mobile bed
2. Mobile gantry with stationary bed
The first type i.e. stationary gantry with mobile bed is not preferred as far as
industrial applications are concerned. This type of design works well for small
applications i.e. for smaller workspaces but with the increase in size of the
horizontal axis the efficiency decreases. The main advantage of this type of
design is that the weight of the gantry does not affect the performance of the
machine.
The second type is mostly preferred for industrial applications since it is not
limited to smaller workspaces but it requires an optimal gantry design. The
design and material selection of the gantry plays a crucial role in the efficiency
of machine. The gantry must be light so that actuators and the drive circuits
could perform well and within the torque limits.
Our design is based on the second type. By doing proper analysis of the forces,
bending moment, torques and material selection we can reduce the stress and
damage to the components like bearing, lead screws motors and other
components that are subjected to forces. This analysis will enable us to assess
the durability and longevity of the machine.
2.5.2 3-axis Linear Motion System:
The linear drive system of the CNC is probably the most important part in the
mechanical fabrication and it must be very smooth and frictionless. The linear
drive system can be of many types like V-groove wheels and track roller
systems, it can be shaft guiding with rods and bushings but we are making use
of re-circulating rolling elements.
DESCRIPTION
12
These rolling elements are actually ball or roller bearings that are positioned
between rail and block. These rolling elements are advantageous because it
reduces coefficient of friction by converting sliding friction into rolling
thereby providing high positional accuracy, long lifetime, high speed motion,
equal loading in all directions, easy installation and easy lubrication.
2.5.3 3-axis Linear Drive System:
The driving system works in harmony with the linear motion system. Both
these systems have to perfect in order to ensure vibration less and smooth
operation. The basic idea behind driving system is converting rotational
movement of the actuator into translational movement.
The drive system can fabricated with different styles e.g. threaded rod or lead
screw drive system. The disadvantage is low precision due to backlash.
Backlash is defined as the number of linear gaps between the screw and the
nut. By making use of Acme Thread this problem can be minimized to a good
extent. The acme screw has broader, thicker and stronger thread. It has good
power transmission capabilities and can carry heavy loads due to trapezoidal
threading but it also has a high coefficient of friction between the screw and
nut that requires high starting torque.
Another type of drive system can be fabricated by using Rack, Pinion and
Gears but this type has some limitations in eliminating backlash effect. An
alternative is to use Pulleys and Timing belts but that’s too has a disadvantage
of slip when given high frequency movement.
The system we are going to use is Ball Screw Mechanism. This mechanism
ensures high precision, high efficiency, high accuracy and smooth movement.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
13
2.5.4 Ball Screw Mechanism:
This mechanism is actually a mechanical linear actuator which consists of
threaded shaft which provides a helical raceway for ball bearings which act as
a nut while shaft act as a screw. Due to its ability to withstand high thrust
loads in addition to other benefits it’s a first choice for industrial machinery. It
is used in aircrafts, missiles, robotics, electric fly by wire systems and car
power steering etc.
The relation of torque ‘𝑇’ applied to screw or nut with linear force ‘𝐹’, length
of ball screw ‘𝑙’ and efficiency ‘𝜂’ is given below:
𝑇 =𝐹𝑙
2𝜋𝜂
Figure 2.8: Close-Up Views of Ball Screw Mechanism
DESCRIPTION
14
Figure 2.9: Sectioned Ball Screw Mechanism
Advantages:
High mechanical efficiency as compared to its alternatives due to low
friction in ball screws.
A typical ball screw has a mechanical efficiency of about 90% as
compared to 50% efficiency of Acme lead screw of same size.
It reduces down time for maintenance and demand of lubrication which
increases operational cost.
Extends the life span of the system on which it is used due to lack of
sliding friction between nut and screw.
All these factors ultimately contribute towards an optimal system in
which power requirements are greatly reduced.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
15
Disadvantages:
Manufacturing cost is high as compared to Acme lead screws.
Due to very less internal friction ball screws can be back-driven due to
low internal friction especially in hand fed systems, but in our system
that is not the case.
Specifications of the ball screw mechanisms that we used are:
Material: mild steel (density = 7390g/m3)
Mass: 0.750 Kg = 750 g
Lead: L = 5mm
Pitch: P = 5mm
Pitch diameter = d – 0.649519 P = 14.768 mm
Major diameter: d = 17mm = 1.7cm
2.5.5 Cutting Tool (Spindle):
The cutting tool is installed on the shaft of motor which is then used for
machining. The spindle is directly involved in the machining. The material of
cutting tool depends upon the material which is being engraved like in our
case it is Bakelite or Fiber board. While choosing a spindle factors considered
are speed (rpm), rated values of load, size of spindle and power requirements.
Figure 2.10: V - Shaped Cutting Tool
DESCRIPTION
16
2.5.6 Actuators:
Two main types of actuators used are the Brushed DC motors and stepper
motors. The cutting tool mounted on the spindle is driven by a DC motor.
While the movement along the three axes is controlled by stepper motors.
2.5.6.1 DC Motor:
DC Motors can be categorized based on field excitation:
Brushed DC Motors (BDC)
Permanent Magnet (PMDC)
Shunt Wound
Series Wound
Compound Wound
Brushless DC Motors (BLDC)
Characteristics Permanent
Magnet
Shunt Series Compound
Cost Low Moderate Moderate High
Loss of
Magnetism
Worst None None None
Torque vs.
Speed
Good at low
speed but
less at high
speed
Consistent
at low speed
Great at
low speed
Best at low
speed
Safety (Motor
Runaway)
No chance High
Chance
Hig
h Chance
Low chance
Speed Control Excellent Excellent Poor Great
Table 2.1: PMDC Comparison
Design & Fabrication of a CNC
Machine for Engraving & Drilling
17
During selection of the DC motors some important parameters were kept in
mind:
1. Supply Voltage: It is the maximum voltage needed to operate the motor
2. Rated Current: This is the current at stall conditions at applied rated
voltage.
3. Back EMF Constant or Voltage Constant: It is the constant that defines
the magnitude of back EMF generated in the armature. In a PMDC motor
this constant is determined by driving the motor as an unloaded generator
and then measuring the voltage divided by the speed in revolutions per
minute.
4. Motor Constant (Km): It is the ratio of the torque to input power.
5. Stall Torque: It is the torque under stall conditions.
We have selected Permanent Magnet DC motor for spindle based on the
theory given above. The specifications of the motor are as follows:
Manufacturer: Pittman™, USA
Part/Model No.: 8224
Supply Voltage: 48 V
Rated Current: 2.82 A
Voltage Constant: 4.57 V/k rpm
Motor Constant: 0.011 Nm/√W
Stall Torque: 0.1193 Nm
2.5.6.2 Stepper Motor:
A stepper motor is a brushless DC motor that divides a full rotation into a
small number of equal steps. The motor's position can easily be commanded
through control signals to move or to hold at any of these steps without the use
of any feedback sensor.
DESCRIPTION
18
Types of Stepper Motors:
1. Permanent Magnet (PM) Stepper Motors
2. Variable Reluctance (VR) Stepper Motors
3. Hybrid Stepper Motors
4. Lavet Type Stepping Motor
In Permanent magnet motors there is a permanent magnet in the rotor which
operates on the attraction or repulsion between the rotor permanent magnet
and electromagnets on the stator. Variable reluctance (VR) motors operates on
the principle that minimum reluctance occurs with minimum gap so that the
rotor points are attracted toward the magnet poles of stator. Hybrid stepper
motors employ the combination of both techniques to achieve maximum
power in smallest size.
Types on Basis of Winding Arrangement:
1. Unipolar
2. Bipolar
Unipolar Winding of Stepper Motor:
A unipolar stepper motor has two windings per phase. In this type of
arrangement the magnetic poles can be reversed without the need of reversing
the direction of current. The drive circuit in this case is also very simple. One
end of each winding is made common to have three leads per phase and
therefore for a two phase motor there would be a total of six leads. Out of
these six leads the two commons of both the phases are often joined together
to have a total of five leads for a two phase motor.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
19
Figure 2.11: Unipolar Winding Arrangement
A stepper motor drivers can be used to energize the transistors in correct order,
and this ease of operation makes unipolar stepper motors ideal to use. It is the
most inexpensive way to get precise angular movements. A six lead unipolar
stepper motor can also be driven using a bipolar driver circuit. In this
configuration, one of the windings per phase remains useless as current never
flows through it.
Bipolar Winding of Stepper Motor:
A bipolar stepper motor has a single winding per phase. To reverse a magnetic
pole in this configuration the current needs to be reversed, which means that
the driving circuit is comparatively more complex, typically with an H-bridge
arrangement.
Figure 2.12: Bipolar Winding Arrangement
DESCRIPTION
20
Following are the Excitation Modes for stepper motor:
1. Full Step Drive: Uses a four step switching sequence.
2. Half Step Drive: Each step of a full step drive is divided into two steps.
This means that a 100-step motor having a resolution of 1.8°, will now
have a resolution of 200 steps with a resolution of 0.9°.
3. Micro Step Drive: Micro stepping divides motor's steps up to 256 times.
It improves smoothness in low speed and minimizes resonance effects in
low speed but in micro stepping around 30% less torque is produced than
two phase full stepping. The primary goal of micro stepping is to make
the motor to run as smooth as possible and we have the same
requirements for our 3 axes stepper motors.
While making selection we kept following things in mind:
1. Holding Torque: The maximum torque which can be applied to an
energized motor without causing any rotation.
2. Pull-in Torque: Maximum Torque at which a motor can start, stop and
reverse without losing steps.
3. Pull-out Torque: The maximum torque that can be applied to motor
(running at constant speed) which does not cause step missing.
4. Detent Torque: The maximum torque that can be applied to the shaft of
non-energized motor.
5. Maximum Starting Frequency: Maximum pulse rate (frequency) at
which the motor can start and run without missing steps.
6. Maximum Slew Frequency: The maximum rate at which the stepper
motor will run.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
21
Following are the specifications of the stepper motor we have selected:
Winding type: Unipolar
Manufacturer: Oriental Motor Company™, Japan
Model: 103-820-2 (Nema 34D)
Mass: 1.2 Kg
Step angle: 2 deg./step
Holding torque: 2.1 N.m
Number of phases: 2 phase
Current per phase: 1.4 A
Resistance per phase: 3.21 ohm
Supply voltage: 4.5 V
2.6 Software and Human Machine Interface:
Software acts as a bridge between the human and machine. The design that
would be created will be communicated to the machine through the software
in the form of special codes that are discussed in detail in CNC programming
section. These codes are generated automatically by software according to the
design. The bridge between the software/computer and machine is CNC
Control Unit.
The software we are going to use is ArtSoft™ Mach3™ as CAM and CNC
control software while Sprint Layout 5.0™ as CAD software which converts
gerber PCB files to Isolation Milling (.plt) files. Isolation milling file isolates
the background from the connection lines that are to be milled away.
DESCRIPTION
22
Features of this software are given below:
Converts a PC to a fully featured 6-axis CNC controller
Allows import of DXF, BMP, JPG, and HPGL files through LazyCam™
Visual G-code display
Generates G-code via LazyCam™ or Wizards
Customizable M-Codes and Macros using VBscript™
Video display of machine
Spindle Speed control
Fully customizable interface
Multiple relay control
Manual pulse generation
Mach3™ is the most widely used software. Other CNC related software are
KCam, EMC2, TurboCNC, Flashcut, MasterCAM, MeshCAM, BobCAD-
CAM etc.
2.7 CNC Programming:
With the successful implementation of numerical control in MIT’s
Servomechanism Laboratory, many implementations have been developed by
commercial and non-commercial organizations. This called for a standardized
version, so in US Electronic Industrial Alliance developed a standardized
version in early 1960’s and the final version approved in 1980’s as RS274. In
European countries other standards are used like DIN 66025 or PN-73M-
55256, PN-93/M-55251. In the rest of the world the standard ISO6983 is
mostly followed.
Many variants have been developed independently by manufacturers, which
mean that the operator of a specific controller must be fully aware of
differences of each manufacturer’s product. Quite few machines use BCL,
which is a standardized version of G-code.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
23
In CNC programming, commands are used and each command consists of a
letter with a two digit number to signal an action. Such instructions are called
part program commands. Each key alphabet of the command is designated by
a specific set of functions e.g. ‘M’ stands for Miscellaneous Functions, ‘A’
stands for Absolute or incremental position, ‘G’ stands for preparatory /
general commands etc.
G-code is a commonly used name to refer CNC programming language. G-
code is a language of communication between a human operator and CNC
machine in which machine is told what to make and how to do it.
Another very common group of commands are the M-codes; here ‘M’ stands
for miscellaneous group of commands i.e. it performs miscellaneous functions.
2.8 Coordinates:
Coordinates are series of numerical positions according to which the required
pattern or contour from the isolation milling file (*.plt) or DXF file is
engraved. While working with CNC’s we come across two types of coordinate
systems:
2.8.1 Absolute Coordinates:
In this type of coordinate system the numerical positions are calculated from a
fixed point of origin e.g. if we are to engrave a word ‘PAKISTAN’ onto a
sheet of soft material like Bakelite, the machine will engrave the word ‘P’ first
then move to the origin (the point that was set as a reference which is usually
the point from where it started), after that the word ‘A’ will be engraved and
the tool will be given the command to get back to the reference position. This
process will be repeated till the word ‘N’ is engraved. Given below is the
mental picture of the process explained above.
DESCRIPTION
24
Figure 2.12: Engraving Using Absolute Coordinate System
The main advantage of using this coordinate system is the accuracy because
every time when the tool moves to its reference the position errors that are
generated overtime will be nullified. The main disadvantage is that large
amount of time will be consumed in the engraving process.
2.8.2 Relative/Incremental Coordinates:
In incremental coordinate system the series of numerical positions use the
previous position as the point of origin. The main advantage of this type of
system is that it takes very less time to perform the operation. The main
disadvantage is the decreased accuracy. Many ways have been developed to
counter this inaccuracy e.g. using Servo-motors or proper check on number of
steps taken if a stepper motor is used etc.
Design & Fabrication of a CNC
Machine for Engraving & Drilling
25
2.9 Interfacing:
There are two methods of interfacing or data communication:
2.9.1 Serial Communication:
In telecommunication and computer science, serial communication is the
process of sending data one bit at a time, sequentially, over a communication
channel or computer bus. Serial communication is used for all long distance
communication and most computer networks, where the cost
of cable and synchronization difficulties makes parallel communication
impractical. Some examples of serial communication architectures are RS432,
RS422, I²C, RS223, RS485, SPI, Avionics Digital Video Bus (ARINC 818),
Universal Serial Bus (USB), Control of electronic musical instruments
(MIDI), Spacecraft communication network (SpaceWire) etc.
2.9.2 Parallel Communication:
In Parallel communication multiple bits are transferred simultaneously.
Examples of Parallel communication are SCSI, ATA, PCI and ISA.
Types of Pins in DB25 Parallel Port:
The parallel port on a PC is DB25 female connector. The 25 pins present on
this connector can be categorized into four groups:
Figure 2.13: DB-25 Pin Diagram
DESCRIPTION
26
Data pins:
The data pins are used to send data in the form of bytes to the machine in such
a manner that each pin is designated one bit of the data. Pins 2 up to 9 are Data
pins.
Status Pins:
These pins sense signals from an external machine. Mostly these pins sense
the outcome of and external switch or read pulses of encoders. In above figure
status pins are 10 up to 15.
Control pins:
Control pins are used to provide control signals for. In above figure 1, 14, 16
and 17 are control pins.
Ground Pins:
In figure ground pins are from 18 to 25. These provide proper ground to the
machine. Without proper grounding, the machine may not work properly or
even get damaged.
The choice of parallel links over serial links is due to these factors:
Speed: The speed of a parallel data link equals to the number of bits sent
multiplied by the bit rate.
Cable length: Interference between the lines worsens with the length of
cable. This places an upper limit on the length of a parallel connection
cable. This limit is usually shorter than that of a serial connection.
Complexity: Creating a parallel port in a computer system is relatively
simple. It requires only a latch to copy data onto a bus. Contrary to that,
conversion into parallel form by a universal asynchronous receiver /
Design & Fabrication of a CNC
Machine for Engraving & Drilling
27
transmitter (UART) is required before they may be directly connected to a
data bus.
Due to the above mentioned reasons we are using Parallel communication
protocols. The machine would be linked up with the computer through the
Electronic Control Unit which contains the power supply along with required
drive circuits of 3 axes stepper motor.
MATHEMATICAL MODELING
AND CALCULATIONS
28
Chapter # 3: Mathematical Modeling and
Calculations
3.1 Mechanical Modeling:
∑ 𝜏 = 𝐽 �̈�
𝐽�̈� + 𝑏�̇� = 𝜏net ------------------------------------------------------ (1)
3.2 Electrical Modeling:
Using Kirchoff’s Voltage Law
V Input = 𝐼𝑅 + 𝐿 (𝑑𝑖
𝑑𝑡)
𝑉 = 𝐼 (𝑅 + 𝐿𝐷)
𝐼 =𝑉
(𝑅+𝐿𝐷) ------------------------------------------------------------ (2)
The net torque of stepper motor is
𝜏 = 𝐾m 𝐼 sin (𝑟∆𝜃) ---------------------------------------------------- (3)
∆𝜃 = 2
𝑟 = 60
Design & Fabrication of a CNC
Machine for Engraving & Drilling
29
𝐾m = 𝜏 hold on / 𝐼 rated = 1.5 Nm/A
Substituting (1) in (3)
𝐽�̈� + 𝑏�̇� = 𝐾m 𝐼 sin(𝑟∆𝜃)----------------------------------------------- (4)
Now, Substituting (2) in (4)
𝐽�̈� + 𝑏𝜃 ̇ = 𝐾m sin(𝑟∆𝜃) × 𝑉
(𝑅+𝐿𝐷)
Taking Laplace
𝜃(𝑠)[𝐽𝑠2 + 𝐵𝑠] = 𝐾m sin(𝑟∆𝜃) [𝑉
𝑠(𝑅 + 𝐿𝑠)]---------------------- (5)
𝑉 → 𝑆𝑡𝑒𝑝 𝐼𝑛𝑝𝑢𝑡 𝑜𝑓 4.5 𝑉𝑜𝑙𝑡𝑠
𝐽 = 𝑀𝑅2 (𝜔2) = 𝐼𝜔2
M = 0.32 kg
R = 0.0179 m
𝐽 = 0.318 (0.0179)2 × (6.28)2 = 4.01 × 10−3 𝑁𝑚
Fc = 9.81 N
b = 1.56 N/s
MATHEMATICAL MODELING
AND CALCULATIONS
30
Substituting values in (5)
𝜃(𝑠)[4.01 × 10−3𝑠2 + 1.5 𝑠]
= 1.55(60 × 2) [4.5
𝑠 (3.21 + 0.05)]
So,
𝜃(𝑡) = 0.17 − 0.209𝑒(−0.64𝑡) + 0.034𝑒(−0.389𝑡)
3.3 Spindle Motor Power Calculations:
RPM = 628.3 𝑟𝑎𝑑
𝑠𝑒𝑐
Input Voltage = 12 V
Current = 0.8 A
Input Power = IV = 12 × 0.8
PInput = 9.6 W
Efficiency = 80%
POutput = 80 × (96
100) W = 7.68 W
P required = 𝜏 required × 𝜔
𝜏 required → Required Torque for routing PCB (Copper + Bakelite
or Fiber)
𝜏 required = 0.012 Nm
𝜔 = 628.3 𝑟𝑎𝑑
𝑠𝑒𝑐
Design & Fabrication of a CNC
Machine for Engraving & Drilling
31
P required = 7.54 W
P required < P Output
Motor can be used.
3.4 Spindle Motor Modeling:
RPM = 6000
𝜔 = 628.3 𝑟𝑎𝑑
𝑠𝑒𝑐
tm = K Im ---------------------------------------------------------------- (1)
E = k 𝜔m ---------------------------------------------------------------- (2)
K = 12
628.3 = 0.019 V/s
G = 1
Ro = G Ed / Im = 15 Ohms
Using Newton’s 2nd Law of Motion
∑ 𝜏 = 𝐽 �̈� = 𝜏M - b 𝜔m – 𝜏L --------------------------------------------- (3)
IM = 𝜏M / K
MATHEMATICAL MODELING
AND CALCULATIONS
32
Using Kirchoff’s Voltage Law
EM = G ED - Ro IM
EF = h 𝜔m
e = ED - EF
EM = Ge + Ro IM ---------------------------------------------------------- (4)
G = 1
So,
𝜏M = K × (ED - h 𝜔m - k 𝜔m) Ro --------------------------------------- (5)
Substituting equation (5) in equation (3)
𝐽𝜔m + b 𝜔m = k/ Ro [Ed - h 𝜔m - k 𝜔m] – 𝜏L ------------------------ (6)
𝜔m = [JD + (B+K2/ Ro + K h/ Ro) = – 𝜏L + K Ed / Ro ------------- (7)
J = 9.54 x 10-5 Nm
FC = 0.02 (2000 RPM)
B= FC/𝜔 = 0.02/628.3 = 𝜏L max / Imax = 0.012 / 0.8 = 0.015
Substituting values in equation (7) gives
𝜔m [(1.28 D +1)] =17 Ed – 6.6 x 104 𝜏L
𝑎, = Static Gain = 17
𝑏, = Disturbance Sensitivity = -6.6 x 104
𝑐 , = Time Constant = 1.28 seconds
Design & Fabrication of a CNC
Machine for Engraving & Drilling
33
Natural time constant = J / B = 9.54 ×10−5
3.18 × 10−5 = 3 seconds
Homogenous complimentary solution is
𝜔m (1.28 D + 1) = (17× 2) - 6.6 × 104 (6 × 10-5)
𝜔m (1.28 D + 1) = 200 ----------------------------------------------- (7)
𝜔m (1.28 D + 1) = 0
D = -0.78
𝜔mh = A e-0.78t
Complimentary solution is
𝜔mc = 200
(1.28 𝐷+1)
𝜔mc = 200
𝜔m (t) = A e-0.78t +200
Initial conditions at 𝜔m = 0 and t=0
𝜔m = 0
0 = A +200
A = -200
So,
𝜔m (t) = 200 (1 – e-0.78t)
MATHEMATICAL MODELING
AND CALCULATIONS
34
3.5 Ball Screw Calculations:
Required Accuracy = 0.0254 mm
Step of motor = 2O
L × (2
360) = 0.0254
L = 4.572 mm (Pitch of Lead Screw)
Percentage of Error = 1.57 %
Can be neglected. OK to use
Chapter # 4: Design
4.1 Mechanical Model:
Figure 4.14: AutoCAD Model Showing Isometric View
Design & Fabrication of a CNC
Machine for Engraving & Drilling
37
4.2 Mechanical Drawings:
Figure 4.15: Top View of the Model on AutoCAD
DESIGN
38
Figure 4.16: Front View of the Model on AutoCAD
Design & Fabrication of a CNC
Machine for Engraving & Drilling
39
Figure 4.17: Side View of Model on AutoCAD
DESIGN
40
4.3 Mechanical Features of Machine:
Net weight of Machine = 30 kg
Resolution = 0.013 inch / step
Spindle motor RPM = 6000 rpm
Spindle motor power = 9.6W
Stepper motor rated power = 6.3W per phase
Size of the base = 14 x 16 (inches)
Size of the Y-Axis positioning table = 15.3 x 11.5 (inches)
Size of the Z-Axis positioning table = 4.1 x 7.6 (inches)
Max Depth of cut = ¼ of an inch
Max Feed rate = 25.4mm/sec
Accuracy = ±5 %
Stepper motor PPS = 180
Stepper Motor Step Angle = 2O
Work piece material = PCB, Soft Wood, Soft Metals
Design & Fabrication of a CNC
Machine for Engraving & Drilling
41
4.4 Application Specific 3-Axis CNC Controller:
Figure 4.18: Application Specific 3-Axes CNC Controller
DESIGN
42
4.5 Overall System Block Diagram:
Figure 4.19: Overall System Block Diagram
Chapter # 5: Conclusion &
Recommendations
5.1 Conclusion:
Working in this project helped us to explore the vast field of industrial
automation and particularly CNC machines. We started with a machine
capable only of point to point motion with many drawbacks in mechanical
design as well as in electronic design. We searched for, observed and
compared the professional CNC machines with the one we currently had.
Along with this we consulted many books on CNC machines.
After making the required improvements the machine is in a position to mill
complex contours on PCB, soft wood and soft metals with considerable
accuracy and speed. Achieving this primary goal is the result of improvements
in both electrical and mechanical design. Exploring new software with better
capabilities also helped us in achieving this goal. The workspace and job
clamping system is also improved.
5.2 Recommendations:
The speed of cut can be improved.
By implementing feedback control systems can greatly improve the
accuracy of machine.
This machine with 3 DOF’s can be made capable of 5 DOF milling.
Appendix A
List of G-codes:
G00 Rapid move
G01 Feed Rate move
G02 Clockwise move
G03 Counter Clockwise move
G04 Dwell time
G08 Spline Smoothing On
G09 Exact stop check, Spline Smoothing Off
G10 A linear feed rate controlled move with a decelerated stop
G11 Controlled stop
G17 XY PLANE
G18 XZ PLANE
G19 YZ PLANE
G28 Return to clearance plane
G33 Threading (Lathe)
G35 Bypass error checking on next line
G40 Tool compensation off
G41 Tool compensation to the left
G42 Tool compensation to the right
G43 Tool length compensation - negative direction
G44 Tool length compensation - positive direction
G49 Tool length compensation cancelled
G53 Cancel work coordinate offsets
G54-G59 Work coordinate offsets 1 through 6
G61 Spline contouring with buffering mode off
G64 Spline contouring with buffering mode on
G65 Mill out rectangular pocket
G66 Mill out circular pocket
G67 Fly cut
G68 Mill out rectangular pocket with radius corners
G70 Inch mode
G71 Millimeter mode
G74 Peck drilling (Lathe)
G81 Drill cycle
G82 Dwell cycle
G83 Peck cycle
G84 Tapping cycle
G85 Boring cycle 1
G86 Boring cycle 2
G88 Boring cycle 3
G89 Boring cycle 4
G90 Absolute mode
G91 Incremental mode
G92 Home coordinate reset
G94 IPM mode (Lathe) default
G95 IPR mode (Lathe)
G96 Constant Surface Feed On (Lathe)
G97 Constant Surface Feed off (Lathe)
G110 Lathe Groove Face
G111 Lathe Groove OD
G112 Lathe Groove ID
G113 Lathe Thread OD
G114 Lathe Thread ID
G115 Lathe Face Rough
G116 Lathe Turn Rough
G120 Mill Outside Square
G121 Mill Outside Circle or Island
G122 Mill out Counter Bore
G123 Mill outside Ellipse pocket
G124 Mill inside Ellipse pocket
G125 Mill outside Slot
G126 Mill inside Slot pocket
G130 3D tool compensation with gouge protection
G131 3D offset parallel to 3D profile
G132 3D tool compensation with gouge protection in the Z axis only
G135 5 axis tool compensation with gouge protection
G136 Included angle limit for gouge protection
G140 3D part rotation and plane tilting
G141 Scale factor for the X axis only
G142 Scale factor for the Y axis only
G143 Scale factor for the Z axis only
G160 Mill 3D Cylinder
G162 Mill 3D Sphere
G163 Mill 3D Ramped Plane
G170 Set soft limits and crash fixture/chuck barriers to defaults
G171 Set backward crash fixture/chuck barriers
G172 Set forward crash fixture/chuck barriers
G181 Bolt hole Drill
G182 Bolt hole Dwell
G183 Bolt hole Peck
G184 Bolt hole Tap
G185 Bolt Hole Bore
Appendix B
List of M-codes:
M02 End of Program
M03 Spindle on Clockwise, Laser, Flame, Power ON
M04 Spindle on Counter Clockwise
M05 Spindle Stop, Laser, Flame, Power OFF
M06 Tool Change
M08 Coolant On
M09 Coolant Off
M10 Reserved for tool height offset
M13 Spindle On, Coolant On
M30 End of Program when macros are used
M91 Readout Display Incremental
M92 Readout Display Absolute
M97 Go to or jump to line number
M98 Jump to macro or subroutine
M99 Return from macro or subroutine
M100 Machine Zero Reset
M199 Mid program start
Bibliography
1. Katsuhiko Ogata, Modern Control Engineering, 4th Edition, Prentice Hall
Of India, New Delhi, 2004
2. Kelly James Floyd, Patrick Hood-Daniel, Build Your Own CNC Machine, 1st
Edition, Springer-Verlag, New York, 2009.
3. Geoff Williams, CNC Robotics: Build Your Own Shop Bot, 1st Edition,
McGraw Hill, New York, 2003.
4. Seames, S. Warren, Computer Numerical Control, 4th Edition, Thomson
Learning Inc., New York, 2002.
5. Overby Alan, CNC Machining Handbook: Building, Programming, and
Implementation, 1st Edition, McGraw Hill, New York, 2010.
6. Madison James, CNC Machining Handbook, 1st Edition, Industrial Press
Inc., New York, 1996.
7. Pabla B.S., Adithan M., CNC Machines, 1st Edition, New Age International,
New Delhi, 1994.
8. Albert Alan, Understanding CNC Routers, 1st Edition, FPInnovations,
Ottawa, 2011.
9. Valentino James , Goldenberg Joseph, Introduction to Computer Numerical
Control, 5th Edition, Prentice Hall, New York, 2012