Beruflich Dokumente
Kultur Dokumente
CAD if often defined in a variety of ways and includes a large range of activities. Very
broadly it can be said to be the integration of computer science (or software) techniques in
engineering design. At one end when we talk of modeling, iIt encompasses the following:
2D/3D drafting
The models thus developed are first visualized on display monitors using avariety of
techniques including wire frame displa, shaded image display, hidden surface removed
display and so on. Once the designer is satisfied, these models are then used for various
types of analysis / applications. thus, at the other end it includes a number of analysis
activities. These could be:
Stress (or deflection) analysis, i.e. numerical methods meant for estimating the
behaviour of an artifact with respect to these parameters. It includes tools like the
Finite Element Method (FEM).
Simulation of actual use
Optimization
CAD/CAM integration
Process planning
These are activities which normally use models developed using one or more of the
techniques mentioned above. These activities are often included in other umbrellas like CAM
or CAE. A term often used is CAx to include this broad set of activities. They all use CAD
models and often the kind of application they have to be used ina determines the kind of
amodel to be developed. Hence, in this course I cover them under the umbrella of CAD. In
this course we will strive to give an overview of modelling techniques followed by some
applications, specifically CAM.
Thus there are three aspects to CAD.
Modeling
Display/ Visualization
Applications
MODELING
Modelling typically includes a set of activities like
Defining objects
Defining relation between objects
The figure below explains what a typical CAD model would need to define, what kind of
entities need to be defined and what relationships exist between them.
At the highest level we have the volume which is defined by (or "delimited by") a set of
surfaces. These surfaces can be either planar or curved / warped. A planar surface can be
bounded by a set of curves. A curved surface can be seen as a net of curves. These curves
are typically a succession of curve segemnts which define the complete the curve. The curve
segment is defined using a set of end points / control points which govern the nature of the
curve. Thus a relation ship is defined between entities at each level.
Once such a relationship is defined, a geometric model of the artifact is available. In any
design there might be manysuch artifacts. One then has to define properties of each of
these artifacts and define a relationship between them. The properties and the relationships
needed are dependant on the application the model is to be used for subsequently. But one
common application that all models have to go through is visualization of the model (s).
DISPLAY / VISUALIZATION
Mapping objects onto screen coordinates: Models are typically made in a model
coordinate system. this could be the world coordinate system, or a coordinate
system local to the object. these coordinate systems are typically three dimensional
in nature. To display the object on a 2D screen, the object coordinates need to be
mapped on to the 2D coordinate system of the screen. This requires two steps:
o Viewing transformations: The coordinates of the object are transformed in a
manner as if one is looking at the object through the screen. This coordinate
system is referred to as the viewing coordinate system.
o
Surface display or shading / rendering: In displaying the objects on the screen one
often likes to get a shaded display of the object and get a good feel of the three
dimensional shape of the object. This requires special techniques to render the
surface based on its shape, lighting conditions and its texture.
Hidden line removal when multiple surfaces are displayed: In order to get a proper
feel of the three dimensional shape of an object, one often desires that the lines /
surfaces which are not visible should not be displayed. this is referred to as hidden
line / surface removal.
Once a model is visualized on the screen and approved by the conceptual designer, it has to
go through a number of analysis. Some of the kinds of usage this model might have to go
through are the following:
Estimating stresses / strains / deflections in the objects under various static loading
conditions
Estimating the same under dynamic loading conditions
Visualizing how a set of objects connected together would move when subject to
external loading. This leads to a whole set of activities under simulation. These
activities would vary depend upon the application the object is to be subject to.
Manufacturing the object using NC / CNC machines and generating the programs for
these machines so as to manufacture these objects.
Having given the overview of the kind of activties that can come under the umbrella of CAD
the uses these CAD models can be put to, I know highlight what aspects of these would be
covered in this course. Needless to say, all these activities would be well beyond the scope
of one single course. Therefore this course, which is targeted to give an overview of CAD
and its applications would include the following:
1. An overview of the hardware systems used in CAD
2. 2D and 3D transformations used to shift between coordinate systems
3. Projection transformation used to get the object in screen coordinate systems
4. Modeling of curves and surfaces
5. Modeling of solids
Raster-Scan Displays
Random-Scan Displays
Flat-Panel Displays
coil of wire, called the filament, inside the cylindrical cathode structure. This causes
electrons to be boiled off the hot cathode surface. In the vacuum inside the CRT
envelope, negatively charged electrons are then accelerated toward the phosphor coating
by a high positive voltage. The accelerating voltage can be generated with a positively
charged metal coating on the in side of the CRT envelope near the phosphor screen, or an
accelerating anode can be used, a in fig below . Sometimes the electron gun is built to
contain the accelerating anode and focusing system within the same unit.
Spots of light are produced on the screen by the transfer of the CRT beam energy to the
phosphor. When the electrons in the beam collide wit the phosphor coating , they are
stopped and there are stopped and their kinetic energy is absorbed by the phosphor. Part
of the beam energy s converted by friction into heat energy, and the remainder causes
electron in the phosphor atoms to move up to higher quantum-energy levels. After a short
time, the excited phosphor electrons begin dropping back to their stable ground state,
giving up their extra energy as small quantums of light energy. What we see on the screen
is the combined effect of all the electrons light emissions: a glowing spot that quickly
fades after all the excited phosphor electrons have returned to their ground energy level.
The frequency ( or color ) of the light emitted by the phosphor is proportional to the
energy difference between the excited quantum state and the ground state.
Different kinds of phosphor are available for use in a CRT. Besides color, a major
difference between phosphors is their persistence: how long they continue to emit light
( that is, have excited electrons returning to the ground state ) after the CRT beam is
removed. Persistence is defined as the time it take the emitted light from the screen to
decay to one-tenth of its original intensity. Lower-persistence phosphors require higher
refresh rates to maintain a picture on the screen without flicker. A phosphor with low
persistence is useful for animation ; a high-persistence phosphor is useful for displaying
highly complex, static pictures. Although some phosphor have a persistence greater than
1 second, graphics monitor are usually constructed with a persistence in the range from
10 to 60 microseconds.
Raster-Scan Displays
In a raster- scan system, the electron beam is swept across the screen, one row at a time from top
to bottom. As the electron beam moves across each row, the beam intensity is turned on and off
to create a pattern of illuminated spots. Picture definition is stored in memory area called the
refresh buffer or frame buffer. This memory area holds the set of intensity values for all the
screen points. Stored intensity values are then retrieved from the refresh buffer and painted on
the screen one row (scan line) at a time (fig.below). Each screen point is referred to as a pixel or
pel (shortened forms of picture element).
Refreshing on raster-scan displays is carried out at the rate of 60 to 80 frames per second,
although some systems are designed for higher refresh rates. Sometimes, refresh rates are
described in units of cycles per second, or Hertz (Hz), where a cycle corresponds to one frame.
At the end of each scan line, the electron beam returns to the left side of the screen to begin
displaying the next scan line. The return to the left of the screen, after refreshing each scan line,
is called the horizontal retrace of the electron beam. And at the end of each frame (displayed in
1/80th to 1/60th of a second), the electron beam returns (vertical retrace)to the top left corner of
the screen to begin the next frame.
On some raster-scan systems (and in TV sets), each frame is displayed in two passes using an
interlaced refresh procedure. In the first pass, the beam sweeps across every other scan line from
top to bottom. Then after the vertical retrace, the beam sweeps out the remaining scan
lines(fig.below). Interlacing of the scan lines in this way allows us to see the entire screen
displayed in one-half the time it would have taken to sweep across all the lines at once from top
to bottom.
Random-Scan Displays
Random scan monitors draw a picture one line at a time and for this reason are also referred to as
vector displays (or stroke-writing or calligraphic displays).The component lines of a picture
can be drawn and refreshed by a random-scan system in any specified order .
Refresh rate on a random-scan system depends on the number of lines to be displayed. Picture
definition is now stored as a set of line-drawing commands in an area of memory referred to as
the refresh display file. Sometimes the refresh display file is called the display list, display
program, or simply the refresh buffer. To display a specified picture, the system cycles through
the set of commands in the display file, drawing each component line in turn. After all linedrawing commands have been processed, the system cycles back to the first line command in the
list. Random-scan displays are designed to draw al the component lines of a picture 30 to
60times each second.
Flat-Panel Displays
The term flatpanel displays refers to a class of video devices that have reduced volume,
weight, and power requirements compared to a CRT. A significant feature of flat-panel displayed
is that they are thinner than CRTs, and we can hang themon walls or wear them on our wrists.
We can separate flat-panel displays into two categories: emissive displays and nonemissive
displays. The emissive displays (or emitters) are devices that displays, and light-emitting diodes
are examples of emissive displays. Nonemissive displays( or nonemitters) use optical effects to
convert sunlight or light from some other source into graphics patterns. The most important
example of a nonemissive flat-panel display is a liquid- crystal device.
Plasma panels, also called gas discharge displays, are constructed by filling the region between
two glass plates with a mixture of gases that usually include neon. A series of vertical conducting
ribbons is placed on one glass panel, and a set of horizontal ribbons is built into the other glass
panel (fig.below). Firing voltages applied to a pair of horizontal and vertical conductors cause
the gas at the intersection of the of two conductors to break down into a glowing plasma of
electrons and ions. Picture definition is stored in a refresh buffer, and the firing voltages are
applied to refresh the pixel positions ( at the intersections of the conductors) 60 times per second.
Another type of emissive device is the light-emitting diode (LED). A matrix of diodes is
arranged to form the pixel positions in the display, and picture defination is stored in refresh
buffer. As in scan- line refreshing of a CRT, information is read from the refresh buffer and
converted to voltage levels that are applied to the diodes to produce the light patterns in the
display.
Liquid- crystal displays (LCDs) are commonly used in systems, such as calculators (fig.below)
and portable, laptop computers (fig.below). These nonemissive devices produce a picture by
passing polarized light from the surrounding or from an internal light source through a liquidcrystal material that can be aligned to either block or transmit the light.
The term liquid crystal refers to the fact that these compounds have a crystalline arrangement of
molecules, yet they flow like a liquid . Flat-panel displays commonly use nematic (threadlike)
liquid-crystal compounds that tend to keep the long axes of the rod-shaped molecules aligned. A
flat-panel display can then be constructed with a nematic liquid crystal, as demonstrated in fig.
below. Two glass plates, each containing a light polarizer at right angles to the other palate,
sandwich the liquid-crystal material. Rows of horizontal transparent conductors are built into one
glass plate, and columns of vertical conductors are put into the other plate. The intersection of
two conductors defines a pixel position. Normally, the molecules are aligned as shown in the on
stateof fig.below. Polarized light passing through the material is twisted so that it witll pass
through the opposite polarizer. The light is reflected back to the viewer. To turn off the pixel, we
apply voltage to the two intersecting conductors to align the molecules so that the light is not
twisted. This type of flat-panel device is referred to as a passive matrix LCD. Picture definition
are stored in a refresh buffer, and the screen is refreshed at the rate of 60 frames per second, as in
the emissive devices. Back lighting is also commonly applied using solid-state electronic
devices, so that the system is not completely dependent on outside light sources. Colors can be
displayed by using different materials or dyes and by placing a triad of color pixels at each
screen location. Another method for constructing LCDs is to place a transistor at each pixel
location, using thin-film transistor technology.
The transistors are used to control the voltage at pixel locations and to prevent charge from
gradually leaking out of the liquid-crystal cells. These devices are called active-matrix displays.
INPUT DEVICES
Various devices are available for data input on graphics workstations. Most systems have a
keyboard and one or more additional devices specially designed for interactive input. These
include a mouse, trackball, spaceball, joystick, digitizers, dials, and button boxes. Some other
input devices used in particular applications are data gloves, touch panels, image scanners, and
voice systems.
Keyboards
An alphanumeric keyboard on a graphics system is used primarily as device for entering text
strings. The keyboard is an efficient device for inputting such nongraphic data as picture labels
associated with a graphics display. Keyboards can also be provided with features to facilitate
entry of screen coordinates, menu selections, or graphics functions.
Mouse
A mouse is small hand-held box used to position the screen cursor. Wheels or rollers on the
bottom of the mouse can be used to record the amount and direction of movement. Another
method for detecting mouse motion is with an optical sensor,. For these systems, the mouse is
moved over a special mouse pad that has a grid of horizontal and vertical lines. The optical
sensor
detects
movement
across
the
lines
in
the
grid.
Since a mouse can be picked up and put down at another position without change in cursor
movement, it is used for making relative changes in the position of the screen cursor. One, two,
or three buttons are usually included on the top of the mouse for signaling the execution of some
operation, such as recording cursor position or invoking a function.
Joysticks
A joystick consists of a small, vertical lever (called the stick) mounted on a base that is used to
steer the screen cursor around. Most joysticks select screen positions with actual stick
movement; others respond to pressure on the stick. Figure below shows a movable joystick.
Some joysticks are mounted on a keyboard; others function as stand-alone units.
Digitizers
A common device for drawing, painting, or interactively selecting coordinate positions on an
object is a digitizer. These devices can be used to input coordinate values in either a twodimensional or a three-dimensional space. Typically, a digitizer is used to scan over a drawing or
object and to input a set of discrete coordinate positions, which can be joined with straight-line
segments to approximate the curve or surface shapes.
One type of digitizer is the graphics tablet (also referred to as a data tablet), which is used to
input two-dimensional coordinates by activating a hand cursor or stylus at selected positions on a
flat surface. A hand cursor contains cross hairs for sighting positions, while a stylus is a pencilshaped device that is pointed at positions on the tablet. Figures below show examples of desktop
and floor-model tablets, using hand cursors that are available with 2, 4, or 16 buttons. Examples
of stylus input with a tablet are shown in Figs. Below. The artists digitizing system in Fig. below
uses electromagnetic resonance to detect the three-dimensional position of the stylus. This allows
an artist to produce different brush strokes with different pressures on the tablet surface. Tablet
size varies from 12 by 12 inches for desktop models to 44 by 60 inches or larger for floor
models. Graphics tablets provide a highly accurate method for selecting coordinate positions,
with an accuracy that varies from about 0.2 mm on desktop models to about 0.05 mm or less on
larger models.
Many graphics tablets are constructed with a rectangular grid of wires embedded in the tablet
surface. Electromagnetic pulses are generated in sequence along the wires, and an electric signal
is induced in a wire coil in an activated stylus or hand cursor to record a tablet position.
Depending on the technology, either signal strength, coded pulses, or phase shifts can be used to
determine the position on the tablet.
HARD-COPY DEVICES
We can obtain hard-copy output for our images in several formats. Eg: Dot matrix printer, laser
printer & inkjet printer are commonly used.
Drafting layouts and other drawings are typically generated with ink-jet or pen plotters. A pen
plotter has one or more pens mounted on a carriage, or crossbar, that spans a sheet of paper. Pens
with varying colors and widths are used to produce a variety of shadings and line styles. Wet-ink,
ball-point, and felt-tip pens are all possible choices for use with a pen plotter. Plotter paper can
lie flat or be rolled onto a drum or belt. Crossbars can be either moveable or stationary, while the
pen moves back and forth along the bar. Either clamps, a vacuum, or an electrostatic charge hold
the paper in position. An example of a table-top flatbed pen plotter is given in Figure below, and
a larger, rollfeed pen plotter is shown in Fig.below
INTRODUCTION
With the matrix representations of the transformations, we can set up a matrix for any sequence of transfo
composite transformation matrix by calculating the matrix product of the individual transformations.
If two successive transformations
calculated as:
Where
ROTATION
1. Translate the object so that the pivot-point position is moved to coordinate origin.
2. Rotate the object about the coordinate origin.
3. Translate the object so that the pivot point is returned to its original position. The
composite matrix for this sequence is obtained as:
where,
SCALING
The animation illustrates a transformation sequence to produce scaling with respect to a
selected fixed position (a,b) using a scaling function that can only scale relative to the
coordinate origin.
1. Translate object so that the fixed point coincides with the coordinate origin.
2. Scale the object with respect to the coordinate origin.
3. Use the inverse translation of step 1 to return the object to its original position.
The composite matrix for this sequence is obtained as:
where,
TRANSLATION
In three-dimensional homogeneous coordinate representation, when a point P is translated to P' with coord
Where,
ROTATION
Unlike 2D, rotation in 3D is carried out around any line. The most simple rotations could be
around coordinate axis. As in 2D positive rotations produce counter-clockwise rotations.
Rotation in term of general equation is expressed as
Where,
R = Rotation Matrix
Rotation matrix when an object is rotated about X axis can be expressed as:
REFLECTION
In 3D-reflection the reflection takes place about a plane whereas 2D reflection it used take
place about an axis. The matrix in case of pure reflections, along basic planes, viz. X-Y
In a short period of time, all the major machine tool manufacturers were producing
some machines with NC, but it was not until late 1970s that computer-based NC
became widely used. NC matured as an automation technology when electronics
industry developed new products. At first, miniature electronic tubes were
developed, but the controls were big, bulky, and not very reliable. Then solid-state
circuitry and eventually modular or integrated circuits were developed. The control
unit became smaller, more reliable, and less expensive.
(2)
Computer
Numerical
Control
Computer numerical control (CNC) is the numerical control system in which a dedicated
computer is built into the control to perform basic and advanced NC functions. CNC controls are
also referred to as soft-wired NC systems because most of their control functions are
implemented by the control software programs. CNC is a computer assisted process to control
general purpose machines from instructions generated by a processor and stored in a memory
system. It is a specific form of control system where position is the principal controlled variable.
All numerical control machines manufactured since the seventies are of CNC type. The computer
allows for the following: storage of additional programs, program editing, running of program
from memory, machine and control diagnostics, special routines, inch/metric,
incremental/absolute
switchability.
CNC machines can be used as stand alone units or in a network of machines such as flexible
machine centres. The controller uses a permanent resident program called an executive program
to process the codes into the electrical pulses that control the machine. In any CNC machine,
executive program resides in ROM and all the NC codes in RAM. The information in ROM is
written into the electronic chips and cannot be erased and they become active whenever the
machine is on. The contents in RAM are lost when the controller is turned off. Some use special
type of RAM called CMOS memory, which retains its contents even when the power is turned
off.
part program may contain few thousands of blocks.So the program is stored in a separate
computer and sent directly to the machine, one block at a time.
First DNC system developed was Molins System 24 in 1967 by Cincinnati Milacron and General
Electric. They are now referred to as flexible manufacturing systems (FMS). The computers that
were used at those times were quite expensive.
CNC machines can be updated by improving the software used to drive the machines.
Training for the use of CNC machines can be done through the use of 'virtual software'.
The manufacturing process can be simulated virtually and no need to make a prototype or
a model. This saves time and money.
Once programmed, these machines can be left and do not require any human intervention,
except for work loading and unloading.
These machines can manufacture several components to the required accuracy without
any fatigue as in the case of manually operated machines.
Savings in time that could be achieved with the CNC machines are quite significant.
Some of the disadvantages of the CNC machines are:
CNC machines are generally more expensive than manually operated machines.
The CNC machine operator only needs basic training and skills, enough to supervise
several machines.
Increase in electrical maintenance, high initial investment and high per hour operating
costs than the traditional systems.
Fewer workers are required to operate CNC machines compared to manually operated
machines. Investment in CNC machines can lead to unemployment.
Weld moves, welding feed rate, wire feed, torch heights & welding current can be
programmed.
CNC welding machines are used for laser welding, welding of plastics, submerged arc
welding, wire welding machines, butt welding, flash butt welding etc.
Cost of these machines will be twice than the conventional welding machines.
Some machine tools for example drilling, boring and tapping machines etc, require the cutter and
the work piece to be placed at a certain fixed relative positions at which they must remain while
the cutter does its work. These machines are known as point-to-point machines as shown in
figure 22.1 (a) and the control equipment for use with them are known as point-to-point control
equipment. Feed rates need not to be programmed. In theses machine tools, each axis is driven
separately. In a point-to-point control system, the dimensional information that must be given to
the machine tool will be a series of required position of the two slides. Servo systems can be
used to move the slides and no attempt is made to move the slide until the cutter has been
retracted back.
( 1.2) Contouring systems (Continuous path systems)
Other type of machine tools involves motion of work piece with respect to the cutter while
cutting operation is taking place. These machine tools include milling, routing machines etc. and
are known as contouring machines as shown in figure 22.1 (b) and the controls required for their
control are known as contouring control.
Contouring machines can also be used as point-to-point machines, but it will be uneconomical to
use them unless the work piece also requires having a contouring operation to be performed on
it. These machines require simultaneous control of axes. In contouring machines, relative
positions of the work piece and the tool should be continuously controlled. The control system
must be able to accept information regarding velocities and positions of the machines slides.
Feed rates should be programmed.
Figure 22.2 (a) Open loop control system Figure 22.2 (b) Closed loop control system
Courtesy: http://jjjtrain.kanabco.com/vms/Media/glossary_o/cnc_opencloseloop.gif
Courtesy: http://jjjtrain.kanabco.com/vms/Media/glossary_o/cnc_opencloseloop.gif
Higher axes machining has been widely used for machining sculptures surfaces in aerospace
and automobile industry.
The CNC machine uses a set of rules to enter, edit, receive and output data. These rules are
known as CNC Syntax, Programming format, or tape format. The format specifies the order and
arrangement of information entered. This is an area where controls differ widely. There are rules
for the maximum and minimum numerical values and word lengths and can be entered, and the
arrangement of the characters and word is important. The most common CNC format is the word
address format and the other two formats are fixed sequential block address format and tab
sequential format, which are obsolete. The instruction block consists of one or more words. A
word consists of an address followed by numerals. For the address, one of the letters from A to Z
is used. The address defines the meaning of the number that follows. In other words, the address
determines what the number stands for. For example it may be an instruction to move the tool
along the X axis, or to select a particular tool.
Most controllers allow suppressing the leading zeros when entering data. This is known as
leading zero suppression. When this method is used, the machine control reads the numbers from
right to left, allowing the zeros to the left of the significant digit to be omitted. Some controls
allow entering data without using the trailing zeros. Consequently it is called trailing zero
suppression. The machine control reads from left to right, and zeros to the right of the significant
digit may be omitted.
(3) Types of CNC codes
(3.1) Preparatory codes
The term "preparatory" in NC means that it "prepares" the control system to be ready for
implementing the information that follows in the next block of instructions. A preparatory
function is designated in a program by the word address G followed by two digits. Preparatory
functions are also called G-codes and they specify the control mode of the operation.
(3.2) Miscellaneous codes
Miscellaneous functions use the address letter M followed by two digits. They perform a group of
instructions such as coolant on/off, spindle on/off, tool change, program stop, or program end.
They are often referred to as machine functions or M-functions. Some of the M codes are given
below.
M00 Unconditional stop
M02 End of program
M03 Spindle clockwise
M04 Spindle counterclockwise
M05 Spindle stop
M06 Tool change (see Note below)
M30 End of program
In principle, all codes are either modal or non-modal. Modal code stays in effect until cancelled
by another code in the same group. The control remembers modal codes. This gives the
programmer an opportunity to save programming time. Non-modal code stays in effect only for
the block in which it is programmed. Afterwards, its function is turned off automatically. For
instance G04 is a non-modal code to program a dwell. After one second, which is say, the
programmed dwell time in one particular case, this function is cancelled. To perform dwell in the
next blocks, this code has to be reprogrammed. The control does not memorize the non-modal
code, so it is called as one shot codes. One-shot commands are non-modal. Commands known as
"canned cycles" (a controller's internal set of preprogrammed subroutines for generating
commonly machined features such as internal pockets and drilled holes) are non-modal and only
function during the call.
On some older controllers, cutter positioning (axis) commands (e.g., G00, G01, G02, G03, &
G04) are non-modal requiring a new positioning command to be entered each time the cutter (or
axis) is moved to another location.
Command group
G-code
Function and Command Statement
Illustration
Tool motion
G00
Rapid traverse
G00 Xx Yy Zz
G01
Linear interpolation
G01 Xx Yy Zz Ff
G02
Circular Interpolation in clock-wise direction
G02 Xx Yy Ii Jj
G02 Xx Zz Ii Kk
G02 Yy Zz Jj Kk
G03
Circular interpolation in counter- clockwise direction
G03 Xx Yy Ii Jj
G03 Xx Zz Ii Kk
G03 Yy Zz Jj Kk
Command group
G-code
Illustration
G17
Plane Selection
Command group
XY - Plane selection
G18
ZX - Plane selection
G19
YZ - plane selection
G-code
G20 or
G70
Unit Selection
G21 or
G71
Metric unit selection
Illustration
Command
group
Function and
GCommand
code
Statement
Illustration
Cutter
G4 diameter
0 compensati
on cancel
Cutter
G4
diameter
Offset and
compensatio 1 cancellation
left
n
Cutter
diameter
G4 compensati
2 on righ
Command
group
G-code
Illustration
G00
Rapid traverse
G00 Xx Zz
G01
Linear interpolation
G01 Xx Zz
G02
Circular Interpolation in
clock-wise direction
G02 Xx Zz Ii Kk
(or)
G02 Xx Zz Rr
Tool motion
G03
Circular interpolation in
counter- clockwise direction
G03 Xx Zz Ii Kk
(or)
G03 Yy Zz Rr
O5678
N02 G21
N03 M03 S1000
N04 G00 X0 Y0
N05 G00 Z-10.0
N06 G01 X50.0
N07 G01 Y20.0
N08 G02 X25.0 Y45.0
R25.0
N09 G03 X-25.0
Y45.0 R25.0
N10 G02 X-50.0
Y20.0 R25.0
N11 G01 Y0.0
N12 G01 X0.0
N13 G00 Z10.0
N14 M05 M09
Program number
Metric programming
Spindle start clockwise with 1000rpm
Rapid motion towards (0,0)
Rapid motion towards Z=-10 plane
Linear interpolation
Linear interpolation
Circular interpolation clockwise(cw)
Circular interpolation counter clockwise(ccw)
Circular interpolation clockwise(cw)
Linear interpolation
Linear interpolation
Rapid motion towards Z=10 plane
Spindle stop and program end
discussed below.
30.1.1 Absolute programming (G90)
In absolute programming, all measurements are made from the part origin established by the
programmer and set up by the operator. Any programmed coordinate has the absolute value in
respect to the absolute coordinate system zero point. The machine control uses the part origin as
the reference point in order to position the tool during program execution (Figure 30.1).
In the above example, the program statements from N70 to N100 are repeated once when the statement N160 is
executed. Usually the G25 is used after a mirror statement. Illustrative example geometry and its program are given
below (Figure 30.3).
Example:
30.4 Mirroring
The mirroring command is used when features of components shares symmetry about one or more axes and are also
dimensionally identical. By using this code components can be machined using a single set of data and length of
programs can be reduced.
G10 cancellation of mirroring image
G11 Mirror image on X axis
G12 Mirror image on Y axis
G13 Mirror image on Z axis
Example:
G92 code is used to temporarily shift the origin to the reference point specified.
Example:
G92
X-100
Y-80
In the above statement the x and y values gives the present values of original origin after shifting it. This is
illustrated through an example (Figure 30.5).
Example:
30.6 Scaling
Scaling function is used to program geometrically similar components with varying sizes.
Syntax: G72 Kk, where k is the scaling factor.
The scaling command can be cancelled by using the statement G72 K1.0.
Example:
Pattern rotation is used to obtain a pattern of similar features. G73 code is used to rotate the
feature to form a pattern.
Syntax G73 Aa, where 'a' is the angle of rotation. This command is cumulative, and the angle
gets added up on time the program is executed. So all the rotational angle parameters should be
cancelled using the code G73.
The unconditional jump code G25 is used in conjunction with this code to achieve the desired
rotation.
The following example (Figure 30.7) depicts the case of a pattern which needs to be programmed
through G73.
Example:
two digits are used to call the particular tool and last two digits are used to represent tool offset in
the program. The tool offset is used to correct the values entered in the coordinate system preset
block. This can be done quickly on the machine without actually changing the values in the
program.
Using the tool offsets, it is easy to set up the tools and to make adjustments
Feed rate control
Cutting operations may be programmed using two basic feed rate modes:
1. Feed rate per spindle revolution
2. Feed rate per time
The feed rate per spindle revolution depends on the RPM programmed.
31. CNC Part Programming III
31.1 Tool radius Compensation
The programmed point on the part is the command point. It is the destination point of the tool. The point on the tool
that is used for programming is the tool reference point. These points may or may not coincide, depending on the
type of tool used and machining operation being performed. When drilling, tapping, reaming, countersinking or
boring on the machining center, the tool is programmed to the position of the hole or bore center - this is the
command point.
When milling a contour, the tool radius center is used as the reference point on the tool while writing the program,
but the part is actually cut by the point on the cutter periphery. This point is at 'r' distance from the tool center. This
means that the programmer should shift the tool center away from the part in order to perform the cutting by the tool
cutting edge. The shift amount depends upon the part geometry and tool radius. This technique is known as tool
radius compensation or cutter radius compensation.
In case of machining with a single point cutting tool, the nose radius of the tool tip is required to be accounted for, as
programs are being written assuming zero nose radius. The tool nose radius center is not only the reference point that
can be used for programming contours. On the tool there is a point known as imaginary tool tip, which is at the
intersection of the lines tangent to the tool nose radius.
Cutter compensation allows programming the geometry and not the toolpath. It also allows adjusting the size of the
part, based on the tool radius used to cut part. This is useful when cutter of the proper diameter is not found. This is
best explained in the Figure 31.1.
The information on the diameter of the tool, which the control system uses to calculate the required compensation,
must be input into the control unit's memory before the operation. Tool diameter compensation is activated by the
relevant
preparatory
functions
(G
codes)
as
shown
in
Figure
31.2.
Compensation for tool radius can be of either right or left side compensation. This can be determined by direction of
tool motion. If you are on the tool path facing direction of tool path and if tool is on your left and workpiece is on
your right side then use G41 (left side compensation). For, reverse use other code G42 (Right side compensation).
Both the codes are modal in nature and remain active in the program until it is cancelled by using another code, G40.
Offset Direction = Left (G41)
When activating cutter radius compensation, it must be ensured that the slides will first make a non-cutting move to
enable the correct tool and workpiece relation to be established. A similar move is necessary prior to cancellation of
the radius compensation. These non-cutting moves are referred as "ramp on" and "ramp off" respectively. Figure 31.3
shows the ramp on motion for different angles of approach.
Any frequently programmed order of instruction or unchanging sequences can benefit by becoming a subprogram.
Typical applications for subprogram applications in CNC programming are
Repetitive machining motions
Functions relating to tool change
Hole patterns
Pallet changing
Structurally, subprograms are similar to standard programs. They use the same syntax rules. The benefits of
subroutines involve the reduction in length of program, and reduction in program errors. There is a definition
statement and subroutine call function.
Standard sub-routine
N10
N20
N30
.
N70 G22 N5
N80
N90
.
N100 G24
.
N160 G20 N5
In the above example G22 statement defines the start block of the sub-routine and G24 marks the end of the subroutine statement. The subroutine is called by another code G20 identified by the label N5.
Parametric subroutine
..
..
..
G23 N18
G01 X P0 Y P1
..
..
G21 N18 P0=k10 P1=k20
In the above example G23 starts the subprogram label and starts the definition, and the parameters P0 , P1 are
defined for values of x and y. The G21 statement is used to call the subroutine and to assign the values to the
parameters.
The overall length and width of the pocket, rather than the distance of cutter motion, are programmed into this cycle.
The syntax is : G87 Xx Yy Zz Ii Jj Kk Bb Cc Dd Hh Ll Ss (This g code is entirely controller specific and the syntax
may vary between controller to controller).
Description:
x,y - Center of the part
z - Distance of the reference plane from top of part
i - Pocket depth
j,k - Half dimensions of the target geometry (pocket)
b - Step depth
c - Step over
d - Distance of the reference plane from top of part
h - Feed for finish pass
l - Finishing allowance
s - Speed
For machining a circular pocket, the same syntax with code G88 is used.
31.4.2 Turning Cycles
The G80 command will make the tool move in a series of rectangular paths cutting material axially until the tool tip
reaches target point P1 where the cycle ends as shown in figure 31.5. Cutting movements will be at the cutting feed
rate. All other movements will be at rapid traverse rate.
The syntax is G80 Xx Zz Ff
31.4.3 Roughing Cycle
In roughing cycle, the final finishing cycle profile is used to perform the roughing operation for the higher material
removal rate. The syntax for the roughing cycle is given below.
G81 Pp Qq Uu Ww Dd Ff Ss
31.5 The APT Programming Language The APT (Automatically Programmed Tool) programming language was
developed in early 1960s to assist engineers in defining the proper instructions and calculations for NC part
programming. A great strength of APT is its ability to perform precise calculations for complicated tool paths when
contouring on a three dimensional surface in a multi- axis programming mode. Now APT has become obsolete. Please
click here to know more about APT. Automatic generation of NC code is dealt in this page