Programmable Logic Controller

PLC

Control engineering has evolved over time. In past humans were the main method for controlling a system. More recently, electricity has been used for control, and the early electrical control was based on relays(1), which allow power to be switched on and off without a mechanical switch. The development of low cost computer has brought the most recent revolution, the “Programmable Logic Controller (PLC)”.

“ It is a digital device that uses a programmable memory to store instructions and to implement functions in order to control machines and processes”.

i.e. it is an electronic device used for automation of industrial processes where output results must be produced in response to input conditions within the bounded time, otherwise miscontrol will result. Thus a PLC is used to control, time and regulate the sequence of operations.

PLC is important since all production processes go through a fixed repetitive sequence of operations that involve logical steps and decisions.

Unlike general purpose computers, the PLC is designed for extended temperature ranges, dirty or dusty conditions, immunity to electrical noise, and resistance to vibration and impact.

Figure 1 shows a schematic diagram of a PLC which consists of 4 main units:

1.  The Program Memory – where the instructions for the logical control sequence are stored.

2.  The Data Memory – in which the status of switches, past values of data and other working data are stored.

3.  The Input Devices – which are drivers for industrial process sensors.

______

(1) A relay is an electrical switch that opens and closes under the control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts

4.  The Output Devices – which are drivers for the industrial process actuators, such as solenoid switches, motors and valves.

In addition the PLC has a PC connected to it through which the logical sequence that the PLC will execute is built and edited.

Figure 1: Schematic diagram of a PLC

When the logic sequence has been programmed and downloaded to the Program Memory Unit, then the program can be started, paused, single stepped and stopped from the PLC unit itself. The normal structure of a PLC sequence is a repetitive chain of actions that are determined by the status of the input devices from the industrial process.

Engineering Motivation – A typical batch process

Consider a process which consists of 2 tanks, one mounted above the other as shown in Figure 2. There is a pump that can be switched on and off to pump liquid to the upper Tank 1 from a reservoir R1. Tank1 has a solenoid operated valve in the base (V2) which is normally closed but can be switched open to release fluid from Tank1 to lower Tank 2. Tank 2 has a solenoid operated valve V3 in its base so that Tank 2 could be emptied into a reservoir R2.

______

(1) A solenoid valve is an electromechanical valve for use with liquid or gas controlled by running or stopping an electrical current through a solenoid, which is a coil of wire, thus changing the state of the valve.

The pump and valves inputs to the process are binary input signals that actuate the process by switching the pump on or off or opening or closing the valves. The sensors are also binary and they tell the PLC whether a switch is opened of closed. (Suppose all valves are initially closed)

Figure (2): A two tank batch process

All inputs and outputs for the process are given in Table (1) below.

Table (1): Inputs and Outputs of the two tank batch process

Variable / Process Input
or Output / Function
Pump / Input / Pump, ON/OFF
Fluid level, L1 / Output / Tank 1 high level switch
Fluid level, L2 / Output / Tank 1 low level switch
Fluid level, L3 / Output / Tank 2 high level switch
Fluid level, L4 / Output / Tank 2 low level switch
Fluid level, L5 / Output / Reservoir R1 level switch
Valve, V1 / Input / Tank 1 feed valve
Valve, V2 / Input / Tank 1 drain valve
Valve, V3 / Input / Tank 2 drain valve

A simple batch sequence for the system might be as follows:

1.  Open V1, set pump ON, this starts filling Tank 1.

2.  Wait until L1 is set and set pump OFF, this stops filling Tank 1 when it is full.

3.  Wait for 10 seconds , this would be to allow fluid mixing, reactions or settling to take place.

4.  Open V2, this starts emptying contents of Tank 1 into Tank 2.

5.  Wait until L2 is set and close V2.

6.  Wait for 20 seconds.

7.  Open V3.

8.  Wait until L4 is set, close V3.

9.  Go to step 1, repeat the sequence indefinitely.

Programming

PLC programming is based on the use of Ladder Diagrams. Using these, writing a program is equivalent to drawing a switching circuit.

