Professional Documents
Culture Documents
CNC 1,2,3,5 Units
CNC 1,2,3,5 Units
With CNC, each object to be manufactured gets a custom computer program, usually written in
an international standard language called G-code, stored in and executed by the machine control
unit (MCU), a microcomputer attached to the machine. The program contains the instructions
and parameters the machine tool will follow, such as the feed rate of materials and the
positioning and speed of the tool's components. Mills, lathes, routers, grinders and lasers are
common machine tools whose operations can be automated with CNC. It can also be used to
control non-machine tools, such as welding, electronic assembly and filament-winding machines.
Early in the process, engineers create a computer-aided design (CAD) drawing of the part to be
manufactured, then translate the drawing into G-code. The program is loaded onto the MCU and
a human operator performs a test run without the raw material in place, to ensure proper
positioning and performance. This step is important because incorrect speed or positioning can
damage both the machine and the part.
CNC is considered to provide more precision, complexity and repeatability than is possible with
manual machining. Other benefits include greater accuracy, speed and flexibility, as well as
capabilities such as contour machining, which allows milling of contoured shapes, including
those produced in 3D designs. On the other hand, CNC can be more expensive, require more
maintenance than other production methods and compel companies to hire a skilled CNC
programmer.
Guideways
Functions of Guideways
The Guideway is one of the important elements of machine tool. The main function of the guideway is to
make sure that the cutting tool or machine tool operative element moves along predetermined path. The
machine tool operative element carries workpiece along with it. The motion is generally circular for
boring mills, vertical lathe, etc. while it is straight line for lathe, drilling, boring machines, etc.
Requirements of guideways are: (a) Guideway should have high rigidity. (b) The surface of guideways
must have greater accuracy and surface finish. (c) Guideways should have high accuracy of travel. It is
possible only when the deviation of the actual path of travel of the operative element from the
predetermined normal path is minimum. (d) Guideways should be durable. The durability depends upon
the ability of guideways to retain the initial accuracy of manufacturing and travel. (e) The frictional forces
acting on the guideway surface must be low to avoid wear. (f) There should be minimum possible
variation of coefficient of friction. (g) Guideways should have good damping properties.
TYPES OF GUIDEWAYS
The guideways are mainly classified according to the nature of friction between contacting surfaces of the
operative element:
The friction between the sliding surfaces is called as guideways with sliding friction. These guideways
are also called as slideways. The slideways are further classified according to the lubrication at the
interface of contacting surfaces. The friction between the sliding surfaces may be dry, semi-liquid, and
liquid. When the lubrication is absent in between contacting surfaces, it is called as dry friction. Dry
friction is rarely occurred in machine tools. When two bodies slide with respect to each other having
lubrication between them, the sliding body tends to rise or float due to hydrodynamic action of the
lubricant film.
The sliding surfaces are completely separated by the lubricant film and liquid friction occurs at their
interface. The slideways in which the sliding surfaces are separated by the permanent lubricant layer are
known as hydrodynamic slideways. This permanent lubrication layer is due to hydrodynamic action. A
permanent lubricant layer between the sliding surfaces can be obtained by pumping the liquid into the
interface under pressure at low sliding speed. The sliding body is lifted by this permanent lubricant layer.
Such slideways are called as hydrostatic slideways.
The most commonly used shapes of guiding elements of slide ways are:
(i) V-type: The V-type slideways are advantageous because of the automatic adjustment due to
gravity action which always keeps the surfaces in contact, thus the possibility of any play is
eliminated. In addition, the wedging action due to cross winding is also prevented and there is no
Page No:
possibility of chips falling on the V-surface and getting entrapped into it. It has no tendency to
accumulate dust.
The disadvantage of V-type guides is that it wears away rapidly due to lack of bearing surface, and is
difficult to manufacture.
(ii) Flat type: Flat type-slideways are simple in construction and offer quite a large bearing area to
the moving parts. Therefore, to overcome the disadvantage of V-type slideways by the advantages of
the flat type slideways, generally these two together are used for guides as in lathes. Separate guides
are provided for the saddle and tail-stock movement so that any wear caused by the saddle movement
does not affect the height of tail stock centre. The flat type bed guides the saddle by the side guides
and in offer to prevent lifting movement the retaining pieces are fitted below the flat bed.
(iii) Dovetail type: Dove tail type slideways are preferred when the location of the moving parts is
considered essential. These are generally used for milling machine tables, saddles and knees. In
dovetail type slideways, adjustment for wear can be made by parallel blocks pushed by set screws.
Dovetail slideways occupy small space. A gib strip is provided so that it can be adjusted to ensure
that the two elements of the slide are a good sliding fit.
(iv) Circular or cylindrical type: Cylindrical slide fulfils the conditions of kinematic principles
being fully constrained. These guides are used in the pillar or radial drilling machines. Clearance
between mating surfaces of slideways are inevitable because of wear and manufacturing
imperfections. Clearance between flat ways may be controlled periodically by means of three gibs or
strips.
b) No stickslip
c) Easy of availability
Disadvantages:
Example:
1. Drives Basic function of a CNC machine is to provide automatic and precise motion control
to its elements such work table, tool spindle etc. Drives are used to provide such kinds of
controlled motion to the elements of a CNC machine tool. A drive system consists of drive
motors and ball lead-screws. The control unit sends the amplified control signals to actuate drive
motors which in turn rotate the ball lead-screws to position the machine table or cause rotation of
the spindle.
2. Power drives: Drives used in an automated system or in CNC system are of different types
such as electrical, hydraulic or pneumatic.
• Electrical drives: These are direct current (DC) or alternating current (AC) servo motors. They
are small in size and are easy to control.
• Hydraulic drives: These drives have large power to size ratio and provide stepless motion with
great accuracy. But these are difficult to maintain and are bulky. Generally they employ
petroleum based hydraulic oil which may have fire hazards at upper level of working
temperatures. Also hydraulic elements need special treatment to protect them against corrosion.
• Pneumatic drives: This drives use air as working medium which is available in abundant and is
fire proof. They are simple in construction and are cheaper. However these drives generate low
power, have less positioning accuracy and are noisy. In CNC, usually AC, DC, servo and stepper
electrical drives are used. The various drives used in CNC machines can be classified as: a.
Spindle drives to provide the main spindle power for cutting action b. Feed drives to drive the
axis.
Spindle drives
The spindle drives are used to provide angular motion to the workpiece or a cutting tool. Figure
shows the components of a spindle drive. These drives are essentially required to maintain the
speed accurately within a power band which will enable machining of a variety of materials with
Page No:
variations in material hardness. The speed ranges can be from 10 to 20,000 rpm. The machine
tools mostly employ DC spindle drives.
But as of late, the AC drives are preferred to DC drives due to the advent of microprocessor-
based AC frequency inverter. High overload capacity is also needed for unintended overloads on
the spindle due to an inappropriate feed. It is desirous to have a compact drive with highly
smooth operation.
Feed Drives
These are used to drive the slide or a table. Figure shows various elements of a feed drive. The
requirements of an ideal feed drive are as follows.
• The feed motor needs to operate with constant torque characteristics to overcome friction and
working forces.
• The drive speed should be extremely variable with a speed range of about 1: 20000, which
means it should have a maximum speed of around 2000 rpm and at a minimum speed of 0.1 rpm.
• The feed motor must run smoothly.
• The drive should have extremely small positioning resolution.
• Other requirements include high torque to weight ratio, low rotor inertia and quick response in
case of contouring operation where several feed drives have to work simultaneously. Variable
speed DC drives are used as feed drives in CNC machine tools. However now-a-days AC feed
drives are being used.
Page No:
Electrical drives
Electric drives are mostly used in position and speed control systems. The motors can be
classified into two groups namely DC motors and AC motors (Fig. 4.1.3). In this session we shall
study the operation, construction, advantages and limitations of DC and AC motors.
DC motors
A DC motor is a device that converts direct current (electrical energy) into rotation of an element
(mechanical energy). These motors can further be classified into brushed DC motor and
brushless DC motors.
A typical brushed motor consists of an armature coil, slip rings divided into two parts, a pair of
brushes and horse shoes electromagnet as shown in Fig. A simple DC motor has two field poles
namely a north pole and a south pole. The magnetic lines of force extend across the opening
between the poles from north to south. The coil is wound around a soft iron core and is placed in
between the magnet poles. These electromagnets receive electricity from an outside power
source. The coil ends are connected to split rings. The carbon brushes are in contact with the split
rings. The brushes are connected to a DC source. Here the split rings rotate with the coil while
the brushes remain stationary.
The working is based on the principle that when a current-carrying conductor is placed in a
magnetic field, it experiences a mechanical force whose direction is given by Fleming's left-hand
rule. The magnitude of the force is given by
𝐹=𝐵𝐼𝐿𝑠𝑖𝑛𝜃 (4.1.1)
Where, B is magnetic field density in weber/m2
I is the current in amperes and
L is the length of the conductor in meter
θ is the angle between the direction of the current in the conductor and the electric field
If the current and filed are perpendicular then θ=90°. The equation 4.1.1 becomes,
𝐹=𝐵𝐼𝐿 (4.1.2) A direct current in a set of windings creates a magnetic field. This field
produces a force which turns the armature. This force is called torque. This torque will cause
the armature to turn until its magnetic field is aligned with the external field. Once aligned the
direction of the current in the windings on the armature reverses, thereby reversing the
polarity of the rotor's electromagnetic field. A torque is once again exerted on the rotor, and it
continues spinning. The change in direction of current is facilitated by the split ring
commutator. The main purpose of the commutator is to overturn the direction of the electric
current in the armature. The commutator also aids in the transmission of current between the
armature and the power source. The brushes remain stationary, but they are in contact with
the armature at the commutator, which rotates with the armature such that at every 180° of
rotation, the current in the armature is reversed.
Advantages of brushed DC motor:
• The design of the brushed DC motor is quite simple
• Controlling the speed of a Brush DC Motor is easy
• Very cost effective
A brushless DC motor has a rotor with permanent magnets and a stator with windings. The rotor can
be of ceramic permanent magnet type. The brushes and commutator are eliminated and the windings
are connected to the control electronics. The control electronics replace the commutator and brushes
and energize the stator sequentially. Here the conductor is fixed and the magnet moves (Fig. 4.1.5).
The current supplied to the stator is based on the position of rotor. It is switched in sequence using
transistors. The position of the rotor is sensed by Hall effect sensors. Thus a continuous rotation is
obtained.
AC Motors
AC motors convert AC current into the rotation of a mechanical element (mechanical energy). As in
the case of DC motor, a current is passed through the coil, generating a torque on the coil. Typical
components include a stator and a rotor. The armature of rotor is a magnet unlike DC motors and the
stator is formed by electromagnets similar to DC motors. The main limitation of AC motors over DC
motors is that speed is more difficult to control in AC motors. To overcome this limitation, AC
motors are equipped with variable frequency drives but the improved speed control comes together
with a reduced power quality.
The working principle of AC motor is shown in fig. 4.1.6. Consider the rotor to be a permanent
magnet. Current flowing through conductors energizes the magnets and develops N and S poles. The
strength of electromagnets depends on current. First half cycle current flows in one direction and in
the second half cycle it flows in opposite direction. As AC voltage changes the poles alternate.
breakage detection
tool identification
Tool identification and offset measurement were discussed in section 2.7, but this is by no means
the only way of establishing tool offset data and identification, as we shall see a little later on.
However, let us confine our thoughts to the means of monitoring and controlling the tool life and
breakage detection.
Whenever cutting tools are engaged in the manufacture of parts there is an interac- tion between
the workpiece, chips and tool, causing tool wear. It is essential that any worn tools (at a pre-
determined level of wear) must be replaced before their predicted failure occurs. During
unmanned machining, tool sensing is necessary in order to establish the extent of wear and
activate a tool change so as to optimise its useful life. In recent years, a variety of sensing
techniques have been developed and are classified
into two distinct groups: direct sensing methods, which include
(c) dimensional changes in workpiece via measurement, or alternatively, the distance from the
tool post to the part indirect sensing methods, covering methods based on temperature, vibration,
sound, acoustic emission and force measurement, which can be measured directly or by torque,
current, and power measurements It should be said that many of the methods listed above have
proved to be satisfactory in the laboratory, but few have been "workshop hardened" for industrial
applications.
The tool monitoring systems available of late tend to be classified into three groups, as those
involving: recording machining time tool breakage detection devices touch-trigger probing
The latter method is reviewed later in the chapter but for now we will concentrate on the
methods used to protect the tool and hence workpiece from the vagaries of the cutting process,
whilst offering numerous other advantages during cutting. The simplest device to be used for
tool wear prediction is the former method and is offered by numerous machine tool companies. It
focuses on the estimation of the machining time which has elapsed whilst cutting components.
The permitted tool life is deter- mined by software within the controller, which can be specified
according to the tool and workpiece combinations and cutter geometries, together with other
related factors. The operation of such systems is simple: during cutting, when the feed functions
for both circular and linear interpolations are monitored, the controller accumulates data on the
actual time employed. Once this time has reacheda prescribed level a "worn tool" alarm is
triggered and the tool is changed as soon as it is safe to do so. In this manner cutting life is
optimised, but the approach to such techniques is based on steady-state machining and it can be
influenced by unexpected, interrupted and abusive cutting conditions, which can be considered a
draw-back, but this solution to tool wear control is a relatively cheap option and as such cannot
be severely criticised.
A more sophisticated method of tool breakage detection based on the indirect approach to
sensing, using adaptive control techniques has been around for some time. In the early days it
was an adaptive control optimisation (ACO) system which was developed using a form of in-
process measurement to assess such factors as tool wear rates, spindle deflection and vibration. It
suffered from poor sensitivity in monitoring tool wear in a productive environment and was
plagued with troublesome sensing methods. Lately, the adaptive control constraint (ACC)
technique has proved to be most popular and is simpler in design and use, whilst costing
considerably less. These "feed-only" systems, as they are sometimes referred to, are still quite
complex and have unique sensory circuits and computation methods for establishing the net
torque during cutting and comparing the monitored value to a preset torque limit.
Page No:
They are often known as torque-controlled machining (TCM) systems. To have such systems
present is a boon on any machine tool, with the costs of such options being of the order of 5% of
the total machine's cost. A machining centre application (Fig.) and a turning centre application
(Fig.) are illustrated schematically and the benefits they accrue to the optimisation of any cutting
process are listed. An obvious problem associated with any torque-controlled machining
monitor, is that if insufficient torque is developed - in the case of small drills, taps and milling
cutters on machining centres, or small diameter workpieces on turning centres – then when they
are under approximately 10 mm diameter, lack of torque makes them obsolete. To overcome this
problem and alleviate such "blind spots" in the machining of .:ritical features in this size zone for
cutters, a further monitoring system is available which complements TCM monitors and is
known as acoustic emission (AE). In principle, the acoustic emission technique is shown in Fig.
2.27 and has a variety ofsources for the generation of sound waves during the cutting process
(Fig.b). The AE signals generated are filtered out, so that only the ultrasonic waves released by
the generation of high-frequency elastic stress waves - whilst cutting - are sensed, owing to the
rapid release of strain energy which is caused by such factors as material deformation, fracture,
and metallurgical phase changes. In order to monitor the AE signal, it is usual to use
piezoelectric sensors which detect the AE amplitude showing a rising tendency (often termed
"tare") just as the tool is about to break (Fig.). It is quite straightforward to separate out the AE
signal from extraneous noises generated by the machine tool, owing to the very high frequency
of this signal. These fast-response piezoelectric sensors require the minimum of power input and
are characterised by their high resolution and sensitivity. The electrical signal produced is
proportional to the measured value and can be amplified for machine tool control. In principle
AE active sensors utilise the piezoelectric effect, in which electrical charges are formed on the
surfaces of particular crystals such as quartz, tourmaline, etc, when they are subjected to
mechanical stress. The reciprocal piezoelectric effect is the reverse of this process and is used to
power quartz clocks and watches, by deforming the crystal by an electrical charge. The
mechanical deformation of the direct piezoelectric sensors used on machine tools produces
electrical charges with virtually no delays and as a result can be used in high-speed machining
operations, or when
metalcutting experience by the tool builders over many years and detect the characteristic changes resulting from tool
failure. Such systems utilise yet further algorithms for the detection of wear, breakage and collision, providing
separate outputs to the machine tool for each occurrence. Any tool breakage tends to be both
sudden and catastrophic, and is characterised by distinct changes in the force signals. Typical
signals (as depicted in Fig. 2.28) showing the force signal characterised by breakage, are
detected using "pattern recognition" techniques. These real-time force signal events show key
parameters which are assessed in terms of significant spikes and sudden changes in force levels.
When such an event occurs, it is recognised as a characteristic, say, of a broken tool pattern
based on "prior experience", which is incorporated within the software and a "broken tool" signal
is generated. A user of such systems can select the worn tool variable over a range from level
one, for finishing cuts, to level ten, for heavy roughing. One might ask the question, "Why do we
need so much sophisticated tool and subsequent machine protection in stand-alone or FMS
environment?". The answer to this can be found by considering the consequences of not
providing such monitoring equipment: in a recent German survey it was determined that a typical
collision resulted in around £7500 worth of damage to the machine tool. This is exacerbated by
the staggering statistics that for all tool collisions, 72% were the direct result of operator error,
whilst only 26% were traced to faults in the electrical systems, with 2% of all faults unclassified.
These results clearly show the advantages of incorporating tool/machine protection devices for a
relatively small capital cost. If ·advantages can be gained, or protection provided by tool
monitoring, there must be similar benefits from utilising workpiece gauging and inspection
monitoring techniques, and this will be the theme of the following section.
Page No:
Unit – II
As stated above, a modular fixturing system is made up of many flexible and interchangeable
components. Likely the most fundamental and important component is the tooling plate or
tooling block. These are also commonly known as fixturing plates, tooling columns, and
tombstones. Modular tooling plates feature a grid of locating holes which are used to attach
clamping
devices, work supports, stops, and any other components necessary to correctly position the
work piece for the application. The tooling plate's multipurpose holes provide increased
flexibility for other modular components because they can be located or positioned anywhere on
the grid. This allows for many different set ups to be created on a single fixturing plate.
confrontation with said main spindle head, and a second cam surface provided at said main
spindle head and at a position in confrontation with said tool magazine, said second cam follower
being selectively engageable with said second cam surface in response to movement of said main
spindle head, said second cam surface being adapted to prevent said tool holder gripping means
from excessive pivotal movement to a direction away from said main spindle head against
biasing force of said biasing means.
7. The automatic tool changer as defined in claim 4, wherein each of said tool holder gripping
means defines a central line along longitudinal direction thereof, said first cam follower being
positioned opposite to said second cam follower with respect to said central line.
8. The automatic tool changer as defined in claim 3, wherein said tool holder gripping means
comprises a grip arm having said first, intermediate and second portions; and wherein each of
said tool holders has a maximum diameter portion formed with annular V-shaped groove, and
wherein said bifurcated portion comprises two bifurcated members each formed with a bore
extending in a direction perpendicular to said grip arm; retractable pins disposed in said bores,
and spring means disposed in said bores for biasing said pins, said pins being engageable with
said annular V-shaped groove.
9. The automatic tool changer as defined in claim 1, further comprising: clamping and
unclamping means for clamping and unclamping one of said tool holder with respect to said
main spindle synchronously with an operation of said pivotting means and with the movement of
said main spindle head.
NC PART PROGRAMMING
Types of part programming, Computer aided part programming, Part programming manual, Part
programme using sub routines, do loops and fixed cycles are described in this Unit.
(f) Return the cutting tool to the reference point after completion of work.
The part programming contains the list of coordinate values along the X, Y and Z directions of the entire
tool path to finish the component. The program should also contain information, such as feed and speed.
Each of the necessary instructions for a particular operation given in the part program is known as an NC
word. A group of such NC words constitutes a complete NC instruction, known as block. The commonly
used words are N, G, F, S, T, and M. The same is explained later on through examples.
Hence the methods of part programming can be of two types depending upon the two techniques as
below:
(a) Manual part programming, and
(e) Knowledge about the codes and functions used in part programs.
Using the example shown in Figure 4.2. The words are as follows :
N001 – represents the sequence number of the operation.
G01 – represents linear interpolation.
X12345 – will move the table in a positive direction along the X-axis.
Y06789 – will move the table along the Y-axis.
M03 – Spindle on CW and
; – End of block.
4.3.4 Standard G and M Codes
The most common codes used when programming NC machines tools are G-codes (preparatory
functions), and M codes (miscellaneous functions). Other codes such as F, S, D, and T are used for
machine functions such as feed, speed, cutter diameter offset, tool number, etc. G-codes are sometimes
called cycle codes because they refer to some action occurring on the X, Y, and/or Z-axis of a machine
tool. The G-codes are grouped into categories such as Group 01, containing codes G00, G01, G02, G03,
which cause some movement of the machine table or head. Group 03 includes either absolute or
incremental programming. A G00 code rapidly positions the cutting tool while it is above the workpiece
from one point to another point on a job. During the rapid traverse movement, either the X or Y-axis can
be moved individually or both axes can be moved at the same time. The rate of rapid travel varies from
machine to machine.
The total numbers of these codes are 100, out of which some of important codes are given as under with
their functions :
G-Codes (Preparatory Functions)
Code Function
G00 Rapid positioning
G01 Linear interpolation
G02 Circular interpolation clockwise (CW)
G03 Circular interpolation counterclockwise (CCW)
G20 Inch input (in.)
G21 Metric input (mm)
G24 Radius programming
G28 Return to reference point
G29 Return from reference point
G32 Thread cutting
G40 Cutter compensation cancel
G41 Cutter compensation left
G42 Cutter compensation right
G43 Tool length compensation positive (+) direction
G44 Tool length compensation minus (-) direction
G49 Tool length compensation cancels
G 53 Zero offset or M/c reference
G54 Settable zero offset
G84 canned turn cycle
G90 Absolute programming
G91 Incremental programming
Note : On some machines and controls, some may be differ.
M-Codes (Miscellaneous Functions)
M or miscellaneous codes are used to either turn ON or OFF different functions, which control certain
machine tool operations. M-codes are not grouped into categories, although several codes may control the
same type of operations such as M03, M04, and M05, which control the machine tool spindle. Some of
important codes are given as under with their function s:
Code Function
M00 Program stop
M02 End of program
M03 Spindle start (forward CW)
M04 Spindle start (reverse CCW)
M05 Spindle stop
M06 Tool change
M08 Coolant on
M09 Coolant off
Circular Interpolation
This is to command the cutter to move from the existing point to the target point along a circular arc in
clockwise direction or counter clockwise direction. The parameters of the center of the circular arc is
designated by I, J and K addresses. I is the distance along the X-axis, J along the Y, and K along the Z.
This parameter is defined as the vector from the starting point to the center of the arc.
Circular Interpolation
In NC machining, if the cutter axis is moving along the programmed path, the dimension of the workpiece
obtained will be incorrect since the diameter of the cutter has not be taken in to account. What the system
requires are the programmed path, the cutter diameter and the position of the cutter with reference to the
contour. The cutter diameter is not included in the programme. It has to be input to the NC system in the
tool setting process.
Tool path without cutter compensation
Example
2 (All dimensions are in mm).
% 2000; (Main programme)
N01 G54 G91 G71 G94 M03 S800; (Parameters Setting)
N05 G01 X-15 Z0 F2; (Facing the job)
N10 G00 Z1; (Tool clearance)
N15 G00 X10; (Tool clearance from the centre)
N20 G01 Z-36; (Turning operation)
N25 G01 X5 –Z30; (Taper turning operation)
N30 G00 X1 Z66; (Final position of tool)
N35 M02; (End of programme)
APT PROGRAMMING:
APT stands for Automatically Programmed Tool. It is a language that defines the tool
path with respect to the part geometry, and often forms the basis for post-processor
generated NC files.
The APT language consists of four types of statements.
Geometry statements will be used to specify the elemental features defining the part
shape.
Motion statements are used to specify the path taken by the tool.
Post-processor statements control the machinery, controlling coolants as well as the
feeds and speeds.
Auxiliary statements complete the picture, specifying the part, required tools, etc. The
following sections describe each of the APT statements.
Geometry Statements
All geometric elements must be defined before tool motion may be programmed.
Geometry statements associate a symbol with a description of the geometric element and
its parameters. The general form for a geometry statement is:
The symbol consists of up to six alpha-numeric characters, containing at least one alpha
character, and avoiding APT reserved words. The symbols provide a means to name the
geometric features. The equals sign separates the symbol from the geometric type.
The geometric type describes these features.
1. POINT,
2. LINE,
3. PLANE, and
4. CIRCLE are valid APT geometric types. The forward slash character separates the
geometric type from the parametric description of the feature.
The parametric description specifies the location and size of the feature. It may include
dimensional data, positional data, and other APT words relating the feature to previously
defined APT symbols. The APT language provides a rich means to specify the geometry,
as is evidenced by the following examples.
1. To specify a point:
P0 = POINT/1.0, 1.2, 1.3 specifies a point at XYZ coordinates 1.0, 1.2, and 1.3,
respectively.
P1 = POINT/INTOF L1, L2 specifies a point at the intersection of lines L1 and L2,
which must have been defined prior to the statement.
P2 = POINT/YLARGE, INTOF, L3, C1 specifies a point at the intersection of line L3
and circle C1 at a Y position above the center point of the circle.
2. To specify a line:
L1 = LINE/P0, P1 specifies a line by two points, previously defined.
L1 = LINE/1.0, 1.2, 1.3, 2.0, 2.1, 2.3 specifies a line by two points, given as explicit
coordinates.
L2 = LINE/P2, PARLEL, L1 specifies a line through point P2 and parallel to line L1.
L3 = LINE/P1, RIGHT, TANTO, C1 specifies a line through point P1 and tangent to
circle C1 on the right side of the center point.
L4 = LINE/P1, ATANGL, 45, L1 specifies a line through point P1 at an angle of 45o to
line L1.
3. To specify a plane:
PL0 = PLANE/P0, P1, P2 specifies a plane through three, non-colinear, previously
defined points.
PL1 = PLANE/P3, PARLEL, PL0 specifies a plane through a point P3 parallel to a
plane PL0.
4. To specify a circle:
C0 = CIRCLE/CENTER, P0, RADIUS, 1.0 specifies a circle of radius 1 from a center
point of P0.
Lines and planes extend infinitely. Circles are always complete. The same geometry may
be defined only once, and may not have more than one symbol.
Motion Statements
The format for motion commands follows the pattern:
Motion/description
The initial motion starts from a home position, and takes the form:
FROM/P0 or FROM/ 0.0, 1.0, 2.0
The FROM motion statement occurs only once for each set of a motion type, at the start
of the set of motions.
Contouring motion – is the most common motion used in APT programming, and these
statements specify the tool path continuously throughout the motion. They make use of
three surfaces: (a) drive; (b) check; and (c) part surfaces.
Drive surfaces represent the surface along which the vertical edges of the tool will follow.
Part surfaces specify the surfaces the tip of the tool will follow. And check surfaces
describe where the tool will come to rest after it has completed the motion of the current
step. There are four locations for the tool to stop with respect to a check surface. These
four possibilities each have their own modifier words.
The TO modifier stops the tool when the first surface of the tool would come into
contact with the check surface. The ON modifier stops the tool where the center point of
the tool would come into contact with the check surface. The PAST modifier stops the
tool where the last surface of the tool would contact the check surface. And the TANTO
modifier stops the tool at the point of circular tangency with the edge of the tool.
The initial contouring motion statement is the GO/TO, which defines the initial drive,
part and check surfaces. It takes the form:
GO/TO, drive surface, TO, part surface, TO, check surface
An example would be:
GO/TO, L1, TO, PL1, TO, L2 specifying that the tool should use line L1 as the drive
surface, plane P1 as the part surface, and line L2 as the check surface.
Note: the GOTO and the GO/TO statements are not the same. The former specifies
point to point motion (see below), and the latter initiates contouring motion.
Continuing contouring motion statements are given from the vantage point of a person
sitting on the top of the tool. The motion words are: (a) GOLFT; (b) GORGT; (c)
GOFWD; (d) GOBACK; (e) GOUP; and (f) GODOWN. The sense of these words
depends on the direction the tool has been coming from, and is depicted in Figure 2:
Post-Processor Statements
These statements provide processing parameters to the post-processor program. Typical
programs will require parameters for feeds, speed, and other tool/spindle/machine
controls. Examples:
SPINDL/600 specifies the spindle to be 600 rpm.
FEDRAT/6.0 specifies a feed rate of 6 inches per minute.
TURRET/T2 specifies loading tool # 2 in the turret.
A final post-processor statement must specify to the post-processor program what type of
machine is intended for the final NC code, and the specific controller to generate the code
for. An example is:
MACHIN/MILL, 2 specifies a mill machine type, and controller type 2
Auxiliary Statements
These statements complete the APT programming language, and include the FINI
statement to mark the end of the program as well as statements to define the width of the
tool. An example of the latter is:
CUTTER/0.25 specifies a quarter-inch cutter diameter.
The computer would then know to calculate a 0.125 inch offset to accommodate the
cutter diameter in computing the center of the tool.
Example APT Problem:
An APT program for the profiling of the part in Figure 2 is to be generated. The
processing parameters are: (a) feed rate is 5.39 inches per minute; (b) spindle speed is 573
revolutions per minute; (c) a coolant is to be used to flush the chips; (d) the cutter
diameter is to be 0.5 inches, and (e) the tool home position is (0, -1, 0).
Figure 3. APT Geometry and Tool Path for Workpiece
CAD Software:
CAD software is written in FORTRAN and C languages. FORTRAN provides the
number crunching, whereas, C language provides the visual images. Early CAD packages
were turnkey systems, i.e., the CAD packages were sold as an integrated software and
hardware package, with no flexibility for using second vendor hardware (1970s and 80s).
These systems were based on 16-bit word, and were incapable of networking. The
modern CAD software utilizes the open architecture system, i.e., software vendors do not
design and manufacture their own hardware. Third party software can be used to augment
the basic CAD package. Most popular CAD package will facilitate integration of the
Finite Element Analysis and other CAD software from more than one vendor. For
example, IDEAS preprocessor can work with almost all the FEA packages for pre and
post analyses.
c) Software: Includes the programs necessary to receive-graphical data and put the
required image on the screen. The image may be as simple as a 2-D wireframe, or as
complex as 3-D. The graphics software in the program receives geometric primitives such
as lines, points, and surfaces and paints them on the screen or on the output device
according to the object attributes. The result of this three-step process (application,
hardware, and software) is graphical output.
An 8 or 16 bit microprocessor.
A little measure of RAM.
Programmable ROM and flash memory.
Parallel and serial I/O.
Timers and signal generators.
Analog to Digital and Digital to Analog conversion
Even at a time when Intel presented the first microprocessor with the 4004 there was already a demand for
microcontrollers: The contemporary TMS1802 from Texas Instruments, designed for usage in calculators, was by
the end of 1971 advertised for applications in cash registers, watches and measuring instruments. The TMS 1000,
which was introduced in 1974, already included RAM, ROM, and I/O on-chip and can be seen as one of the first
microcontrollers, even though it was called a microcomputer. The first controllers to gain really widespread use
were the Intel 8048, which was integrated into PC keyboards, and its successor, the Intel 8051, as well as the
68HCxx series of microcontrollers from Motorola. Today, microcontroller production counts are in the billions
per year, and the controllers are integrated into many appliances we have grown used to, like
• Household appliances (microwave, washing machine, coffee machine, . . . )
• Telecommunication (mobile phones)
• Automotive industry (fuel injection, ABS, . . . )
• Aerospace industry
• Industrial automation
The RD and WR (both active low) signals are connected to RAM for reading and writing the data.
PSEN of microcontroller is connected to the output enable of the ROM to read the data from the memory.
EA (active low) pin is always grounded if we use only external memory. Otherwise, once the program size
exceeds internal memory the microcontroller will automatically switch to external memory.
Instruction Memory:
Like the data memory, the instruction memory is usually a relatively large external memory (at least with
general CPUs). Actually, with von-Neumann-architectures, it may even be the same physical memory as the
data memory. With microcontrollers, the instruction memory, too, is usually integrated right into the MCU.
These are the most prominent uses of memory in or around a CPU. However, there is more memory
in a CPU than is immediately obvious. Depending on the type of CPU, there can be pipeline registers,
caches, various buffers, and so on. About memory embedded in an MCU: Naturally, the size of such on-chip
memory is limited. Even worse, it is often not possible to expand the memory externally (in order to keep the
design simple). However, since MCUs most often are used for relatively simple tasks and hence do not need
excessive amounts of memory, it is prudent to include a small amount of data and instruction memory on the
chip. That way, total system cost is decreased considerably, and even if the memory is not expandable, you
are not necessarily stuck with it: Different members in a MCU family usually provide different amounts of
memory, so you can choose a particular MCU which offers the appropriate memory space. Now, the
functional distinction of memory types made above is based on the way the memory is used. From a
programmer’s perspective, that makes sense. However, hardware or chip designers usually view memory
rather differently: They prefer to distinguish according to the physical properties of the electronic parts the
memory is made of. There, the most basic distinction would be volatile versus non-volatile memory. In this
context, volatile means that the contents of the memory are lost as soon as the system’s power is switched
off. Of course, there are different ways either type of memory can be implemented. Therefore, the distinction
based on the physical properties can go into more detail. Volatile memory can be static or dynamic, and there
is quite a variety of non-volatile memory types: ROM, PROM, EPROM, EEPROM, FLASH, and NV-RAM.
Let’s examine those more closely.
5.4. COUNTERS
Each timer is basically a counter which is either incremented or decremented upon every clock tick. The
direction (up- or down-counter) is either fixed or configurable. The current count value can be read through a
count register and can be set to a specific value by the user. For a timer resolution of n, the count value is
within [0, 2n − 1]. Care must be taken when the timer length exceeds the word length of the controller, e.g.,
when using a 16-bit timer on an 8-bit controller. In such a case, access to the 16-bit count value must be done
in two passes, which could lead to inconsistent values. Just think of a timer that is at value 0x00FF and will
switch to 0x0100 in the next cycle. If you read the high byte first and the low byte with the next instruction,
you will get 0x0000. If you do it the other way round, you will end up with 0x01FF, which is not any better.
To counter such problems, the ATmega16 controller for example uses a buffer register to store the high byte
of the timer. So whenever the program reads the low byte of the count register, the high byte is
simultaneously stored in the buffer and can then be read at the next cycle. Likewise, to write a new count
value, the high byte should be written first (and is stored in the buffer by the controller), and as soon as the
low byte is written, both high and low byte are written into the count register in one go.
Timers can generally raise an interrupt whenever they experience an overflow of the count value. This can be
used to implement a rudimentary periodic signal by setting the count value to a given start value and then
waiting for the overflow. However, this method does not give an accurate period because after the overflow
the timer has to be set to its starting value by the program. In consequence, the time from the overflow until
the start value has been reloaded into the timer must either be considered or incorporated into the start value,
or the period will be longer than desired. To avoid this drawback, some timers provide a modulus mode
which automatically reloads the start value when the timer overflows. Another method for getting accurate
periods is to use the PWM feature we will describe shortly. Although the timer is generally clocked by the
same source as the microcontroller itself, this need not be the case. Microcontrollers may allow one or more
of the following sources for clocking the timer.
5.5. TIMERS:
Timers/Counters are used generally for
Time reference
Creating delay
Wave form properties measurement
Periodic interrupt generation
Waveform generation
Timer in 8051 is used as timer, counter and baud rate generator. Timer always counts up irrespective of whether it
is used as timer, counter, or baud rate generator: Timer is always incremented by the microcontroller. The time
taken to count one digit up is based on master clock frequency.
If Master CLK=12 MHz,
Timer Clock frequency = Master CLK/12 = 1 MHz
Timer Clock Period = 1micro second
This indicates that one increment in count will take 1 micro second.
The two timers in 8051 share two SFRs (TMOD and TCON) which control the timers, and each timer also has
two SFRs dedicated solely to itself (TH0/TL0 and TH1/TL1).
The following are timer related SFRs in 8051.
SFR Name Description SFR Address
TH0 Timer 0 High Byte 8Ch
TL0 Timer 0 Low Byte 8Ah
TH1 Timer 1 High Byte 8Dh
TL1 Timer 1 Low Byte 8Bh
TCON Timer Control 88h
TMOD Timer Mode 89h
Embedded System
An embedded system can be thought of as a computer hardware system having software embedded in it. An
embedded system can be an independent system or it can be a part of a large system. An embedded system is a
microcontroller or microprocessor based system which is designed to perform a specific task. For example, a fire
alarm is an embedded system; it will sense only smoke. An embedded system has three components –
It has hardware.
It has application software.
It has Real Time Operating system (RTOS) that supervises the application software and provide mechanism to
let the processor run a process as per scheduling by following a plan to control the latencies. RTOS defines the
way the system works. It sets the rules during the execution of application program. A small scale embedded
system may not have RTOS.
So we can define an embedded system as a Microcontroller based, software driven, and reliable, real-time
control system.
Characteristics of an Embedded System
Single-functioned − An embedded system usually performs a specialized operation and does the same
repeatedly. For example: A pager always functions as a pager.
Tightly constrained − All computing systems have constraints on design metrics, but those on an embedded
system can be especially tight. Design metrics is a measure of an implementation's features such as its cost, size,
power, and performance. It must be of a size to fit on a single chip, must perform fast enough to process data in
real time and consume minimum power to extend battery life.
Reactive and Real time − Many embedded systems must continually react to changes in the system's
environment and must compute certain results in real time without any delay. Consider an example of a car cruise
controller; it continually monitors and reacts to speed and brake sensors. It must compute acceleration or de-
accelerations repeatedly within a limited time; a delayed computation can result in failure to control of the car.
Microprocessors based − It must be microprocessor or microcontroller based.
Memory − It must have a memory, as its software usually embeds in ROM. It does not need any secondary
memories in the computer.
Connected − It must have connected peripherals to connect input and output devices.
HW-SW systems − Software is used for more features and flexibility. Hardware is used for performance and
security.
Basic Structure of an Embedded System
The following illustration shows the basic structure of an embedded system –
Sensor − It measures the physical quantity and converts it to an electrical signal which can be read by
an observer or by any electronic instrument like an A2D converter. A sensor stores the measured
quantity to the memory.
A-D Converter − An analog-to-digital converter converts the analog signal sent by the sensor into a
digital signal.
Processor & ASICs − Processors process the data to measure the output and store it to the memory.
D-A Converter − A digital-to-analog converter converts the digital data fed by the processor to
analog data
Actuator − An actuator compares the output given by the D-A Converter to the actual (expected)
output stored in it and stores the approved output.
Embedded Systems are classified into three types based on the performance of the microcontroller such as
Small scale embedded systems
(i) The central processing unit (CPU): Like a computer this is the brain of a PLC.
It has several sub-parts.
(a) A microprocessor to carry out arithmetic and logic operations.
(b) Memory to store data and programs.
(c) Process image memory.
(d) Internal timers and counters.
(e) Flags.
(ii) Input module: This acts as an interface between the field inputs and the CPU. The
input module accepts voltage signals from the limit switches, sensors, transducers,
proximity switches, push buttons etc. The input signals can be analog or digital.
The input module performs four tasks.
• It senses the presence or absence of input signals at each of its input
terminals. The input signal tells what switch, sensor, or other signal is on
or off in the operation being controlled.
• It converts the input signal to a DC level useable by the PLC’s electronic circuit.
• The input module carries out electronic isolation of output from input.
• It produces an output sensed by CPU.
A typical input module will have 4, 6, 8, 12, 16, or 32 terminals.
(iii) Output module: The output module interfaces the output devices like contactors,
lamps, relays, solenoid valves etc. with the CPU. The output module acts in
just opposite manner to input module. A signal from CPU is received by the
output module, once for each scan. If the CPU signal code matches the assigned
number of the module the module is turned on. The output modules will have
4,6,8,12,16 or 32 terminals.
(iv) Power supply
(v) Racks and chassis to mount the elements
PROGRAMMING OF PLC
Entering and storing a sequence of instructions in the memory of the PLC either can be
carried out by a hand-held programming device or using a personal computer. The
programming can be done either on-line or off-line as desired by the programmer.
11.6.1 OFF-LINE PROGRAMMING
Off-line programming is used to design programs prior to running the machine. This
permits the programs to be checked prior to implementation and detect any bug in the
program.
This is the preferred method of programming.
ON-LINE PROGRAMMING
On-line programming is implemented with the direct connection to the PLC. Changes in the
program are made when the PLC is in the running mode.
11.6.3 LADDER LOGIC
The type programming used for PLC is ladder logic. This is a graphical representation of
the hard-wired system used in electrical circuits and includes switches, timers, counters,
and many other pieces of hardware in a structured manner. Figure 11.5 shows one rung of
a circuit diagram and the corresponding ladder diagram.
The left hand of the ladder diagram is the live supply and the right hand is the neutral or
common line. The flow of control is from left to right. The operation of the ladder logic can
be explained with the help of a simple example of starting an electric motor. Figure 11.6
shows a single rung motor starter circuit.
The activation of the motor will occur when all the input devices on the rung will provide
continuity from left to right to the output device. However, this cannot be used practically.
Another path to the motor is needed to keep the motor running. This is shown in Fig. 11.7.
When the start button is depressed the motor will start and the relay contact parallel to
the start button will close. When the start button is released current will flow through the
relay contact until the stop button is pressed. This will open the relay contact and stop the
motor. In terms of the Boolean logic the motor will run if: (Start depressed OR IR relay
closed) AND (STOP closed). Now this can be programmed in the PLC software using
contact symbols as shown in Fig. 11.7.