Liquid Level Control using PID Controller Based on Labview & Matlab Software

DOI : 10.17577/IJERTV3IS100143

Download Full-Text PDF Cite this Publication

Text Only Version

Liquid Level Control using PID Controller Based on Labview & Matlab Software

Praseed Kumar Mechanical Engg Department Fr.C.R.I.T, Vashi Navi Mumbai

Maharashtra, India.

Shamim S Pathan1 Bipin Mashilkar2 Mechanical Engg. Department Fr.C.R.I.T,Vashi, Navi Mumbai Maharashtra,India

Abstract The purpose of study paper is to demonstrate an innovative approach for low cost continuous liquid level monitoring based on virtual instrumentation. Most of the traditional measuring systems were designed and implemented by complicated hardware circuitry. It made the product expensive, with low functionality and with limited precision. With virtual measurement technology, more of the instrument can be substituted by software. Using this approach the cheaper and more versatile measurement system can be developed. A prototype of a liquid level monitoring system based on float sensors, electromagnetic valve, Matlab and LabVIEW environment is developed for measuring liquid level accurately and accordingly maintaining the level of liquid close to the reference level. In order to illustrate flexibility of the designed system the front panel of the developed virtual instrument is presented. Measurements carried out in laboratory show that the accuracy of some millimeters could be achieved.

Keywords LabVIEW, liquid level control, PID, control system, Matlab

I INTRODUCTION

Many industrial and scientific processes require knowledge of the quantity of content of tanks and other containers. In many instances it is not possible or not practical to directly view the interior. The more obvious industrial applications include: tank level gauging of milk, beer or wine in food and beverage industry; level gauging of acid, oil and solvent vessels in chemical plants; level monitoring of water in reservoirs. Over the last several decades, computer control of manufacturing systems has been the focus of extensive research. Advances in microprocessor, computing, networking and interfacing technologies have improved capabilities of industrial measurement and monitoring systems substantially over the period. The development of virtual and open architecture monitoring systems shifts the focus of automation from being hardware centric to software centric, providing further flexibility. Therefore an experimental setup will be constructed to control liquid level in a tank using Lab VIEW & Matlab software. In this project we are using float level sensor to sense liquid level along with LabVIEW software in windows based PC to control the electromagnetic valve through DAQ card.

James D. Wagoner [1] (2004) has studied and implemented the automatic liquid level control in a water tank. The system consists of 5 major parts viz. tank, gate valve, and actuator, controller in LabVIEW and bubbler pressure sensor. Pressure sensor measures the water pressure or head at the bottom of the tank. A feedback signal sent to the solenoid actuator which

controls the position of the gate valve. ON/OFF and PID controller implemented in LabVIEW interfaced with DAQ card. DAQ card has input/output module whose output ranges from 3-8 volts. Author compared PID and ON/OFF controller for accuracy. Author concluded that PID controller performed with least error as compared to the ON/OFF controller.

GeorgiNikolov[2] (2008) has studied virtual techniques for liquid level monitoring using differential pressure sensors. In this paper author has used differential pressure silicone sensor. Liquid density and liquid level are obtained with the help of two differential pressure sensors. Basic principle of the sensor is if a pipe is placed along the height of the tank with its top end sealed off, with rise or fall of water level, the pressure in the pipe will vary proportionally. This pressure change is measured and calibrated accordingly.

II MATHEMATICAL MODELING

In order to design any control system the value of its transfer function should be known. To get the transfer function, mathematical modeling of the system needs to be done. Consider a system consisting of a single tank with single inlet and outlet as shown in Fig. 1

Fig.1 Control system

Q = Steady state flow rate (before any changes occurred) m3/s qi= Small deviation of inflow rate from its steady state

qo= Small deviation of outflow rate from its steady state value, m3/s

H = Steady state head (before any change has occurred), m

h = Small deviation of head from its steady state value, m Flow rate (Q) Head (H)

Q = K x H

K = Constant For laminar R= H/Q ——– (1)

Capacitance is defined as the ratio of change in volume of liquid stored to change in head of liquid in the tank.

Cdh = (qi-qo) dt ———— (2)

For laminar flow from equation (1)

As qo = h/R —————– (3)

  • Tuning of PID Controller in Matlab:

From the transfer function obtained, a PID controller is tuned for various PID gains. MATLAB© Simulink is used for PID tuning. The block diagram for tuning of PID controller in

Substituting the values of eqn. (3) in equation (2) RC (dh/dt) + h = Rqi ——————- (4)

Taking Laplace we obtain the following transfer function H(S)/Q(S) = 1/ (1+RCS) —————- (5)

From equation (5) we get the relationship between head of liquid in tank and the net flow rate. The transfer function obtained from mathematical modelling will be used to design PID controller using Matlab & Lab VIEW software.

II EXPERIMENTAL IDENTIFICATION OF TRANSFER FUNCTION

An experiment is carried out to find the values of Resistance (R). The tank is filled up to its maximum level. With the outlet kept on and time interval of 30seconds, head loss is measured. Observation for the experiment is shown in table1.

Sr.

No.

Time

H (cm)

H2-H1 (cm)

H- 5

(cm)

Q (cm3/sec) () /t

1

30

28.9

3.1

23.9

210.552

2

30

26

2.9

21

196.968

3

30

23.3

2.7

18.3

183.384

4

30

20.5

2.8

15.5

200.74

5

30

18.3

2.2

13.3

157.73

6

30

16.0

2.3

11

164.89

Table No.1

MATLAB© is shown in fig 3.ing

Fig 3.Block diagram of controller in MATLAB©

