DF Lecture 26-28
DF Lecture 26-28
DF Lecture 26-28
DIGITAL FABRICATION
Course Instructor:
Email: ankurgupta@iitj.ac.in
Lectures
on
“Computer control of manufacturing systems”
Computer assisted manufacturing: HOW?
• Most machines need control systems to operate. There are many kinds of control systems, for
example, manual control, automatic control, computer control or remote control.
• For the convenience of mass production, machines need to repeat precise, speedy and automatic
actions continuously. These machines may use mechanical, pneumatic and electrical systems to
control.
• However, some fixed procedures, changing procedures or tools may need a lot of time to restore
the whole system. As technology advances, electronic and computer technologies have been
applied to a lot of production machines to reduce the production time and increase both the
quality and efficiency. So, modern factories usually use numerical control machines, simply called
NC machines. And an NC machine that comes along with a computer is called a computer control
numerical machine, simply CNC machine.
• The production method that requires a computer to control the machines is called a computer
aided manufacturing, simply called CAM. CAM is closely related to the computer-aided design
(CAD) because the output information about the products from the CAD can assist the composing
of production program. Tests and productions can start immediately. This simplifies the
procedures from the designing to manufacturing of the product
Computer control of manufacturing systems
• Of course metals are hard and therefore high forces are required, first to feed the tool into the
work-piece and then to force relative motion between the tool and the work-piece so as to
remove the chips for which high power machines are employed.
• Relative motion between the cutting tool and the work-piece can be achieved by keeping
the work-piece stationary and moving the tool or by keeping the tool stationary and moving
the work-piece.
• The main function of a machine tool is to control the work-piece-cutting tool positional
relationship in such a way as to achieve a desired geometric shape of the work-piece with
sufficient dimensional accuracy.
• Actual machine tool movements are made up of one or more degrees of freedom which can
be combined to form various geometric shapes such as cylinders or flat surfaces.
Metal cutting machines
• Open Loop Control System: This type of control system is used with a special
motor called a stepper motor. In this control, signals in form of current pulses are
sent from the MCU to the individual motor being controlled.
• Each pulse results in a finite predetermined amount of revolution of the motor.
To cause a specified amount of movement, the control system determines how
many current pulses are required and sends precisely that number to the motor.
• Thus the control does not need to monitor specifically where the motor is
located; it is assumed that the required motion is achieved if the correct number
of pulses is sent.
• The control system needs to only keep track of how many revolutions the motor
has gone through, to know the motor’s position.
Close Loop Control
• Conventional variable speed DC motors (servos) are used in this type of control
system.
• DC motors have an important advantage of being able to generate very high
levels of torque, and they can in essence, be reversed instantly.
• However, they cannot be caused to move in a very precise amounts as stepper
motors can.
• In order to keep track of the position of the motor a separate position sensor,
called resolver, has to be fitted and the position information so determined is fed
back as signal to the controller.
• Because of this feedback, the system forms a closed loop.
• The positional information from the resolver is compared with the target position
and any errors are determined. Because DC motors can be reversed instantly, it is
possible to correct any positional error detected.
Programming of NC machines
• For a NC machine to accomplish the required machining operations, the
necessary data have to be entered into the MCU.
• The MCU can then convert the data into commands that can be issued to the
appropriate motors for the necessary functions to be executed.
• The series of data that is fed into the MCU to generate the required machine
tool commands is referred to as an NC part program.
• The process of writing an NC part program is called NC part programming and
the person responsible for writing this is a part programmer.
NOTE: A part program refers to the program required to machine a specific part
or component; it is not meant to suggest that the program is incomplete!
Programming of NC machines
• In writing the part program, the programmer generally starts with an engineering
drawing of the part to be made.
• This must be interpreted to determine the individual operations that should be
performed on the work-piece to produce the final component according to the
design specifications.
• It is the basis used to determine the order in which the operations should be
carried out, establish the cutting conditions to be used in each machining
operations , determine the associated non machining operations such as tool
changing, machine setup, coolant use etc. and select the appropriate jigs and
fixtures to be used to hold the workpiece as the machining is being done.
Basic of NC program
What moves?
1. Machining is achieved by digging the tool into the workpiece and causing relative
motion between the two.
2. For some machines the tool undergoes a primary motion, whereas for some
others the work-piece undergoes the primary motion.
3. When writing a part program it is always assumed that the tool undergoes the
primary motion.
4. Thus the part programmer does not have to remember which element moves for
which machine.
5. It is easier for the programmer to visualize motion of the tool relative to work-
piece during the programming stage.
6. If it is indeed the tool that moves relative to the work-piece, such as in turning
operations, the motions programmed are the motions that actually take place.
7. If it is the work-piece that moves relative to the tool, such as in milling, the
programmed motions have to be translated internally by the MCU to cause the
work-piece to move in such a way as to achieve the equivalent relative motion
that was programmed for the tool.
Basics of NC program
• An NC part program is made up of a series of commands that are input into the MCU
in a serial manner.
• The MCU interprets these commands and generates the necessary signals to each of
the drive units of the machine to accomplish the required action.
• The NC program is required to have a particular structure that the controller can
understand and it must follow a specific syntax.
• Commands are inputs into the controller in units called blocks or statements.
• Each block is made up of one or more machine commands.
• In general, several commands are grouped together to accomplish a specific
machining operation, hence the use of a block of information for each operation.
• Each command gives a specific element of control data, such as dimension or a feed
rate. Each command within a block is also called a word.
• The way in which words are arranged within the block is called block format.
• Three different block formats are commonly used, (Fixed sequential format, Tab
sequential format and Word address format)
Fixed Sequential Format
• This format is essentially the same as the fixed sequential format. The
difference is that each word within a block is preceded by a Tab character.
• The main improvement over fixed sequential format is that the Tab
character for a specified word need not be followed by a numeric data if
data are not required in that particular block or they are modal data.
• The Tab character indicates a beginning of a new word but does not
specify which type of word; therefore the sequence of the words remain
significant.
• Exhibit 6.2 is a repetition of the program represented in Exhibit 6.1 but
written in the Tab sequential format.
Word Sequential Format
• This is the format that is used on virtually all modern controllers and will be
explained in greater detail.
• With this type of format, each type of word is assigned as address that is
identified by a letter code within the part program.
• Thus the letter code specifies the type of word that follows and then its
associated numeric data is given.
• For example, the code T represents a tool number. Thus a word of the form
T01 would represent tool number 1.
• Theoretically, with this approach, the words in a given block can be entered in
any sequence and the controller should be able to interpret them correctly.
Review of previous topic:
Basics of NC machining
Structure of NC part program
Different block formats:
fixed sequential, tab sequential and word address format
Word Address Format
• The American National Standards institute (ANSI) has established a standard method of
specifying word address data for any controller, which has been adopted by most
manufacturers. A typical specification might look as follows:
• Within the specification, a letter identifies a specific type of word as in Table . A + symbol
after the letter indicates that sign is significant for the associated numeric data.
• Generally, a positive sign is assumed if numeric data have no sign specified. If one numeral
follows the letter, the data for that word are of integer form with upto the number of
digits specified by the numeral.
• If the letter (and the associated sign wherever applicable) is followed by two numerals, the
data for that word are real numbers.
• The decimal point is not to be programmed explicitly; its position is inferred by counting
the number of digits in the actual data associated with the word, counting from the right.
• The second numeral in the specification gives the number of digits to count in the data
before the decimal point.
Word Address Format
• The first step in writing an NC part program is to determine and organize the
data that will be used within the program.
• A fully coded NC part program generally consists of five broad categories or
classes of command. These are the following:
1. Preparatory functions: These are used to inform the MCU of the
requirements for the machining that is to be carried out and thus to establish
the necessary operating conditions.
2. Axis motion commands: These are used to control the amount of relative
motion between the cutting tool and workpiece along each machine axis.
3. Feed and speed commands: These are used to set and control the cutting
conditions for individual machining operations.
4. Identification commands: These are used to identify specific entities in the
program, such as cutting tools used.
5. Miscellaneous Commands: These are used to control various other aspects of
the machine’s operation not addressed elsewhere, such as turning the
spindle on and off and changing tools.
Preparatory Functions
• Preparatory functions form the largest class of commands used in NC
programs.
• They are identified by the word address letter ‘G’ followed by two digits.
• The digits specify the particular type of function.
• The combination is referred to as a ‘G’ code.
• In general preparatory functions have the effect of making the MCU assume
specific operating conditions or command the controller to perform the next
task in a particular manner.
• Preparatory functions generally take effect before execution of other
commands within the block in which the function is programmed.
• It is usually permissible to program more than one preparatory word in a block
provided the words do not have a conflicting effects.
Preparatory functions
• Most preparatory functions are modal. Efforts have been
made to standardize NC commands and the table below
show some widely used standard ‘G’ codes. There are about
97 ‘G’ codes that are used.
The effect of any one of these canned cycles is cancelled by programming a G80
function.
Axis Motion Commands
• Axis motion commands are used to specify the axes that are required to move
during the execution of a given command.
• They are made up of a letter specifying an axis such as x, followed by dimensional
information associated with the motion of the axis in question.
• The X,Y, and Z commands, respectively, specify the motion of the cartesian
coordinates themselves; I,J and K values specify the offset relative to x,y,and z axes.
• Some controllers support the use of polar coordinates, in which case R and A axes
are used to specify the radial and angular directions, respectively.
• The dimensional data associated with an axis command can represent absolute
dimensions (if G90 was specified) or they may be incremental values (if G91 was
specified)
• The dimensional data associated with the axis commands consists of real numbers
that may or may not have a sign associated with them.
• An important point to remember is that the axis commands guide the motion of
the point defining the tool position. For some operations, such as profile milling,
the periphery of the cutter moves along the surface to be machined, rather than
the tool-point (i.e., center of the cutter)
Axis motion commands
• Thus the actual motion of the tool has to be along a path different from the geometry of
the machined surface. This difference is called a tool offset which the programmer has to
consider when writing the program.
• Most modern controllers can be programmed using an offset tool by applying a
compensation factor called cutter compensation.
• With this approach one the offset between the tool point and the machined surface is
specified, the tool motion can be programmed as if the tool point followed the actual
machined surface.
• The controller adjusts internally for the difference in the actual path followed by the tool
point.
• Cutter compensation is programmed using G41 and G42 codes and cancelled using G40
code.
Feed and speed commands
• Feed and speed commands are used to specify the feed rate and speed to use
during the machining operation.
• The feed command is specified by the address script ‘F’ followed by the
numerical value of the feed rate required; the speed command is specified by
the address word ‘S’ followed by the required speed.
• The feed rate and the speed used during the machining are of crucial
importance in determining how long it will take to make a part.
• The units for cutting conditions can be specified in a variety of ways in the NC
program. The feed rate may be specified directly in units/ min. or units/rev.,
where the units may be in inches or millimeters.
• The preparatory functions G92-G98 are used to designate how the cutting
conditions are to be specified.
Identification commands
• Identification commands are used within a NC program for the simple task of being able to
identify certain entities within the program.
• The ‘N’ word is the most widely used identification command and it is used to identify
individual blocks within the program.
• The identification data in this case consist of integer numbers written in a format given as
part of the machine specification.
• Usually three or four digits are used and leading or trailing zeros are not suppressed.
• The ‘N’ word is purely for the convenience of human writing or using the program, so that
they can distinguish between the various blocks in the program.
• The MCU itself does not use the data contained in the ‘N’ word.
• Because the controller does not use the block identification data, it is not strictly
necessary to number the blocks in any particular order.
• However, for the convenience of the human users, blocks are generally numbered in
ascending order, with increments of 5 or 10 between consecutive blocks.
• The reason for having increments of 5 or 10 is that, when necessary, additional blocks may
be inserted in the program while maintaining the generally ascending order in which
blocks are numbered.
Identification Commands
• The other widely used command is the ‘T’ word.
• This is used to identify individual cutting tools used within the program.
• For most components, more than one tool is needed to complete the
machining operations needed to make the part.
• For many NC machines, multi-station tool turret or tool magazines housing
several cutting tools are used.
• The programmer uses the ‘T’ word to specify to the controller regarding
the various tools available should be used for a particular machining
operation.
• The format of ‘T’ word usually consists of two unsigned digits after ‘T’.
• Other identification commands are used to identify special sections of the
part program, such as loops and macros, that can be executed more than
once during the running of the program.
Miscellaneous Commands
• Miscellaneous commands are used to control a variety of machine functions
that are not covered by the other commands.
• The address word ‘M’ followed by two unsigned digits is used to specify
miscellaneous commands.
• Examples of functions controlled by miscellaneous commands are turning the
spindle on and off, turning coolant on and off, initiating a tool change,
clamping and unclamping the work-piece interrupting and restarting program
execution, stopping the program and rewinding the program.
Miscellaneous Commands
• Generally, miscellaneous commands
take effect after execution of the other
commands in the block in which they
are programmed.
• It is usually permissible to program
more than one miscellaneous command
in a given block provided they do not
have conflicting effects.
• Many of the ‘M’ codes have been
assigned standardized functions. Some
‘M’ codes are given in the table :
Special Characters
• In addition to the commands outlined in the preceding pages, certain special characters
are used in NC part programs to achieve special effects.
•Some of these special characters are used with all controllers, but others are particular to
specific controllers.
•These characters include the % sign, common to all controllers, which is used as the first
line of the NC program.
•The character signals the controller when the beginning of the program has been reached
during a rewind of the program, an end of block character is used at the end of each block
of the program.
•This special character is produced by hit of a carriage return on a keyboard.
•The character itself does not print when the program is printed.
•During coding , the end-of-block is frequently represented by * symbol or the letters EOB.
Example of NC code
Write an NC program to machine a ½ in. wide L-shaped slot in a mild steel workpiece with
dimensions 3X2.5X0.75 in as shown in Figure:
Assumptions:
1. The top lower left corner will be used for program zero.
2. Machining motion will start in the indicated position.
3. The tool is ¼ in. above the top surface of the part prior to start of machining.
4. The tool diameter used is ½ in., so only one pass is required.
5. A cutting speed of 500 rpm and feed rate of 10in./ min are used for machining.
6. Machine specification: N3G2X + 43Y + 43Z+ 43R+ 43F4S4T2M2
Review of previous lectures
• Basics of NC program
• Absolute and incremental positioning.
• Types of block formats (Fixed sequential method, tab
sequential format, word format)
• Word address format
• Preparatory functions, axis motion commands, Feed and
speed commands, Identification commands and
Miscellaneous commands.
• G-code, Canned cycles
• Special characters.
Example
Example of NC code
Write an NC program to machine a ½ in. wide L-shaped slot in a mild steel workpiece with
dimensions 3X2.5X0.75 in as shown in Figure:
Assumptions:
1. The top lower left corner will be used for program zero.
2. Machining motion will start in the indicated position.
3. The tool is ¼ in. above the top surface of the part prior to start of machining.
4. The tool diameter used is ½ in., so only one pass is required.
5. A cutting speed of 500 rpm and feed rate of 10in./ min are used for machining.
6. Machine specification: N3G2X + 43Y + 43Z+ 43R+ 43F4S4T2M2
Solution
Solution
Example of NC Code
Solution
Solution
Example problem of NC Code
Solution
Solution
Example problem of NC code
Solution
Solution
Solution
Solution
Advanced Features
• With the progress in controller capabilities, several advanced features are
becoming available on NC machines.
• Among these are the following:
1. Ability to take a portion of the program and execute it in a rotated or mirrored
position.
2. Ability to scale the program and produce larger or smaller features than those
programmed.
3. Capabilities such as three dimensional circular interpolation, helical
interpolation, parabolic and cubic interpolation for producing free form
designs.
4. Ability to execute part of the program more than once.
Loading the program
• For the NC program to be executed, it has to be loaded into the MCU.
• One of the most widely used methods of program storage among the various
methods used in the 1in.-wide punched paper tape.
• Punched tape uses a binary based representation code that is efficient for the
machine to read and provides a compact storage medium.
• Numbers in the program are represented in a modified binary form called binary
coded decimal. Non numeric characters are also assigned specific codes in this
representation scheme.
• The digit ‘1’ in the BCD representation of a number is represented by a punched
hole on the tape, whereas the digit ‘0’ is represented by the absence of a hole.
Loading the program
• BCD is slightly less efficient for data storage than pure binary but is easier for
humans to interpret if need arises.
• Two standard coding schemes have emerged and are widely used in industry.
• One is the electronic Industries Association (EIA) standard RS-244A and the
other is the American standard code for information interchange (ASCII)
standard.
• With each standard a character is represented by a series of holes punched
across the width of the tape.
• Each character is represented by a specific pattern of holes. A total of eight
tracks are available across the width of the tape for punching holes.
Loading of the program
• In each coding scheme, one of the eight channels is reserved for checking
the accuracy of the punched information.
•This is done by using a scheme called parity check.
•The EIA scheme uses odd parity which requires every row of the tape to
have an odd number of punched holes.
•If the character represented in that row in fact has an odd number of ones,
nothing needs to be done.
•If, however the actual no. of holes (or ones) for a particular character is
even, an extra hole is punched in the parity channel so that this, together
with the holes for the character , results in an odd no. of holes.
Loading of the program
•Thus, the system can make a rough check on the accuracy of the
punched data by counting the no. of holes.
•For example, if an even number of holes is found in a given row
of the tape in this case, it is recognized as an error.
•The ASCII scheme follows the same logic but uses even parity.
Conventional Numerical Control
• With the conventional numerical control, once the program is on tape, it is read into the
MCU by a tape recorder on the controller.
•The program is read and executed one block at a time.
•At the end of the program, the tape is physically rewound to get ready for machining the
next component. (Remember the % and EOB as indicators)
•The tape then has to be stored if it is to be used for making more parts in the future.
•Perforated paper tape is fragile and can be difficult to handle and store conveniently,
especially at a facility with large number of programs of different lengths.
•Another problem is that if a program has to be altered for example because of program
errors or engineering changes, the complete tape must be replaced.
•Once a program has been verified and there are no errors in it, a more durable material
such as Mylar is sometimes used for the production tape.
•Another important aspect of conventional numerical control is that, in general, the MCU
has only a limited range of capabilities.
•Most of the functionality of the controller is fixed in the way the controller is built; in
other words, the various capabilities are hardwired and cannot be changed.
•For example, some early NC controllers were capable of incremental programming but not
absolute programming; others were capable of linear interpolation but not circular
interpolation.
•The greater the range of capabilities desired in a given controller, the more expensive it
was to buy.
Consequently, the buyer had to make a trade-off between the cost and
usefulness of various option.
(i) The cost of the machine is so high that some small factories may not be able to afford.
(ii) Operators need to be trained to compose computer control program.
(iii) The control system is complicated and sophisticated, therefore the maintenance cost is high.