Design and Implementation of PLC-Based Monitoring and Sequence Controller System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Jour of Adv Research in Dynamical & Control Systems, Vol.

10, 02-Special Issue, 2018

Design and Implementation of PLC-Based


Monitoring and Sequence Controller System
Mohammed S. Saleh*1,Khalid G. Mohammed2, Zuhair S. Al-sagar3, , Aws Zuhair Sameen4
1
Electronic Department, Engineering Collage, Diyala University,Baqubah, Iraq
2
Electrical Power and Machine Department, Engineering Collage, Diyala University Baqubah, Iraq
3
Electrical Technical Department, Baqubah Technical Institute, Middle Technical University,Baghdad, Iraq
4
Department of Electrical, Electronic and Systems, Faculty of engineering, Universiti Kebangsaan Malaysia (UKM)
Bangi, Malaysia
Email: [email protected],[email protected],
3
[email protected], [email protected]

Abstract– Programmable Logic Controller (PLC) is an electronic digital device. PLC has a programmable memory
that is used for storing codes and implement functions like timing, logic, counting, sequencing and arithmetic. These
instructions are used for controlling machines and processes. The aim of this paper is to design and implement a
monitoring and control prototype of products transfer system from one point to another point based on PLC
technology using CIMON-BP32 and describing the method for development the program of the PLC. During
normal operation and under dishonest conditions, the parameters control correlation by the user is required where
the correlation is done by the PLC. The implementation of the hardware and software for control system is
provided. Thus, PLC proves as a versatile and wide effective tool in industrial control of electric drives.
Keyward: PLC, automatic control, Ladder diagram, Sequence controllers

1. Introduction
Programmable Logic Controller (PLC) is an electronic digital device. PLC has a programmable memory that
is used for storing codes and implement functions like timing, logic, counting, sequencing and arithmetic. The
logical operations are primarily used concerned with switching operations. The PLC connects the input (e.g.
Switches) to the output (e.g. Motors) and they are controlled by the controller according the stored program is the
PLC [1, 2]. PLC is widely used in many industry aspects to expand and enhance the production. The PLCs
functionality has been evolving over the last few years, replacing typical relay controls [3, 4]. One PLC can replace
hundreds or thousands of relays that were used in older automated systems [5]. Now, PLC’s covering sophisticated
motion control, distributive control systems, process control and complex networking [6]. Therefore, PLCs have
many advantages over conventional relays including more flexibility, increased reliability, convenience to
troubleshoot, lower cost, faster response time and communication capability [1]. PLC’s greatest advantage is that it
has the possibility of modifying a control system without needs to rewrite the inputs and output devices connections.
The only requirement is an operator that has a key with a different set of instructions.
Originally, PLCs was designed for replacing logic timer control systems and hard-wired relay. The result of using
PLCs is a flexible system which can be used to control systems with a wide variety in their nature and complexity
[2]. The PLC advantages can be summarized as high reliability, smaller space, computing capabilities, reduced
costs, ability to withstand harsh environments, expandability, high power handling and reduce Human Efforts. The
PLC works by scanning the program continues. The scanning procedure is consisting three steps as shown in Fig.1.

Fig. 1 PLC cycle

*Corresponding Author: Mohammed S. Saleh,Email id : [email protected]


Article History: Received: Aug 15, 2018, Revised: Sep 10, 2018, Accepted: Oct 04, 2018
2281
Jour of Adv Research in Dynamical & Control Systems, Vol. 10, 02-Special Issue, 2018

Typically, there are more than three steps, but these steps are the most important steps and the rest are sub steps such
as checking the system, updating the current internal counter and timer values [7].
For the last two decades, PLCs has been used in industry. The PLC is designed to replace the traditional control
panels that are depending on timers and hard-wired relays. Based on logic instructions programming and executing,
PLC can provide ease and flexible control. Even with using the smallest PLC, the Internal functions like shift
registers, counters and timers are making the sophisticated control possible.
The PLC structure is divided into four parts. These parts are input/output modules, central processing unit (CPU),
memory and programming terminal. Fig. 2 shows the PLC general structure.

Fig. 2 PLC general structure


