Lab Manual: MCT-334L Industrial Automation
Lab Manual: MCT-334L Industrial Automation
LIST OF EXPERIMENTS
Introduction to:
Memory Structure
3
Ladder Logic Programming Elements
PLC Programming
6 Introduction to Timers
7 Introduction to Counters
13 Design Ladder Diagram for Tank Level and Pump Control Module
Registration # _______________________
Date: _______________________
Objective:
To become familiar with Industrial Automation & PLCs.
Introduction:
Industrial Automation:
Automation takes a step further mechanization that uses a particular machinery mechanism aided
human operators for performing a task. Mechanization is the manual operation of a task using powered
machinery that depends on human decision making. Automation replaces the human involvement with
the use of logical programming commands and powerful machineries.
Industrial Automation is the replacement with computers and machines to that of human thinking.
The word Automation gives the meaning ‘self dictating’ or ‘a mechanism moves by itself’ that derived
from the Greek words ‘Auto’ and ‘Matos’ where ‘auto’ means self while ‘Matos’ means moving. In a
brief, industrial automation can be defined as the use of set technologies and automatic control devices
that results the automatic operation and control of industrial processes without significant human
intervention and achieving superior performance than manual control. These automation devices
include PLCs, PCs, PACs, etc. and technologies include various industrial communication systems.
2) Programmable Automation
History:
Industrial automation began long before PLCs. In the early to mid-1900s, automation was usually done
using complicated electromechanical relay circuits. However, the amount of relays, wires and space
needed to create even simple automation was problematic. Thousands of relays could be necessary to
automate a simple factory process and if something in the logical circuit needed to be changed then it
will be very difficult.
In 1968 the first programmable logic controller came along to replace complicated relay circuitry in
industrial plants. The PLC was designed to be easily programmable by plant engineers and technicians
that were already familiar with relay logic and control schematics. Since the beginning PLCs have
been programmable using ladder logic which was designed to mimic control circuit schematics. The
ladder diagrams look like control circuits where power is flowing from left to right through closed
contacts to energize a relay coil.
As we can see in Fig 1.4 ladder logic looks like simple control circuit schematics where input sources
like switches, push-buttons, proximity sensors, etc. are shown on the left and output sources are shown
on the right. The ability to program complicated automated processes with an intuitive interface like
ladder logic made the transition from relay logic to PLCs much simpler for many in the industry.
Although, the first PLCs were very limited in their memory and speed capabilities, they quickly
improved over the years. The presence of PLCs helped simplify the design and implementation of
industrial automation.
Working of PLC:
A programmable logic controller is a specialized computer used to control machines and processes. It
therefore shares common terms with typical PCs like central processing unit, memory, software and
communications. Unlike a personal computer though the PLC is designed to survive in a rugged
industrial atmosphere and to be very flexible in how it interfaces with inputs and outputs to the real
world.
The components that make a PLC work can be divided into three core areas.
1) The power supply and rack
2) The central processing unit (CPU)
3) The input/output (I/O) section
PLCs come in many shapes and sizes. They can be so small as to fit in your shirt pocket while more
involved controls systems require large PLC racks. Smaller PLCs (a.k.a. “bricks”) are typically
designed with fixed I/O points. For our consideration, we’ll look at the more modular rack based
systems. It’s called “modular” because the rack can accept many different types of I/O modules that
simply slide into the rack and plug in.
The rack is the component that holds everything together. Depending on the needs of the control
system it can be ordered in different sizes to hold more modules. Like a human spine the rack has a
backplane at the rear which allows the cards to communicate with the CPU. The power supply plugs
into the rack as well and supplies a regulated DC power to other modules that plug into the rack. The
most popular power supplies work with 120 VAC or 24 VDC sources.
2) The CPU:
The brain of the whole PLC is the CPU module. This module
typically lives in the slot beside the power supply. The CPU
consists of a microprocessor, memory chip and other integrated
circuits to control logic, monitoring and communications. The
CPU has different operating modes. In programming mode, it
accepts the downloaded logic from a PC. The CPU is then placed
in run mode so that it can execute the program and operate the
process.
Inputs:
Input devices can consist of digital or analog devices. A digital input card handles discrete devices
which give a signal that is either on or off such as a pushbutton, limit switch, sensors or selector
switches. An analog input card converts a voltage or current (e.g. a signal that can be anywhere from
0 to 20mA) into a digitally equivalent number that can be understood by the CPU. Examples of analog
devices are pressure transducers, flow meters and thermocouples for temperature readings.
Outputs:
Output devices can also consist of digital or analog types. A digital output card either turns a device
on or off such as lights, LEDs, small motors, and relays. An analog output card will convert a digital
number sent by the CPU to its real world voltage or current. Typical outputs signals can range from
0-10 VDC or 4-20mA and are used to drive mass flow controllers, pressure regulators and position
controls.
Programming a PLC:
In these modern times a PC with specially dedicated software from the PLC manufacturer is used to
program a PLC. The most widely used form of programming is called ladder logic. Ladder logic uses
symbols, instead of words, to emulate the real world relay logic control, which is a relic from the PLC's
history. These symbols are interconnected by lines to indicate the flow of current through relay like
contacts and coils. Over the years the number of symbols has increased to provide a high level of
functionality.
The completed program looks like a ladder but in actuality it represents an electrical circuit. The left
and right rails indicate the positive and ground of a power supply. The rungs represent the wiring
between the different components which in the case of a PLC are all in the virtual world of the CPU. So
if you can understand how basic electrical circuits work then you can understand ladder logic.
In this simplest of examples, a digital input (like a button connected to the first position on the card)
when it is pressed turns on an output which energizes an indicator light.
Conclusion:
Lab No. 02
Orientation to PLC Software (Fatek)
Name: _____________________________
Registration # _______________________
Date: _______________________
Objective:
To become familiar with FATEK WinProladder Software.
To implement Logic Gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) using Ladder logic
in FATEK PLC.
FATEK FBS 14 MA
FATEK WinProladder Software
PC
Introduction:
FATEK FBS-14-MA PLC:
The FATEK FBS Series PLC is a new generation of micro PLC
equipped with excellent functions comparable to medium or
large PLC, with up to five communication ports. The maximum
I/O numbers are 256 points for Digital Input (DI) and Digital
Output (DO), 64 words for Numeric Input (NI) and Numeric
Output (NO). The Main Units of FBS are available in three
types: MA (Economy Type), MC (High-Performance Type),
and MN (High-Speed NC Type). With the combination of I/O
point ranges from 10 to 60, a total of 17 models are available.
Fifteen DI/DO and 19 NI/NO models are available for
Expansion Units/Modules. With interface options in RS232,
RS485, USB, Ethernet, CANopen, Zigbee and GSM, the
communication peripherals are available with 15 boards and
modules. FATEK FBS 14 MA indicates economy type PLC
having 14 in/out ports, 8 inputs and 6 outputs ports.
Fig 2.1: FATEK FBS-14-MA
FATEK WinProladder Software:
It provides the connection for PLC and PC with varieties. Among the connections, there are hardware
connection, Modem connection and Internet connection. For every different connection, WinProladder
provide a session name to associate the setting of the communication parameters, such as port no.,
baud rate, IP address etc. With this feature can alleviate the user from the burden of the memorizing.
It provides the on-line program editing capability. After modify the ladder program can send the RUN
command immediately without to re-download the program to PLC. With this feature can reduce the
application development time dramatically comparing with other PLC without this feature.
(Functions toolbar) is the collection of functions included in the applications software, presented in
different categories. When the user selects any of the categories in the above function’s toolbar, a list
of additional selectable functions will be displayed for the user to select.
(Tools bar) In the process of the design of a project, it is often convenient to provide a toolbar with
the most commonly used functions included in it for the user to directly select, which can prove to be
much faster and more convenient that having to find the function through the functions toolbar.
(Component tray) allows the user to easily select the components and command functions that they
need to use without having to search for what they want through the functions toolbar, which is faster
and more convenient.
(Status bar) displays information on the status of the current application, such as whether the
application is connected, whether it is in execution or has been disconnected, and the current location
of the cursor, etc., allowing the user to know the status of the current application at all times.
Logic Gates:
i) Not Gate:
In this logic gate, the output is high if the input is
low and vice versa. The symbol and truth table for
this gate are shown.
ii) OR Gate:
In this Logic gate, the output is high if one of the
input is high. If both the inputs are low, then the
output is low. The symbol and truth table are
shown.
v) NOR Gate:
In this Logic gate, the output is low if one of the input
is high. If both the inputs are low, then the output is
high. The symbol and truth table for this gate are shown
Then add an output Light (Y1) in ladder logic to indicate the switching of Fan. If the fan is ON,
the light should be ON and vice versa. Insert the PLC simulation below:
Create Ladder Logic for OR gate, verify all the outputs using different inputs & insert the PLC
simulation below:
Create Ladder Logic for NOR gate, verify all the outputs using different inputs & insert the PLC
simulation below:
Create Ladder Logic for AND gate, verify all the outputs using different inputs & insert the PLC
simulation below:
Create Ladder Logic for NAND gate, verify all the outputs using different inputs & insert the PLC
simulation below:
Create Ladder Logic for XNOR gate, verify all the outputs using different inputs & insert the PLC
simulation below:
Conclusion:
Lab No. 03
Introduction to Memory Structure, Ladder Logic
Programming Elements & PLC Programming
Lab No. 04
Use of advanced Instructions:
Comparison Instructions, Mathematics (Addition, Subtraction,
Comparison etc.) & Data Handling
Name: _____________________________
Registration # _______________________
Date: _______________________
Objective:
To become familiar about memory elements.
To perform various arithmetic operations using memory elements.
To become familiar with use of comparators in PLCs.
Equipment and Components:
FATEK FBS 14 MA
FATEK WinProladder Software
PC
Introduction:
Registers in PLC:
In a PLC there are several registers. Each data register can store a binary word of usually 8 or 16 bits.
The number of bits determines the size of the number that can be stored. The binary system uses only
two symbols, 0 and 1. Thus we might have the 4-bit number 1111.
Subtraction (-):
Performs the subtraction of the data specified at Sa and Sb and writes the results to a specified register
D when the subtract control input "EN" =1 or from 0 to 1(P instruction). If the result of subtraction is
equal to 0 then set FO0 to 1. If carry occurs (subtracting a negative number from a positive number
and the result exceeds 32767 or 2147483647), then set FO1 to 1. If borrow occurs (subtracting a
positive number from a negative number and the resulted difference is less than -32768 or -
2147483648), then set FO2 to 1. All the FO statuses are retained until this instruction is executed again
and overwritten by a new result.
Division (/):
Performs the division of the data specified at Sa and Sb and writes the quotient and remainder to
registers specified by register D when the division control input "EN" =1 or from 0 to 1 (P instruction).
If the quotient of division is equal to 0 then set FO0 to 1. If the divisor Sb=0 then set the error flag
FO1 to 1 without executing the instruction.
Increment (+1):
Adds 1 to the register D when the increment control input "EN" =1 or from 0 to 1 (P instruction). If
the value of D is already at the upper limit of positive number 32767 or 2147483647, adding one to
this value will change it to the lower limit of negative number -32768 or -2147483648. At the same
time, the overflow flag FO0 (OVF) is set to 1.
Average (MEAN):
When operation control "EN" = 1 or from 0 to 1(P instruction), add the N successive 16-bit or 32-bit
(D instruction) numerical values starting from S, and then divided by N. Store this mean value
(rounding off numbers after the decimal point) in the register specified by D. While the N value is
derived from the content of the register, if the N value is not between 2 and 256, then the N range error
"ERR" will be set to 1, and do not execute the operation.
Absolute (ABS):
When operation control "EN" = 1 or from 0 to 1(P instruction), calculate the absolute value of the
content of the register specified by D, and write it back into the original D register.
Compares the data of Sa and Sb when the compare control input "EN" =1 or from 0 to 1(P instruction).
If the data of Sa is equal to Sb, then set FO0 to 1. If the data of Sa>Sb, then set FO1 to 1. If the data of
Sa<Sb, then set FO2 to 1. If the data of Sa < Sb, then set the FO2 to 1.
When operation control "EN" = 1 or from 0 to 1 (P instruction), compares S with upper limit SU and
lower limit SL. If S is between the upper limit and the lower limit (SL≦S≦SU), then set the inside
zone flag "INZ" to 1. If the value of S is greater than the upper limit SU, then set the higher than upper
limit flag "S>U" to 1. If the value of S is smaller than the lower limit SL, then set the lower than lower
limit flag” S<L" as 1. The upper limit SU should be greater than the lower limit SL. If SU<SL, then
the limit value error flag "ERR" will set to 1, and this instruction will not carry out.
Apply the sum operation on D0 & D1 and store their sum in D21 and insert the PLC simulation
below:
Apply the subtraction operation on D0 & D1 and store their sum in D22 and insert the PLC
simulation below:
Apply the multiplication operation on D0 & D1 and store their sum in D100 and insert the PLC
simulation below:
Apply Zone Compare operation on D0. Set the upper limit of zone to 10 and lower limit 2. Insert
the PLC simulation below:
Conclusion:
Lab No. 05
Reset Coil ( )
A reset coil turns a set coil OFF (unlatches), when the preceding net conditions are ON, allowing
power flow to reach the reset coil from the net. Once a set coil is turned ON, it stays
ON, independent of the original set condition, until a reset coil linked to the same address resets
(unlatches) the coil condition
Latching:
In electronics, a latch is a kind of bistable multivibrator, an electronic circuit that has two stable states
and can be used to store state information. The circuit can be made to change state by signals applied
to one or more control inputs and will have one or two outputs. It is the basic storage element in
sequential logic. Latches are fundamental building blocks of digital electronics systems used in
computers, communications, and many other types of systems. Simple Latching circuit is Shown in
Fig4.1.
Switch 1 Switch 2 X Y
ON OFF SET RESET
OFF ON RESET SET
Procedure:
First, run WinProladder software. Then create a Ladder Logic for the logic given above:
Picked two contacts X1 (for switch 1) & X2(for switch2), connect them with set and rest coils (Y0
/ Output X).
Then connect (Y0 / Output X) with set and rest coils (Y1 / Output Y).
Then turn ON Switch1 and turn OFF Switch 2 and observe the Output X and Output Y.
Insert the PLC simulation below:
Then turn off Switch1 and turn on Switch 2 and observe the Output X and Output Y.
Insert the PLC simulation below:
Switch Output
ON X SET
OFF Y SET
ON X RESET
OFF Y RESET
Procedure:
Picked a contact X0 (for Input switch) and connect it with set and rest coils of (Output X and
Output Y).
Then turn ON Switch1 and observe the Output X.
Insert the PLC simulation below:
Pick contacts M0 (for set) and M12 (for reset), connect them with Output M11.
Use output M11 to latch the circuit.
Then turn ON set button and observe the Output.
Then turn OFF set button and observe the Output.
Insert the PLC simulation below:
Reset the Logic.
Picked contact M20 (for input) and connect it with set coil and rest coils (M22).
Then turn ON the input to energize the SET and RESET coils at the same time, and observe
which coil dominates.
Insert the PLC simulation below:
Fig 5.9: Energizing the SET and RESET Coils at the Same Time
Pick pulse operated switches M31 (for set) and M32 (for reset), connect them with Output M40
(SET and RESET Coils).
Use output M40 (SET coil) to latch the circuit.
Then give a pulse using set button and observe the Output.
What happens if pulse using the Rest button is given.
Conclusion:
Lab No. 06
Introduction to Timers
Name: _____________________________
Registration # _______________________
Date: _______________________
Objective:
To familiarize with the function of timers
Equipment and Components:
FATEK FBS 14 MA
FATEK WinProladder Software
PC
Introduction:
Timers:
PLC timers are instructions that provide the same functions as on-delay and off-delay mechanical and
electronic timing relays. A PLC timer provides a preset delay to the control actions. In general, there
are three types of PLC timer delays, ON-delay timer, OFF-delay timer and retentive timer on. The
terms represented in the timer block in the PLC are a Preset value which means the delay period of the
timer, an Accumulated value which is the current delay of the timer. A timer begins the counting on
time-based intervals and continues until the accumulated value equals the preset value. When the
accumulated value equals the preset time the output will be energized. Then the timer sets the output.
The total number of timers is 256 (T0~T255) with three different time bases, 0.01S, 0.1S and 1S. The
default number and allocation of timers is shown as below (Can be adjusted according to user’s actual
requirements by the “Configuration” function):
T0~T49:0.01S timer(default as 0.00~327.67S)
T50~T199:0.1S timer(default as 0.0~3276.7S)
T200~T255:1S timer(default as 0~32767S)
Task # 01: There is a transfer line of canned food. The inductive proximity switch is used to detect
the movement of cans. If cans become jam, the movement stops. Since the cans will not be passing the
detection point. The timer will time out. The output of the timer will either trigger an alarm or stop the
machine until system is corrected.
Procedure:
Fig 6.3: When Input is Off and Timer Turned On but No Output
Task # 02: Fluorescent light (Y5) for the garage door opener is attached. Every time the garage
door(X5) is opened the light is ‘ON’. After the garage door is closed the light remains ‘ON’ for 5
seconds while driver walks to the house from the car.
Procedure:
Picked a contact M1 (for input), connect it with reset M12 and output M11 and latched it with
M11.
Use the timer with the inverse of input M1. At the output of timer, connect reset (M12).
When input M1 is turned on (door is open) output M11 (light) will be turned on.
Insert the PLC simulation in Fig 6.5.
When input M1 is turned off (door is closed) output M11 (light) will remained turned on and timer
will also have turned on.
Insert the PLC simulation in Fig 6.6.
After 5sec timer will reset the output M11 and output M11 (light) will off.
Insert the PLC simulation in Fig 6.7.
Task # 03: Consider a program that could be used to flash a light on and off as long as there is some
output from a sensor. Thus we might have both timer T0 and timer T1 both set for 5 seconds. When
the output from a sensor occurs then timer T0 starts and switches on after 5s. This closes the timer T0
contacts and starts timer T1. This switches on after 5s and in doing so, switches off timer T0. In so
doing it switches off itself. The lamp is only on when timer T0 is on and so we have a program to flash
the lamp on and off as long as there is an output from a sensor.
Procedure:
Picked a contact M100 (for input), connect it M31(Timer T21 output), Timer (T20) and output
M30.
Connect Output M30 with another timer T21 whose output is M31.
When input is off there will be no output. Insert the PLC simulation in Fig 6.8.
When the input (M100) from a sensor occurs then timer T20 starts. Insert the PLC simulation in
Fig 6.9.
After 5s turn on the light at output M30. Insert the PLC simulation in Fig 6.10.
Then timer T22 starts. Insert the PLC simulation in Fig 6.11.
After 5sec it turns off timer T21. In so doing it switches off itself and the cycle repeats until input
remain turned on. Insert the PLC simulation in Fig 6.12.
The lamp is only on when timer T21 is on and so we have a program to flash the lamp on and off
as long as there is an input from a sensor.
Conclusion:
Lab No. 07
Introduction to Counters
Name: _____________________________
Registration # _______________________
Date: _______________________
Objective:
To familiarize with the function of Counters.
Equipment and Components:
FATEK FBS 14 MA
FATEK WinProladder Software
PC
Introduction:
Counters:
Counter is a device which stores (and sometimes displays) the number of times a particular event or
process has occurred, often in relationship to a clock signal. Counters are used in digital electronics
for counting purpose, they can count specific event happening in the circuit. For example, in
UP counter a counter increases count for every rising edge of clock. Not only counting, a counter can
follow the certain sequence based on our design like any random sequence 0,1,3,2…. They can also
be designed with the help of flip flops.
There are total 200 16-Bit counters (C0~C199). There are total 56 32-Bitcounters (C200~C255).
When "CLR" is at 1, all of the contact Cn, FO0 (CUP), and CV value of the counter CV are cleared
to 0 and the counter stops counting.
When "CLR" is at 0, the counter is allowed to count up. The Counter counts up every time the
clock "CK" changes from 0 to 1 (adds 1 to the CV) until the cumulative current value is equal to
or greater than the preset value (CV>=PV), the counter "Count-Up" and the contact status of the
counter Cn and FO0 (CUP) changes to 1. If the input status of clock continues to change, even the
cumulative current value is equal and greater than the preset value, the CV value will still
accumulate until it reaches the up limit at 32767 or 2147483647.
Task # 01: Write a code to turn ON a light after 6 events and turn it OFF after 10 seconds. Events
may be treated as two normally open switches.
Procedure:
Fig 7.4: After 10 sec Timer Resets the Counter and Output is Turned OFF
Task # 02: Design a ladder logic diagram that will use counter element as one UP/Down counter to
keep track of the cars in a certain parking plaza. If the number of cars exceeds a certain value (say 15)
“CAR LOT FULL” light should light up.
Procedure:
Picked contact X1 (for input as UP when a car is entered), connect it with counter C1 (having
preset value 15) and Output Y5.
Connect output Y3 with CLR of counter C1 to reset the counter.
Connected a pulse switch Y100 (for down when a car leaves) and connect it with a decrement
arithmetic function and give it the address of counter to decrease the value of counter).
Turn on and off the input 13 times (which means 13 cars entered) the counter counted 13 but there
is no output on Y5. Insert the PLC simulation in Fig 8.5.
Turned on and off the input until counter counted 15 (which means 15 cars entered), output Y5
was turned ON to indicate that the “CAR LOT FULL”. Insert the PLC simulation in as Fig 8.6.
Create a pulse input on Y100 (which means 1 car is out) the decrement operator decrease the value
of counter C1 to 14 and outputY0 is tuned OFF. Insert the PLC simulation in Fig 8.7.
Conclusion: