http://www.press.ierek.com ISSN (Print: 2537-0154, online: 2537-0162) International Journal on: The Academic Research Community Publication DOI: 10.21625/archive.v2i4.389 An Intelligent Controller of Nonlinear Conical Tank Water Level System Hanan Mohamed Omran1, Ahmed Saad Ali2, Abd El-Fatah.Mohamed Hashem3, AliAbdalla Abdal-hay4 1Department of Mechatronics Engineering, South Valley University ,Qena, Egypt. 2Dr.Department of Mechatronics Engineering, Assuit University, Assuit, Egypt. 3Pro.Dr. Department of mechanical Engineering, South Valley University ,Qena, Egypt. 4Dr. Department of mechanical Engineering, South Valley University, Qena, Egypt. Abstract The present research presents an intelligent fuzzy logic controller (FLC) system for control water level of nonlinear systems, whereas the cross-section area of the vertical water is not constant (conical tank). The mathematical model of the conical tank level system was derived and its simulation runs were carried out by considering the FLC. For comparative analysis, a similar test runs were also carried out by means of conventional ZN based PI- mode. Interestingly, the results illustrate that applying the FLC system in the control loop in the conical tank system could provide a good tracking performance than that of conventional PI model. © 2019 The Authors. Published by IEREK press. This is an open access article under the CC BY license (https://creativecommons.org/licenses/by/4.0/). Keywords Fuzzy Logic Controller; Conical Tank; Nonlinear Process; PI controller; MATLAB ; 1. Introduction Numerous industry applications such as chemical plants, power plants, boiler, etcher requiring a control on their fluid tank precisely. This is extremely important because the desired production . Rates and inventories are achieved through proper control of fluid flow and flow level. In more specific, propor- tional integral derivative (PID) controller [1] and various linear controllers are the most popular control schemes which have been widely implemented to control the liquid level in the process tank. In most of the industrial pro- cesses, the conventional controllers are usually Proportional-Integral (PI) or Proportional-Integral-Derivative (PID. These controllers are popular partially due to their functional simplicity that allows a simple and straightforward operation. Many tuning approaches have evolved in tuning the controller since 1942 when Ziegler and Nichols [1] pioneered a Unified systematic properly, the PID loop must be properly tuned. Standard methods for tuning include Ziegler- Nichols Ultimate-cycle tuning [1], Cohen-Coon Method [3], Astrom and Hagglund [2] and many other traditional techniques. A level Control of conical tank is a challenging problem because of its non-linearity and changing in cross section. Due to its simplicity, fuzzy logic control [4] method became most famous in this application. Fuzzy logic is a form pg. 409 https://creativecommons.org/licenses/by/4.0/ Mohamed / The Academic Research Community Publication of probabilistic logic or many-valued logic; it deals with approximate reasoning rather than fixed and exact. Unlike traditional binary sets, where variables take either true or false values, fuzzy logic variables have a truth value that ranges in degree between 1 and 0. The truth value may range between completely true and completely false. Thus, Fuzzy logic has been extended to handle the concept of partial truth. Fuzzy logic is a part of artificial intelligence or machine learning which interprets a human’s actions. Computers can interpret only true or false values, but a human being can reason the degree of truth or degree of falseness. Fuzzy models interpret the human actions and are also called intelligent systems. Tuning approach in tuning the PI controller. For this control loop to function. 2. Application description Here, an inverted nonlinear structured conical process tank is taken. Generally conical tanks are highly preferred for industrial storage process because of gravity discharge in its shape and it is difficult to maintain the level of the liquid at the desired point. It has a nonlinear structure which leads the liquid in the tank rises with respect to the inclination angle through which the tank is designed. The pressure acting in the conical tank is different at each point, and in this article, a fuzzy logic controller is implemented and the results were compared with PI control technique. The process is considered as single input and single output, i.e. A tank has an inlet upstream valve and outlet downstream valve [5]. Identifying the process has to be done before proceed to tuning method. The process of identification has deals with the process gain (K), time constant (τ ), and time delay (θ ) that can be determined by an experimental result of single step change on process input. Figure 1. The liquid conical tank Table 1. Operating Parameters SI Parameter Description Value 1 R Top radius of cone 19.25cm 2 H Maximum Total height of the tank 73cm 3 Fin Maximum Inflow rate of the tank 111cm3/s 4 β Valve co-efficient 55cm2/s 3. Mathematical model of conical tank Fig. 1 illustrates the geometry relationship of the conical tank under study. As is shown, the shape isconical and therefore the geometrical relationship is nonlinear. The control goal is to keep up the level of liquid at a constant value and for thus must control the inflow rate. The radius of the cone is (r) for the level (h). The outflow rate is pg. 410 Mohamed / The Academic Research Community Publication due to the hydrostatic pressure and it is not controlled. For the level h the liquid volume V is given by: V = 1 3 ·π r2 ·g h tan α = R H = r h V = [ 1 3 ·π ·tan2 α ] ·h3·= 1 3 ·π · ( R H )2 ·h3 (1) 4. Volume variation is the difference between the inflow and the outflow and it depends on the discharge coefficient β , as follows: dv dt = Fin − Fout = Fin− β . √ h (2) By differentiating the equation (1), then: dv dt = [ 1 3 ·π ·tan2 α ] ·h2 (3) The transfer function relating the height h and the inflow rate Fin with parameters (k, τ ) can be obtained as Eq. (4) G(s) = H(s) Fin(s) = K.e−θ s τ s + 1 W here K = 2h Fout ; τ = 2hA Fout ; Fout = β . √ h (4) By the system identifier, process parameters of different operating regions are obtained (Table 2). The process tank is divided into four Region (I-IV). It is evident from Table 2, when the level of the tank raises the process gain and delay time decreases because of accumulation of integral error [6]. Table 2. Process parameter at different valve opening Inflow % Rang K τ θ 40% Region1 2.7 0.75 0.15 60% Region2 .68 1.5 0.70 80% Region3 0.18 0.78 0.22 100% Region4 0.09 0.30 0.30 5. Control description The main objective is to control the level of the non-linear conical tank. To achieve this, two controllers separately was proposed and comparing their results to evaluates its performance. 5.1. PID Controller PID stands for proportional, integral and derivative. These controllers are designed to eliminate the need for continuous operator attention. In order to avoid the small variation of the output at the steady state, the PID controller is so designed that it reduces the errors by the derivative nature of the controller. A PID controller is depicted in Figure 2. The set-point is where the measurement to be. Error is defined as the difference between set- point and measurement. (Error) = (set-point) – (measurement), the variable being adjusted is called the manipulated variable which usually is equal to the output of the controller. The output of PID controllers will change in response to a change in measurement or set-point [7]. Manufacturers of PID controllers use different names to identify the three modes. With a proportional controller, offset (deviation from set-point) is present. Increasing the controller gain will make the loop go unstable. Integral pg. 411 Mohamed / The Academic Research Community Publication action was included in controllers to eliminate this offset. With integral action, the controller output is proportional to the amount of time the error is present. Integral action eliminates offset. Controller Output = (1/Integral) (Integral of) e (t) d (t). With derivative action, the controller output is proportional to the rate of change of the measurement or error. The controller output is calculated by the rate of change of the measurement with time. Derivative action can compensate for a change in measurement. Thus derivative takes action to inhibit more rapid changes of the measurement than proportional action. When a load or set-point change occurs, the derivative action causes the controller gain to move the “wrong” way when the measurement gets near the set-point. Derivative is often used to avoid overshoot [7]. The different between the actual acceleration and desired acceleration is taken as error in this study. Figure 2. PID controller The PID controller is the most-used feedback control design. PID is a short form for Proportional-Integral- Derivative, show the three terms operating on the error signal to produce a control signal. If u(t) is the control signal which sent to the system, y(t) is the actual output and r(t) is the desired output, and tracking error e(t) = r(t) − y(t), a PID controller has the next form. u(t) = kpe(t)+ ki ∫ e(t) dt + kd d dt e(t) (5) The desired closed loop dynamics can be obtained by adjusting the three parameters KP, KI and KD, often it- eratively with ”tuning” and without specific knowledge of a plant model. Stability can often be obtained using only the proportional term. The integral term permits the rejection of a step disturbance. The derivative term pro- vides damping or shaping of the response. PID controllers are the most well established class of control systems: however, they cannot be used in several more complicated cases, almost in the MIMO systems [8]. Applying Laplace transformation in equation (5) will results in the transformed PID controller equation u(s) = kpe(s)+ ki 1 s e(s)+ kd se(s) (6) With the PID control transfer function C(s) = kp + ki 1 s + kd s (7) Kp: Proportional gain, a tuning parameter e: Error = SP − PV t: Time or instantaneous time (the present) KI: Integral gain, a tuning parameter τ : a dummy integration variable pg. 412 Mohamed / The Academic Research Community Publication The effects of each of controller parameters Kp, Ki, and Kd on a closed-loop system are summarized in the table below. Note that these correlations may not be exactly accurate, because Kp, Ki, and Kd are dependent on each other. In fact, changing one of these variables can change the effect of the other two. For this reason, the table should only be used as a reference for determining the values for Kp, Ki, and Kd [9]. Table 3. Effects of increasing PID parameters Type Rise-Time Overshooting Setting Time S-S Error Kp Decrease Increase Small change Decrease Ki Decrease Increase Increase Eliminate Kd Small change Decrease Decrease Small change 6. Intelligent controller (Fuzzy Logic Controller) Fuzzy logic is all about “The relative importance of precision” [10]. Its importance is to be exactly right when a rough answer will do. A list of general observations about fuzzy logic: 1. Fuzzy logic understanding is easy. Its mathematical concepts are very simple. Which makes fuzzy nice is the ”naturalness” of its approach and not its far-reaching complexity. 2. It is flexible. With any given system, it’s easy to massage it or layer more functionality on top of it without starting again from scratch. 3. Fuzzy logic is tolerant of imprecise data. Everything is imprecise if you look closely enough, but more than that, most things are imprecise even on careful inspection. Fuzzy reasoning builds this understanding into the process rather than tacking it onto the end. 4. Fuzzy logic can model nonlinear functions of arbitrary complexity. You can create a fuzzy system to match any set of input-output data. This process is made particularly easy by adaptive techniques like Adaptive Neuro-Fuzzy Inference Systems (ANFIS), which are available in the Fuzzy Logic Toolbox. 5. Fuzzy logic can be built on top of the experience of experts. In direct contrast to neural networks, which take training data and generate opaque, impenetrable models, fuzzy logic lets you rely on the experience of people who already understand your system. 6. Fuzzy logic can be blended with conventional control techniques. Fuzzy systems don’t necessarily replace conventional control methods. In many cases fuzzy systems augment them and simplify their implementation. 7. It is also based on natural language. The principal for fuzzy logic is the basis for human communication. This notice underpins many of the other statements about fuzzy logic. Classical control theory requires a mathematical model of the system. While, fuzzy logic based control does not require a mathematical model since it is a rule based system. Therefore it has an advantage over classical controller when it is applied to complex systems. It can be developed with minimal knowledge about the system dynamics. We’ll start with a little motivation for where we are headed. The point of fuzzy logic is to map an input space to an output space, and the primary mechanism for doing this is a list of if-then statements called rules. All rules are evaluated in parallel, and the order of the rules is unimportant. The rules themselves are useful because they refer to variables and the adjectives that describe those variables. Before we can build a system that interprets rules, we have to define all the terms we plan on using and the adjectives that describe them. Figure 3 is something like a roadmap for the fuzzy inference process. It shows the general description of a fuzzy system [10]. To summarize the concept of fuzzy inference depicted in this figure, “fuzzy inference is a method that interprets the values in the input vector and, based on some set of rules, assigns values to the output vector”. The key aspects of fuzzy logic are Fuzzy sets, membership functions, linguistic variables, fuzzy rules and fuzzy reasoning. These topics will be discussed in detail in the following sections [10]. pg. 413 Mohamed / The Academic Research Community Publication Figure 3. Overview of Fuzzy Logic 6.1. Fuzzy Sets Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp, clearly defined boundary. It can contain elements with only a partial degree of membership. To understand what a fuzzy set is, first consider what is meant by what we might call a classical set. A classical set is a container that wholly includes or wholly excludes any given element. For example, the set of days of the week unquestionably includes Monday, Thursday, and Saturday. It just as unquestionably excludes butter, liberty, and dorsal fins, and so on. We call this set a classical set because it has been around for such a long time. It was Aristotle who first formulated the Law of the Excluded Middle, which says X must either be in set A or in set not-A. In fuzzy logic, the truth of any statement becomes a matter of degree. A formal definition of a fuzzy set is, if X is a collection of objects denoted generically by x then a fuzzy set A in X is a set of ordered pairs [10]: A = { ( x, µx(x) x )ε X } Where µ A(x) is called the grade of membership or membership function of x in A. An often used method for denoting a fuzzy set is A = ∑ x1 ∈ X µA (Xi) Xi , i f X is discrete A = ∫ xµA(X) x ,i f X is continous 6.2. Linguistic variables Linguistic variables are used to describe particular characteristics of a system. A Linguistic variable is defined by [56] (X, T(x), U, G, M) where x is the name of the variable, T(x) is the set of names of linguistics values describing x over the universe of discourse U; G is a synthetic rule in the form of grammar for generating the name, X, of values of x, and M is a semantic rule for associating with each X its meaning. Each particular synthetic rule generated by G is referred to as a term. As an example if Temperature was the linguistic variable X and U = [30, 90], Then the term set might be T (temperature) = {cold, comfortable, hot}. M is a rule that assigns a fuzzy set or membership function to a specific term. e.g. M(cold) ={(u, µcold(u))/u ∈U} G(x) is a rule designed by using expert knowledge, which is generates the labels of the terms i.e. cold, comfortable and hot. A graph of this linguistic variable temperature is shown in Figure 4 [11]. It is to be noted that in our daily life most of the decisions are based on linguistic information rather than numerical pg. 414 Mohamed / The Academic Research Community Publication values; then the use of the linguistic variables is an ideal way to characterize human behavior and decision analysis [11]. Figure 4. Membership function example 6.3. Fuzzy Rules Fuzzy sets and fuzzy operators are the subjects and verbs of fuzzy logic. The if-then rule statements are used to formulate the conditional statements that comprise fuzzy logic. A single fuzzy if-then rule assumes the form if x is A then y is B Where A and B are linguistic values defined by fuzzy sets on the ranges (Universes of discourse) X and Y, respec- tively. The if-part of the rule ”x is A” is called the antecedent or premise, while the then-part of the rule ”y is B” is called the consequent or conclusion. Fuzzy rules also called as fuzzy if-then rules, fuzzy conditional statements or fuzzy implications are explained by using the fallowing example, X Y Small Negative big Large Positive small Using If-then statements IF x IS small THEN y IS negative big IF x IS large THEN y IS positive small Statements of this type are known rather approximately as conditional statements with formal definitions, if x is A then y is B or symbolically A →B Where A and B are linguistic sets defined by fuzzy sets on universe of discourse X and Y, respectively. The antecedent or premise is “x is A” while “y is B” is consequence or conclusion. The relation A → B represents a relation between two variables x and y. Using this idea, a fuzzy rule is defined as a binary relation R found by the Cartesian product depicted as, R (A → B) = A × B The Cartesian product is defined by the min. operator, A×B = ∫ min (µA (x), µB (y)) (x,y) or the algebraic operator [12] A×B = ∫ µA(x), µB (y) (x, y) pg. 415 Mohamed / The Academic Research Community Publication Thus the Cartesian product X × Y is characterized by the membership function µA(x, y) where each element (x, y) ∈ X × Y [11]. 6.3.1. Design of a Fuzzy Logic Controller The designing a fuzzy logic controller consists of the following four steps: 1. Fuzzification 2. Rule design 3. Computation 4. Defuzzification The key steps involved in designing a fuzzy logic controller were examined [10]. They consist of, defining input and output variables, a knowledge base, fuzzy reasoning inference and a defuzzification procedure. Figure 5 shows the basic elements of a fuzzy logic controller [11]. Figure 5. Fuzzy logic controller 6.3.1.1. Input and Output variables For a particular system the necessary input and output variables must be defined. No pre-defined procedure exists for defining the correct variable and relies on a thorough understanding of the plant being controlled and experi- mental procedures. If a controller for the plant has been already developed; this is often a good starting point for selecting the fuzzy input and output variables [11]. 6.3.1.2. Knowledge base This consists of two parts: a data base which defines linguistic variables and their corresponding membership functions, and a rule base which uses the data base in the development of the fuzzy if-then rules [10]. 6.3.1.3. Data base This consists of a set of input membership functions that defines each input and output variable. To arrive a data base for a fuzzy controller, the universe of discourse or interval spanned by each variable is partitioned into a number of fuzzy subsets with a linguistic label applied to each subset. For example the input to a fuzzy controller is acceleration, and then the corresponding linguistic variables can be portioned into fuzzy subsets named positive big (PB), positive small (PS), negative big (NB), negative small (NS), zero (ZE), positive medium (PM), negative medium (NM). The number of fuzzy subsets must be decided using pg. 416 Mohamed / The Academic Research Community Publication expert knowledge and or experimentation. Additional fuzzy subsets improve control sensitivity at the expense of additional computational complexity [11]. 6.3.1.4. Rule base A rule base is a group of fuzzy rules that define the controller output response given a particular set of inputs. The input conditions are the antecedent and the output conditions are the consequence of the fuzzy rules. Depending on the system being controlled, anywhere from 9 rules to control an inverted pendulum, to as many as 105 rules may be necessary to control a truck and trailer system. Lee gives four ways to derive fuzzy control rules [10] Use expert experience and control engineering knowledge. Based on operator’s control actions. Based on the fuzzy model of a process. Based on learning through experimentation. The most popular method is to use expert experience and control engineering knowledge. This procedure allows fuzzy control rules to relate state variables in the antecedent to process control variables in the consequence. However, it is necessary to have a general understanding of how a change in certain control input influences the system. One other increasingly popular method for developing fuzzy control rules is via an adaptive fuzzy rule system. Normally called as Adaptive-Network-based-fuzzy inference system (ANFIS). This technique enables rules to be developed directly from training data. This procedure utilizes neural networks in the development of fuzzy control rules and the optimization of the corresponding membership functions. 7. Simulation A conical tank control process considered here has nonlinear characteristics and can be represented as piecewise linearized regions around four operating regions as shown in table 2. Block diagram shown in Fig. 4 for the conical tank process system was created by using MATLAB SIMULINK software. The system simulation response is analyzed for 40% to 100% valve opening. 8. PID Simulation Figure 6. PID simulink of council tank pg. 417 Mohamed / The Academic Research Community Publication 9. FLC Simulation Figure 7. a) Simulink block diagram for non linear conical process tank Figure 8. (b) Subsystem tank Figure 9. (a) – (c) shows membership values (a) membershiperror e(t) Following five rules are used to make up the rule base of FLC: Rule 1: If an error is okay then valve is no change Rule 2: If an error is positive, then valve is open fast Rule 3: If an error is negative, then valve is closely fast Rule 4: If an error is okay and rate is positive, then the valve is closer slow Rule 5: If an error is okay and rate is negative, then valve is closely fast. pg. 418 Mohamed / The Academic Research Community Publication Figure 10. (b) membership of rate of error Figure 11. (c) membership of Input flow u(t) Fig.5. Shows the corresponding rule editor window in the MATLAB fuzzy logic toolbox. Fig.9 shows the rule editor window in MATLAB FLC toolbox. Figure 12. Fuzzy rules pg. 419 Mohamed / The Academic Research Community Publication 10. Results and discussion We find that the advantages and disadvantages of PID control and fizzy control just offset each other. We can use fuzzy controller for rapid control (coarse adjustment) and then use PID controller for accurate control (fine tune). As seen from table 4, compared with PID control program, the overshoot is less in fuzzy curve. Settling time reduces. The result of the simulation shows that as far as no balance and complex mathematical models, such a fuzzy control is similar to the human way of thinking. And it is suitable for coarse control at the beginning of the operation to rapidly control. And in order to get better 25 control accuracy, PID control program used as a fine tune. On the other hand, the fuzzy and PID control program presented has a wide practical value because of the fuzzy control program does not rely on the mathematical model. The responses of level control of Conical Tank using MATLAB, Simulink are as shown above. The simulation shows the simulated results of the ZN tuning method. From the simulated results step response for 40% step input is better than 60%, 80% and 100% in terms of time domain specifications. 60% step response also shows better results closer to 40% step change. Then results show the response of FLC on simulation. The controller stabilizes at the desired water level very quickly. In the fourth region in PID the system shows the high non-linearity process, FLC shows critical system. 10.1. PID Results Figure 13. Step response for 40% step input Figure 14. Step response for 60% step input pg. 420 Mohamed / The Academic Research Community Publication Figure 15. Stepresponse for 80% step input Figure 16. Stepresponse for 100% step input 10.2. FLC Results Figure 17. Step response for 40% step input pg. 421 Mohamed / The Academic Research Community Publication Figure 18. Step response for 60% step input Figure 19. Step response for 80% step input Figure 20. Step response for 100% step input Table 4. Comparion of PID & FLC NO Rise time Setting time Peak time Max overshoots 1 PID 50 78 60 1.33 2 60 90 60 1.55 3 55 70 60 1.45 1 FLC 13 38 20 1.1 2 20 40 29 1.09 3 20 48 25 1.1 pg. 422 Mohamed / The Academic Research Community Publication 11. Conclusion Non-linearity of the conical tank is observed and the model is implemented with the help of MATLAB. Level control of the tank is checked by both PID Controller and Fuzzy Logic Controller. From the simulation results we can observe that Fuzzy Logic Controller gives fast response with less number of oscillations when subjected to change in the level of the conical tank compare to PID controller and it enhances the performance of the system. 12. References 1. Sung, S.W.; and Lee, I.-B. (1996). Limitations and countermeasures of PID controllers. Industrial & Engi- neering Chemistry Research, 35(8), 2596-2610. 2. Ziegler, G. and Nichols, N. B,”Optimum settings for automatic controllers”, Trans. ASME, 64,759-768, 1942. 3. Astrom, K J.;.Hagglund .T, , “ Automatic tuning of simple regulators with specifications on phase and amplitude margins”, Automatica, 20,645- +a651, 1984. 4. G.H Cohen and G.A Coon: “Theoretical Consideration of Retarded Control “, Trans ASME 75,pp.827/834,1953. 5. O.Safarzadeh, A.Kahki Sedigh and A.S.Shirani, ‘Identification and robust water level 6. control of horizontal steam generators using quantitative feedback theory’, Energy 7. conversion and Management, vol.52, pp.3103-3111, 2011. 8. S.Nithya, N.Sivakumaran, T.K.Radhakrishnan and N.Anantharaman” Soft Computing Based Controllers Implementation for Non-linear Process in Real Time” Proceedings of the World Congress on Engineering and Computer Science(WCECS )2010,Vol – 2. 9. S. Mouleeswaran, Development of Active Suspension System for Automobiles using PID Controller, Pro- ceedings of the World Congress on Engineering 2008 Vol II WCE 2008, July 2 - 4, 2008, London, U.K. 10. http://www.linuxcnc.org/docs/2.4/html/common Integrator Concepts.html. 11. H. Imine, A. Benallegue, T. Madani and S. Srairi, “Rollover risk prediction of an instrumented heavy vehicle using high order sliding mode observer”, 2009 IEEE International Conference on Robotics and Automation, Kobe, Japan. 12. The MathWorks Inc . ”Fuzzy Logic Toolbox for use with MATLAB”, The MathWorks Inc., 2004. 13. http://www.scribd.com/doc/22786677/Quarter-Car-Vehicle-Suspension system-Using-Fuzzy-Logic-controller. 14. Gao, W.Zhang, N.Du, H. P.”A half-car model for dynamic analysis of vehicles with random parameters” The fifth Australasian Congress on Applied Mechanics (ACAM 2007), Brisbane, Australia, Vol.149, No. 163. pp.595-600, December 10-12, 2007. pg. 423 Introduction Application description Mathematical model of conical tank Volume variation is the difference between the inflow and the outflow and it depends on the discharge coefficient , as follows: Control description PID Controller Intelligent controller (Fuzzy Logic Controller) Fuzzy Sets Linguistic variables Fuzzy Rules Design of a Fuzzy Logic Controller Simulation PID Simulation FLC Simulation Results and discussion PID Results FLC Results Conclusion References