TAREQ AZIZ HASAN AL-QUTAMI. 14670 ...... 2, pp. 74-81, 1994. [24] A. M. F. Fileti, A. J. B. Antunes, F. V. Silva, V. Silveira Jr, and J. A. F. R. Pereira,.
Development of an Advanced Controller for Flow Process Applications Using Fuzzy Logic
BY TAREQ AZIZ HASAN AL-QUTAMI 14670
FINAL DISSERTATION Submitted to the Department of Electrical & Electronic Engineering in Partial Fulfillment of the Requirements for the Degree Bachelor of Engineering (Hons) (Electrical & Electronic Engineering)
January 2015
Universiti Teknologi PETRONAS Bandar Seri Iskandar 31750 Tronoh Perak Darul Ridzuan
1
CERTIFICATION OF APPROVAL
Development of an Advanced Controller for Flow Process Applications Using Fuzzy Logic By
TAREQ AZIZ HASAN AL-QUTAMI A project dissertation submitted to the Department of Electrical & Electronic Engineering Universiti Teknologi PETRONAS in partial fulfilment of the requirement for the Bachelor of Engineering (Hons) (Electrical & Electronic Engineering)
Approved:
_______________________ (Dr Rosdiazli Bin Ibrahim) Project Supervisor
UNIVERSITI TEKNOLOGI PETRONAS TRONOH, PERAK
January 2015
2
CERTIFICATION OF ORIGINALITY
This is to certify that I am responsible for the work submitted in this project, that the original work is my own except as specified in the reference and acknowledgements, and that the original work contained herein have not been undertaken or done by unspecified sources or persons.
_______________________
TAREQ AZIZ HASAN AL-QUTAMI
3
ABSTRACT Flow control is essential in many industrial applications such as chemical reactors, heat exchangers and distillation columns. Most industrial processes exhibit nonlinearities and inherit dead time, which limit the performance of conventional linear PID controllers. This Project aims to design and implement two advanced process controllers based on Fuzzy Logic for flow control applications. The objective of the controllers is to overcome the problems inherited with conventional PID controllers such as handling unpredicted disturbance, non-measureable noise as well as further improve the performance of the transient state and the steady state. The first controller is Fuzzy Logic Controller and the second is Hybrid between Fuzzy Logic and PID (FPID) where Fuzzy Logic is used to tune PID gains in real time. The developed controllers were implemented in Flow Control and Calibration Unit PcA SimExpert Mobile Pilot Plant. The design is done using Matlab/Simulink software package and is connected to the Pilot Plant through USB-type DAQ cards. Simulation and implementation results showed that the developed controllers have less overshoot, good control performance, better disturbance handling ability, great robustness and are more flexible. It is expected that these advanced controllers improve efficiency and productivity of industrial processes through proper handling of any disturbance or noise and increase the robustness of controller actions. Lastly two HMIs were developed for the Pilot Plant to easily tune parameters and visualize trends, they are expected to increase efficiency of experimentation on the Pilot Plant and can be used to analyze controller performance and make optimization easier.
i
ACKNOWLEDGEMENT First and foremost, all praises to Allah almighty for his blessings and guidance. Deepest gratitude to project supervisor Dr Rosdiazli Bin Ibrahim , for teaching me to have high standards and not to satisfy with less than the best, for giving me the chance to do something that I enjoy and most of all for his constant guide and support. Second I would like to thank all of those who helped and made sure the project is a success and it will be a precious experience and I would like to specifically thank Mr Azhar Bin Zainal Abidin, for his assistance in laboratory work. Last but not least I would like to thank my family and friends for standing beside me and supporting me until the end of the project. Thank you.
ii
TABLE OF CONTENT ABSTRACT.............................................................................................................................. I ACKNOWLEDGEMENT ....................................................................................................... II LIST OF TABLES ................................................................................................................... 1 LIST OF FIGURES ................................................................................................................. 2 NOMENCLATURE ................................................................................................................ 4 1.
PROJECT BACKGROUND............................................................................................ 5 1.1 BACKGROUND STUDY ............................................................................................. 5 1.2 PROBLEM STATEMENT ............................................................................................ 6 1.3 OBJECTIVES ................................................................................................................ 6 1.4 SCOPE OF STUDY ....................................................................................................... 6 1.5 RELEVANCY, FEASIBILITY AND SIGNIFICANCE OF THE PROJECT ............... 7
2.
3.
LITERATURE REVIEW ................................................................................................ 8 2.1
FLOW MEASUREMENT ....................................................................................... 8
2.2
CONVENTIONAL PID CONTROLLER ................................................................ 9
2.3
FUZZY LOGIC ...................................................................................................... 10
2.4
FUZZY LOGIC CONTROLLER (FLC) ................................................................ 11
2.5
COMPARISON BETWEEN FLC AND FUZZY-PID CONTROLLER ............... 13
2.6
FUZZY LOGIC IN PROCESS CONTROL ........................................................... 14
2.7
FUZZY LOGIC CONTROLLER STRUCTURE .................................................. 15
METHODOLOGY ........................................................................................................ 17 3.1 PROJECT FLOWCHART ........................................................................................... 17 3.2 PROJECT ACTIVITIES .............................................................................................. 18 3.3 KEY MILESTONES AND GANTT CHART .............................................................. 19
4.
RESULTS AND DISCUSSION .................................................................................... 22 4.1 PILOT PLANT DESCRIPTION .................................................................................. 22 4.2 PILOT PLANT CHARACTERISTICS AND CALIBRATION .................................. 24 4.3 PLANT MODELING ................................................................................................... 27 4.4 PID CONTROLLER DESIGN ..................................................................................... 30 4.5 FUZZY LOGIC CONTROLLER (FLC) DESIGN ...................................................... 32 4.6 HYBRID FUZZY PID CONTROLLER (FPID) DESIGN ........................................... 35
iii
4.7 SIMULATION RESULTS ........................................................................................... 37 4.8 CONTROLLERS IMPLEMENTATION IN PILOT PLANT ...................................... 41 4.9 DISTURBANCE HANDLING .................................................................................... 43 4.10 CONTROLLERS TUNING PROCEDURE .............................................................. 46 4.11 HUMAN MACHINE INTERFACE (HMI) DEVELOPMENT ................................. 48 5.
CONCLUSION AND RECOMMENDATION ............................................................. 51 5.1 CONCLUION .............................................................................................................. 51 5.2 RECOMMENDATION ............................................................................................... 51
6.
APPENDICES ............................................................................................................... 52 APPENDIX A: SIMULINK MODEL TO DEVELOP CONVERSION FUNCTIONS AND STUDY CONTROL VALVE CHARACTERISTICS ................................................................................. 52 APPENDIX B: MATHEMATICAL MODELLING ...................................................................... 53 APPENDIX C: DETAILS OF EMPIRICAL MODELLING........................................................... 54 APPENDIX D: PID TUNING METHODS ................................................................................ 59 APPENDIX E: SIMULINK MODEL FOR CONTROLLERS SIMULATION ................................... 60 APPENDIX F: SIMULINK SYSTEM FOR CONTROLLERS IMPLEMENTATION ......................... 62 APPENDIX G: SIMULINK MODEL SUBSYSTEMS .................................................................. 63 APPENDIX H: PILOT PLANT INSTRUMENTS ........................................................................ 65
iv
LIST OF TABLES
Table 2.1 fuzzy logic components ............................................................................. 10 Table 2.2: Comparison among different controllers .................................................. 14 Table 2.3: Quick reference to controllers ................................................................... 16 Table 3.1: Project activities ........................................................................................ 18 Table 3.2: Gantt chart of Final Year Project 1 ........................................................... 19 Table 3.3: Gantt chart of Final Year Project 2 ........................................................... 20 Table 4.1: comparison between available flow meters .............................................. 23 Table 4.2: Recorded data using Orifice FT ................................................................ 25 Table 4.3: Results from Process Reaction Curve using Orifice FT ........................... 28 Table 4.4: Results from Process Reaction Curve using Coriolis FT.......................... 29 Table 4.5: Summary of Empirical Modelling ............................................................ 30 Table 4.6: PID tuning parameters .............................................................................. 30 Table 4.7: fine-tuned PID parameters ........................................................................ 32 Table 4.8: FIS rules and relationship between inputs and output .............................. 34 Table 4.9: Operating regions and their appropriate action ......................................... 34 Table 4.10: FIS rules and relationship between inputs and output for Fuzzy PID .... 36 Table 4.11: Response characteristics for controllers.................................................. 40 Table 4.12: Response characteristics for controllers, aggressive tuning ................... 40 Table 4.13: Controllers parameters for Orifice FT model ......................................... 40 Table 4.14: Controllers parameters for Coriolis FT model ........................................ 41 Table 4.15: Response characteristics for controllers.................................................. 43 Table 4.16: Disturbance response summary .............................................................. 46 Table 4.17: Controllers parameters used in implementation ..................................... 46 Table 6.1: Parameters obtained from PRC, Orifice FT First Run .............................. 54 Table 6.2: Parameters obtained from PRC, Orifice FT Second Run ......................... 55 Table 6.3: Parameters obtained from PRC, Coriolis FT First Run ............................ 56 Table 6.4: Parameters obtained from PRC, Coriolis FT Second Run ........................ 57 Table 6.5: Cohen-Coon Correlations formulas .......................................................... 59 Table 6.6: Ziegler-Nichols Open-Loop Correlations formulas .................................. 59
1
LIST OF FIGURES Figure 1.1: Typical feedback control system ............................................................... 5 Figure 2.1: Time domain PID block diagram .............................................................. 9 Figure 2.2: Basic configuration of Fuzzy Logic system ............................................ 11 Figure 2.3: Fuzzy Logic controller block diagram .................................................... 11 Figure 2.4: Fuzzy Inputs and Outputs ....................................................................... 12 Figure 2.5: Rules evaluation at given input states...................................................... 13 Figure 2.6: Defuzzification of Fuzzy output using centroid ...................................... 13 Figure 2.7: Fuzzy-PID controller block diagram ....................................................... 13 Figure 2.8: FP controller ............................................................................................ 15 Figure 2.9: FPD controller ......................................................................................... 16 Figure 2.10: Incremental controller............................................................................ 16 Figure 2.11: FPD+I controller .................................................................................... 16 Figure 3.1: Project flowchart...................................................................................... 17 Figure 3.2: Implementation Block diagram ............................................................... 21 Figure 4.1: P&ID of the Pilot Plant............................................................................ 22 Figure 4.2: Raw data VS. Filtered Data using ButterWorth Filter ............................ 24 Figure 4.3: Raw data VS. Filtered data using FIR filter ............................................ 25 Figure 4.4: Observed Flow Rate VS. Measured Voltage ........................................... 26 Figure 4.5: Orifice Flow Rate VS Valve opening ...................................................... 26 Figure 4.6: Coriolis Flow Rate VS Valve opening .................................................... 27 Figure 4.7: series tanks system .................................................................................. 27 Figure 4.8: valve opening % & Flow Rate l/min for Orifice FT................................ 28 Figure 4.9: valve opening % & Flow Rate l/min for Coriolis FT .............................. 29 Figure 4.10: Simulink Plant model with PID Control ............................................... 31 Figure 4.11: Orifice model PI response using Parameters from Ziegler Nichols(black), Cohen Coon(red) methods and the final Fine-tuned response(blue) 31 Figure 4.12: Coriolis model PI response using Parameters from Ziegler Nichols(black), Cohen Coon(red) methods and the final Fine-tuned response(blue) 32 Figure 4.13:FLC structure .......................................................................................... 32 Figure 4.14: Membership functions for input E ......................................................... 33 Figure 4.15: Membership functions for input CE ...................................................... 33 Figure 4.16: Surface View of FIS ............................................................................. 35 Figure 4.17: Fuzzy PID structure ............................................................................... 35 Figure 4.18: Membership functions for input E (left) and CE (right) ........................ 36 Figure 4.19: 3D Surface Views of FIS for FPID ...................................................... 37 Figure 4.20: Response of PID, FLC, and FPID to step change using Orifice FT ...... 37 Figure 4.21: Response of PID, FLC, and FPID to Random steps using Orifice FT .. 37 Figure 4.22: Response of PID, FLC, and FPID to step change using Coriolis FT .... 38 Figure 4.23: Response of PID, FLC, and FPID to Random steps using Coriolis FT 38 2
Figure 4.24: Aggressive response of controllers to step change using Orifice FT .... 38 Figure 4.25: Aggressive response of controllers to random changes using Orifice FT .................................................................................................................................... 39 Figure 4.26: Aggressive response of controllers to step change using Coriolis FT ... 39 Figure 4.27: Aggressive response of controllers to random changes using Coriolis FT .................................................................................................................................... 39 Figure 4.28: Response of controllers to step change using Orifice FT ...................... 42 Figure 4.29: Controllers performance due to random step changes using Orifice FT42 Figure 4.30: Response of controllers to step change using Coriolis FT .................... 42 Figure 4.31: Controllers performance due to random step changes using Coriolis FT .................................................................................................................................... 43 Figure 4.32: Controllers disturbance response, Orifice FT ........................................ 44 Figure 4.33: Controllers disturbance response, Coriolis FT ...................................... 45 Figure 4.34: Screenshot of the whole Simulink System ............................................ 48 Figure 4.35: Simulink Controllers Mask .................................................................... 49 Figure 4.36: Simulink Pilot Plant Mask ..................................................................... 49 Figure 4.37: Simulink Set Point Slider ...................................................................... 49 Figure 4.38: Screenshot of the whole Simulink System, Altia Pulg-in ..................... 50 Figure 4.39: HMI face-Plate developed by Altia Design ........................................... 50 Figure 6.1: Simulink Model for Pilot Plant study and Calibration ............................ 52 Figure 6.2: PRC for Orifice, First Run ....................................................................... 54 Figure 6.3: PRC for Orifice, Second Run .................................................................. 55 Figure 6.4: PRC for Coriolis, First Run ..................................................................... 56 Figure 6.5: PRC for Coriolis, Second Run ................................................................. 57 Figure 6.6: Simulink System for Empirical Modeling ............................................... 58 Figure 6.7: Plant and Valve Subsystem ..................................................................... 58 Figure 6.8: Simulink System for Controllers Simulation .......................................... 60 Figure 6.9: PID Block Mask ...................................................................................... 60 Figure 6.10: FLC Block Mask ................................................................................... 61 Figure 6.11: FPID Block Mask .................................................................................. 61 Figure 6.12: Simulink System for Controllers Implementation ................................. 62 Figure 6.13: Controller Subsystem ............................................................................ 62 Figure 6.14: Pilot Plant Subsystem ............................................................................ 63 Figure 6.15: PID controller Subsystem ...................................................................... 63 Figure 6.16: FLC controller Subsystem ..................................................................... 63 Figure 6.17: FPID controller Subsystem .................................................................... 64 Figure 6.18: Record and Scope Subsystem ................................................................ 64
3
NOMENCLATURE
PID
Proportional Integral Derivative
PI
Proportional Integral
PD
Proportional Derivative
FL
Fuzzy Logic
FIS
Fuzzy Inference System
ANFIS
Adaptive Neuro-Fuzzy Inference System
PV
Process Variable
SP
Set Point
MV
Manipulated Variable
SISO
Single Input Single Output
MIMO
Multiple Input Multiple Output
PC
Personal Computer
HMI
Human Machine Interface
GUI
Graphical User Interface
DAQ
Data Acquisition Card
FT
Flow Transmitter
MPC
Model Predictive Control
4
1. PROJECT BACKGROUND
1.1 BACKGROUND STUDY Process control is an engineering discipline that facilitates basic operation and control requirements of a process by maintaining its output within a certain desired range. For example controlling the amount of feed to a chemical reactor in order to maintain a consistent product output or regulate the inflow and outflow to a tank in order to maintain liquid level in the tank. These processes include oil and mineral refining, Pharmaceutical and Food Processing, petrochemicals, chemicals, power generation, etc. Some processes are single input single output (SISO) and others are multiple input multiple output (MIMO). The control of these processes can be in open loop or closed-loop (feedback loop). The feedback control system typically consists of sensor(s), controller, and final element(s) as shown in Figure 1.1.
Figure 1.1: Typical feedback control system Performance stability of the system depends mostly on the controller since it can be modified [1]. The most used controller is PID which performs well in the absence of process disturbances and nonlinearities [2]. There are more robust and effective controllers than PID which can overcome unpredicted disturbances and can adequately control nonlinear processes or processes with multiple inputs/outputs, such as Fuzzy logic, Neural Networks and Model Predictive Control.
5
1.2 PROBLEM STATEMENT The most widely used controllers in industry are PID controllers because of their simple structure and satisfactory performance as long as they are properly tuned [3]. However they have some disadvantages, one of which is they do not perform well in presence of unpredicted disturbances and they have to be retuned frequently to accommodate the wear and tear of equipments which results in changing behaviours of the system not to mention the extensive knowledge required to tune them properly [4]. Furthermore, fluid flow control is one of the most complex and fastest processes and is affected by several factors like change in pressure, temperature, density and viscosity as well as presence of impurities in the fluid. Thus advanced robust flow controller design is required to tackle these problems and handle any unpredicted disturbance. Another issue is related to the existing PID controller which is mounted on the Local Control Panel and does not have Human Machine Interface (HMI) on the local panel where the data trend can be viewed. So, the proposed system provides monitoring and tuning HMI accessed through a remote PC. 1.3 OBJECTIVES The main aim of this project is to design, develop and implement an advanced controller based on intelligent approach for flow control application. The objectives of the research are as follows:• To investigate and design advanced control strategy for flow Control process using Fuzzy Logic principles. • To implement the advanced control strategy onto the Pilot Plant. • To compare current PID control strategy to the proposed advanced controller in terms of control performance and handling disturbances. 1.4 SCOPE OF STUDY The scope of is to design and implement a fluid flow controller based on Fuzzy logic and investigate the performance of the controller under different conditions using PcA SimExpert Mobile Pilot Plant which will be interfaced through DAQ cards. The controller will be designed using MATLAB/Simulink software package, and lastly design an interactive HMI for it. 6
1.5 RELEVANCY, FEASIBILITY AND SIGNIFICANCE OF THE PROJECT This project is related to the field of Instrumentation and Process Control System specifically the design of advanced process controllers. Advanced controllers solve a lot of issues inherited within conventional controllers such as disturbance handling and tuning difficulty. Moreover, those advanced controllers will guarantee efficient and productive process and increase profit. The Pilot Plant used in this project is scaled-down plant that reflects industrial standards and captures real disturbances such as unmeasured noise, feed pressure and nonlinearities, and it uses industrial grade control and measurement instruments. Thus, the designed controller could be applied in industrial scale once tested and proven reliable in this Pilot Plant and that is where the significance of the project lies. Finally, since all tools required for this project are available and the designed controller can be validated using the pilot plant, with proper planning and determination, this project is feasible to be completed within the time frame and scope of work.
7
2. LITERATURE REVIEW
2.1 FLOW MEASUREMENT Precise measurement of flow is essential in the process industries to ensure proper rate of supply of ingredients during mixing and blending of materials and to avoid any high rate that may cause temperature or pressure to reach dangerous levels, spilling of materials or over-speed of machines. Furthermore, Flow measurement is used to determine quantity of a product passed to customers (custody transfer) and is essential for accounting and payment purposes [5, 6] . Flow measurement is classified into volumetric flow rate (Litres/min, ft3/s, gallons/s), mass flow rate (fluid mass per unit time like kg/h) and flow velocity (kg/h or Ib//h) [5]. The measurement of flow process parameters like flow rate has been difficult for process engineers and several measuring techniques had been developed for this purpose [7], There are several concepts on how the flow of fluid is measured such as differential pressure, positive displacement, directly reading mass, Velocity and other electronic flowmeters such as Coriolis, electromagnetic flow detectors, thermal, vortex, and ultrasonic flowmeters [8]. There are several factors that influence fluid flow through a system, and significantly impact flowmeters measurements, these factors are: -
Velocity: the faster the flow, the more inertia the liquid has.
-
Density which is weight per unit of a volume and is affected by pressure and temperature.
-
Viscosity which is the ease with which the fluid flows and it is affected by temperature.
-
Pipe size where the larger the size the easier it is for fluid to pass through.
These factors can be numerically determined using Reynolds number (R number) in Eq.1. 𝑅=
𝑉𝐷𝜌
Eq. 2.1
𝑢
V = velocity, D = Pipe inner diameter, ρ = density, u = viscousity [5]. 8
2.2 CONVENTIONAL PID CONTROLLER PID controller and its variants PI and PD are the most widely used in process industries due to their simple structures, easy realization and good performances [4, 9, 10]. The formula and diagram of PID are shown in Eq. 2.2 and Figure 2.1. 𝒕
𝒅𝒆
𝒖 = 𝑲𝒑 𝒆 + 𝑲𝒊 ∫𝒕𝟎 𝒆𝒅𝒕 + 𝑲𝒅 𝒅𝒕
;
𝒆 = 𝑺𝑷 − 𝑷𝑽
(Eq. 2.2)
Figure 2.1: Time domain PID block diagram Where u is the output of the controller, e is the error between step point (SP) and process value (PV). Kp, Ki and Kd are proportional, integral and derivative gains respectively [9, 11]. Proportional gain will keep the controller output in proportion to the error, the integral will eliminate the offset or steady state error and derivative will anticipate the change in error and is in proportion to its rate of change [11]. However, PID is a linear-type controller and hence is only efficient for a limited operating range when used to control non-linear processes [9]. But most of the industrial processes exhibit nonlinear characteristics and inherit long dead-time such as flow, PH and temperature [9, 12]. Moreover, parameters tuning is sensitive and has to be changed with changing process conditions (gain scheduling) and requires expertise in order to be tuned properly [13]. These reasons led to the development of advanced nonlinear controllers such as MPC, Fuzzy logic and Neural Networks based controllers.
9
2.3 FUZZY LOGIC Using limited experimental data to generate a reliable empirical model is a challenging task especially for MIMO and nonlinear processes. Traditionally, statistical models are developed using these experimental data. However it is still hard to choose the most appropriate model structure and parameters. Mathematical modelling for some processes like flow is not easy and therefore model based control is not possible [14]. It seems that new methodologies for efficient
control and
modelling are required. This is where Fuzzy Logic and Neural Networks come in [13]. Fuzzy Logic is a mathematical system that is used to deal with Fuzzy information which are complex
to
calculate
by means of
conventional
mathematics [14]. Fuzzy Logic uses Fuzzy sets in continuous interval [0, 1] rather than two-valued logic (0, 1) or crisp set. Table 2.1 explains the main components of Fuzzy Logic [15]. Table 2.1 fuzzy logic components Fuzzification
Converts the inputs into information that the inference
interface
engine can use to apply rules (Fuzzy sets) via what is called membership functions.
Rule base
Fuzzy quantification using if-then statements of the expert’s linguistic knowledge.
Inference engine
Emulates the expert’s decision making by activation of antecedents then modification of consequents using minimum or multiplication operators, then accumulation of consequents using maximum or summation operators to result in output Fuzzy set.
Defuzzification
Converts the output Fuzzy set into a crisp number that can
interface
be sent as actual inputs to the process using methods like centre of gravity or averaging.
Following Figure 2.2 shows the general configuration of Fuzzy Logic system.
10
Figure 2.2: Basic configuration of Fuzzy Logic system
There are two famous types of Fuzzy inference system the first and most common was introduced by Mamadani to control steam engine and boiler [16], the output membership functions are continuous Fuzzy sets. Whereas the second type was introduced by Sugeno [17] in which the output membership functions are either constant or linear (discrete). There are also two general types of Fuzzy logic, type-1 which is the most common and the one we explained. Type-2 however differs from type-1 in membership functions which are in type-2 considered Fuzzy, i.e. Fuzzy sets are themselves fuzzy. Thus type-2 Fuzzy sets handle uncertainties better than typ-1 Fuzzy sets [18, 19]. A more advanced inference system is called Adaptive neuro-Fuzzy inference system (ANFIS) where the learning capability of neural networks is used to tune the Fuzzy logic and was introduced by Roger Jang in 1993 [20]. 2.4 FUZZY LOGIC CONTROLLER (FLC) General FLC block diagram is shown is Figure 2.3. The inputs to most of FLCs are the error and error rate of change; the outputs go through scaling functions and then fed to the final element (e.g. Control Valve).
Figure 2.3: Fuzzy Logic controller block diagram 11
An example that demonstrates how the Fuzzy Logic controller works is the control of steam turbine. The input and output variables are mapped into the fuzzy sets in Figure 2.4, where N3 is Large
negative,
N2
is
Medium
negative, N1 is Small negative, Z is Zero, P1 is Small positive, P2 is Medium positive, and P3 is Large positive. The Fuzzy controller takes crisp inputs and maps them into their membership
functions.
These
mappings are evaluated using the rules. If
the
rule
relationship
specifies between
an
inputs,
AND then
minimum of the inputs is used as the combined truth value; if an OR is specified, then maximum is used.
Figure 2.4: Fuzzy Inputs and Outputs
The rule set for this example can be designed as: (1) IF Temperature is cool AND Pressure is weak,
THEN throttle is P3.
(2) IF Temperature is cool AND Pressure is low,
THEN Throttle is P2.
(3) IF Temperature is cool AND Pressure is ok,
THEN Throttle is Z.
(4) IF Temperature is cool AND Pressure is strong, THEN Throttle is N2. If the input temperature is in the "cool" state, and the pressure is in the "low" and "ok" states. Then the fuzzy output is evaluated as shown in Figure 2.5.
12
Figure 2.5: Rules evaluation at given input states The resulted fuzzy output from inference system can then be defuzzified using centroid method as shown in Figure 2.6. 1 Z
P2
F i 0 0g Centroid output u Figure 2.6: Defuzzification r of Fuzzy output using centroid e 2.5 COMPARISON BETWEEN FLC AND FUZZY-PID CONTROLLER Fuzzy-PID controllers are hybrid controllers that use FL engine to adaptively tune 2 the parameters of a conventional PID depending on the current state of the system. . The final element is controlled by the6 output of the PID instead of the Fuzzy Logic, F in contrast to FLC. Figure 2.7 shows general block diagram of Fuzzy-PID controller. i g u r e
2 . 6 Figure 2.7: Fuzzy-PID controller block diagram Table 2.2 shows a comparative summary among PID,FLC and FPID controllers.
13
Table 2.2: Comparison among different controllers PID
FLC (Mamadani)
FLC (Sugeno)
FPID
1940
1975 [16]
1985 [21]
-
Output
Summation of P,I and D terms
Crisp value from FLC
FIS outputs singleton (Output membership)
FIS outputs 3 gains to tune PID
Computational requirements
Least requirements
intensive
More efficient than Mamadani
Depends on FIS
Works well with optimization techniques
-
No
Yes
Depends on FIS
Yes
No
No
No
Widely used
Little
Little
Little
Disturbance rejection
Little
Excellent
Excellent
Excellent
Easy tuning
No
Yes
Yes
No
Able to adapt to dynamic changes
No
Yes
Yes
Yes
Membership functions tuning, linguistic rules tuning
Membership functions tuning, linguistic rules tuning
Membership functions tuning, linguistic rules tuning
Criteria Years of Invention
Linear? Application in process industry
Design Difficulty
SISO, MIMO Integration with neural networks for learning and auto-tuning?
Tuning, and best performance requires system modelling
SISO only
Both
Both
Both
No
Yes
Yes
Yes
2.6 FUZZY LOGIC IN PROCESS CONTROL Fuzzy logic has been applied in industry and has managed to overcome problems inherit with conventional PID controllers. For example NOX reduction in a power plant and plasma-etching are non-linear processes that were modelled by Lou and Huang [14] using Fuzzy logic through limited experimental data . Takagi and Sugeno who developed Fuzzy controllers for water cleaning process and a converter in a steal-making process which solved the decomposition and realization 14
problems of the controllers [21]. Another application is in the boiler system of thermal power plant where control of the water level in the drum is crucial, and PID control fails in the presence of process disturbance while Fuzzy logic controller performed better in disturbance handling [2]. Another Fuzzy controller was also developed for steam temperature control in steam distillation of the extraction oil and results achieved were better than PID in terms of step point tracking [22]. A Type-2 Fuzzy controller was developed for aerobic alcoholic fermentation nonlinear bioprocess characterized by parameter uncertainty proved to reduce the negative effects of system parameters with a minimum computational load [18]. a multiregional FLC was proposed by Qin and Borders [23] for control of nonlinear processes such as pH titration in continuously stirred tank reactor. Prior knowledge divides the process into Fuzzy regions and Fuzzy controller is designed based on this information where auxiliary process variable will detect the operating region. And several other Fuzzy controllers were developed for several processes involving disturbance, nonlinearity and long dead-time and proved to have improvements over the conventional controller. Fuzzy-PID controllers were developed for several processes such as polymerization process which was proven to be more reliable than conventional PID, batch time and the energy consumption were reduced for batch distillation column process [24]. Simple tuning mechanisms for PID controllers were developed using Fuzzy logic for SISO and MIMO systems and were tested on coupled double tank plant where water level is the controlled variable and results showed better performance and rejection of disturbance associated with tank nonlinearity than conventional PID [25]. 2.7 FUZZY LOGIC CONTROLLER STRUCTURE Several FLC structures have been developed, most common structures are: 2.7.1 FP Controller Fuzzy Proportional controller in Figure 2.8 is the simplest fuzzy controller that emulates P controller and take the error as input and it is not sufficient to control most processes. Figure 2.8: FP controller
15
2.7.2 FPD Controller Fuzzy PD controller in Figure 2.9 has advantage of less overshoot due to the use of derivative term however it is sensitive to noise and an abrupt change of the reference causing Figure 2.9: FPD controller
a derivative kick [26]. 2.7.3 FPI (Incremental) Controller Fuzzy
PI
controller
or
incremental
controller in Figure 2.10 will ensure zero steady state error. The change in control signal cu is added to the current control Figure 2.10: Incremental controller
signal, 𝑈𝑛 = 𝑈𝑛−1 + 𝑐𝑢𝑛 .
A disadvantage is that it cannot include D-action well [3, 26]. 2.7.4 FPD+I Controller Fuzzy PD+I controller in Figure 2.11 is a three input controller that combines FPD controller with I controller. The integral error is computed as
Figure 2.11: FPD+I controller It provides all the benefits of PID control; however it also inherits the disadvantages of derivative kick and integrator windup. A summary of all controller structures is shown in Table 2.3. Table 2.3: Quick reference to controllers
16
3. METHODOLOGY 3.1 PROJECT FLOWCHART Start
Preliminary Research
Scope determination
Literature review
FYP 1
Hardware setup and testing
Plant modelling and study
Controllers development
Reject ed
Simulation? Acceptable
Tuning and optimization FYP 2 Fail
Implementation? Success
Data analysis and future work End Figure 3.1: Project flowchart
17
3.2 PROJECT ACTIVITIES Table 3.1: Project activities Activity
Description
Preliminary Research
Gathering
information
about
the
project
and
Scope determination
Deciding the scope and type of controller to be used
understanding previous projects work and results.
based on the project and the preliminary research. Literature review
Comprehension of the current literature, findings and principles the project relies on such as Fuzzy Logic and flow measurements.
Hardware setup and testing
Setting up hardware interface to the plant via DAQ board,
Plant modelling and study
Develop plant model through mathematical, empirical, or
testing and calibrating the instruments.
statistical techniques and analyze its behaviours before developing the controller. Find and tune the PID controller using Ziegler Nichols or Coheen Coon tuning methods.
Controllers development
Develop the Fuzzy Inference System for the controllers based on the plant analysis. Two controllers will be developed
Fuzzy logic
controller
and
Fuzzy-PID
controller, FIS will be designed using Matlab FL toolbox. Simulations
Simulation of the developed controllers in Matlab to check performance and response characteristics.
Tuning and optimization
Fine tuning the input/output scaling and membership functions of the developed controllers to ensure the best control performance and response characteristics.
Implementation
Implementing the controllers and testing them by subjecting them to random step changes and disturbances then optimizing them further.
Data analysis and future work
Analysis of the results and comparison with conventional PID control then suggestions for future work.
18
3.3 KEY MILESTONES AND GANTT CHART Table 3.2: Gantt chart of Final Year Project 1 Item/Week (FYP1)
1
2 3
4
5 6 7
8 9
10 11 12 13 14
project title selection Preliminary research and scope
*
determination Literature review Extended proposal Hardware setup and testing Plant modelling and
*
study Proposal defense presentation Testing and tuning
*
PID controller Submission of FYP1 Draft Report Submission of FYP1
*
interim report * Key milestone, Red deliverables Key milestones of Final Year Project 1: -
Determine the scope of the project and type of advanced controller to be used
-
Obtain a plant model to be used in simulations and developing PID controller.
-
Develop and tune a PID controller to be used for comparison with the advanced controllers.
-
Prepare and write the interim report.
19
Table 3.3: Gantt chart of Final Year Project 2 Item/Week (FYP2)
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15
Controllers development and
*
simulation Testing developed system in the lab Tuning and
*
optimization Data collection and results analysis Progress report submission Testing controllers
*
under disturbance Results analysis
*
Pre-EDX presentation Future work recommendation Submission of Draft Report Submission of Final
*
Report VIVA
*
* Key milestone, Red deliverables Key milestones of Final Year Project 2: -
Develop the Fuzzy Logic Controller and Fuzzy-PID controller.
-
Simulation and tuning of the developed controllers to get best performance.
-
Testing the developed controllers under different circumstances and analyze and compare the results to PID controller.
-
Prepare the Final report and do the VIVA.
20
3.5 TOOLS AND EQUIPMENT REQUIRED
A laptop or PC.
2 USB-1208FS DAQ cards or 1 of USB-1208FSPLUS card.
Simulink/MATLAB software package with Data Acquisition, Control System and Fuzzy Logic toolbox.
PcA SimExpert Mobile Pilot Plant SE231B-21 Flow Control and Calibration Process Unit (block 23).
250 ohm resistors to convert 4-20mA into 1-5V.
The hardware and equipments were setup according to block diagram is shown in Figure 3.2 below.
E USB
SP dE/dt
Controller
MV
DAQ
1-5V
250 Ohm
PV
(AO)
COMPUTER USB
Control Valve
PILOT PLANT 1-5V
DAQ
250 Ohm
4-20mA
(AI) Figure 3.2: Implementation Block diagram
21
Sensor
4. RESULTS AND DISCUSSION 4.1 PILOT PLANT DESCRIPTION The SimExpert Model: SE231B-21 is a self-contained Mobile Flow meter Calibration Trainer (Pilot Plant). The Piping and Instrumentation Diagram (P&ID) is shown in Figure 4.1 and pictures of the Pilot Plant are in Appendix H.
Figure 4.1: P&ID of the Pilot Plant The plant is simply two series tanks with the objective of transferring the fluid from VE-100 Buffer Tank to the VE-200 Calibration Tank; while controlling the fluid flow rate between the two tanks. P-101 and P201 are pumps used to circulate the fluid between the two tanks. The main feedback controller in this plant is PIC - 110 which controls the flow rate using either one of the three available flow transmitters FT-110A, FT-110B and FT-110C, selecting the desired FT is done using the Manual Selection Switch. The controller sends an appropriate output signal to control the opening of the Control Valve (CV-110). In order to prevent the overflow of fluid in the tanks, two level switches (LS-101 and LS-201) are connected to the pumps (P101 and P-201) respectively in order to shut down the pumps whenever the level in the tanks get too high to prevent overflow or too low to protect the pumps from 22
damage. The pressure transmitters (PT-101 and PT-102) are used to determine the pressures before and after the Control Valve CV-1 10 (differential pressure). There is also a Level Transmitter to measure the fluid level in the Calibration tank VE200.TT-102 RTD temperature transmitter is used to measure the fluid temperature circulating between the tanks and can be used to determine the density of the fluid. Several hand-valves have been installed to control the flow in the plant. The first Flow meter available in this plant is differential pressure (DP) flow meter which operates on the principle of pressure drop due to an orifice plate in the flow stream. The difference in pressure between the upstream and downstream of the orifice plate is proportional to the square of volumetric flow across the orifice. It is a volumetric flow meter whose measurement is dependent on the density of the flowing fluid. Second flow meter is the Vortex Flow meter which operates on the principle of vortices created when a bluff body is present in the flow stream; it is a volumetric flow meter whose measurement is dependent on the density of the flowing fluid. The third flow meter is Coriolis flow meter which operates on the principle of Coriolis force. With this principle mass flow rate can be measured independent of the changes in fluid density and temperature. It is therefore a true mass flow meter and is capable of measuring the true liquid mass flow, volumetric flow and liquid density. Hence it is used as the Master flow meter in this plant and used to calibrate the other two flow meters. The following Table 4.1 summarizes the differences between those three flow meters. Table 4.1: comparison between available flow meters
Mass Type Head Type Velocity Type
Device Type Coriolis
Fluid
Slurries
Liquid/Gas
Viscous Liquid Yes
Yes
Relative Accuracy Cost (%F.S.) High 0.02~0.5
Orifices Plate Vortex
Liquid/Gas/ Steam
Limited
No
Low
0.25~2
Liquid/Gas/ Steam
Limited
No
Medium
0.25~2
23
4.2 PILOT PLANT CHARACTERISTICS AND CALIBRATION In order to use the Pilot Plant for testing the designed controllers; valve characteristics, conversion functions and operating ranges have to be identified using Simulink model in Appendix A. 4.2.1 Valve Percent Opening To Analogue Voltage Conversion The control signal coming from controller is usually in percentage of full range, this percentage has to be converted to a proper voltage/current signal and fed to the Manipulated Variable. In this project the Valve input range is 4-20mA and the DAQ card can only output 0-4 Volt which can be converted to current using a 250 Ohms resistor. Eq. 3.1 is used to convert from Valve opening Percentage to Volts. u
AO = 25 + 1
(Eq. 4.1)
4.2.2 Measurements Filter Design Data coming from Flow Transmitter is noisy and a filter is required, two filters were considered as follow: 1) Butterworth Analogue Low Pass Filter: This filter has a configurable order N and Bandwidth Wc. The resulting filter has N poles around the circle of radius Wn in the left half plane, and no zeros. Results of first order with Wn=17 are shown in Figure 4.2. 1.65
Raw Data Filtered Data
1.6 1.55
Flow Rate (volt)
1.5 1.45 1.4 1.35 1.3 1.25 1.2 1.15
0
20
40
60
80
100
120
140
160
100 samples/sec
Figure 4.2: Raw data VS. Filtered Data using ButterWorth Filter
24
180
200
2) Discrete FIR Filter: an FIR filter with configurable coefficients can be designed using Matlab DSP toolbox, results of a 20 coefficients with equal values 0.05 are shown in Figure 4.3. 1.65
Raw Data Filtered Data
1.6 1.55
Flow Rate (Volt)
1.5 1.45 1.4 1.35 1.3 1.25 1.2 1.15
0
20
40
60
80
100
120
140
160
180
200
100 samples/sec
Figure 4.3: Raw data VS. Filtered data using FIR filter
4.2.3 Voltage To L/min Conversion Function The flow rate measurements from the Pilot Plant are in 4-20mA, converted to 1-5 Volt using 250 Ohms resistor. However flow rate is required to be in Litre/minute (l/min) unit thus a conversion formula is required to convert the measured 1-5 Volt into Flow rate in l/min. This can be done as follow: i.
Change valve opening, record voltage from the Transmitter and the flow rate measurement in the local display panel, results in Table 4.2. Table 4.2: Recorded data using Orifice FT Valve opening (%) 0 10 20 30 40 50 60 70
Observed Flow rate (L/min) 0 0 0 15.9 22.8 29.5 34.2 38
25
Measured input Voltage (V) 0.5 0.5 0.5 1.01 1.23 1.42 1.56 1.67
ii. Plot observed flow rate versus measured voltage and obtain a linear equation to
relate them. Figure 4.4 Shows flow rate versus voltage.
Volt
1.5
1 0.5 0
10
20
30
40
Flow Rate(I/min)
Figure 4.4: Observed Flow Rate VS. Measured Voltage The developed Conversation Formula is 𝒚 = 𝟑𝟐. 𝟎𝟖𝒙 − 𝟏𝟔. 𝟏 (Eq 4.2) iii. Similar steps were taken to develop the conversion formula for Coriolis and Vortex FTs and the conversion formula is the same as Eq 4.2. 4.2.4 Valve Characteristics And Linear Operating Region Before modelling the process, the linear region has to be identified. Sweeping across the valve range and observing the changes in flow rate can be used to identify the linear region and study the valve characteristics. i.
Orifice FT: this Transmitter can only measure flow rates above 16 l/min and according to Figure 4.5, it can only operate between 30% -75% valves opening which corresponds to 16 l /min - 38 l /min respectively.
Flow rate (l/min)
40 30
20 10 0 0
20
40
60
80
Valve opening (%)
Figure 4.5: Orifice Flow Rate VS Valve opening ii. Coriolis FT: this Transmitter can measure flow rate from 0 l/min however due to the bypass flow in the plant the FT reports 11 l/min when valve is totally closed (0%). according to Figure 4.6, the Best operating range is 26
between 20% to 75% valve opening which corresponds to 21 l/min to 51.5 l/min respectively.
Flow rate (l/min)
60 40 20 0 0
20
40
60
80
Valve opening (%)
Figure 4.6: Coriolis Flow Rate VS Valve opening
4.3 PLANT MODELING 4.3.1 Mathematical Modelling Figure 4.7 shows the simplified plant system that can be used to come up with the mathematical model. The developed mathematical equations can be found in Appendix B.
Figure 4.7: series tanks system 4.3.2 Empirical Modelling After studying the Pilot Plant characteristics, we can now design and carry out an experiment to get the Process Reaction Curve (PRC) and estimate the parameters of a First Order with Dead Time (FODT) model. There are two methods to estimate these parameters:
27
1.
Method I uses the Maximum slope of PRC to determine the time constant and dead time, this method is prone to errors because of evaluation of maximum slope especially in presence of noise.
2.
Method II uses the rise time characteristics to estimate the parameters.
PRC can be obtained by introducing a perturbation to MV and record the response of the system however several points has to be considered in choosing the step size: -
The step is in the linear region and step change is close to perfect step.
-
The step does not have any long term disturbance, i.e. when returning back to initial value, PV will return to initial value as well.
-
The Signal to noise ratio has to be sufficiently large (greater than 5).
The flow rate can be measured using one of three Flow Transmitters selected from front panel. The selection of the Flow Transmitter will influence the response of the process, thus one model has to be developed for each Flow Transmitter. In this project, Orifice FT and Coriolis FT were used and two PRCs were obtained. Orifice FT 50 45
MV (%) PV (L/min)
40 35 30 X: 358 Y: 25.23
X: 572 Y: 29.89
25 X: 194 Y: 17.42
20 15
0
100
X: 337 Y: 20.89
200
300
X: 310 Y: 17.41
400
500
600
100 samples/sec
Figure 4.8: valve opening % & Flow Rate l/min for Orifice FT
From PRC in Figure 4.8, using Method II and sampling rate of 100 samples/second, the results are summarized in Table 4.3: Table 4.3: Results from Process Reaction Curve using Orifice FT Parameter
Value
Change in perturbation / MV, Change in output / PV, 28
20% 12.5 𝑙/𝑚𝑖𝑛
time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% )
0.315 𝑠𝑒𝑐
dead time, 𝜃 = 𝑡63% − 𝜏
1.325 𝑠𝑒𝑐
Steady State Process Gain, KP = /
0.625
The FODT model obtained is 𝑮(𝒔) =
𝟎. 𝟔𝟐𝟓 𝒆−𝟏.𝟑𝟐𝟓𝒔 𝟎. 𝟑𝟏𝟓𝒔 + 𝟏
Coriolis FT SP% PV(L/min)
52 50 48 46 44 42
X: 153 Y: 37.14
38 X: 82 Y: 35.21
36 34
X: 289 Y: 41.94
X: 162 Y: 39.42
40
0
50
100
X: 141 Y: 35.27
150
200
250
300
350
400
100 samples/s
Figure 4.9: valve opening % & Flow Rate l/min for Coriolis FT From PRC in Figure 4.9, the results in Table 4.4 are obtained: Table 4.4: Results from Process Reaction Curve using Coriolis FT Parameter Change in perturbation / MV,
Value 10%
Change in output / PV,
6.7 l/min
time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% )
0.15 𝑠𝑒𝑐
dead time, 𝜃 = 𝑡63% − 𝜏
0.65 𝑠𝑒𝑐
Steady State Process Gain, KP = /
0.67
The FODT model obtained is 𝑮(𝒔) =
𝟎.𝟔𝟕𝒑 𝒆−𝟎.𝟔𝟓𝒔 𝟎.𝟏𝟓𝒔+𝟏
In order to make sure the model is valid another PRC was obtained for each FT and the average was taken, calculation details and Simulink Model are in Appendix C. 29
Table 4.5 shows a summary of modelling parameters, the average values for each Flow Transmitter will be used in controllers design. Table 4.5: Summary of Empirical Modelling
No
perturbation in MV
1 2
20 10
1 2
10 20
Change in PV(∆) 12.5 5.3 Average
t63% t28% Orifice Plate 1.64 1.43 1.54 1.22
6.7 14.44 Average
Coriolis 0.8 0.7 0.8 0.67
time constant
dead time
Process Gain(Kp)
0.315 0.480 0.398
1.325 1.060 1.193
0.625 0.530 0.578
0.150 0.195 0.173
0.650 0.605 0.628
0.670 0.722 0.696
4.4 PID CONTROLLER DESIGN Using models parameters from Table 4.5, we can obtain the PID parameters using any tuning method such as Cohen Coon correlations or Ziegler-Nichols tuning methods. Table 4.6 below shows the PID parameters using Cohen Coon correlations and Ziegler-Nichols open-loop tuning methods (formulas are in Appendix D). Table 4.6: PID tuning parameters
P
Using Orifice FT Ziegler-Nichols open-loop Kc Ti Td 5.19
Using Coriolis FT Ziegler-Nichols open-loop Kc Ti Td 5.23
PI
0.52
3.94
0.36
2.07
PID
0.69
2.39
0.47
1.26
Control Mode
0.6
0.31
P
Cohen Coon correlations Kc Ti Td 1.15
Cohen Coon correlations Kc Ti Td 0.87
PI
0.66
0.67
0.48
0.31
PID
1.35
1.61
1.00
0.80
Control Mode
0.28
4.4.1 PID Controller Simulation Figure 4.10 shows the Simulink model used to simulate the PID controller.
30
0.14
Figure 4.10: Simulink Plant model with PID Control After testing with the different control modes, PI seems the best for this process. Figure 4.11 and Figure 4.12 show the results of using Cohen Coon correlations and Ziegler-Nichols open-loop tuning methods as well as the fine-tuned response for Orifice & Coriolis models. 20 SP
flow rate l/min
18
Response using CC tuning
16
Response using ZN tuning
14
Response after Fine-tuning
12 10 8 6 4 2 0 0
500
1000
1500
2000 100 samples/sec
2500
3000
3500
Figure 4.11: Orifice model PI response using Parameters from Ziegler Nichols(black), Cohen Coon(red) methods and the final Fine-tuned response(blue)
31
4000
20 SP Response using CC tuning Response using ZN tuning
flow rate l/min
15
Response after Fine-tuning
10
5
0
0
500
1000
1500
2000
2500
3000
100 samples/sec
Figure 4.12: Coriolis model PI response using Parameters from Ziegler Nichols(black), Cohen Coon(red) methods and the final Fine-tuned response(blue)
Table 4.7 shows the parameters of the fine-tuned response for Orifice and Coriolis models. Table 4.7: fine-tuned PID parameters Model/Parameters Kp Ki (1/Ti) Kd 0.35 0.6 0 Orifice Model 0.35 1.1 0 Coriolis Model
4.5 FUZZY LOGIC CONTROLLER (FLC) DESIGN The Fuzzy Logic Controller (FLC) for this project has Fuzzy PD+Fuzzy PI structure shown in Figure 4.13. The inputs to the controller are the error (E) and the rate of change of error (CE) while the output of FIS is the change in control action (CU). GE and GCE are input gains used to map input ranges to the range of FIS. The Fuzzy PI part (incremental controller) accumulates CU and ensures zero steady state error; it has GCU gain to control the accumulation rate and it is dependent on the process dead time and rise time. GEU
E CE
GE
FIS
GC U
CU
GCE
GU
Rule Base Figure 4.13:FLC structure
32
1/s
∑
MV
The Fuzzy PD part will ensure faster reaction and dampen the oscillations and its effect can be controlled through GU gain that controls the amount of derivative action contribution to the output. A Proportional gain that is dependent on the error has been added and it can be used to increase the initial kick of the controller however increasing this value may lead to harder tuning of other parameters and bigger overshoots. 4.5.1 FIS structure and Membership Functions Both Sugeno-Takagi FIS and Mamadani FIS were experimented with however Sugeno-Takagi type FIS has been chosen for this controller since it is computationally efficient and can be optimized during implementation. Figure 4.14 and Figure 4.15 show the membership function of inputs.
Degree of membership
NB 1
NM
NS
ZE
PS
PM
PB
-20
-10
0 E
10
20
30
0.8
0.6
0.4
0.2
0 -30
Figure 4.14: Membership functions for input E
Degree of membership
NB 1
NM
NS
ZE
PS
PM
PB
-20
-10
0 CE
10
20
30
0.8
0.6
0.4
0.2
0 -30
Figure 4.15: Membership functions for input CE
Error and Change of Error have 7 Gaussian-type MFs and ranges are set to [-30 30] according to Section 4.2 where Plant operating limits were identified. The output membership functions for the output are discrete values rather than fuzzy membership functions. 33
The memberships for the output are: NB, NM, NS, ZE, PS, PM and PB referring to Negative Big, Negative Medium, Negative Small, Zero, Positive Small, Positive Medium and Positive Big respectively, all outputs are distributed equally in the range of [-0.4 0.4]. 4.5.2 FIS Rules Table 4.8 and Table 4.9 show the 45 FIS rules developed for the Fuzzy Logic Controller and the different operating regions, they are based on the behaviours of PID controller. Table 4.8: FIS rules and relationship between inputs and output E/CE NB NM NS ZE PS PM PB
NB NB NB NM NM NS PS PB
NM NB NB NS NS NS PS PB
NS NB NM NS ZE ZE PM PB
ZE NB NM NS ZE PS PM PB
PS NB NM ZE ZE PS PM PB
PM NB NS PS PS PS PB PB
PB NB NS PS PM PM PB PB
Table 4.9: Operating regions and their appropriate action I: Starting up, response to the Set Point change II: Error is not changing, change output accordingly III: Moving along, Maintain output IV: getting worse, reverse output somewhat.
V: Error changing very fast, adjust output a bit if necessary. VI: reached equilibrium VII: Error is zero but changing VIII: Error is zero but changing insignificantly, wait and no change in action.
The Surface view in Figure 4.16 shows a graphical representation of the rules and how the surface changes when error and rate of error change, we can observe that the slope of control action is steep near the zero error, sharp and nonlinear when error is big and error rate is big and it is almost linear when error rate is zero.
34
0.5 0.4 0.3 0.2 CU
0.1 0 -0.1 -0.2 -0.3 -0.4 -0.5 30
20
10
0
-10
-20
CE
-30
-30
20
10
0
-10
-20
30
E
Figure 4.16: Surface View of FIS
4.6 HYBRID FUZZY PID CONTROLLER (FPID) DESIGN Another advanced controller investigated in this project is Hybrid between linear PID and Fuzzy Logic where Fuzzy Logic is used to tune the PID gains in real time resulting in a nonlinear adaptive PID controller structure shown in Figure 4.17. The inputs to the FIS are the error (E) and the rate of change of error (CE) while the output of FIS are change in Proportional Gain (CP) and change in Integral Gain (CI) the derivative part was not implemented since most flow processes don’t require derivative action. GE and GCE are input gains used to map input ranges to the range of FIS, GCP and GCI are output gains of FIS, while Kp,Ki, and Kd are PID gains. E CE
GE
CP
FIS
GCE
CI
GCP GCI
CD
GCD
Rule Base Kp
∑ ∑
Ki ∑
Kd
Figure 4.17: Fuzzy PID structure
35
1/s du/dt
∑
MV
4.6.1 FIS structure and Membership Functions A Sugeno-Takagi type FIS with Gaussian input MFs was chosen for this controller, Figure 4.18 show the membership functions of inputs. N
Z
N
P
0.8 0.6 0.4 0.2
Z
1 Degree of membership
Degree of membership
1
0
P
0.8 0.6 0.4 0.2 0
-30
-20
-10
0 E
10
20
30
-30
-20
-10
0 CE
10
20
30
Figure 4.18: Membership functions for input E (left) and CE (right)
Inputs have three Gaussian-type MFs and ranges are set to [-30 30] while outputs have three discrete values -1, 0 and 1. Both inputs and outputs MFs are referred to as N (Negative), Z (Zero), and P (Positive). 4.6.2 FIS Rules Table 4.10: FIS rules and relationship between inputs and output for Fuzzy PID E/CE N Z P
N P Z P
CP Z N Z P
P N Z N
N Z N Z
CI Z N Z P
P Z P Z
FIS rules shown in Table 4.10 are based on the following conditions: 1. If E is Big, increase the Proportional Action and limit the Integral Action. 2. If E is getting worse (overshoot), decrease the Proportional Action and limit the Integral Action. 3. If E is small, limit the Proportional Action and increase the Integral Action. 4. If E is big but not changing, increase both Proportional and Integral Action. The Surface views in Figure 4.19 shows a graphical representation of the rules and how the surface changes when error and rate of error change.
36
0.5
0.5 CP
CI
0 -0.5
0 -0.5
20
0
-20
CE
20
0
-20
-20
20
0
0
E
20
-20
E
CE
Figure 4.19: 3D Surface Views of FIS for FPID 4.7 SIMULATION RESULTS Simulink model in Appendix E was used to simulate PID, FLC, and FPID controllers while the Plant Model used is either Orifice or Coriolis FT model, all parameters can be changed using custom masks that show up when mouse-double clicking the controller block. The response of the three controllers to a 20 l/min step change and to random step changes are shown in Figure 4.20, Figure 4.21, Figure 4.22 and Figure 4.23 for Orifice and Coriolis FT models respectively. SP PI D FLC FPI D
20
flow rate (l/min)
15
10
5
0 0
200
400
600 800 100 samples/s
1000
1200
Figure 4.20: Response of PID, FLC, and FPID to step change using Orifice FT 45 SP PID FLC FPID
40
flow rate (l/min)
35 30 25 20 15 10 5 0 0
1000
2000
3000
4000
5000 100 samples/s
6000
7000
8000
9000
Figure 4.21: Response of PID, FLC, and FPID to Random steps using Orifice FT 37
10000
SP PID FLC FPID
20
flow rate (l/min)
15
10
5
0 0
100
200
300 100 samples/s
400
500
600
Figure 4.22: Response of PID, FLC, and FPID to step change using Coriolis FT 40
SP PID FLC FPID
35
flow rate (l/min)
30 25 20 15 10 5 0 0
1000
2000
3000 100 samples/s
4000
5000
Figure 4.23: Response of PID, FLC, and FPID to Random steps using Coriolis FT All controllers were tuned such that no overshoot happens; now if we change the tuning to have a more aggressive response in the expense of overshoot in order to see how the controller will handle overshoot we get the responses shown below. 25
SP PID FLC FPID
flow rate (l/min)
20
15
10
5
0 0
200
400
600 100 samples/s
800
1000
1200
Figure 4.24: Aggressive response of controllers to step change using Orifice FT 38
SP PID FLC FPID
40
flow rate (l/min)
35 30 25 20 15 10 5 0 0
1000
2000
3000
4000
5000 100 samples/s
6000
7000
8000
9000
10000
Figure 4.25: Aggressive response of controllers to random changes using Orifice FT SP PID FLC FPID
flow rate (l/min)
20
15
10
5
0 0
100
200
300 100 samples/s
400
500
600
Figure 4.26: Aggressive response of controllers to step change using Coriolis FT SP PID FLC FPID
40
flow rate (l/min)
35 30 25 20 15 10 5 0 0
1000
2000
3000 100 samples/s
4000
5000
6000
Figure 4.27: Aggressive response of controllers to random changes using Coriolis FT We can observe from previous figures the responses of each controller in the first case where the objective is to have no overshoot, FLC has the best performance and 39
fastest settling time followed by FPID and last is PID. Table 4.11 summarizes the characteristics of the 20l/min set point response of each controller. Table 4.11: Response characteristics for controllers Parameter/Controller Settling Time (s) Rise Time (s) Overshoot (%)
PID 8.3 1.7 0
Orifice FT FLC FPID 4.4 5.7 1.2 1.6 0 0
PID 3.9 0.7 0
Coriolis FT FLC FPID 1.9 2.3 0.5 0.6 0 0
In the second case with the objective of faster rise time in the expense of overshoot, our objective from this tuning is to see how fast the controllers are in dampening the overshoots. FLC has the best performance and dampens the overshoot fast followed by FPID and last is PID. Table 4.12 summarizes the characteristics of the 20l/min set point response of each controller. Table 4.12: Response characteristics for controllers, aggressive tuning Parameter/Controller Settling Time (s) Rise Time (s) Overshoot (%)
PID 5.9 1.2 5.5
Orifice FT FLC FPID 3.1 4.2 0.9 1.1 0.9 0.2
PID 3.5 0.6 11
Coriolis FT FLC FPID 2.2 2.6 0.4 0.5 7 2.4
We conclude from the simulation results that FLC has better performance and that is due to the nonlinearity inherit within the design and the proper handling of error rate and its influence on the change in control action. FPID on the other hand inherits some PID characteristics and only acts on the gains of PID rather than the control action, though it has better performance than conventional PID when both are given the same PID gains. All parameters used in simulations for each controller are summarized in Table 4.13 and Table 4.14. Table 4.13: Controllers parameters for Orifice FT model
PID FLC FPID
GE 1 GE 1
First Simulation(No overshoot) Kp Ki 0.35 0.6 GCE GEU GU GCU 0.51 0 18.5 0.45 GCE Kp Ki GCP GCI 0.5 0.35 0.6 -0.6 1.3 40
PID FLC FPID
GE 1 GE 1
Second Simulation(Aggressive) Kp Ki 0.5 0.85 GCE GEU GU GCU 0.54 0 26.5 0.515 GCE Kp Ki GCP GCI 0.5 0.5 0.85 0.1 -1.7
Table 4.14: Controllers parameters for Coriolis FT model
PID FLC FPID
GE 1 GE 1
PID FLC FPID
GE 1 GE 1
First Simulation(No overshoot) Kp 0.35 GCE GEU GU 0.23 0 16.5 GCE Kp Ki 0.2 0.35 1.1 Second Simulation(Aggressive) Kp 0.3 GCE GEU GU 0.23 0.1 18.7 GCE Kp Ki 0.15 0.3 1.4
Ki 1.1 GCU 0.74 GCP GCI -0.3 1.9 Ki 1.4 GCU 0.87 GCP GCI 2 -2.3
. 4.8 CONTROLLERS IMPLEMENTATION IN PILOT PLANT This section aims to validate the controllers through real system implementation and show performance comparison among the developed controllers in controlling the Flow rat in the Pilot Plant. Two DAQs (from Measurement Computing) and Fuzzy Logic Toolbox from MATLAB/Simulink are used. Simulink Models used in implementation are in Appendix F. Figure 4.28 to Figure 4.31 show the results of implementation. We can observe from these Figures that both FLC and FPID have generally better tracking performance, faster rise time and settling time compared to conventional PID in both Orifice and Coriolis FT. Both FLC and FPID have almost the same performance using Coriolis FT however FLC is better using Orifice FT, we will see later that FLC performs better in handling sudden disturbances. 41
SP
35
PID
flow rate (l/min)
FLC FPID 30
25
20 1800
2000
2200
2400
2600 2800 100 samples/s
3000
3200
3400
3600
flow rate (l/min)
Figure 4.28: Response of controllers to step change using Orifice FT 36
SP
34
PID FLC
32
FPID
30 28 26 24 22 20 18
2000
3000
4000
5000
6000 100 samples/s
7000
8000
9000
Figure 4.29: Controllers performance due to random step changes using Orifice FT SP PID FLC FPID
flow rate (l/min)
40
35
30
25
1000
1100
1200
1300 1400 100 samples/s
1500
1600
Figure 4.30: Response of controllers to step change using Coriolis FT
42
1700
SP PID FLC FPID
flow rate (l/min)
40
35
30
25
20 1000
1500
2000
2500
3000 3500 100 samples/s
4000
4500
5000
5500
Figure 4.31: Controllers performance due to random step changes using Coriolis FT Table 4.15 summarizes the response characteristics of controllers using Orifice (20 l/min-35 l/min) and Coriolis (23 l/min-40 l/min) Flow transmitters with 3% and 5% acceptable steady state error bands respectively. Table 4.15: Response characteristics for controllers Parameter/Controller Settling Time (s) Rise Time (s) Overshoot (%)
PID 5.3 1.4 5.6
Orifice FT FLC FPID 2.8 3.2 0.9 1.2 3.3 3.5
PID 3.8 0.7 12.4
Coriolis FT FLC FPID 1.4 1.4 0.6 0.6 2.2 0.9
From Table 4.15, we can observe that FLC performs the best in case of Orifice FT while FPID and FLC have almost similar response in case of Coriolis FT except that FLC has slightly bigger overshoot and this is due to the variation of noise each controller was subject to during the testing. We can conclude that the designed advanced controllers (FLC and FPID) have clearly outperformed the conventional PID in all aspects. 4.9 DISTURBANCE HANDLING In this section we will investigate the performance of each controller when subjected to sudden disturbance using the manual valves in the pilot plant. Changing Hand Valves 101 and 121 to 20% opening will reduce the flow rate (MV), then waiting until the controller adjusts the Control Valve to make PV equal to MV, then changing both Valves back to 100% as fast as possible will create a disturbance in MV that controller has to handle. Figure 4.32 and Figure 4.33 show the results.
43
FLC disturbance response 65 MV
60
PV
PV(l/min), MV(%)
55 50 45 40 35 30 25 20 4500
5000
5500
6000 6500 100 Samples/sec
7000
7500
8000
FPID disturbance response 65 MV
60
PV
PV(l/min), MV(%)
55 50 45 40 35 30 25 20 4500
5000
5500
6000 6500 100 Samples/sec
7000
7500
8000
PID disturbance response 65 MV
60
PV
PV(l/min), MV(%)
55 50 45 40 35 30 25 20 4500
5000
5500
6000 6500 100 Samples/sec
7000
7500
Figure 4.32: Controllers disturbance response, Orifice FT
44
8000
FLC disturbance response MV
37
PV
PV(l/min), MV(%)
36 35 34 33 32 31 30 1000
1500
2000
2500
3000 3500 100 Samples/sec
4000
4500
5000
5500
FPID disturbance response PV MV
PV(l/min), MV(%)
36
34
32
30 1000
1500
2000
2500
3000 3500 100 Samples/sec
4000
4500
5000
5500
PID disturbance response PV MV
PV(l/min), MV(%)
36
34
32
30 1000
1500
2000
2500
3000 3500 100 Samples/sec
4000
4500
5000
5500
Figure 4.33: Controllers disturbance response, Coriolis FT From above results in case of Orifice FT, we observe all three controllers have almost the same overshoot magnitude however both PID and FLC undershot a lot before settling. PID took 8.15 seconds to recover from disturbance, FPID took 6.74 seconds and FLC took 6.37 seconds which is the fastest. In case of Coriolis FT, FLC still shows superior handling of disturbance both in terms of recovery time (5.8s) and undershoot (1.3%) followed by FPID (8.5s and 45
2.4%) and the worst performance was PID with 14.8s recovery time and 2.5 undershoot percentage. All results are summarized in Table 4.16. Table 4.16: Disturbance response summary
Parameter/Controller Recovery Time (s) Undershoot (%)
PID 8.15 8
Orifice FT FLC FPID 6.37 6.74 13 3
Coriolis FT FLC FPID 5.8 8.5 1.3 2.4
PID 14.8 2.5
Controllers Parameters used in implementation differ somewhat from simulation and that is due to the noise and disturbance existing in the Pilot Plant as well as errors in modelling where the process was assumed to be linear first order and only part of it is linear. Table 4.17 summarize controller gains used in implementation for both Orifice FT and Coriolis FT. Table 4.17: Controllers parameters used in implementation Orifice FT PID FLC FPID
GE 1 GE 1
Kp 0.3 GCE 0.8 GCE 0.8
Ki 0.9 GEU 0.2 Kp 0.3
GU 18 Ki 0.9
GCU 0.64 GCP GCI 4 1
Coriolis FT PID FLC FPID
GE 1 GE 1
Kp 0.3 GCE 0.5 GCE 0.5
Ki 1.7 GEU 0.07 Kp 0.3
GU 10 Ki 1.7
GCU 1.1 GCP GCI 4 0.5
4.10 CONTROLLERS TUNING PROCEDURE Tuning phase is traditionally the result of intuition and experience. However some rules of thumb can be followed to accelerate the tuning:
46
4.10.1 FLC Tuning 1. All gains are initialized to zero. 2. Identify the range of the system and modify GE to scale to the range of FIS universe [-30 30], the maximal E should not exceed the limit of the universe, i.e. |Emax*GE|=|Universemax |. 3. Increment GCU until you have zero steady state error and the response starts to oscillate, good initial value is Ki/1.2 from conventional PID gains. 4. Increment GCE until the oscillation is removed or the response starts to undershoot, good initial value is Kp/2 from conventional PID gains. 5. Alternate between incrementing GCU and GCE until there is overshoot followed by undershoot. 6. Alternate between incrementing GU and decrementing GCE until you get the best rise time, minimum overshoot and no undershoot. 7. To improve the performance further, increment GEU slightly to get better rise time, and then repeat steps 4-6 to remove any overshoots but this time consider either incrementing or decrementing each gain depending on the response, this is done through observation of the effect of each gain and intuition. 4.10.2 FPID Tuning 1. All gains are initialized to zero. 2. Tune the PID gains using any tuning method like Ziegler-Nichols tuning method or Cohen Coon correlations. 3. Identify the range of the system and modify GE to scale to the range of FIS universe [-30 30], the maximal E should not exceed the limit of the universe, i.e. |Emax*GE|=|Universemax |. 4. If the response has overshoot increment GCP until the overshoot is removed and if the response has no overshoot then decrement GCP until the response starts to overshoot. 5. Alternate between incrementing GCI until there is overshoot, and incrementing GCP to remove the overshoot, 6. Repeat step 5 until response starts to have undershoots even if there is no overshoot. 7. Increment GCE a bit then repeat steps 4 and 5 until the response cannot be improved any further. 47
4.11 HUMAN MACHINE INTERFACE (HMI) DEVELOPMENT On objective of this project is to develop an HMI to enable control of the Pilot Plant and trends visualization through PC. Two HMIs were developed for the Pilot Plant, the first one is using Windows ActiveX controls and Simulink Masks and the second one is interactive HMI developed using Altia Design software. Both methods share the following advantages:
Easy to use and all parameters can be customized including Pilot Plant parameters like filter and conversion functions.
Ability to view the trend and change parameters simultaneously.
Ability to change controller with one click within the same window.
All data can be saved and analyzed after stopping.
Trends Scope automatically opens when running simulation and contains trends of the three main variables SP, PV, and MV.
Ability to override the controller and control the Pilot Plant in open loop.
The advantage of Altia HMI over Windows AcitveX is the ability to generate embedded code and it looks more attractive. 4.11.1 HMI Using Windows ActiveX and Simulink Masks Simulink Custom Masks were developed to change the tuning parameters easily. Figure 4.34 to Figure 4.37 show Screenshots of the whole System.
Figure 4.34: Screenshot of the whole Simulink System
48
Figure 4.35: Simulink Controllers Mask
Figure 4.36: Simulink Pilot Plant Mask
Figure 4.37: Simulink Set Point Slider
49
4.11.2 HMI Development Using Altia Design Altia Design is famous HMI development software that can generate the embedded code directly using DeepScreen software and export into hardware. It also has a plug-in for Matlab/Simulink. Figure 4.38 and Figure 4.39 show the developed HMI.
Figure 4.38: Screenshot of the whole Simulink System, Altia Pulg-in
Figure 4.39: HMI face-Plate developed by Altia Design
50
5. CONCLUSION AND RECOMMENDATION 5.1 CONCLUION Fuzzy Logic-based controllers exhibit far better control performance and stability than conventional PID controllers, they are flexible and can handle any sudden changes or disturbances on the system. Hybrid systems that take advantage of Fuzzy logic and use it to tune PID gains in real time also showed a great improvement over conventional PID. It is expected that the efficiency of the plant and ability to handle any disturbances will be increased dramatically. The designed system can then be transferred into real industrial processes through the use of modern PLCs which support Fuzzy Logic; such PLCs are available nowadays from different manufacturers such as Siemens and Omron. Lastly, The designed HMIs are painless to use and can be used for further studies and enhancements on the developed controllers or development of new ones and implementation on the Flow Pilot Plant.
5.2 RECOMMENDATION It is recommended to expand current work and develop a level controller that is cascaded with the flow controller and test the performance of Fuzzy logic control in the cascade system. Furthermore, an investigation is required to develop a comprehensive and clear procedure to tune both FLC and FPID; this will guarantee optimum performance and stability of these controllers. Another recommendation is to take this project to the next phase, which is implementation in industrial PLC or DCS system and test whether it will still have the same performance and explore ways of optimization to implement the controllers with minimum resources. Last recommendation is to expand the designed controllers into other processes such as temperature and pressure and test whether these controllers can be used to control these processes with minimum changes to the structure or FIS rules.
51
6. APPENDICES
Appendix A: Simulink Model to develop conversion Functions and study Control Valve characteristics
Figure 6.1: Simulink Model for Pilot Plant study and Calibration
52
Appendix B: Mathematical modelling Assuming ρ is constant, the cross section of the tank doesn't change with the height, and given: -
Area of the tank, A = 551.55cm2
-
Diameter of the tank d = 26.5cm
-
The max height of liquid Lmax = 83cm
-
The initial tank's levels, L1 and L2
-
The velocity of fluid is, c1 and c2
Material Balance equations: A1
dL1 dt
= ρF1 − ρF0
Eq. 6.1
6.1 A2
dL2 dt
= ρF2 − ρF1
Eq. 6.2
The equation of the liquid out-flow rate in a pipeline is: F0 = k F0 L0.5
Eq. 6.3
where k F0 = cd a√2g = 39.23 F0 is the flow rate of the liquid out of the tank (cm3/ sec)
Eq. 6.4
cd is the discharge coefficient of the tank outlet = 0.7 a is the area of the tank outlet = 1.266 cm2 g is the gravitational constant = 980 cm / s2 Combining Eq.3, Eq.4and Eq.5 to get a first order differential equation dL
A dt = Fi − k F0 L0.5
Eq. 6.5
Assuming the input is constant step and subtracting the linearized balance at steady state conditions Eq.7 becomes: A
dL′
Rearrranginig A
dt dL′ dt
= AFi (t) − 0.5k F0 L−0.5 )L′ s
Eq. 6.6
= AFi (t) − 0.5k F0 L−0.5 )L′ s
Eq. 6.7
and using Laplace Transform results in the following first order transfer function 𝐊𝐩
𝐋′ (𝐬) = 𝛕𝐬+𝟏 𝐅𝐢′ (𝐬)
Eq. 6.8 𝛕
𝐀
Where: 𝐊 𝐩 = 𝐀 𝐚𝐧𝐝 𝛕 = 𝟏𝟗.𝟐𝟔 𝐋−𝟎.𝟓 𝐬
We observe that the transfer function is dependent on the initial value of the liquid level.
53
Appendix C: Details of Empirical Modelling Orifice FT 1) First run 50 MV (%) PV (L/min)
45 40 35 30 X: 358 Y: 25.23
X: 572 Y: 29.89
25 X: 194 Y: 17.42
20 15
0
100
X: 337 Y: 20.89 X: 310 Y: 17.41
200
300 100 samples/s
400
500
600
Figure 6.2: PRC for Orifice, First Run 𝑆𝑡𝑒𝑝 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑀𝑉 𝜎 = 50% − 30% = 20% 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑃𝑉 ∆= 29.9 − 17.40 = 12.5 𝑙/𝑚𝑖𝑛 0.63∆= 25.3 𝑙/ min 𝑎𝑛𝑑 0.28∆= 20.9 𝑙/𝑚𝑖𝑛 𝑡63% =
(358𝑠𝑚𝑝𝑙 − 194𝑠𝑚𝑝𝑙) = 1.64 𝑠𝑒𝑐 100 𝑠𝑚𝑝𝑙/𝑠
𝑡28% =
(337𝑠𝑚𝑝𝑙 − 194𝑠𝑚𝑝𝑙) = 1.43 𝑠𝑒𝑐 100 𝑠𝑚𝑝𝑙/𝑠
𝜏 = 1.5(𝑡63% − 𝑡28% ) = 1.5(1.64 − 1.43) = 0.315 𝑠𝑒𝑐 𝜃 = 𝑡63% − 𝜏 = (1.64 − 0.315) = 1.325 𝑠𝑒𝑐
Table 6.1: Parameters obtained from PRC, Orifice FT First Run Parameter Change in perturbation / MV,
Value 20%
Change in output / PV, time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% ) dead time, 𝜃 = 𝑡63% − 𝜏
12.5 l/min
Steady State Process Gain, KP = /
4.8 𝑠𝑒𝑐 1.325 𝑠𝑒𝑐 12.5 𝑙/𝑚𝑖𝑛 = 0.625 20%
The model we obtained from empirical modelling is first order with dead time as follow: 𝑮(𝒔) =
𝑲𝒑 𝒆−𝜽𝒔 𝝉𝒔+𝟏
𝒘𝒉𝒆𝒓𝒆 𝑲𝒑 = 𝟎. 𝟔𝟐𝟓, 𝜽 = 𝟏. 𝟑𝟐𝟓𝒔, 𝝉 = 𝟎. 𝟑𝟏𝟓 𝒔
54
2) Second run 60 SP% PV(L/min)
55 50 45 40 X: 406 Y: 34.95
35
X: 222 Y: 30.91
X: 100 Y: 29.63
X: 254 Y: 33.01
30 0
100
200
300 100 samples/s
400
500
Figure 6.3: PRC for Orifice, Second Run 𝑆𝑡𝑒𝑝 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑀𝑉 𝜎 = 60% − 50% = 10% 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑃𝑉 ∆= 34.9 − 29.6 = 5.3 𝑙/𝑚𝑖𝑛 0.63∆= 33 𝑙/𝑚𝑖𝑛 𝑡63% =
(254𝑠𝑚𝑝𝑙 − 100𝑠𝑚𝑝𝑙) = 1.54 𝑠𝑒𝑐 100 𝑠𝑚𝑝𝑙/𝑠
0.28∆= 31.09 𝑙/𝑚𝑖𝑛 𝑡28% =
(222𝑠𝑚𝑝𝑙 − 100𝑠𝑚𝑝𝑙) = 1.22 𝑠𝑒𝑐 100 𝑠𝑚𝑝𝑙/𝑠
𝜏 = 1.5(𝑡63% − 𝑡28% ) = 0.48 𝑠𝑒𝑐 𝜃 = 𝑡63% − 𝜏 = 1.06 𝑠𝑒𝑐
Table 6.2: Parameters obtained from PRC, Orifice FT Second Run Parameter
Value
Change in perturbation / MV,
10%
Change in output / PV,
5.3 l/min
time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% )
0.48 𝑠𝑒𝑐
dead time, 𝜃 = 𝑡63% − 𝜏
1.06 𝑠𝑒𝑐
Steady State Process Gain, KP = /
0.53
The model we obtained from empirical modelling is first order with dead time as follow: 𝑮(𝒔) =
𝟎.𝟓𝟑 𝒆−𝟏.𝟎𝟔𝒔 𝟎.𝟒𝟖𝒔+𝟏
55
Coriolis FT 1) First run 52
SP% PV(L/min)
50 48 46 44 42
X: 153 Y: 37.14
38 X: 82 Y: 35.21
36 34
X: 289 Y: 41.94
X: 162 Y: 39.42
40
0
50
100
X: 141 Y: 35.27
150
200 100 samples/s
250
300
350
Figure 6.4: PRC for Coriolis, First Run 𝑆𝑡𝑒𝑝 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑀𝑉 𝜎 = 50% − 40% = 10% 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑃𝑉 ∆= 41.9 − 35.2 = 6.7 𝑙/𝑚𝑖𝑛 0.63∆= 39.4 𝑙/𝑚𝑖𝑛 𝑡63% = 0.8 𝑠𝑒𝑐 0.28∆= 37.1 𝑙/𝑚𝑖𝑛 𝑡28% = 0.7 𝑠𝑒𝑐
Table 6.3: Parameters obtained from PRC, Coriolis FT First Run Parameter Change in perturbation / MV,
Value 10%
Change in output / PV,
6.7 l/min
time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% )
0.15 𝑠𝑒𝑐
dead time, 𝜃 = 𝑡63% − 𝜏
0.65 𝑠𝑒𝑐
Steady State Process Gain, KP = /
0.67
The model we obtained from empirical modelling is first order with dead time as follow: 𝑮(𝒔) =
𝟎.𝟔𝟕𝒑 𝒆−𝟎.𝟔𝟓𝒔 𝟎.𝟏𝟓𝒔+𝟏
56
400
2) Second run SP% PV(L/min)
50
45
X: 220 Y: 42.13
40
X: 136 Y: 36.88
35
X: 121 Y: 31.65
30
0
50
X: 54 Y: 27.69
100
X: 105 Y: 27.8
150 100 samples/s
200
250
Figure 6.5: PRC for Coriolis, Second Run 𝑆𝑡𝑒𝑝 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑀𝑉 𝜎 = 50% − 30% = 20% 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑃𝑉 ∆= 42.13 − 27.69 = 14.44 𝑙/𝑚𝑖𝑛 0.63∆= 36.8 𝑙/𝑚𝑖𝑛 𝑡63% = 0.8 𝑠𝑒𝑐 0.28∆= 31.7 𝑙/𝑚𝑖𝑛 𝑡28% = 0.67 𝑠𝑒𝑐
Table 6.4: Parameters obtained from PRC, Coriolis FT Second Run Parameter
Value
Change in perturbation / MV,
20%
Change in output / PV,
14.44 l/min
time constant, 𝜏 = 1.5(𝑡63% − 𝑡28% )
0.2 𝑠𝑒𝑐
dead time, 𝜃 = 𝑡63% − 𝜏
0.61 𝑠𝑒𝑐
Steady State Process Gain, KP = /
0.72
The model we obtained from empirical modelling is first order with dead time as follow:𝑮(𝒔) =
𝟎.𝟕𝟐 𝒆−𝟎.𝟔𝟏𝒔 𝟎.𝟐𝒔+𝟏
57
300
Simulink System Used for Empirical Modelling
Figure 6.6: Simulink System for Empirical Modeling Simulink System for Empirical Modeling
Figure 6.7: Plant and Valve Subsystem
58
Appendix D: PID Tuning Methods
Cohen-Coon Correlations 𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑑𝑒𝑎𝑑 𝑡𝑖𝑚𝑒 𝑅 =
𝜃 𝜏
Table 6.5: Cohen-Coon Correlations formulas Control Modes P only
P+I
Parameters 1 R 1 KC RK 3 p
1 9 R KC RK 10 12 p TI
(30 3R) (9 20 R)
1 4 R KC RK 3 4 p P+I+D
P+D
TI
(32 6 R) (13 8 R)
TD
4 (11 2 R)
1 5 R KC RK 4 6 p TI
(6 2 R ) (22 3R)
Ziegler-Nichols Open-Loop Tuning Correlations Table 6.6: Ziegler-Nichols Open-Loop Correlations formulas Controller
Kc
TI
Td
P-only
(1/Kp) / (τ /θ)
_
_
PI
(0.9/Kp)(τ/θ)
3.3 θ
_
PID
(1.2/Kp)(τ/θ)
2.0 θ
0.5 θ
59
Appendix E: Simulink Model for Controllers Simulation
Figure 6.8: Simulink System for Controllers Simulation For Subsystems details refer to Appendix G.
Figure 6.9: PID Block Mask
60
Figure 6.10: FLC Block Mask
Figure 6.11: FPID Block Mask
61
Appendix F: Simulink System for Controllers Implementation
Figure 6.12: Simulink System for Controllers Implementation
Figure 6.13: Controller Subsystem
Details of Pilot Plant Subsystem and details of each controller are in Appendix G.
62
Appendix G: Simulink model Subsystems
Figure 6.14: Pilot Plant Subsystem
Figure 6.15: PID controller Subsystem
Figure 6.16: FLC controller Subsystem
63
Figure 6.17: FPID controller Subsystem
Figure 6.18: Record and Scope Subsystem
64
Appendix H: Pilot Plant Instruments
Project Set Up
Local Control Panel
65
Coriolis Transmitter
Vortex Transmitter
Orifice Transmitter
66
Control Valve and Positioner
DAQ cards and resistor boxes
67
REFERENCES [1] [2]
[3] [4]
[5] [6] [7]
[8] [9]
[10]
[11] [12]
[13]
[14]
[15] [16]
[17] [18]
[19]
[20]
R. S. Burns, Advanced control engineering Butterworth Heinemann, 2001. H. F. VanLandingham and N. D. Tripathi, "Knowledge-based adaptive fuzzy control of drum level in a boiler system," in Southcon/96. Conference Record, 1996, pp. 454-459. K. J. Astrom. Control System Design [Online]. Available: http://www.cds.caltech.edu/~murray/courses/cds101/fa02/caltech/astrom.html K. Sridhar, A. B. Patil, M. S. Kumbhar, and K. U. Jadhav, "Optimal fuzzy PID Controller for Multi Input Multi Output model," in Control, Automation, Communication and Energy Conservation, 2009. INCACEC 2009. 2009 International Conference on, 2009, pp. 1-4. T. L. M. Bartelt, Instrumentation and process control vol. 1: Thomson Delmar learning, 2007. A. K. Pandey, "Low Cost Sensor for Low Flow-Rate Measurement," in Sensors for Industry Conference, 2005, 2005, pp. 6-8. T. Chao, W. Hao, and D. Feng, "Mass Flow Rate Measurement of Oil-Water TwoPhase Flow by a Long-Waist Cone Meter," Instrumentation and Measurement, IEEE Transactions on, vol. 62, pp. 2795-2804, 2013. B. G. Liptak, Flow Measurement: Taylor & Francis, 1993. G. Zaidner, S. Korotkin, E. Shteimberg, A. Ellenbogen, M. Arad, and Y. Cohen, "Non linear PID and its application in process control," in Electrical and Electronics Engineers in Israel (IEEEI), 2010 IEEE 26th Convention of, 2010, pp. 000574-000577. Y. Zhou, G.-l. Wang, P. Yang, and D.-Q. Kang, "Fuzzy Immune Adaptive PID Control for Fermentation Process," in Intelligent Information Technology Application, 2008. IITA '08. Second International Symposium on, 2008, pp. 678-682. M. King, process control a practical approach. United Kingdom: Wiley & Sons Ltd, 2011. M. Yukitomo, Y. Baba, T. Shigemasa, M. Ogawa, K. Akamatsu, and S. Amano, "A model driven PID control system and its application to chemical processes," in SICE 2002. Proceedings of the 41st SICE Annual Conference, 2002, pp. 2656-2660 vol.4. Z. Dingxue and X. Zhen, "Fuzzy PID control in the process control," in Instrumentation & Measurement, Sensor Network and Automation (IMSNA), 2012 International Symposium on, 2012, pp. 587-591. H. H. Lou and Y. L. Huang, "Fuzzy-logic-based process modeling using limited experimental data," Engineering Applications of Artificial Intelligence, vol. 13, pp. 121-135, 4/1/ 2000. S. Y. Kevin M. Passino (1998). Fuzzy Control (1 ed.). E. H. Mamdani and S. Assilian, "An Experiment in Linguistic Synthesis with a Fuzzy Logic Controller," International Journal of Human-Computer Studies, vol. 51, pp. 135-147, 8// 1999. M. Sugeno, "Fuzzy measures and fuzzy integrals: a survey," Fuzzy Automata and Decision Processes, , pp. 89-102, 1997. C. Bartolomeo and G. Mose, "Type-2 fuzzy control of a bioreactor," in Intelligent Computing and Intelligent Systems, 2009. ICIS 2009. IEEE International Conference on, 2009, pp. 700-704. D. Xinyu and Y. Hao, "Control Performance Comparison between a Type-2 Fuzzy Controller and a Comparable Conventional Mamdani Fuzzy Controller," in Fuzzy Information Processing Society, 2007. NAFIPS '07. Annual Meeting of the North American, 2007, pp. 100-105. D. J. Kelly, P. D. Burton, and M. A. Rahman, "The application of a neural-fuzzy logic controller to process control," in Fuzzy Information Processing Society Biannual 68
[21]
[22]
[23] [24]
[25]
[26]
Conference, 1994. Industrial Fuzzy Control and Intelligent Systems Conference, and the NASA Joint Technology Workshop on Neural Networks and Fuzzy Logic, 1994, pp. 235-236. T. Takagi and M. Sugeno, "Fuzzy identification of systems and its applications to modeling and control," Systems, Man and Cybernetics, IEEE Transactions on, vol. SMC-15, pp. 116-132, 1985. N. N. Mohammad, N. Kasuan, M. H. F. Rahiman, and M. N. Taib, "Steam temperature control using fuzzy logic for steam distillation essential oil extraction process," in Control and System Graduate Research Colloquium (ICSGRC), 2011 IEEE, 2011, pp. 53-58. S. J. Qin and G. Borders, "A multiregion fuzzy logic controller for nonlinear process control," Fuzzy Systems, IEEE Transactions on, vol. 2, pp. 74-81, 1994. A. M. F. Fileti, A. J. B. Antunes, F. V. Silva, V. Silveira Jr, and J. A. F. R. Pereira, "Experimental investigations on fuzzy logic for process control," Control Engineering Practice, vol. 15, pp. 1149-1160, 9// 2007. M. B. B. Pinto, J. G. R. Mota, and O. M. Almeida, "PID self-adjustable fuzzy logic MIMO case: Method and application," in Industry Applications (INDUSCON), 2010 9th IEEE/IAS International Conference on, 2010, pp. 1-6. J. Jantzen, "Tuning Of Fuzzy PID Controllers," Technical University of Denmark, Lyngby, DENMARK 98-H 871 30 Sep 1998.
69