The basic components in a ladder logic program are the contact and the coil. The contact is the name given to a general input device, while the coil is the name given to a general output device. Figure 3 shows the standard symbols used in any ladder diagram.

Input Input Output device

Normally open contact Normally closed contact

Inputs in series Inputs in parallel A special instruction

logic AND logic OR

Figure 3: Standard symbols of PLC

The ladder diagram consists of 2 vertical lines and circuits are connected as horizontal lines i.e. the rungs of the ladder between these two verticals.

Figure 4 shows an example of a ladder diagram.

Figure 4: An example of a ladder diagram

N.B.:

·  Each rung must start with an input or a series of inputs and end with an output.

·  Inputs and outputs are numbered, the notation used depends on the PLC manufacturer.

To illustrate the drawing of a ladder diagram, consider a normally open start switch. When the switch is closed, the coil is energized. This is represented as follows:

In case of a normally closed switch the coil is energized provided that the switch does NOT change.

Logic Functions

The coil is not energized unless two normally open switches are both closed (both changes their state), thus gives AND logic situation. The truth table is shown below.

Inputs / Outputs
A / B
0 / 0 / 0
0 / 1 / 0
1 / 0 / 0
1 / 1 / 1

The coil is not energized until either one of 2 normally open switches is closed which thus gives an OR logic situation.

Inputs / Outputs
A / B
0 / 0 / 0
0 / 1 / 1
1 / 0 / 1
1 / 1 / 1

For the coil to be energized we require A to be closed and either B or C to be closed.

Inputs / Output
A / B / C
0 / 0 / 0 / 0
0 / 0 / 1 / 0
0 / 1 / 0 / 0
0 / 1 / 1 / 0
1 / 0 / 0 / 0
1 / 0 / 1 / 1
1 / 1 / 0 / 1
1 / 1 / 1 / 1

The figures below show how we can represent NOR and NAND gates. These include switches that are normally closed.

Inputs / Outputs
Y430
X400 / X401
0 / 0 / 1
1 / 0 / 0
0 / 1 / 0
1 / 1 / 0
Inputs / Outputs
Y430
X400 / X401
0 / 0 / 1
0 / 1 / 1
1 / 0 / 1
1 / 1 / 0

Entering the program

Each horizontal line i.e. rung on the ladder represents a line in the program and the entire ladder can be translated into a program using a keyboard with the graphic symbols for the ladder elements and then the program panel translates these symbols into machine language that is then stored in the PLC memory.

Example

A robot is used to unload processed parts of a machine into AGV, pick up a new part for processing from AGV and load it onto the machine. The AGV is to be dispatched after completion of the cycle. Construct a ladder logic diagram for the task.

01 AGV has arrived

02 AGV is carrying a new part to be processed.

03 AGV has space to store a processed part.

04 Machine has a finished part to be unloaded

20 Unload old part from machine onto AGV

21 Pick new part from AGV and load onto machine

22 Dispatch the AGV

Timers and Counters

The previous sections have been concerned with tasks requiring the series and parallel connections of input contacts. However, there are tasks that involve time delays and even counting.

·  Timers: It counts time units. It is represented by the symbol below where the number indicated means that the following task will be performed after timer counts that number of time units (usually seconds).

·  Counter: They are used when there is a need to count a specified number of contact operations e.g. where items pass along a conveyer into boxes, and when the specified number of items has passed into a box, the next item is diverted into another box. It is represented by the symbol below with the number indicting that the following step will be performed after the counter counts that number of times.

Example

During the powder metallurgy process, a punch is used to press blended metal powder into a die. A pushbutton is used to start the process. When the start button is pressed, the die is filled with powder. The punch is then advanced and it applies pressure to the powder for a duration of 10 seconds, after which it is retracted. The pressed compact is then ejected from the die and then the cycle repeats. The cycle can be interrupted by pressing a stop button. If the stop button is pressed, the punch is required to retract (if it had been advanced) before the process is stopped. It is required to construct a ladder logic diagram for this task.

01 Start button

02 Stop button

TI Timer (with a limit of 10 s)

30 Fill die

31 Advance punch

32 Retract punch

33 Eject part (i.e compact)

34 Stop cycle

12