A Real-Time Robust Fuzzy-based Level Control Using Programmable Logic Controller

Industrial software are specially designed to meet specific process. And sometimes this software can be very expensive. One way to reduce this cost is to develop own algorithm. This paper presents a real-time liquid level control implementation for an industrial process. The implementation of the level control is achieved using a fuzzy-based control algorithm. A Programmable Logic Controller (PLC) was used in which the fuzzy control algorithm has been embedded and can withstand against abrupt changes in the outlet flow. In addition, the fuzzy control algorithm is introduced to the system without a fuzzy module or software package. As a consequence, a robust and low cost liquid level control system has been realized. A Mamdani Fuzzy Inference System (MFIS) has been proposed. Membership functions of the input and output variables of the system were obtained and verified using Matlab/Simulink environment. The obtained functions have been used for the construction of fuzzy control algorithm in PLC.  A robust fuzzy-based level controller has been achieved and quite satisfactory results were obtained in real-time implementation for different outlet flow rates. DOI: http://dx.doi.org/10.5755/j01.eee.21.1.7812

1 Abstract-Industrial software are specially designed to meet specific process.And sometimes this software can be very expensive.One way to reduce this cost is to develop own algorithm.This paper presents a real-time liquid level control implementation for an industrial process.The implementation of the level control is achieved using a fuzzy-based control algorithm.A Programmable Logic Controller (PLC) was used in which the fuzzy control algorithm has been embedded and can withstand against abrupt changes in the outlet flow.In addition, the fuzzy control algorithm is introduced to the system without a fuzzy module or software package.As a consequence, a robust and low cost liquid level control system has been realized.A Mamdani Fuzzy Inference System (MFIS) has been proposed.Membership functions of the input and output variables of the system were obtained and verified using Matlab/Simulink environment.The obtained functions have been used for the construction of fuzzy control algorithm in PLC.A robust fuzzy-based level controller has been achieved and quite satisfactory results were obtained in real-time implementation for different outlet flow rates.Index Terms-Fuzzy control, level control, process control, robust control, real time systems.

I. INTRODUCTION
The level control has an important role in chemical processes, pharmaceutical industry, nuclear plants and so on.The purpose of level control is to keep the liquid level of tank constant against sudden changes in outlet flow.The liquid level of tank must have accurate and continuous control to meet the changing needs of security and set points.It has been shown that the cause of the reactor fault in nuclear plants is due to the feed-water system in the nuclear reactor [1].In nuclear power plants, about 25 % of urgent shutdowns occur due to poor control of the steam generator water level.Such shutdowns highly decrease the sustainability of plant and must be minimized [2].
The PLC has been utilized in industry after the evolution of the microprocessors.The prevalence of PLC increases in industrial applications.It is simple, flexible and reliable.It has simple framework arrangement with minimal effort, low upkeep and running expense.Therefore, an industrial application could be effectively created by a PLC [3].
Most industrial applications require not only on/off states but also transition values between these two states as analog outputs.For instance, a level control can be obtained by on/off states control or using a feedback control scheme as PID or Fuzzy controller.However, the fuzzy controller is more available for these type applications since the advantages of short rise/fall time, fast response time, minimum overshoot and reduces the settling time.A nonlinear and multi-variable process can be controlled by Fuzzy logic [4]- [6].System control parameters is specified by a fuzzy controller adjusts the on the basis of a fuzzy rulebased expert system, which is a logical model of the human behavior of the process operator.Therefore, an exact model of the system is not necessary to design of the system.The fuzzy identifiers combine both linguistic and numerical information into their designs [7], [8].
The role of fuzzy logic in the controlling process has been expanded within the last decade [9].Several researches have been presented in recent years to investigate the problem of controlling the water level of a tank.Combination of Linear Quadratic Gaussian with Loop Transfer Recovery and fuzzy logic is presented to realize a scheme capable of overcoming the limitations of the classical control in [10].A genetic algorithm is suggested for optimal tuning parameters of fuzzy controller in [11].Decoupling control is introduced to weaken both water level regulating and steam flow rate disturbance in [12].An output feedback propagation control is presented in [13] for a class of nonlinear systems only based on system output.An expansion has been made to proportional-lag level control by load estimation for liquid level control in [14].An automatic controller has been intended to control for the water level of a steam generator with no manual operation from start-up to full load transient conditions in [15].
The fuzzy logic controllers can be easily applied to these types of processes by using readymade fuzzy toolbox software or modules.However, this kind of solutions increase the total cost of the control system.Nowadays, the PLCs have many high costly fuzzy software/module in their product ranges.
Thus in this work a robust fuzzy controller was proposed for a liquid level control system of an industrial process.A standard PLC has been used and developed program has been written to PLC without fuzzy logic module/software.Thus a low cost system was realized.Also one of the important points different from other studies is that the system has very good endurance to abrupt changes of outlet valve (up to 100 %).