The PID controller is tuned to get the exact values of proportional, integral and derivative gains. Values for PID gains are obtained as: Proportional gain = 1.3185 Integral gain

= 0.0038707, Derivative gain = -90.6714 These values were used in LabVIEW software to obtain the output.

  1. EXPERIMENTAL SETUP

    The setup consists of a water tank which receives water from a reservoir under a suitable head. A solenoid valve is located at the inlet of the tank. A float sensor located at a suitable height in the tank is used to sense the level of water. The float sensor senses the water level and sends a signal to the NI DAQ 9234 (input module) in the form of voltage.The DAQ card converts this analogue signal into digital signal and sends it to LabVIEW software. The PID ontroller designed in LabVIEW software will process the data and sends a voltage of 5V as a signal to the output module, i.e. NI DAQ 9263, which will be converting the signal into analogue voltage. This voltage actuates solenoid valve via relay. The components used in the experimental setup are as follows:

    1. Sensor:

      The sensor used is a float type sensor which acts as a switch to an external voltage source. The excitation voltage for sensor is 5V. Fig. 4 shows the mounting of the sensor on the tank.

      Fig 2. Graph for Net head v/s Flow rate

      Graph shown in fig 2. is plotted from the readings obtained in table1. From the graph we find the value of the resistance by calculating the slope corresponding to height of the sensor

    2. Tank:

      Fig 4. Float sensor

      from the bottom of the tank which is 16cm. The resistance of the tank is found out to be R = 0.2145/cm2

      Transfer Function =H(S)/Q(S) = 1/(1+ RCS)

      = 1/ (437.06S +1)

      This transfer function was used to find the values of PID gains in MATLAB© Simulink.

      A tank of size 12 x 18 x 14 is used for the experimental set up. Material of the tank is high density Polystyrene Plastic. The material of the tank is of no consequence of the experimental setup and was chosen for its easy availability and is show in Fig. 5.

    3. Relay:

      Fig 5. Tank

      IV Design of PID Controller in LabView:

      A PID controller is designed in LabView. A LabView block diagram is developed for this purpose & is shown in the figure 9.

      The output from the NI DAQ 9263 is limited to ±10 V, but the actuation voltage for the electromagnetic valve is 12V. In order to acquire this actuating voltage a separate 12 volt DC supply is used along with a relay. The relay switches its state when the voltage is above 6V. Fig. 7 shows the circuit diagram for relay and relay connections.

    4. LM324

      Fig 6. Relay

      Fig 9. LabView block diagram for PID controller

      The float sensor is tested for determining one level of water in the tank. The float sensor is mounted in an inverted position. When the float is at the bottom position, the float sensor is in the on condition and vice versa. The sensor output of 5V (in on condition) was given to the LabView through the DAQ 9234 (input module). PID controller is implemented using LabView software as shown in Fig. 11.The sensor output is given to the PID controller via. NI DAQ 9234.

      Fig 7. Op-amp

      The fig.7 shows Op-amp LM 324. The current and voltage required to switch the relay is 30mA and at least 6V DC. The current and voltage obtained from the NIDAQ 9263(output module) is 2mA and 8V DC. Hence amplification of current is necessary which is done by Op-amp LM324. It acts as a current amplifier.

    5. Electromagnetic valve

    Fig 8. Electromagnetic valve

    The electromagnetic valve actuates at 12V. It controls the flow of water from the reservoir. The input voltage is acquired from NI DAQ 9263 via a relay. The mounting of electromagnetic valve on the tank is shown in Fig. 8.

    Fig 10. Sensor output

    The PID controller output is taken out from LabVIEW software using NI DAQ 9263 and given to the relay via Op- amp LM324. The acquired sensor output & controller output is shown in Fig. 10 & Fig. 11 respectively.

    Fig 11. Controller output

    The actuating voltage and current required for electromagnetic valve is 12V and 200mA.But the magnitude of the controller output (current) is only 2mA. Hence a relay is used to actuate the electromagnetic valve. But the current required to switch

    the relay is 30mA. Hence Op-ampLM324 is used to amplify the current from 2mA to 30mA. The terminals of the electromagnetic valve are connected to terminal 1 and positive of the battery as shown in the Fig. 7. The negative terminal of the battery is connected to NO (normally open) terminal of the relay. When the float sensor is in the on condition, the relay completes the circuit where the valve is connected and turns on the electromagnetic valve. When the water rises to the desired level the float sensor turns off and this in turn turns off the electromagnetic valve.

  2. CONCLUSIONS

    Interfacing of hardware components with LabVIEW software through NI hardware is done successfully. Detection of liquid level by float sensor and corresponding ON/OFF switching of electromagnetic valve is achieved. The open loop control system is modeled in LabVIEW. Control of 2 levels could not be achieved due to the restrictions imposed by the configuration and working of the float sensor. This set up will further be used for testing and implementing an Ultrasonic sensor. This will enable us to control the level of liquid at any height directly from LabVIEW.

  3. REFERENCES

  1. James D. Wagoner, Automatic liquid level controller using a LabVIEW based PC, 2004, America Society for Engineering.

  2. PrafullaPatil, "Designing PID controller using LabVIEW for controlling fluid level of vessel, 2013, International Journal of Engineering Research and Applications.

  3. GeorgiNikolov, Virtual techniques for liquid level monitoring using differential pressure sensors, 2008, RECENT, Vol.9, no.2 (23).

  4. Katsuhiko Ogata, Modern control engineering, Pearson education 2011, 5th edition, pp.100

Leave a Reply