The PLC starts with checking the input states by determining each input that connects to the PLC pins whether they
are on or off, then record the data into the PLC memory [2, 8]. The second step of the PLC’s workflow is executing
the codes as a one instruction per time unit. The third step is updating the output status. The output updates depend
on the turned-on inputs in the first step and the results of the code executing within the second step.
The rest of this paper will be as follows: Sections 2 describes the hardware of the plant, section 3 is the software and
system specification, section 4 analysis the problem of the plant, section 5 is driving the expressions for the coding,
section 6 describes the program in the last section is the conclusion.
2. Hardware Description
Ladder diagram method is used for programming the PLC. The PLC system provides a design environment as a
software tool based on PCs, which allows ladder diagrams to be developed, verified, tested and diagnosed. The PLC
codes are written in functional block ladder diagrams [9]. The written codes could be stored in erasable
programmable read only memory (EPROM) or in a random-access memory (RAM). The CPU with fetch and
execute each successive instruction. The CPU controls the I/O devices and memory operation of memory to process
the data according to the stored program. Each I/O connection to the PLC has an exact address that is used to
identify the I/O bit [3].
DC motors are one of the devices that can be connected and controlled by PLC. DC motors run on direct current
from a battery or a DC power supply. Direct current provides a constant voltage as a power source. The programmed
operations work on a straight two-state which are forward and reverse basis. These alternate possibilities correspond
to positive or negative polarity.
Before PLCs, relays were used to control the DC motors. A relay is an electrical operational switch. A magnetic
field is created by flowing the current through the relay’s coil which attracts a lever and changes the switch contacts.
Relays acts as a switch with two positions and they are double throw (changeover) switches. Relays separates two
circuits by allowing one circuit to switch independently from the second circuit [10]. By using the relay as shown in
Fig. 3 if the first relay (ON / OFF) is OFF the motor M will stop where, the motor will rotate in either the forward or
reverse direction according to the state of the second relay. If the relay is ON, the motor will rotate in the reverse
direction and if the relay is OFF then the motor will rotate in the forward direction. When the reverse relay is ON the
2282
*Corresponding Author: Mohammed S. Saleh,Email id : [email protected]
Article History: Received: Aug 15, 2018, Revised: Sep 10, 2018, Accepted: Oct 04, 2018
polarity of the supplied voltage will be change across the motor terminals, therefore the motor will rotate in the
reverse direction.

Fig. 3 Reversed motors with relay connection


Fig. 4 shows the plant of the system which consists a box at the starting point of a conveyor system, disk platform,
pushing system and anther conveyor.

Fig. 4 The sequence control system


The box is transmitting from the start of the first conveyor which is the motor (Y1). when the box is positioned in
the exact place, a contact sensor that is attached to the platform depressed and the disk will rotate the motor (Y2)
where it will rotate with counterclockwise (CCW). The rotation is stopped at 90°, then the disk will stop and push
arm will move with the pushing the motor (Y3) until the box becomes outside its position. The second conveyor is
running from the motor (Y4) for transmitting the box to the end of the product line. The disk and the push arm must
be returned to their original position by moving them in the reverse direction to transmit anther box if required,
otherwise shut down the system. Fig. 5 shows the real sequence control system.

Fig. 5 The real system


Jour of Adv Research in Dynamical & Control Systems, Vol. 10, 02-Special Issue, 2018

The state of the input signal to the plant from the sensors is:
 X0: The starting point of the line which is a manual signal to switch the system ON / OFF.
 X1: Box at the first conveyor and travels towards a position on the disk.
 X2: Box in position where the electrical contact signal of the platform sensor is on.
 X3: End of the CCW rotation.
 X4: Box out of the position on the disk.
 X5: End of the CW rotation.
The output signals describe the line operation, and it can be used by a controller to yield control signals:
 Y1: Moving the first conveyor Motor 1.
 Y2: Rotating the disk Motor 2.
 Y3: Pushing the arm of pusher Motor 3.
 Y4: Start the second conveyer Motor 4.
 Y5: Reverse Relay to change the direction of Motor 2 and Motor 3.
Fig. 6 shows the rotating disk where it is showing the DC motor for the pusher, the entrance of the box to the rotary
disk and the sensor of the box exit.

Fig.6 Rotating disk with DC motor pusher


CIMON BP32M PLC that has 16 input pins and 16 output pins is used for replacing the relay with PLC-CPU-CM2-
BP series, which is an ideal for small applications that requires high processing speed. This CPU can clock up to 200
ns/step with the ability to connect with 128 I/O expansion modules. It has a built-in power, communication and I/O
points which very handy to eliminate the needs for any external units which will simplify the setup process. The
PLC-CPU-CM2-BP unit is available with 1 or 2 RS232C channels and the option of Ethernet connection. This CPU
also provides the option of adding up to 2 additional analog blocks where you can choose between digital I/O or
analog I/O.
Fig. 7 shows the implemented circuit for changing the polarity of the motor using PLC and the power supply to
provide the required voltages.