A. Liquid Tank Model
The liquid tank model is created by accepting the flow Qi into the tank to the flow Q0 leaving through the outlet valve at the bottom of tank.The flow balance equation can be written as ( ) , where A is the cross-sectional area of the tank, and h(t) is the height of the liquid level in the tank.The flow through the outlet valve will be associated with the liquid level in the tank is given 2 ( ), where a is the cross-sectional area of the output pipe, Cd is called the discharge coefficient of the valve.And g = 980 cm/sec 2 is the gravity.In ( 2), Cd and a are constant so the product of two taken as constant c.Combining these two equations gives ( ) 2 ( ) .
To achieve the MATLAB of the liquid tank, (3) can be rewrite as The outlet flow rate is proportional with c which is adjusted by a manual valve to obtain the desired distortions [16]- [18].The system is in 1.The liquid tank has an input and an output.The detailed model of liquid tank is given in Fig. 2. As seen in model, inlet flow from actuator is numbered as 1 (input) and outlet flow is numbered as 2 (manual valve).

B. Mamdani Fuzzy Inference System
Fuzzy concept was introduced by Zadeh in 1965 to develop the mathematical framework for imprecisely presented data [19].A fuzzy rule-based system is formed entirely linguistic rule base.The rule base and the data base both represent the knowledge base of the Mamdani fuzzy rule-based system [20].
µ(x) represents the membership function on the universe X, thus The general and simplest if-then structure of the Mamdani algorithm can be given as where x is the input variable and y is the output variable.A and B are linguistic statements defined by fuzzy sets in the universes of x and y.Defuzzification is the final step of the construction of a fuzzy inference system.Several defuzzification methods exist, but almost the most favorite one is the centroid technique [21]- [25].Mathematically this Centre of Gravity (COG) technique can be expressed as where centroid defuzzification method finds the center of the fuzzy set A, on the interval from a to b.

C. Programmable Logic Controller
In this work, to control of the liquid level system a PLC (S7-200) has been used.Some technical specifications has been given in Table I.In this section the system is taken into account in two main parts as hardware and software.Overall system configuration is presented in Fig. 3.The conversions of values of each blocks are shown as below.

A. Hardware
The experimental setup basically consists of controller equipment, measurement devices and liquid tank system components.The implementation setup is shown in Fig. 4.
The details of components in Fig. 4   The height of liquid tank is scaled as 60 cm and it has inlet and outlet pipes.The liquid level is measured by pressure transmitter.The operation range of pressure transmitter is 0 mbar to 60 mbar, the output range of transmitter is 4 mA-20 mA.The minimum level value of 0 cm is measured as 4 mA by transmitter and this analog is converted to digital value of 6400 for PLC.actual of is calculated by using the digital value in PLC.The inlet liquid flow is controlled by using an electropneumatic positioner (actuator).The actuator is adjusted as 4 mA-20 mA with analog output of PLC.The distortion effect is obtained by a manual valve which is connected to outlet pipe.The actuator position and level of liquid are measured by a digital scope.The graphical representation of analog-digital conversion is shown in Fig. 5.

