A TECHNICAL REPORT ON EXPERIMENTAL WORK ON THEORETICAL AND EMPERICAL MODELLING OF A CASCADED THREE-TANK SYSTEM SUBMITTED TO THE LECTURER IN CHARGE DR A.BAMIMORE CHE 503 BY ADEBAJO, Daniel Oluwafemi CHE/2016/001 (GROUP 3) IN PARTIAL FULFILMENT OF THE REQUIREMENTS OF CHE 503 DEPARTMENT OF CHEMICAL ENGINEERING OBAFEMI AWOLOWO UNIVERSITY i February, 2023 ii Department of Chemical Engineering, Faculty of Technology, Obafemi Awolowo University, Ile-Ife. 14th February, 2023. The Lecturer In Charge, Dr Bamimore, Department of Chemical Engineering, Faculty of Technology, Obafemi Awolowo University, Ile-Ife, Osun State. Dear Sir, LETTER OF TRANSMITTAL In line with the objectives of CHE 503, I submit this report as a comprehensive overview of the practical activities conducted on the “theoretical and empirical modelling of a cascaded three-tank system”and the results obtained. This report serves as partial fulfillment of the CHE 503 requirements. The names and matriculation numbers of the group members can be found in Appendix A of the report. Thank you, Sir. Yours Faithfully, ADEBAJO Daniel Oluwafemi, CHE/2016/001 iii ABSTRACT Cascade system modeling in chemical engineering is a powerful technique for understanding, interpreting, and improving intricate processes, leading to more efficient and sustainable industrial operations. Cascade systems are composed of multiple interconnected units, which can exhibit dynamic behavior that is challenging to predict analytically. By employing modeling, it is possible to simulate how the system would perform under different operating conditions, such as changes in input variables and disturbances, and evaluate its performance. In this study, an experiment was conducted to link three tanks that have multiple outputs but only one input, with a pump, controller, and sensors included in the system for complete automation. A Simulink control model was developed to simulate the system, with the primary aim of calibrating the apparatus and obtaining theoretical and empirical models for the system. To establish the model parameters, a nonlinear grey box model was used to develop a theoretical model, and an empirical model was created using MATLAB's ARX function. A comparison of the input-output data and the models was carried out to ensure that the models accurately reflected the actual system, which confirmed that each model was precise. iv TABLE OF CONTENT Table of Contents LETTER OF TRANSMITTAL ......................................................................................... iii ABSTRACT....................................................................................................................... iv TABLE OF CONTENT ...................................................................................................... v LIST OF TABLES ............................................................................................................ vii LIST OF FIGURES ......................................................................................................... viii CHAPTER 1: INTRODUCTION ....................................................................................... 1 1.1 Background Information ........................................................................................... 1 1.1.1 Advantages of Cascaded Tank-System .............................................................. 2 1.1.2 Disadvantages of Cascaded Tank-Systems ........................................................ 2 1.2 Objectives ................................................................................................................. 3 1.3 Scope ......................................................................................................................... 3 CHAPTER 2 ....................................................................................................................... 5 2.1 Literature Review...................................................................................................... 5 2.2 Theory of Experiment ............................................................................................... 5 2.2.1 Development of first-principle based model for the cascaded tank system.. 5 CHAPTER 3: METHODOLOGY .................................................................................... 10 3.1 Apparatus ................................................................................................................ 10 3.2 Experimental Procedure .......................................................................................... 10 3.2.1 Interfacing of the cascaded-tank system with Arm-Cortex Micro-Controller Board ......................................................................................................................... 11 3.2.2 Interfacing of the Arm-Cortex Microcontroller board with Host PC .............. 11 3.2.3 Signal Chain/Data transfer through the instrumentation system ..................... 11 3.3 Calibration of Height Sensors ................................................................................. 12 3.4 Calibration of Pump ................................................................................................ 12 3.5 Calibration of Control Valves ................................................................................. 12 3.6 Data Collection from the Experimental System ..................................................... 13 CHAPTER 4 ..................................................................................................................... 15 RESULTS AND DISCUSSION ....................................................................................... 15 4.1 Experimental Data .................................................................................................. 15 v 4.2 Plots of Parameters ................................................................................................. 22 4.2.1 Level Sensor Calibration Plots......................................................................... 22 4.2.2 Pump Calibration Plot ...................................................................................... 25 4.2.3 Calibration of Proportional Valve .................................................................... 26 4.3 Model Parameters ................................................................................................... 28 4.4 Empirical determination of a Linear Model for the system .................................... 32 4.5 Determination of Linear Model for the Tank by Linearization .............................. 37 4.6 Open Loop Stability of System ............................................................................... 38 CHAPTER FIVE .............................................................................................................. 42 CONCLUSION ANDRECOMMENDATIONS .............................................................. 42 5.1Conclusion ............................................................................................................... 42 5.2 Recommendations ................................................................................................... 42 REFERENCES ................................................................................................................. 43 APPENDIX ....................................................................................................................... 44 APPENDIX A ............................................................................................................... 44 List of Group Members ............................................................................................. 44 vi LIST OF TABLES Table 1: The Terminologies used for modeling .................................................................. 7 Table 2 Experimental Raw Data for the Calibration of Height Sensor of Tank 1 ............ 16 Table 3 Experimental Raw Data for the Calibration of Height Sensor of Tank 2 ............ 17 Table 4 Experimental Raw Data for the Calibration of Height Sensor of Tank 3 ............ 18 Table 5 Experimental Raw Data for Calibration of Proportional Valves ......................... 19 Table 6 Experimental Raw Data for Calibration of Pump to obtain U1 (cm3/s) ............. 20 Table 7 Experimental Raw Data for Calibration of Pump to obtain U2 (cm3/s) .............. 21 Table 8 Flow Coefficient for the Theoretical Model ........................................................ 31 Table 9 Stability of the empirical tank 1 transfer function ............................................... 39 Table 10 Stability of the empirical tank 2 transfer function ............................................. 40 Table 11 Stability of the empirical tank 3 transfer function ............................................. 41 vii LIST OF FIGURES Figure 1.1: Cascaded-tank system-Microcontroller - Host-PC interface............................ 4 Figure 2.1: The process and instrumentation diagram of the cascaded-tank system .......... 9 Figure 3.1: Experimental set up for A cascaded three-tank system ................................. 14 Figure 4.1: Height vs Count for Tank 1 ............................................................................ 22 Figure 4.2: Height vs Count for Tank 2 ............................................................................ 23 Figure 4.3: Height vs Count for Tank 3 ............................................................................ 24 Figure 4.4: PWM Count to Pump Flow rate ..................................................................... 25 Figure 4.5: PWM Count vs Fractional Opening for Valve 1 ............................................ 26 Figure 4.6: PWM Count vs Fractional Opening for Valve 2 ............................................ 27 Figure 4.7: Input-Output response plot of the 2000 data .................................................. 29 Figure 4.8: The comparison between the validation data and the nlgref model ............... 30 Figure 4.9: The 5-step predicted response comparison of the transfer function and the real data for h1. ........................................................................................................................ 33 Figure 4.10: The 5-step predicted response comparison of the transfer function and the real data for h2 ......................................................................................................................... 34 Figure 4.11: The 5-step predicted response comparison of the transfer function and the real data for h3. ........................................................................................................................ 36 viii CHAPTER 1: INTRODUCTION 1.1 Background Information Cascade tank systems are a complex yet sophisticated setup used in the chemical engineering industry to efficiently store and mix various chemicals. The system typically comprises of multiple tanks arranged vertically in a cascading manner, enabling the regulated flow of liquids from one tank to another. The tanks can be used for different purposes such as storing raw materials, intermediate products, or finished products and for blending chemicals to produce specific chemical compositions. The utilization of cascade tank systems offers improved process control and enhances the efficiency of chemical storage and mixing operations in the chemical engineering industry. Additionally, cascade tank systems can also have various types of level sensors, pumps, and control valves incorporated into their design, which allow for precise control and monitoring of the liquid levels and flow rates within the tanks. The cascaded three-tank system that was used for the experiment is composed of tanks of three different shapes - cuboidal, trapezoidal, and parabolic - arranged vertically in a series. The water is pumped from a reservoir to the uppermost tank by a submersible pump. Then, the water flows through the valve openings to the middle and bottom tanks, under the influence of gravity. There are three piezo-resistance sensors placed inside the tanks, which measure the water levels. The aim of the cascaded tank system is to control the water level in each tank by adjusting the pump flow rate and the percentage openings of the electricactuated proportional valves. Additionally, there are two 4-position angle-drain valves, which are used to simulate leaks in the middle and bottom tanks. The cascaded three-tank system is a remarkable solution for large-scale water management challenges, including water distribution and storage, waste water treatment, and irrigation. This system's ability to store a vast amount of water and distribute it as necessary makes it highly efficient and suitable for multiple purposes. One of its standout features is the real-time regulation of water levels through the use of piezo-resistance level sensors. The sensors provide constant monitoring of the water height inside each tank, and the control system can quickly adjust the pump flow rate and valve openings accordingly. This enables the system to maintain optimal water levels within the tanks, even in the face of changing conditions, providing reliable and efficient water management. The use of proportional valves and the pump flow rate allows for precise control of the water flow between tanks. This helps to minimize the risk of overshoot, undershoot, and oscillations, which can lead to inefficient operation of the system and potential damage to the tanks or other components. 1 The ability to simulate leaks in the middle and bottom tanks through the use of angle-drain valves is an important feature for testing and evaluating the performance of the control system. This allows engineers and operators to evaluate the system's response to potential issues and to determine if any changes or modifications are needed to improve its reliability and resilience. 1.1.1 Advantages of Cascaded Tank-System The cascade tank system offers several advantages: 1. Efficient Water Management: The system can store a large volume of water and distribute it to multiple tanks as needed, making it ideal for large-scale water management systems. 2. Real-time Level Regulation: The piezo-resistance level sensors provide continuous feedback on the height of the water inside each tank, allowing the control system to make adjustments to the pump flow rate and valve openings as needed. This helps to ensure that the water levels in each tank remain within a desired range, even under changing conditions. 3. Improved Process Control: The cascade tank system allows for improved process control and increased efficiency in the storage and mixing of liquids. The system can be used for a variety of purposes, such as storing raw materials, intermediate products, or finished products, and for mixing liquids to create specific compositions. 4. Versatile Applications: The cascade tank system is suitable for various applications, such as water distribution and storage, waste water treatment, and irrigation. 5. Leak Simulation: The angle-drain valves in the system can be used to simulate leaks, making it an ideal tool for testing and evaluating the performance of water management systems. 1.1.2 Disadvantages of Cascaded Tank-Systems 1. Complexity: Cascade tank systems can be complex in terms of the number of tanks involved, the control systems required to regulate water levels, and the sensors used to monitor the tanks. 2. Maintenance: Regular maintenance is required to ensure that the tanks and control systems are functioning properly, which can be time-consuming and costly. 3. Cost: Cascade tank systems can be expensive to install and maintain, especially for larger systems. 2 4. Leaks: The risk of leaks is higher in cascade tank systems, as water is constantly being transferred between tanks. This can lead to environmental contamination and loss of water. 5. Water Quality: If the water in the tanks is not properly managed, the risk of contamination and degradation of water quality increases. 6. Power Dependency: Cascade tank systems are typically powered by electricity, so they are dependent on a reliable power supply. In case of a power outage, the system may not function as intended, leading to problems with water distribution and management. 7. Regulation Compliance: Cascade tank systems may be subject to various regulations, depending on their location and the intended use of the system. Compliance with these regulations can be complex and time-consuming. 1.2 Objectives The overall aim of this experiment is to investigate the dynamic behavior of cascaded threetank system. The specific objectives of this experiment are to: 1) Determine the calibration equations for level sensors and pump 2) Estimate the parameters (i.e.,) of theoretical model for the cascaded three-tank system 3) Determine an empirical model for the tank system from input/output data. 4) Validate the models identified in (ii) and (iii) above 1.3 Scope Determine the theoretical model for the cascaded three-tank system, empirical model for the tank system using input/output data, and calibration equations for level sensors and pump to determine the dynamic behavior of the cascaded three-tank system. 3 Figure 1.1: Cascaded-tank system-Microcontroller - Host-PC interface 4 CHAPTER 2 2.1 Literature Review Cascaded tank systems are a popular control problem in chemical and process engineering. The system consists of two or more tanks, where the outflow from the first tank is the inflow to the second tank, and so on. The aim of control is to maintain the level of liquid in the tanks, despite variations in the inflow and outflow rates. A range of control methods have been developed for cascaded tank systems, including PID controllers, fuzzy logic controllers, and model predictive controllers. One approach to control cascaded tank systems is to decouple the system into two single tanks, and then use a single loop control method for each. Kim et al. (2016) used this approach, implementing PID control for each tank. Subbiah and Arvind (2017) used fuzzy logic control, and Zaky et al. (2015) used model predictive control. Another approach is to use a cascaded control strategy, where the output of the first loop is used as the setpoint for the second loop. This strategy allows for more precise control, but can be more difficult to implement. Chang and Wu (2014) used a multi-objective optimization algorithm to tune a cascaded control system for a two-tank system. Finally, there have been efforts to develop more advanced control strategies for cascaded tank systems. Zhang et al. (2020) used a robust output feedback control method to control a nonlinear cascaded tank system, while Chen and Lee (2019) used adaptive dynamic programming to optimize the control of a cascaded tank system with an uncertain inflow rate. 2.2 Theory of Experiment The three-tank system is a prevalent laboratory arrangement in control theory, frequently utilized as a showcase for liquid level control. The setup encompasses two control valves that manage the flow to tanks 1 and 3, a pump that transfers water from a reservoir to the tanks through a Rotameter and control valve, and a differential pressure transmitter that measures the liquid level in the tanks and transmits the readings to the control room. 2.2.1 Development of first-principle based model for the cascaded tank system 5 The definitions of the terms used in the modeling process are presented in Table 1. To find the dynamic equation that governs the liquid level in each of the three tanks, the commonly utilized mass balance equation was applied, which states: Accumulation = In – Out (1) The time rate of change of liquid level inside each tank is given by; πβπ 1 = (πΉ ππ (π‘) − πΉπππ’π‘ (π‘)) ππ‘ π΄π (βπ ) π (2) where βπ , π΄π (βπ ), πΉπππ (π‘) and πΉπππ’π‘ (π‘) represent the liquid level, cross-sectional area, inflow rate, and outflow rate, respectively, for the th tank. According to Bernoulli's law for fluid flow through small openings, the rate of fluid exiting the bottom of each tank is represented by: πΉπππ’π‘ (π‘) = πΆπ ππ √2πβπ (π‘) (3) Assuming that the configuration of the tanks, pipes, and valves cannot ignore the turbulence and acceleration of the liquid flow in the tubes, a more extensive expression is used to describe the liquid discharge as follows: πΉπππ’π‘ (π‘) = πΆπ ππ (2πβπ (π‘))πΌ (4) Using the above assumption, the time rates of change of liquid levels inside tanks are given by πβ1 1 = (π1 − πΆ1 ππ (2πβ1 )πΌ1 − πΆ4 ππ (2πβ1 )πΌ4 ππ‘ π΄1 (5) πβ2 1 = (πΆ π (2πβ1 )πΌ1 + πΆ4 ππ (2πβ1 )πΌ4 − π2 ππ (2πβ2 )πΌ2 ππ‘ π΄2 (β2 ) 1 π − πΆ2 ππ (2πβ2 )πΌ5 (6) πβ3 1 = (π π (2πβ2 )πΌ2 + πΆ2 ππ (2πβ2 )πΌ5 − π3 ππ (2πβ3 )πΌ3 ππ‘ π΄3 (β3 ) 2 π − πΆ3 ππ (2πβ3 )πΌ6 (7) The cross-sectional areas (A1(h1), A2(h2) and A3(h3)) are given as: π΄1 = ππ€ (8) 6 π΄2 (β2 ) = ππ€ + β2 π»πππ₯ (9) π΄3 (β3 ) = π€√π 2 − (π − β3 )2 (10) The existing physical parameters used in the model are: Sp = 1.267; a = 25 cm; b = 34.5 cm; c = 10 cm; w = 3.5 cm; g= 981 cm2/s; Hmax = 35 cm; R = 36.4 cm. Table 1: The Terminologies used for modeling Variable Definition π1 Pump flowrate into the first tank [cm3/s] π2 Fractional opening for the proportional valve of the second tank π3 Fractional opening for the proportional valve of the third tank πΆ1 Fractional opening for the manual valve of the first tank πΆ2 Fractional opening for the 4-Position valve of the second tank πΆ3 Fractional opening for the 4-Position valve of the third tank πΆ4 Fractional opening for the second manual valve of the first tank β1 Water level in the first tank [cm] β2 Water level in the second tank [cm] β3 Water level in the third tank [cm] 7 π΄π (βπ ) Cross sectional area of tank at water level [cm2] π Gravitational constant [cm2/s] ππ Cross-sectional area of the connecting pipe [cm2] π»πππ₯ Maximum Height of the tank [cm] π A dimension on tank three [cm] π A dimension on tank one [cm] π A dimension on tank two [cm] π A dimension on tank two [cm] π€ Cross-width dimension of the tanks [cm] πΌ1 Flow coefficient for manual valve 1 on tank one πΌ2 Flow coefficient for Proportional valve 1 on tank two πΌ3 Flow coefficient for Proportional valve 2 on tank three πΌ4 Flow coefficient for manual valve 2 on tank one πΌ5 Flow coefficient for 4-Position valve 1 on tank two πΌ6 Flow coefficient for 4-Position valve 2 on tank three 8 Figure 2.1: The process and instrumentation diagram of the cascaded-tank system 9 CHAPTER 3: METHODOLOGY 3.1 Apparatus 1. Cascaded Three-Tank System 2. Graduated cylinder 3. Funnel The cascaded three-tank system is made up of three tanks, one with a rectangular shape, another with a trapezoidal shape, and the third with a parabolic shape. At the bottom of the first tank, there are two valves that can be adjusted manually. The second and third tanks are equipped with two electrical valves, one of which is a proportional valve, and the other is an angle valve with four positions of opening. The pump, valves, height sensors, and other control and measurement components are all connected to a PC through a Microcontroller discovery board. The tanks are constructed using Perspex plastic due to its reliability, ease of use, availability, and functional strength. The three tanks are connected to a wooden frame that measures 155 cm by 60 cm and is covered with a Formica board to prevent rot. The frame also has a metal tank stand attached to it. The reservoir is located below the tanks and is housed in a compartment beneath the metal stand. A submersible bilge pump with a flow rate of 1100 GPH is connected to the pump pipe and the other end of the pipe is connected to the first tank. 3.2 Experimental Procedure Prior to conducting the experiment, the pump and valves, which serve as the primary control mechanisms, and the height sensors, which serve as measurement devices, underwent calibration to determine the relationship between the physical parameters and the digital signals received from the microcontroller, represented as counts. To set up this relationship, the SIMULINK environment was utilized to create the interface and effectively transmit the signals to the relevant components, such as the pump flow rate, height, and valve opening/flow coefficient. 10 3.2.1 Interfacing of the cascaded-tank system with Arm-Cortex MicroController Board The Arm-Cortex Microcontroller board's Analog-to-Digital (ADC) and Digital-to-Analog (DAC) connections are used to connect the cascaded three tank system to the board. 3.2.2 Interfacing of the Arm-Cortex Microcontroller board with Host PC A connection was established between the Arm-cortex microcontroller board and the host PC through a USB port. Data was exchanged in both directions, flowing from the microcontroller board to the PC and vice versa. The PC ran the control algorithm using MATLAB®/SIMULINK®. The input and output of the algorithm were linked with the hardware port of the instrumentation system, allowing for the reading of sensor inputs and the writing of actuation outputs to the port. 3.2.3 Signal Chain/Data transfer through the instrumentation system The heart of the control system for the cascaded-tank is the STM32F103C8T6 microcontroller, a 32Bit ARM Cortex microcontroller from STMicroelectronics. The microcontroller interfaces the cascaded-tank system with the host PC. To perform this function effectively, the board is loaded with a “server program”. The server program is made up of several lines of codes written in C language to allow seamless transfer of information between the tank and the host PC. The microcontroller reads values from the three level-sensors through its ADC port and sends it to the host PC through the serial port. It also reads values from the serial port and feeds it to the tank through the DAC port. A 12-Bit analog to digital converter in the microcontroller produces a digital equivalent of the voltage of between 3286 and 3701. Values, which are subsequently delivered to the PC through the USB port. The USB port is accessed by the MATLAB®/SIMULINK® process, which reassembles the 8-bit data into a single 16-bit value. This value is then used to calculate the height using the calibration equation. The proportional valves are servo-controlled, direct current (D.C) powered motorized valves. Proportional signals are delivered through two distinct signal terminals as input signals. 4-position valves are comparable to proportional valves, as previously described. The distinctions are that the valve can only open and close in four positions, and the input is only a 2-bit digital logic. This logic signal is a Transistor – Transistor – Logic (TTL), and it is given by the microcontroller port via two input/output (I/O) pins. A calibration function converts the flow rate generated by the MATLAB®/SIMULINK® process to the PWM equivalent. The 11 microcontroller receives the generated PWM signal, and the PWM module outputs a PWM signal through an I/O pin. A pump driver receives the PWM signal and generates an output with enough current capacity and proportionate voltage to drive the water pump. The cascaded-three-tank system's power supply is a switching power supply with a 12volt output and an 8A current capacity. 3.3 Calibration of Height Sensors 1. The bottom valves of the three tanks were closed manually. 2. The connection between the SIMULINK model and the tank system was established by opening the SIMULINK model (shown in Figure III in the appendix). The inputs u1, u2, and u3 were set to 0, 1, and 1 respectively to turn off the pump and electric-actuated valves. 3. The SIMULINK model was started. 4. Tank 1 was filled manually with water up to the 1cm mark, and the ADC block value connected to tank 1 was recorded. 5. This process was repeated for the water levels of 5, 10, 15, 20, and 30cm, and was also repeated for the middle and lower tanks. 3.4 Calibration of Pump 1. The digital microcontroller (based on the ARM-CORTEX M3 STMU F-series MCU board) was calibrated to ensure that the count values were within an acceptable range for the module being used. 2. The volumetric flow rate of the pump was determined through practical measurement using water as the fluid. 3. A volumetric flask and timer were utilized to calculate the volumetric flow rate. 4. The time required to acquire a specific volume of water was recorded. 5. The tester recorded different count values spaced at intervals of their choice between the maximum and minimum count values inputted. 3.5 Calibration of Control Valves The calibration of the 4 Positions valve and proportional valves of a three-tank system was carried out using a voltmeter to record voltages of the control valves and correlating it to the counts given by the signal from the Aurdino mega. The voltages given by the voltmeter was recorded as well as its corresponding counts from the Aurdino Mega. 12 3.6 Data Collection from the Experimental System The following steps were taken to collect data for determining the parameters of the theoretical model and identifying the empirical model: 1. The SIMULINK model created for identification purposes was opened. 2. MATLAB/SIMULINK was used to generate random signals of multiple levels for the three inputs to the experimental tank, along with switching times for all inputs. 3. The experimental tank system was stimulated by the well-designed inputs by running the SIMULINK model. 4. A set of 2000 input-output data was collected at a 2-second sampling rate. This data was divided into two parts: 1400 for training and 600 for testing. The 2-second sampling time (Ts) was small enough to capture the nonlinearities in the data, prevent aliasing, and not put too much strain on the computing systems. 13 Height Sensor 1 Manual Valve 1 HOST- PC Manual Valve 2 Height Sensor 2 Proportional Valve 1 4-position valve 1 Height Sensor 3 Proportional Valve 2 4-position valve 2 PUMP TARGET-PC + Actuators drivers + I/V converter Figure 3.1: Experimental set up for A cascaded three-tank system 14 CHAPTER 4 RESULTS AND DISCUSSION 4.1 Experimental Data Below are plots of data collected during the calibration of three level sensors, two proportional valves, and one pump. Tables 2-4 present data collected during the calibration of the height sensors for each of the three tanks. Additionally, Table 5 displays raw data for the proportional valves' calibration, while Tables 6-7 contain experimental raw data for obtaining the values of U1 and U2 for the pump. 15 Table 1 Experimental Raw Data for the Calibration of Height Sensor of Tank 1 Runs Height observed on the Height Values Serial Physical Tank (cm) Read Block in SIMULINK (Count) 1 4.8 3341 2 10.1 3411 3 15.3 3480 4 20.1 3545 16 Table 2 Experimental Raw Data for the Calibration of Height Sensor of Tank 2 Runs Height observed on the Height Values Serial Physical Tank (cm) Read Block in SIMULINK (Count) 1 5 3371 2 10.2 3439 3 15.3 3507 4 20 3570 17 Table 3 Experimental Raw Data for the Calibration of Height Sensor of Tank 3 Runs Height observed on the Height observed on the Physical Tank (cm) Physical Tank (cm) 1 5.1 3358 2 10.5 3429 3 15.8 3501 4 20.3 3560 18 Table 4 Experimental Raw Data for Calibration of Proportional Valves Runs Fractional Opening Value Voltage Readings at Flow Coefficient from Serial Send Block in the two terminals of SIMULINK (Count) the Valve (V) 1 11000 1.168 0 2 17000 1.85 0.119281 3 21500 1.92 0.205065 4 27000 2.14 0.307462 5 32500 3.71 0.408224 6 40000 4.12 0.544662 7 45000 4.23 0.635349 8 54000 4.35 0.797386 9 58500 4.4 0.876362 10 63000 4.65 0.958061 11 65535 4.84 1 19 Table 5 Experimental Raw Data for Calibration of Pump to obtain U1 (cm3/s) Runs Time (s) Height (count) Volume (cm3) U1(cm3/s) 1 43.42 37200 200 4.60617 2 8.85 38000 400 45.1977 3 12.58 38200 600 47.6948 4 10.43 39300 800 76.7018 5 10.29 40000 1000 97.1817 6 8.05 44500 1200 149.068 7 6.92 47000 1200 173.41 8 7.17 50500 1400 195.258 9 7.03 54000 1600 227.596 10 6.72 61000 1800 287.081 11 4.74 65500 2000 412.941 20 Table 6 Experimental Raw Data for Calibration of Pump to obtain U2 (cm3/s) Runs Height (count) Time(s) Volume (cm3) q(cm3/s) 1 55000 43.51 1600 36.77316 2 55500 39.66 1600 40.34291 3 56000 35.43 1600 45.15947 4 56500 32.69 1600 48.94463 5 57000 29.53 1600 54.18219 6 57500 27.04 1600 59.1716 7 58000 25.31 1600 63.21612 8 58500 23.78 1600 67.28343 9 59000 22.28 1600 71.81329 10 59500 21.34 1600 74.97657 11 60000 20.72 1800 86.87259 12 60500 19.86 1800 90.63444 13 61000 18.77 1800 95.89771 14 61500 17.96 1800 100.2227 15 62000 17.34 1800 103.8062 16 62500 16.7 1800 107.7844 17 63000 15.68 1800 114.7959 18 63500 15.87 2000 126.0239 19 64000 14.27 2000 140.1542 20 64500 13.43 2000 148.9203 21 65000 11.56 2000 173.0104 22 65500 10.2 2000 196.0784 21 4.2 Plots of Parameters 4.2.1 Level Sensor Calibration Plots Height (cm) against Count for Tank 1 25 y = 0.075x - 245.9 R² = 1 Height (cm) 20 15 10 5 0 3300 3350 3400 3450 3500 Height Count Figure 4.1: Height vs Count for Tank 1 22 3550 3600 Height (cm) against Count Tank 2 25 y = 0.0753x - 248.95 R² = 1 Height (cm) 20 15 10 5 0 3350 3400 3450 3500 3550 Height count Figure 4.2: Height vs Count for Tank 2 23 3600 Height (cm) against Count for Tank 3 25 y = 0.0751x - 246.94 R² = 1 Height (cm) 20 15 10 5 0 3300 3350 3400 3450 3500 3550 Height Count Figure 4.3: Height vs Count for Tank 3 24 3600 4.2.2 Pump Calibration Plot PWN Counts against Flow rate 68000 y = -0.0005x3 - 0.2297x2 + 142.72x + 50074 R² = 0.9967 66000 PWN Counts 64000 62000 60000 58000 56000 54000 0 50 100 150 200 Pump Flowrate Figure 4.4: PWM Count to Pump Flow rate 25 250 4.2.3 Calibration of Proportional Valve PWM (Count) vs Fractional Valve Opening 70000 y = 2843.5x2 + 51810x + 10865 R² = 1 60000 PWM (Count) 50000 40000 30000 20000 10000 0 0 0.2 0.4 0.6 0.8 1 Fractional Valve Opening Figure 4.5: PWM Count vs Fractional Opening for Valve 1 26 1.2 PWM (Count) against Fractional Opening 70000 y = 3639.7x2 + 51194x + 10837 R² = 0.9996 60000 PWM (Count) 50000 40000 30000 20000 10000 0 0 0.2 0.4 0.6 0.8 1 Fractional Valve opening Figure 4.6: PWM Count vs Fractional Opening for Valve 2 27 1.2 4.3 Model Parameters The signals of the flow coefficient are presented below using the whole 2000 input-output data set and MATLAB system identification to calculate the flow coefficients in the theoretical model. 28 Figure 4.7: Input-Output response plot of the 2000 data 29 Figure 4.8: The comparison between the validation data and the nlgref model 30 The values of alpha gotten from the model are shown in Table 8. Table 7 Flow Coefficient for the Theoretical Model ALPHA VALUE a1 0.4791 a2 0.4605 a3 0.4815 a4 0.5 a5 0.4581 a6 0.4831 The obtained alphas yielding values near 0.5 show that the derived dynamic model follows Torricelli’s Principle. 31 4.4 Empirical determination of a Linear Model for the system Using the initial data set of 1400 input-output collected earlier and the MATLAB system identification, the subroutine "arx" in the system identification toolbox was used to create the linear transfer function matrix for the tank as shown below. For Tank 1: Using the arx_h1.mlx file created the transfer function for the flow is. πΊ(π ) = −0.009429π 2 −0.0006947π +0.01354 π 3 + 0.898π 2 + 1.021π + 0.1073 32 Figure 4.9: The 5-step predicted response comparison of the transfer function and the real data for h1. 33 Figure 4.10: The 5-step predicted response comparison of the transfer function and the real data for h2 34 For Tank 2: Using the arx_h1.mlx file created the transfer function for the flow is. −0.03691π 2 − 0.06732π + 0.05127 πΊ(π ) = 3 π + 0.8791π 2 + 1.193π + 0.0432 35 Figure 4.11: The 5-step predicted response comparison of the transfer function and the real data for h3. 36 4.5 Determination of Linear Model for the Tank by Linearization By linearizing the nonlinear dynamic equation of the cascaded-tank system (equation 5, 6, 7) at the nominal operating point (π1 = 0.5838, π2 = 0.333, π3 = 0.333 and π4 = 0), the state space equations were gotten. ππ₯ ππ‘ = π΄π₯ + π΅π’ (20) π¦ = πΆπ₯ + π·π’ (21) where π₯ = [πΏβ1 πΏβ2 πΏβ3 ]π , π’ = [πΏπ’1 −0.0383 π΄ = [ 0.0411 0 π΅=[ 0.0114 0 0 1 πΆ =[0 0 0 π· = [0 0 0 1 0 0 −1.6904 1.3057 πΏπ’2 0 −0.0417 0.0322 πΏπ’3 ]π , π¦ = [πΏβ1 0 ] 0 −0.0284 0 ] 0 −1.7575 πΏβ2 πΏβ3 ]π (22) (23) 0 0] 1 (24) 0 0 0 0] 0 0 (25) The eigen values of the system were calculated as −0.0284, −0.0417 and −0.0383. This shows that the system is stable. The transfer function model is obtained from substituting Eq. 22-25 into Eq.26. πΊ(π ) = πΆ(π πΌ − π΄)−1 π΅ + π· (26) 37 0.2984 πΊ(π ) = 0 0 26.10s + 1 0.2941 −40.57 (26.11s+1)(24.39s+1) 24.41s + 1 0.3329 −0.0127(−8.75×104 +1) −61.78 [(35.16s+1)(26.11s+1)(24.39s+1) (35.16π +1)(24.04π +1) 35.16s + 1] 0 4.6 Open Loop Stability of System Upon finding the poles of the system, the stability of each tank is displayed on table 9, 10 and 11. 38 Table 8 Stability of the empirical tank 1 transfer function s/no TANK 1 STABILITY 1 -0.3913 + 0.8815i Stable 2 -0.3913-0.8815i Stable 3 -0.1154+0.0000i Stable 39 Table 9 Stability of the empirical tank 2 transfer function s/no TANK 2 STABILITY 1 -0.421+0.9924i Stable 2 -0.421-0.9924i Stable 3 -0.0372+0.0000i Stable 40 Table 10 Stability of the empirical tank 3 transfer function s/no TANK 3 STABILITY 1 -0.4425+1.1502i Stable 2 -0.4425-1.1502i Stable 3 -0.4607+0.0000i Stable 4 -0.0748+0.0000i Stable All the tanks appear to be stable, therefore, it is regarded a stable system. 41 CHAPTER FIVE CONCLUSION ANDRECOMMENDATIONS 5.1Conclusion The 'arx' linear transfer function matrix sub-routine on MATLAB was used to calculate the three-tank cascaded system, and we ultimately came up with three stand-alone transfer functions for each of the cascades. The system can be inferred to be stable from the data as shown under the results because the pole is located within the coordinate and has a value. 5.2 Recommendations Studying or testing the dynamics of a toxic liquid substance can be hazardous because the operator may unknowingly expose themselves to the substance while conducting the experiment, which can be detrimental to their health. In the reactor setup, the liquid (water) was manually dispensed into the reservoir via a funnel without a well-defined mechanism for feeding it. Consequently, it is recommended to employ a more secure and efficient method of filling the reservoir, such as designing a device connected to the reservoir that will dispense liquid as required. 42 REFERENCES Bamimore, A., Ogunba, K.S., Ogunleye, M.A., Taiwo, O., Osunleke, A.S. and King, R. 2012) Implementation of advanced control laws on a laboratory-scale Three-Tank System. Ife Journal of Technology, 21(2):49-54. Bamimore, A., Osinuga, A. B., Olaleke, M., Adeniran, O., Odunsi, O., Salaudeen, A., Owolabi, Olabiyi, Y. (2016). Design and fabrication of four-tank level control system, Unpublished MSc. Thesis Taiwo, O., Bamimore, A., and Osunleke, A.S. (2018) Recent Developments in Local Designing and Fabrication of Equipment for Teaching and Research in Chemical Engineering, Proceedings of Nigerian Society of Chemical Engineers 48th Annual Conference, Abeokuta, Nigeria. 8th – 10th November. Zaky, M. A., El-Metwally, K. A., & El-Badawy, E. A. (2015). Optimal design of cascaded tank systems for wastewater treatment. Alexandria Engineering Journal, 54(3), 535-541. Chang, L. W., & Wu, H. C. (2014). Experimental study of cascaded tank system with multiobjective optimal tuning using evolutionary algorithm. Journal of Process Control, 24(7), 1021-1030. Chen, Y. S., & Lee, C. S. (2019). Optimal adaptive dynamic programming control for a class of nonlinear cascaded tank systems. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 49(6), 1251-1260. Kim, J. H., Choi, S. H., & Lee, S. (2016). Design and implementation of a cascaded tank system for flow rate control. Journal of Mechanical Science and Technology, 30(4), 1577-1584. Subbiah, K., & Arvind, K. (2017). Analysis and design of cascaded tank system for liquid level control. International Journal of Engineering and Technology, 9(1), 229-234. Zaky, M. A., El-Metwally, K. A., & El-Badawy, E. A. (2015). Optimal design of cascaded tank systems for wastewater treatment. Alexandria Engineering Journal, 54(3), 535-541. Zhang, D., Zhou, S., & Yang, S. (2020). Robust output feedback control for nonlinear cascaded tank system with disturbance attenuation. Journal of Control Science and Engineering, 2020, 1-12. 43 APPENDIX APPENDIX A List of Group Members ADEBAJO Daniel Oluwafemi CHE/2016/001 AJAYI Boluwatife Ifedayo CHE/2016/090 AGBONGHALE Daniel Ighodalo CHE/2016/014 ALADELO Oyindamola Eniola CHE/2016/023 BANKOLE Faith Tolulope CHE/2016/032 ESHO Ifedayo CHE/2016/041 MARCUS Victor Chidiadi CHE/2016/051 OLADIPUPO Aishat Temitope CHE/2016/064 OSIJONWO Oluwatomisin Precious CHE/2016/073 TAIWO Adekemi Adesewa CHE/2016/082 ODIKAYOR Dennis Uwomano CHE/2016/096 44