2284
*Corresponding Author: Mohammed S. Saleh,Email id : [email protected]
Article History: Received: Aug 15, 2018, Revised: Sep 10, 2018, Accepted: Oct 04, 2018
Fig. 7 PLC and interface circuit
3. System Specification
Based on the fact of the PLC memory is organized into three subsections: discreet input (I), output relay (O) and
internal memory (M), the method of the direct representation for data associated with the I/O and M is implemented.
The memory location is directly referenced using I, O, and M [3].
The plant control behavior can be described in terms of states and transitions between states. The system transition
from one state to another is caused by the occurrence of an input signal, or a combination of input signals where it
can change the value of an output signal, or a set of output signals. The first step of the analysis is defining the states
of the system.
 Stopped: the line switched off (it can be started by the signal S0).
 Moving: the box is transported by the conveyor, and is expected on the scale platform.
 Loading: the box is positioned on the scale platform.
 CCW: the disk rotates CCW direction.
 Push: the jack pushes the box outside the scale platform.
 Return: the disk rotates CW, the push arm is returned to the first position, and the second conveyor is
transported the box.
Fig. 8 show all possible states and transition between them in order to transit from one state to another, it is required
an input signal and the output signal.

Fig. 8 State transition


Jour of Adv Research in Dynamical & Control Systems, Vol. 10, 02-Special Issue, 2018

4. Defining The Transition Functions


From the previous section, there are six states in the system, a 2n bits is required where n is the number of plant starts
to program all the states of the plant. Therefor the controller requires three bits to identify all the states. The Gray
code is selected because it can change only one bit in each transition. This can help in keeping the transition
functions as simple as possible. Table 1 shows the selected codes of all states of the system.
Table 1 States codes
1
State 2
Line State 3
M3 4
M2 5
M1
6
S0 7
Stopped 8
0 9
0 10
0
11
S1 12
Moving 13
0 14
0 15
1
16
S2 17
Loading 18
0 19
1 20
1
21
S3 22
CCW 23
0 24
1 25
0
26
S4 27
Push 28
1 29
1 30
0
31
S5 32
Return 33
1 34
1 35
1

Table 1 determines the setting and resetting the code bits (M1, M2 and M3). A bit is set by a transition if it was not
set in the source state of this transition, and set in the target state of this transition. Similarly, a bit is reset by a
transition if it was set in the source state and not set in the target state of this transition. The first code bit (M1) is set
in two transits, when the transit from Stopping state (S0) to Moving state (S1), the second transit is from push state
(S4) to return state (S5). The same code bit will reset at two transits, first one when the transit from Loading state
(S2) to CCW state (S3), the second one when the transit from Return state (S5) to Stopping state (S0). The
expressions to describe that are:
Set M1 if S0. M1. M2. M3 + S4. M1. M2. M3 (1)
Reset M1 if S2. M1. M2. M3 + S0. S5. M1. M2. M3 (2)
For the second code bit (M2) will be set at the transition from Moving state (S1) to Loading state (S2), and M2 will
reset when the transit from Return state (S5) to Stopping state (S0). As in the expression bellow:
Set M2 if S1. M1. M2. M3 (3)
Reset M2 if S0. S5. M1. M2. M3 (4)

The last code bit (M3) will be set when the transit from CCW state (S3) to Push state (S4) and reset when the transit
from Return state (S5) to Stopping state (S0). As shown in the expression bellow:
Set M3 if S3. M1. M2. M3 (5)
Reset M3 if S0. S5. M1. M2. M3 (6)
The finite state machine model is the transitions atomic where all bits will change their state during a transition
simultaneously. The PLC executes a program sequentially function by function. When a function is computed, the
respective bit is set or reset immediately. This will produce an error of transitions. For example, the functions for
resetting bits M2 and M3 both functions including the sub-expression (5) and (6). Each of these functions is correct
where describes the action which should be done if signal S0 and S5 occurs in last state. However, the functions are
executed sequentially, and when the function Reset M2 (4) has been executed, bit M2 will reset. Function Reset M3
(6) is then false, and bit M3 will remain unchanged. In order to solve this issue, it is necessary to prevent any
changes of state, until the computation of the entire sequence of functions has been finished. This can be
implemented by means of secondary bits, assigned as the one-to-one basis to the primary bits, i.e. To the used bits
that is used for encoding the system’s states. The next state of the system will be stored in an auxiliary flip flops will
where it is calculated by the computation of transition functions, until the entire computation finished. The system’s
next state is converting the current state by copying the state of secondary bits to the primary bits. There are three
primary bits: M11, M22, and M33 in the system. Denote the secondary bits by respectively. The Modified sequence
of functions can now be written as follows:

2286
*Corresponding Author: Mohammed S. Saleh,Email id : [email protected]
Article History: Received: Aug 15, 2018, Revised: Sep 10, 2018, Accepted: Oct 04, 2018
Set M11 if S0. M1. M2. M3 + S4. M1. M2. M3 (7)
Reset M11 if S2. M1. M2. M3 + S0. S5. M1. M2. M3 (8)
Set M22 if S1. M1. M2. M3 (9)
Reset M22 if S0. S5. M1. M2. M3 (10)
Set M33 ifS3. M1. M2. M3 (11)
Reset M33 if S0. S5. M1. M2. M3 (12)
Then exchange of the primary bits with the secondary bits as follows:

M1 = M11 (13)
M2 = M22 (14)
M3 = M33 (15)
5. The Output Functions
The Output functions are defining the relation of output signals values to the state of the automaton and the values of
input signals. These functions can be derived directly from the state transition. The output signals can change their
values during the transitions only. The new value is given by the action defined by the label of the transition.
In the system, the values of output signals depend on states only where signal Y1 is true in state (Start of the first
conveyor), signal Y2 is true in state (Rotating the disk CCW), signal Y3 is true in states (Pushing the box by jack),
signal Y4 is true in states (Start the second conveyer) and signal Y5 is true in states (Reverse relay ON). This
behavior is described by the following three functions:
Y1 = M1. M2. M3 (16)
Y2 = M1. M2. M3 + Y4 (17)
Y3 = M1. M2. M3 + Y4 (18)
Y4 = M1. M2. M3 (19)
Y5 = Y4 (20)
Output functions must be computed before copying the secondary bits state to the primary flip flops to keep the
outputs with current state of the system consistent. However, output functions do not need any transition functions,
but can be placed anywhere within the sequence.
6. Simplified Functions
In the first step we can take advantage of the incompleteness coding where not all combinations of states of bits are
used. When M2 is reset M3 is reset as well. Similarly, if M3 is set, then M2 is set as well. Using such dependencies,
the transition functions can be reduced to the form:
Set M11 if S0. M1. M2 + S4. M1. M3 (21)
Reset M11 if S2. M1. M2. M3 + S0. S5. M1. M3 (22)
Set M22 if S1. M1. M2 (23)
Reset M22 if S0. S5. M1. M3 (24)
Set M33 ifS3. M1. M2. M3 (25)
Reset M33 if S0. S5. M1. M3 (26)
Then the functions can be subject to factoring as follow:
Set M11 if M1. (S0. M2 + S4. M3) (27)
Reset M11 if M1. (S2. M2. M3 + S0. S5. M3) (28)
The error state in the system is important to study because of this state may be cause significant losses or endanger
the environment or even human’s life. By correcting the sequence, it can be used as a basis for designing a program
for PLC. However, PLC controllers are used in many application areas in which a malfunction of the system. It is
Jour of Adv Research in Dynamical & Control Systems, Vol. 10, 02-Special Issue, 2018

still required for the dependability of control programs in such areas such as air and railway transport, process
control and medical devices. To fulfill these requirements, it is necessary to plan a reaction to an error which can
arise during the computation. One of the most important sources of errors is the incomplete use of the space, created
by all possible states of bits used to encode the states of the system. For example, consider the coding of the states
defined in Table 1. Only 6 of 8 possible states of three bits are used in the system. The behavior in each of these 6
states is defined by the sequence of transition and output functions. But what happens if for any reason one of the
other two undefined states, e.g. M1=1, M2=0, M3 = 1, M1 = 0, M2 = 0 and M3 = 1 as shown in table 2 occurs. The
behavior of the system in such an invalid state has not been defined.
Table 2 Undefine States
36
M3 37
M2 38
M1 39
Line State 40
State
41
1 42
0 43
1 44
Undefine 45
Error
46
1 47
0 48
0 49
Undefine 50
Error

