Beruflich Dokumente
Kultur Dokumente
Introduction
to
CNC
Machines
INTRODUCTION
Numerical control for machines .tools were introduced in 1950s by Prof.John T Parsons. The first NC machine
was built at the Massachusetts institute of Technology in 1953 by joint efforts of US Air Force, the MIT and
parsons cooperation. NC is control by numbers .NC is control recorded information called part program, which
is set of coded instructions given as numbers for automatic control of am machine in a pre-determined
sequence.
Numerical control can be defined as a technique of controlling a machine tool by the direct insertion of
numerical data at some point of the system .The functions that are controlled on the machine tool are
displacement of the slide members, spindle speeds ,tool selection etc.At first ,the numerical control was used to
produce geocentrically complex parts ,but later used for added efficiency in medium batch production of turned
and milled parts presently, Numerical control is employed in all sectors of production .
Rapid development in the field of electronics such as integrated circuit, large scale integrated circuits and
development of minicomputer lead to the development of minicomputers based CNC systems. Further
development and the electronic chip revolution have ushered in the current generation compact and
powerful Microprocessor based CNC systems.
Development of computer numerically controlled (CNC) machines is an outstanding contribution to the
manufacturing industries. It has made possible the automation of the machining process with flexibility to
handle small to medium batch of quantities in part production.
Initially, the CNC technology was applied on basic metal cutting machine like lathes, milling machines, etc.
Later, to increase the flexibility of the machines in handling a variety of components and to finish them in a
single setup on the same machine, CNC machines capable of performing multiple operations were developed.
To start with, this concept was applied to develop a CNC machining centre for machining prismatic components
combining operations like milling, drilling, boring and taping. Further, the concept of multi-operations was also
extended for machining cylindrical components, which led to the development of turning centers.
Computer Numerical Control (CNC) is a specialized and versatile form of Soft Automation and its
applications cover many kinds, although it was initially developed to control the motion and operation of
machine tools.
Computer Numerical Control may be considered to be a means of operating a machine through the use of
discrete numerical values fed into the machine, where the required 'input' technical information is stored on a
kind of input media such as floppy disk, hard disk, CD ROM, DVD, USB flash drive, or RAM card etc.
The machine follows a predetermined sequence of machining operations at the predetermined speeds
necessary to produce a workpiece of the right shape and size and thus according to completely predictable
results. A different product can be produced through reprogramming and a low-quantity production run of
different products is justified.
Higher flexibility
Increased productivity
Consistent quality
Reduced scrap rate
Reliable operation
Reduced non productive time
Reduced manpower
Shorter cycle time
High accuracy
Reduced lead time
Just in time (JIT) manufacture
Automatic material handling
Lesser floor space
Increased operation safety
Machining of advanced material
CNC SYSTEMS
INTRODUCTION
Numerical control (NC) is a method employed for controlling the motions of a machine tool slide and its
auxiliary functions with input in the form of numerical data. A computer numerical control (CNC) is a
microprocessor-based system to store and process the data for the control of slide motions and auxiliary
functions of the machine tools. The CNC system is the heart and brain of a CNC machine which enables the
operation of various machine members such as slides, spindles, etc. as per the sequence programmed into it,
depending on the machining operations.
The main advantage of a CNC system lies in the fact that the skills of the operator hitherto required in the
operation of a conventional machine is removed and the part production is made automatic.
The CNC systems are constructed with a NC unit integrated with a programmable logic controller (PLC) and
some times with an additional external PLC (non-integrated). The NC controls the spindle movement and the
speeds and feeds in machining. It calculates the traversing path of the axes as defined by the inputs. The PLC
controls the peripheral actuating elements of the machine such as solenoids, relay coils, etc. Working together,
the NC and PLC enable the machine tool to operate automatically. Positioning and part accuracy depend on the
CNC system's computer control algorithms, the system resolution and the basic mechanical machine accuracy.
Control algorithm may cause errors while computing, which will reflect during contouring, but they are very
negligible. Though this does not cause point to point positioning error, but when mechanical machine
inaccuracy is present, it will result in poorer part accuracy.
Computer Numerical Control (CNC) is a specialized and versatile form of Soft Automation and its
applications cover many kinds, although it was initially developed to control the motion and operation of
machine tools.
Computer Numerical Control may be considered to be a means of operating a machine through the use of
discrete numerical values fed into the machine, where the required 'input' technical information is stored on a
kind of input media such as floppy disk, hard disk, CD ROM, DVD, USB flash drive, or RAM card etc. The
machine follows a predetermined sequence of machining operations at the predetermined speeds
necessary to produce a work piece of the right shape and size and thus according to completely predictable
results. A different product can be produced through reprogramming and a low-quantity production run of
different products is justified.
Control Systems
Open Loop Systems :
Open loop systems have no access to the real time data about the performance of the system and therefore no
immediate corrective action can be taken in case of system disturbance. This system is normally applied only to
the case where the output is almost constant and predictable. Therefore, an open loop system is unlikely
to be used to control machine tools since the cutting force and loading of a machine tool is never a constant. The
only exception is the wirecut machine for which some machine tool builders still prefer to use an open loop
system because there is virtually no cutting force in wirecut machining.
CNC system
PL
C
Servo Drive
Servo Motor
Encoder
NC
Command
value
Tacho
Generator
Velocity
Feedback
Lead
Screw
Table
Position Feedback
Tape Reader
Tape Punch
Other Devices
Inputs
Outputs
Machine
Elements
Proximity switches
Limit switches
Relay coils
Pressure switches
Float switches
Input Device
Machine Control Unit
Machine Tool
Driving System
Feedback Devices
Display Unit
Input Devices
a. Floppy Disk Drive
Work piece
Floppy disk is a small magnetic storage device for CNC data input. It has been the most
common storage media up to the 1970s, in terms of data transfer speed, reliability, storage
size, data handling and the ability to read and write. Furthermore, the data within a
floppy could be easily edited at any point as long as you have the proper program to read it.
However,this method has proven to be quite problematic in the long run as floppies have
a tendency to degrade alarmingly fast and are sensitive to large magnetic fields and as well
as the dust and scratches that usually existed on the shop floor.
c. Serial communication
The data transfer between a computer and a CNC machine tool is often accomplished
through a serial communication port.
established so that information can be exchanged in an orderly way. The most common
interface between computers and CNC machine tools is referred to the EIA Standard RS-232.
Most of the personal computers and CNC machine tools have built in RS232 port and a
standard RS-232 cable is used to connect a CNC machine to a computer which enables the
data transfer in reliable way.
communication software.
leave room for other sections. This method is commonly used for machine tools that do not
have enough memory or storage buffer for large NC part programs.
Distributed Numerical Control is a hierarchical system for distributing data between a
production management computer and NC systems. (ISO 2806:1994) The host computer is
linked with a number of CNC machines or computers connecting
machines
for
downloading
part
programs.
to
the
CNC
computer can utilize two-way data transfer features for production data communication
including: production schedule, parts produced and machine utilization etc.
10
11
Machine Tool
This can be any type of machine tool or equipment. In order to obtain high accuracy and repeatability, the
design and make of the machine slide and the driving lead screw of a CNC machine is of vital importance. The
slides are usually machined to high accuracy and coated with anti-friction material such as PTFE and Turcite in
order to reduce the stick and slip phenomenon. Large diameter recirculating ball screws are employed to
eliminate the backlash and lost motion. Other design features such as rigid and heavy machine structure; short
machine table overhang, quick change tooling system, etc also contribute to the high accuracy and high
repeatability of CNC machines.
12
Ball Screw in a CNC machine
Driving System
The driving system is an important component of a CNC machine as the accuracy and repeatability depend very
much on the characteristics and performance of the driving system. The requirement is that the driving system
has to response accurately according to the programmed instructions. This system usually uses electric motors
although hydraulic motors are sometimes used for large machine tools. The motor is coupled either directly or
through a gear box to the machine lead screw to moves the machine slide or the spindle. Three types of
electrical motors are commonly used.
a. DC Servo Motor
This is the most common type of feed motors used in CNC machines. The principle of operation is based on the
rotation of an armature winding in a permanently energized magnetic field. The armature winding is
connected to a commutator, which is a cylinder of insulated copper segments mounted on the shaft. DC current is
passed
to
the
commutator
through
carbon
brushes,
which
are
connected
to
the
machine terminals. The change of the motor speed is by varying the armature voltage and the control of
motor torque is achieved by controlling the motor's armature current. In order to achieve the necessary
dynamic behaviour it is operated in a closed loop system equipped with sensors to obtain the velocity and
position feedback signals.
13
DC Servo Motor
b. AC Servo Motor
In an AC servomotor, the rotor is a permanent magnet while the stator is equipped with 3-phase
windings. The speed of the rotor is equal to the rotational frequency of the magnetic field of the stator, which is
regulated by the frequency converter. AC motors are gradually replacing DC servomotors. The main reason is
that there is no commutator or brushes in AC servomotor so that maintenance is virtually not required.
Furthermore, AC servos have a smaller power-to-weight ratio and faster response.
14
AC Servo Motor
c. Stepping Motor
A stepping motor is a device that converts the electrical pulses into discrete mechanical rotational
motions of the motor shaft. This is the simplest device that can be applied to CNC machines since it can
convert digital data into actual mechanical displacement. It is not necessary to have any analog-todigital converter nor feedback device for the control system. They are ideally suited to open loop systems.
However, stepping motors are not commonly used in machine tools due to the following drawbacks: slow
speed, low torque, low resolution and easy to slip in case of overload. Examples of stepping motor application
are the magnetic head of floppy-disc drive and hard disc drive of computer, daisy-wheel type printer, X-Y tape
control, and CNC EDM Wire-cut machine.
15
Stepping Motor
Feedback Device
In order to have a CNC machine operating accurately, the positional values and speed of the axes need to be
constantly updated. Two types of feedback devices are normally used positional feedback device and velocity
feedback device.
16
Linear Transducers
A linear transducer is a device mounted on the machine table to measure the actual displacement of the
slide in such a way that backlash of screws; motors, etc would not cause any error in the feedback data. This
device is considered to be of the highest accuracy and also more expensive in comparison with other measuring
devices mounted on screws or motors.
Linear Transducer
Rotary Encoders
A rotary encoder is a device mounted at the end of the motor shaft or screw to measure the angular
displacement. This device cannot measure linear displacement directly so that error may occur due to the
backlash of screw and motor etc. Generally, this error can be compensated for by the machine
builder in the machine calibration process.
17
18
Tachogenerator
19
Display Unit
The Display Unit serves as an interactive device between the machine and the operator. When the machine is
running, the Display Unit displays the present status such as the position of the machine slide, the spindle
RPM, the feed rate, the part programmes, etc. In an advanced CNC machine, the Display Unit can show the
graphics simulation of the tool path so that part programmes can be verified before the actually
machining. Much other important information about the CNC system can also displayed for maintenance and
installation work such as machine parameters, logic diagram of the programmer controller, error massages and
diagnostic data.
Servo Drive
A servo drive consists of a servo amplifier and a servo motor. The main task of a servo amplifier (also called
amplifier, servo controller, or just controller) is the control of the motor current. In addition, ESR servo
amplifiers offer a broad spectrum of functionality
While most of the electrical drives are operated at constant speed, a servo drive has a rather "hectic" life. Often
it has to accelerate to the rated speed within a few milliseconds only to decelerate a short time later just as
quick. And of course the target position is to be reached exactly with an error of a few hundredths of a milli
-meter.
Compared to other controlled drives servo drives have the advantage of high dynamics and accuracy, full stall
torque, and compact motors with high power density.
Servo drives are used where high dynamics (i. e. fast acceleration and deceleration) and good accuracy at
reaching target positions are important. The good control behaviour allows the optimal adaptation to the
application (e. g. positioning without overshoot). But also the smooth run (due to sinusoidal commutation) and
the possibility of exact synchronisation of two or more drives open a wide field. Because of their wide speed
range servo drives can be used in a huge number of applications.
20
Servo drives run in large, highly automated installations with several dozens of axes as well as in machines with
only a few axes which perhaps operate independently.
Servo motor
Servo motors are electric motors that are designed specially for high dynamics. Servo motors by ESR
distinguish themselves by a compact design with high power density and a high degree of protection (up to IP
65). They come as AC servo motors (brush less) or DC servo motors (with brushes for the commutation). The
high power density is achieved by permanent magnets made of neodymium-iron-boron (NdFeB), samariumcobalt (SmCo), or ferrite material. The servo motor is equipped with a position sensor which provides the
controller with position and speed information.
As a standard, the AC servo motors are equipped with resolvers. In combination with the digital servo
amplifiers sincos encoders (absolute encoder, single-turn or multi-turn) and high-resolution incremental
encoders may be used as well, in case higher accuracy or dynamics is required. The DC servo motors can be
equipped with tacho generators and/or incremental encoders. For dimensioning the motor the following data
are important: the mass of the parts to be moved, the cycle time of the application, and the friction torque. With
these data the rated and peak torque (maximum acceleration or deceleration) and the rated speed can be
calculated. If required, gears are used to match the moment of inertia of the motor to the moment of inertia of
the application.
Servo amplifier
The servo amplifier (also called amplifier, servo controller, or just controller) controls the current of the motor
phases in order to supply the servo motor with exactly the current required for the desired torque and the desired
speed. The essential parts of a servo amplifier are the power section and the control loops.
The power section consists of a mains rectifier, a DC-bus, and a power circuit which supplies the individual
motor phases with current.
21
The control loops (analogue or digital) drive the power circuit and by constantly comparing setpoint with actual
values ensure that the motor keeps exactly to the desired motions even under varying load.
SINUMERIK
SIEMENS
SYSTEM 3
LSMLogic Sub
module
LSM2
LSM1
Emergency Stop
X+
Z-
Z+
Machine
Control
Panel
XPOWER
ON
Cycle
Machine
Control
Panel
Expansion
Power
Supply
PLC 2, external
NC
PLC1
Logic Unit
Tape Puncher
Fig.2Tape
Typical
Readernumerical control configuration of Hinumerik 3100 CNC system
22
Fig.4 shows a typical Hinumerik 3100 CNC system's operator control panel. The operator control panel
provides the user interface to facilitate a two-way communication between the user, CNC system and the
machine tool. This consists of two parts:
Keyboard
The VDU displays the status of the various parameters of the CNC system and the machine tool. It displays all
current information such as:
Actual position value, set or actual difference, current feed rate, spindle speed
Active G functions
Display of all entered data, user programs, user data, machine data, etc.
In addition to a CRT, a few LEDs are generally provided to indicate important operating modes and status.
Video display units may be of two types:
23
SINUMERIK
SIEMENS
SYSTEM 3
Emergency Stop
X+
Z-
Z+
X-
POWER
ON
Cycle
Program in progress
Feed hold
Position not yet reached
(Machine in motion)
Basic
Alarmdisplay
Tool compensation
CRT
Zero offset
Test
Part program
LED-indicator
For assignment
Of keys
Change to actual
value display
Change of display
Leaf forwards
Leaf backwards
Right-Left Cursor
Address
Reset changeover
Keys/Numerical
keyboard
Assignment of keys
Cancel word
Alter word
Enter word
Change over to
customer display
Operator guidance
Yes,No
Delete input
Start
24
Keyboard
A keyboard is provided for the following purposes:
For these tasks, the system must be operated in specific operating mode so that these preparatory functions can
be established.
25
Spindle speed
override
Feedrate/rapid traverse
override
Emergency Stop
Direction keys
Spindle
OFF ON
X+
Z-
Z+
Feed
Hold/Start
X-
Cycle start
POWER
ON
NC ON
Key operated
switch for input
inhibit
Cycle
Single
block
Block search
Manual mode
Automatic mode
Reference mode
Input mode
26
Manual mode:
In this mode, movement of a machine slide can carried out manually by pressing the particular jog button (+
or -). The slide (axis) is selected through an axis selector switch or through individual switches (e.g., X+, X-,
Y+, Y-, Z+, Z-, etc.). The feed rate of the slide movement is prefixed. CNC system allows the axis to be jogged
at high feed rate also. The axis movement can also be achieved manually using a hand wheel interface instead
of jog buttons. In this mode slides can be moved in two ways:
Continuous
Incremental
Continuous mode: In This mode, the slide will move as long as the jog button is pressed.
Incremental mode: Hence the slide will move through a fixed distance, which is selectable. Normally, system
allows jogging of axes in 1, 10, 100, 1000, 10000, increments. Axis movement is at a prefixed feed rate. It is
initiated by pressing the proper jog+ or jog- key and will be limited to the no of increments selected even if the
jog button is continuously pressed. For subsequent movement the jog button has to be released and once again
pressed.
Manual Data Input (MDI) Mode
27
Teach-in
Some system allows direct manual input of a program block and execution of the same. The blocks thus
executed can be checked for correctness of dimensions and consequently transferred into the program memory
as part program.
Playback
In setting up modes like jog or incremental, the axis can be traversed either through the direction keys or via the
hand wheel, and the end position can be transferred into the system memory as command values. But the
required feed rates, switching functions and other auxiliary functions have to be added to the part program in
program editing mode.
Thus, teach-in and playback operating method allows a program to created during the first component prove
out.
Automatic Mode (Auto and Single Block)
In this mode the system allows the execution of a part program continuously. The part program is executed
block by block. While one block is being executed, the next block is read by the system, analyzed and kept
ready for execution. Execution of the program can be one block after another automatically or the system will
execute a block, stop the execution of the next block till it is initiated to do so (by pressing the start button).
28
Selection of part program execution continuously (Auto) or one block at a time (Single Block) is done through
the machine control panel.
Many systems allow blocks (single or multiple) to be retraced in the opposite direction. Block retrace is allowed
only when a cycle stop state is established. Part program execution can resume and its execution begins with the
retraced block. This is useful for tool inspection or in case of tool breakage. Program start can be effected at any
block in the program, through the BLOCK SEARCH facility.
Reference Mode
Under this mode the machine can be referenced to its home position so that all the compensations (e.g., pitch
error compensation) can be properly applied. Part programs are generally prepared in absolute mode with
respect to machine zero. Many CNC systems make it compulsory to reference the slides of the machine to their
home positions before a program is executed while others make it optional.
In this mode, the part programs, machine setup data, tool offsets, etc. can be loaded/unloaded into/from the
memory of the system from external devices like programming units, magnetic cassettes or floppy discs, etc.
During data input, some systems check for simple errors (like parity, tape format, block length, unknown
characters, program already present in the memory, etc.). Transfer of data is done through a RS232C or RS422C
port.
Other Peripherals
29
These include sensor interface, provision for communication equipment, programming units, printer, tape
reader/puncher interface, etc.
INTERFACING
Interconnecting the individual elements of both the machine and the CNC system using cables and connectors is
called interfacing.
Extreme care should be taken during interfacing. Proper grounding in electrical installation is most essential.
This reduces the effects of interference and guards against electronic shock to personnel. It is also essential to
properly protect the electronic equipment.
Cable wires of sufficiently large cross-sectional area must be used. Even though proper grounding reduces the
effect of electrical interference, signal cable requires additional protection. This is generally achieved by using
shielded cables. All the cable shields must be grounded at control only, leaving other end free. Other noise
reduction techniques include using suppression devices, proper cable separation, ferrous metal wire ways, etc.
Electrical enclosures should be designed to provide proper ambient conditions for the controller.
MONITORING
In addition to the care taken by the machine tool builder during design and interfacing, basic control also
includes constantly active monitoring functions. This is in order to identify faults in the NC, the interface
control and the machine at an large stage to prevent damages occurring to the work piece, tool or machine. If a
fault occurs, first the machining sequence is interrupted, the drives are stopped, the cause of the fault is stored
30
and then displayed as an alarm. At the same time, the PLC is informed that an NC alarm exits. In Hinumerik
CNC system, for example, the following can be monitored:
Read-in
Format
Contour
Spindle speed
Enable signals
Voltage
Temperature
Microprocessors
Serial interfaces
DIAGNOSTICS
The control will generally be provided with test assistance for service purposes in order to display some status
on the CRT such as:
31
Interface signals between NC and PLC as well as between PLC and machine
For the output signals, it is also possible to set and generate signal combinations for test purposes in order to
observe how the machine react to a changed signal. This simplifies trouble shooting considerably.
MACHINE DATA
Generally, a CNC system is designed as a general-purpose control unit, which has to be matched with the
particular machine to which the system is interfaced. The CNC is interfaced to the machine by means of data,
which is machine specific. The NC and PLC machine data can be entered and changed by means of external
equipment or manually by the keyboard. These data are fixed and entered during commissioning of the machine
and generally left unaltered during machine operations.
Machine data entered is usually relevant to the axis travel limits, feed rates, rapid traverse speeds and spindle
speeds, position control multiplication factor, Kv factor, acceleration, drift compensation, adjustment of
reference point, backlash compensation, pitch error compensation, etc. Also the optional features of the control
system are made available to the machine tool builder by enabling some of the bits of machine data.
32
CNC machines are widely used in the metal cutting industry and are best used to produce
the following types of product:
machines
Some common types of CNC machines and instruments used in industry are as
following:
Drilling Machine
Grinding Machine
33
Industrial Robot
PLC PROGRAMMING
Programmable Logic Controller (PLC)
A PLC matches the NC to the machine. PLCs were basically introduced as replacement for hard wired relay
control panels. They were developed to be reprogrammed without hardware changes when requirements were
altered and thus are reusable. PLCs are now available with increased functions, more memory and large
input/output capabilities. Fig.7 gives the generalized PLC block diagram.
In the CPU, all the decisions are made relative to controlling a machine or a process. The CPU receives input
data, performs logical decisions based upon stored programs and drives the outputs. Connections to a computer
for hierarchical control are done via the CPU.
34
The I/O structure of the PLCs is one of their major strengths. The inputs can be push buttons, limit switches,
relay contacts, analog sensor, selector switches, proximity switches, float switches, etc. The outputs can be
motor starters, solenoid valves, position valves, relay coils, indicator lights, LED displays, etc.
The field devices are typically selected, supplied and installed by the machine tool builder or the end user. The
voltage level of the field devices thus normally determines the type of I/O. So, power to actuate these devices
must also be supplied external to the PLC. The PLC power supply is designated and rated only to operate the
internal portions of the I/O structures, and not the field devices. A wide variety of voltages, current capacities
and types of I/O modules are available.
The principle of operation of a PLC is determined essentially by the PLC program memory, processor, inputs
and outputs.
The program that determines PLC operation is stored in the internal PLC program memory. The PLC operates
cyclically, i.e. when a complete program has been scanned, it starts again at the beginning of the program. At
the beginning of each cycle, the processor examines the signal status at all inputs as well as the external timers
and counters and are stored in a process image input (PII). During subsequent program scanning, the processor
the accesses this process image.
To execute the program, the processor fetches one statement after another from the programming memory and
executes it. The results are constantly stored in the process image output (PIO) during the cycle. At the end of a
scanning cycle, i.e. program completion, the processor transfers the contents of the process image output to the
output modules and to the external timers and counters. The processor then begins a new program scan.
Programming
Units
Tape
Reader
Tape
Puncher
Printers
35
Inputs
Processor
Programmer
Logic
memory
Storage
memory
Power
Supply
Outputs
Power
Supply
Field
Devices
A digitally operating electronic apparatus which uses a programmable memory for the internal
storage of instructions by implementing specific functions such as logic sequencing, timing,
36
counting, and arithmetic to control, through digital or analog input/output modules, various types of
machines or processes.
Traditional PLC Applications
*In automated system, PLC controller is usually the central part of a process control system.
*To run more complex processes it is possible to connect more PLC controllers to a central computer.
Disadvantages of PLC control
- Too much work required in connecting wires.
- Difficulty with changes or replacements.
- Difficulty in finding errors; requiring skillful work force.
- When a problem occurs, hold-up time is indefinite, usually long.
Advantages of PLC control
* Rugged and designed to withstand vibrations, temperature, humidity, and noise.
* Have interfacing for inputs and outputs already inside the controller.
* Easily programmed and have an easily understood programming language.
Major Types of Industrial Control Systems
Industrial control system or ICS comprise of different types of control systems that are currently in operation in
various industries. These control systems include PLC, SCADA and DCS and various others:
PLC
They are based on the Boolean logic operations whereas some models use timers and some have continuous
control. These devices are computer based and are used to control various process and equipments within a
facility. PLCs control the components in the DCS and SCADA systems but they are primary components in
smaller control configurations.
37
DCS
Distributed Control Systems consists of decentralized elements and all the processes are controlled by these
elements. Human interaction is minimized so the labor costs and injuries can be reduced.
Embedded Control
In this control system, small components are attached to the industrial computer system with the help of a
network and control is exercised.
SCADA
Supervisory Control And Data Acquisition refers to a centralized system and this system is composed of various
subsystems like Remote Telemetry Units, Human Machine Interface, Programmable Logic Controller or PLC
and Communications.
38
39
Programming Device
The programming device is used to enter the required program into the memory of the processor.
The program is developed in the programming device and then transferred to the memory unit of the PLC.
PLC OPERATIONS:
Input Relays
These are connected to the outside world. They physically exist and receive signals from switches, sensors, etc.
Typically they are not relays but rather they are transistors.
Internal Utility Relays
These do not receive signals from the outside world nor do they physically exist. They are simulated relays and
are what enables a PLC to eliminate external relays.
There are also some special relays that are dedicated to performing only
one task.
Counters
These do not physically exist. They are simulated counters and they can be programmed to count pulses.
Typically these counters can count up, down or both up and down. Since they are simulated they are limited in
their counting speed.
Some manufacturers also include highspeed counters that are hardware based.
Timers
These also do not physically exist. They come in many varieties and increments.
The most common type is an on-delay type.
Others include off-delay and both retentive and non-retentive types. Increments vary from 1ms through 1s.
40
Output Relays
These are connected to the outside world. They physically exist and send on/off signals to solenoids, lights, etc.
They can be transistors, relays, or triacs depending upon the model chosen.
Data Storage
Typically there are registers assigned to simply store data. Usually used as temporary storage for math or data
manipulation.
They can also typically be used to store data when power is removed from the
PLC.
The Simatic S5 PLC is an automation system based on PLC. It was manufactured and sold by Siemens. Such
automation systems control process equipment and machinery used in manufacturing.
STEP 5 programming language is used for writing user programs for SIMATIC S5 programmable controllers.
The program can be written and entered into the programmable controller as in:
Statement list
Ladder diagram
(LAD), Fig.12 (c)
STL
A I
A I
O I
= Q
2.3
4.1
3.2
1.6
I 2.3
A
N
D
41
(a)
I 4.1
O
R
I 3.2
Operation
2.3
2.3
Q 1.6
I 2.3
I 4.1
Operand
2.3
Parameter
Operand identifier
I 3.2
Parameter, i.e. the number of operand identifiers addressed by the statement. For inputs, outputs and
flags (internal relay equivalents), the parameter consists of the byte and bit addresses, and for timers and
counter, byte address only.
42
The statement may include absolute operands, e.g. I 5.1, or symbolic operand, e.g. I LS1. Programming is
considerably simplified in the later case as the actual plant designation is directly used to describe the device
connected to the input or output.
Typically, a statement takes up one word (two bytes) in the program memory.
STRUCTURED PROGRAMMING
The user program can be made more manageable and straightforward if it is broken down into relative sections.
Various software block types are available for constructing the user program.
Program blocks (PB) contain the user program broken down into technologically or functionally related
sections (e.g. program block for transportation, monitoring, etc.). Further blocks, such as program blocks or
function blocks can be called from a PB.
Organization blocks (OB) contain block calls determining the sequence in which the PBs are to be processed. It
is therefore possible to call PBs conditionally (depending on certain conditions).
In addition, special OBs can be programmed by the user to react to interruptions during cyclic programming
processing. Such an interrupt can be triggered by a monitoring function if one or several monitored events
occur.
Function block (FB) is block with programs for recurrent and usually complex function. In addition to the basic
operations, the user has a extended operation at his disposal for developing function blocks. The program in a
function block is usually not written with absolute operands (e.g. I 1.5) but with symbolic operands. This
enables a function block to be used several times over with different absolute operands.
For even more complex functions, standard function blocks are available from a program library. Such FBs are
available, e.g. for individual controls, sequence controls, messages, arithmetic operations, two step control
loops, operator communications, listing, etc. These standard FBs for complex functions can be linked it the user
program just like user written FBs simply by means of a call along with the relevant parameters.
43
The Sequence block (SB) contain the step enabling conditions, monitoring times and conditions for the current
step in sequence cascade. Sequence blocks are employed, for example, to organise the sequence cascade in
communication with a standard FB.
The data blocks (DB) contain all fixed or variable data of the user program.
CYCLIC PROGRAM PROCESSING
The blocks of the user program are executed in the sequence in which they specified in the organisation block.
INTERRUPT DRIVEN PROGRAM PROCESSING
When certain input signal changes occur, cyclic processing is interrupted at the next block boundary and an OB
assigned to this event is started. The user can formulate his response program to this interrupt in the OB. The
cyclic program execution is the resumed from the point at which it was interrupted.
TIME CONTROLLED PROGRAM EXECUTION
Certain Obs are executed at the predetermined time intervals (e.g. every 100ms, 200ms, 500ms, 1s, 2s, and 5s).
For this purpose, cyclic program execution is interrupted at the block boundary and resumed again at this point,
once the relevant OB has been executed. Fig.13 gives the organisation and execution of a structured user
program.
44
Structured programming
OB1
PB1
FB2
PB2
FB3
Cycle execution
OB
PB
FB
PB
FB
Interrupt-driven execution
OB
PB
FB
45
List down each individual element (field device) on the machine as Input/Output.
Indicate against each element the respective address as identifier during electrical interfacing of these
elements with the PLC.
Break down the complete machine auxiliary functions that are controlled by the PLC into individual, self
contained functions.
Once the PBs and FBs for each function are identified, take them one by one for writing the program.
List down the preconditions required for the particular function separately.
Translate the flow chart into PLC program using the instructions already familiarized.
Check the individual blocks independently and correct the program to get the required results.
Organize all the program blocks in the organization block depending upon the sequence in which they are
supposed to be executed as per the main machine function flow chart.
Check the complete program with all the blocks incorporated in the final program.
46
Example 1: Spindle ON
Preconditions
Fault indication
Address
Tool clamp
Job clamp
Door close
Lubrication ON
Drive ready
Pressure switch
Proximity switch
Limit switch
PLC output bit
Input signal from
Drive unit
Lamp
Lamp
Lamp
Lamp
Lamp
Q 2.1
Q 1.7
Q 4.0
Q 7.7
Q 0.4
I 2.4
I 3.2
I 5.7
Q 1.0
I 4.6
Remark
PB 12 written is the individual function module for spindle ON for all the preconditions checked and found
satisfactory. This function is required to be executed only when the spindle rotation is requested by the NC in
the form of a block in the part program.
Whenever NC decodes the part program block, it in turn informs the PLC through a fixed buffer location that
spindle rotation is requested. Say Flag bit F 100.0 is identified for this information communication. With this
data, spindle ON function module can be recalled in the organisation block OB1 as follows.
OB 1
A F 100.0
JC PB12
BE
Now, spindle ON function module PB12 will be executed only when F 100.0 is set. Otherwise the function
execution will be bypassed.
47
FLOW CHART
PB12
START
Comments
NO
INDICATE
FAULT
TOOL CLAMP
AN I 2.4
=
Q 2.1
YES
NO
INDICATE
FAULT
JOB CLAMP
YES
NO
INDICATE
FAULT
DOOR CLOSED
AN I 5.7
=
Q 4.0
AN Q 1.0
=
Q 7.7
Lubrication not on
Display fault lamp
YES
NO
INDICATE
FAULT
LUBRICATION
ON
YES
NO
INDICATE
FAULT
DRIVE READY
AN I 4.6
=
Q 0.4
ON I
ON I
ON I
ON Q
ON I
R Q
BEC
A I
A I
A I
A Q
A I
S Q
BE
YES
YES
Exit
STOP
SPINDLE
ANY FAULT
NO
DO SPINDLE
ON
END
2.4
3.2
5.7
1.0
4.6
67.3
2.4
3.2
5.7
1.0
4.6
67.3
48