B. Software
In this work, a fuzzy-based level control algorithm was realized using Mamdani Fuzzy Inference System.The error, which is the difference between set value and actual level is used as an input.A one-input fuzzy inference system which is used in this work has been shown in Fig. 6.Mamdani Fuzzy rules have been used in this work is shown in Table II.The MATLAB/Simulink program is used to determine the membership functions.A Matlab Embedded program module has been written.Then the developed program was tested in simulation environment.After satisfactory results were obtained, the program was written to PLC.Flowchart of the PLC program has been shown in Fig. 8.

IV. SIMULATION AND REAL-TIME IMPLEMENTATION RESULTS
The real-time results were measured by using a digital scope.The actuator positions and liquid levels have been given in following figures.The simulation and experimental results were obtained for different levels and distortion effects.In Fig. 10, actuator positions are given in Fig. 10(a) for simulation and 10(b) for real-time and liquid levels are given in Fig. 10(c) for simulation and 10d for real-time.The outlet manual valve was adjusted as 25 % open and the reference levels were given 20 cm, 40 cm, 30 cm and 50 cm, respectively.As seen in Fig. 10  Up to the 20th seconds, the outlet manual valve was opened as 25 % and suddenly the valve was opened as 100 % in between 20 seconds and 35 seconds.This transition can be seen in Fig. 12(a) for simulation and Fig. 12(b) for real-time.The robust controller provides an uninterrupted process for level control as shown in Fig. 12(c) and Fig. 12(d).

V. CONCLUSIONS
A robust fuzzy controller has been developed to show performance of a liquid level control system of an industrial process using a standard PLC without fuzzy logic module or software package.The control algorithm was written through ladder diagram.The controller was tested and verified by using a real-time liquid level tank system.
A manual outlet valve was used for obtaining of different outlet flow rate disturbances to show robustness of the level control system.Performance of the control system was observed for various target levels under different outlet flow rates.
Satisfactory and well-matched simulation and implementation results which demonstrate performance of a robust fuzzy-based liquid level control system have been obtained.The developed system has very good endurance to abrupt changes of outlet valve up to 100 %.
In this work a low cost control scheme also has been achieved by not using ready package software.

Fig. 6 . 7 .
Fig. 6.One-input fuzzy inference system.The fuzzy triangular membership function for one input and one output variables are shown in Fig. 7.

Fig. 9 .
Fig. 9.Some part of Ladder Diagram.After the program is verified, it is written to the PLC using Ladder Diagram.Due to the length of the program, some part of Ladder Diagram has been shown in Fig. 9.

10 .
(a) for simulation and Fig. 10(b) for real-time, the actuator was 100 % opened for transitions of increasing level changes.Then the actuator was controlled by fuzzy controller to keep the level constant in which the actuator position was nearly 65 %.The graphs of 100 % open position of outlet manual valve were shown in Fig. 11.The actuator positions are given in Fig. 11(a) for simulation and Fig. 11(b) for real-time and liquid levels are given in Fig. 11(c) for simulation and Fig. 11(d) for real-time.The same set levels were used as in previous case to demonstrate the controller performance.The actuator position been to provide desired rate for inlet flow.The settling times were increased depending on the outlet manual valve position.Outlet manual valve is 25 % open, a) actuator position (simulation), b) actuator position (real-time), c) level of liquid (simulation), d) level of liquid (real-time) (Horizontal axis are in seconds).The actuator was opened about 65 % for 25 % open position and 85 % for 100 % open position of outlet manual valve as seen in Fig. 10(a) and Fig. 10(b) and Fig. 11(a) and Fig. 11(b), respectively.The desired levels were satisfactorily achieved in both cases.

11 .
Outlet manual valve is 100 % open, a) actuator position (simulation), b) actuator position (real-time), c) level of liquid (simulation), d) level of liquid (real-time) (Horizontal axis are in seconds).The outlet manual valve has been changed from 25 % open to 100 % open abruptly to show the robustness of the fuzzy controller in Fig. 12.

12 .
Changing of outlet manual valve from 25 % to 100 % open, a) actuator position (simulation), b) actuator position (real-time), c) level of liquid (simulation), d) level of liquid (real-time) (Horizontal axis are in seconds).

TABLE I .
TECHNICAL SPECIFICATIONS.

TABLE II .
MAMDANI FUZZY RULES.
Fig. 8. Flowchart of the PLC program.