The state recovery policy returns the system to a valid and safety state must be exist. In many cases the most
obvious choice of such a recovery state is stopped. To implement this fail, stop policy, it needs an auxiliary bit,
which is set if an erroneous in next state was observed. The primary bits are reset to stop, instead of being set by the
erroneous next state, if the new bit has been set. In the system this protective action can be described by the
functions:
M4 = M1. M2. M3 + M1. M2. M3 (29)
M4 = M2. M3 (30)
M1 = M11. M4 (31)
M2 = M22. M4 (32)
M3 = M33. M4 (33)
7. Ladder Programming
A sequence of Boolean functions can be written in a ladder diagram form directly. Each function is converted into a
single line code. Parallel branches within the one line represents the disjunction. Serial elements within a given
branch represents a conjunction [11]. A normal closed contact is used to implement the negation of a system
controller, which implements the functions (21) – (33) is shown in Fig. 9.

Fig. 9 The Ladder Program


2288
*Corresponding Author: Mohammed S. Saleh,Email id : [email protected]
Article History: Received: Aug 15, 2018, Revised: Sep 10, 2018, Accepted: Oct 04, 2018
The ladder diagram shows how the program executes step by step. The output states determined by scanning the
program and solving the various logical functions. The output states updates are stored in fixed memory locations
(output image memory O). The physical PLC outputs is set/reset according the output values held in memory. For
the given PLC, the time taken to complete one cycle or the scan time is 0 - 20 msec. The input acquisition time is 1
to 2 cycle times and with a maximum program capacity of 350 blocks /200 words [12]. The development system
comprises a computer (PC) connected via an RS232 serial port to the target PLC. The PC provides the software
environment to perform storage, file editing, program operation monitoring and printing. The PLC development
process consists of: drawing the ladder diagram by using an exact editor, converting the source code into binary
code to be executable on the PLC’s microprocessor and downloading the object code to the PLC system from the PC
via the serial port. The PLC system works when it is in active control and it can monitor any data to check for the
correct operation [13].
8. Conclusion
In this paper the authors have successfully designed and implement a sequence control for monitoring system. The
steppes for design and analysis depends upon the Boolean function are described. The mathematical formalism of a
finite state machine model based for designing and analysis of the performance system is presented. Unexpected
states are determined and account for avoiding any error can cause significant damage to the system or the
environment or endanger human life, that may happen in the real system.

References
[1] Petruzella, F. D., “Programmable Logic Controllers”, McGraw Hill, 2005.
[2] Johnson, C. D., “Process Control Instrumentation Technology”, Prentice Hall, 2006.
[3] Hassapis, G., “An interactive electronic book approach for teaching computer implementation of industrial
control systems”, IEEE Transaction on Education, Vol. 46, pp. 177 – 184, Feb. 2003.
[4] Kamen, E. W., Gazarik, M. J., “A course in industrial controls and manufacturing for EE students and other
engineering majors”, Proceeding of the 1997 American Control Conference, Vol. 5, pp. 3160 – 3165, June
1997.
[5] Anderson, J. C., “Design a flexible industrial controls lab module”, 32nd Annual Frontiers in Education, Vol.
1, pp. 17 – 22, Nov. 2002.
[6] Osama Mahfooz, MujtabaMemon and AsimIftikhar, “Project Review on Water Level Sensing Using PLC”, Pak.
j. eng. technol. sci. Vol. 2, No 2, 2012.
[7] Komal Gupta and Kirti Mourya, “Initial Face of Automation Programable Logic Controller”, International
Journal of Advance Research in Science and Engineering IJARSE, Vol. No.2, Issue No. 2, 2013.
[8] Saurabh Sharma, T. Y. Ladakhi, A. P. Tiwary, B. B. Pradhan and R. Phipon, “Application of PLC for Elevator
Control System”, International Journal of Computer Applications (IJCA), 2011.
[9] Programmable Controllers. Part 2: Equipment Requirements and Tests, 1994.
[10] M. Tawadros, J. Rizk, and M. Nagrial, “Brushless DC motor control using PLC”.
[11] Mohamed Endi, Y. Z. Elhalwagy and Attalla hashad, “Three - Layer PLC/SCADA System Architecture in
Process Automation and Data Monitoring”, 978-1-4244-5586-7/10/C 2010 IEEE.
[12] Liping Guo, “Design Projects in a Programmable Logic Controller (PLC) Course in Electrical Engineering
technology”, The Technology Interface Journal, Vol. 10, No 1, 2009.
[13] G.Madhan, G. R. Kandhasamy and S. Muruganand, “Design and Implementation of PLC based Computerized
Monitoring in Dip Coating System”, International Journal of Computer Applications, Vol. 57, No 16, 2012.

You might also like