A series on Digital Controller design
Digital Controllers have found wide acceptance and application in the industrial & commercial applications for the past few decades. Availability of fast and cost effective microprocessors and microcontrollers have made the implementation of digital controller design much easier and cheaper than their continuous counterparts. They are the best for their optimum control schemes and non-linear systems.
This blog series presents the digital controller design for controlling liquid level of Coupled Liquid Tank System (CLTS). This coupled liquid tanks systems is a 3rd order system. The controller will be designed to control liquid level of Tank 1 only. The mathematical model of the system will be acquired and controller is designed on the basis of this model. The dynamics of the model are simulated using Matlab/Simulink and accuracy of designed controller is verified through the simulations. Hardware-in-the-Loop simulation is used to implement the designed digital controller to the system.
The Controller is implemented in the Simulink model and is interfaced to the physical system in real time using USB 1208 FS Data Acquisition Card. The controller has also been implanted through LabVIEW virtual instrument environment. The experimental results of the controller are presented and compared to the simulated results according to the designed specifications and satisfactory results are achieved.
Introductory Overview of the Coupled Liquid Tank System (CLTS)
This nonlinear system consists of three liquid tanks. A photograph of coupled liquid tank system is shown in figure 1.1. One of the tanks is placed horizontally to make the system nonlinear. Water flows from top tank to lower tank due to gravity. A computer controlled pump is used to pump back water from the lowermost tank to top tank. Computer also records water level in all tanks and pump flow rate. A number of basics and advanced experiments such as tuning of PID controller or testing of fuzzy logic controllers can be carried out on this system. This system is controllable in a limited range of system setting hence making it possible to study different control characteristics of the system.
This computer controlled coupled tank system has three tanks. Each water tank is about 5 litre capacity and water level in each tank may be varied 0-20cm. All three tanks are cylindrical in shape. Top tank and lower tank are placed vertically so that their cross sectional area remains the same as water level rises in these tanks. The middle tank is placed horizontally so that its cross sectional area increases with water level. Tubing and valves are used to direct water flow. During the operation the total water inventory is about 5 liters that fully fills only one tank. This is to ensure that there is no water spillage during the operation in case of power failure. Detail described in this thesis has been taken from manual of the system.
Objectives of the Case Study of Digital Controller Design:
The Main objectives of our project are:
Understanding the system dynamics:
- To make a clear understanding of the assigned task and develop a thorough conceptual basis.
- Modeling the complete system and to represent it as standard control system block diagram.
- State space representation of the system in discrete form.
Simulation of the Model in Simulink:
- Developing a Simulink model of the system and to verify the accuracy of the mathematical model.
Development of necessary electronics and interface:
- Building an interface of the sensors and actuators of the system to the Simulink Model through MC-1208-FS Data acquisition card.
- Calibration of the equations for level sensors and pump speed through DAC card
Digital Controller Design:
- Design of digital controller by emulation and direct design techniques. The controller will control the speed of motor to control the water level in Tanks.
- Using the power of Matlab/Simulink to design a digital controller for the system by numerical optimization techniques and through PID Tuner Tool.
Implementation through Real Time Hardware-in-the-Loop (HIL) Simulation via Simulink:
- The system modeled in the Simulink will be interfaced to the actual physical system though DAC card.
Both systems will run in parallel though a synchronized HIL simulation and the physical system will be controlled through simulation.
Hardware Description and Functioning
Flow Rate Measurement
A computer controlled 12v DC pump is used to pump back water from lowermost tank to top tank. At full speed pump produces flow rate of about 4lts/min. Computer also records the water level in all the three tanks and pump flow rate. Flow rate is measured with the help of flow transducer which is capable of recording flow rate in the range of 0.25-6.5lit/min. The output of the flow transducer (Rs-257-149) is in the form of pulses and is converted into an analogue voltage using a frequency to voltage converter.
Water Level Measurement
Water level in each tank is measured using floats and servo potentiometers. Each level transducer consists of a servo potentiometer and two plastic floats. Floats are tied together with a string. A small pulley is attached to each potentiometer. The string tying floats together passes over the pulley. Servo potentiometer are used due to less fiction and longer life. Floats that goes into the tank is a bit larger than the float that hangs outside the tank.
Floats in the tank is only partially dipped into the water. When water is rising, due to buoyancy, float inside tank becomes lighter than the outer one. This makes the pulley and servo potentiometer to move with the rising water level in the tank. When water level is receding, floats inside the tank becomes heavier due to reduced buoyancy than the float hanging outside. This moves potentiometer backwards with the receding water level. This arrangement needs some adjustment before the start of each experiment session.
Each level measuring potentiometer is supplied with +5volts. Output of each potentiometer varies between 0-5V with the water level. Three analogue voltages (0-5V) indicating water level in upper ,middle, and lower tanks along with the analogue voltage of flow transducer with F-V converter are supplied to the PC I/O card.
Pump Flow Rate
Variable speed of the pump is achieved by the use of a motor driver. Duty cycle of the chopper is varied with the DAC card analog output. When DAC output is low, pump runs at low speed delivering low flow rate. This pump is the only actuator in the system. PC controls the pump flow rate using DAC card, motor driver and pump. A regulated power supply for the pump and potentiometer is provided through Digital Trainer available in the lab.
USB 1208FS Data Acquisition Card
DAC card is used for communication between controller simulator in PC and physical system. It takes sensor values and sends them to Simulink/LabVIEW simulation where the voltage is converted to tank water level and corresponding action is taken by controller.
Similarity, output to the pump is also provided to the system using DAC analog output port.
Power Supply Unit
Power supply unit enclosed in top left corner derives 12V for the above mentioned circuits and a +5V regulated output for potentiometers from PC. An unregulated +12V DC, 3A supply is mounted in top left corner. It has one transformer, bridge, filter capacitors and few other components. Transformer input is 220V AC, 50 Hz. This can be switched ON/OFF using a switch.
Components and Hardware used in the CLTS Digital Controller Design
Interface of this system to a computer comprises of following hardware components:
|1||5 liter capacity tanks||1|
|9||12 V DC Pump||1|
|14||1208-FS DAC Card||1|
Implementation of Digital Controller Design: Methodology
- As already described, the physical tanks system will be controlled by its virtual counterpart inside the Simulink environment.
- Both hardware & software model will run in parallel and water level in tank will be measured through the servo potentiometer and will be given to Simulink model.
- The model generates a PWM signal to control the pump speed when the PID controller has computed the error signal and issues a duty cycle.
- We will control the level of water by controlling the flow rate of water through the pump, for the speed control of pump the PWM will be generated by the Simulink model, the duty cycle of PWM will be decided by Discrete PID controller.
Project Timeline for Digital Controller Design Case Study
The detail of tasks completed until now in the lab sessions is given below:
- Complete understating of the system (1-week): We performed a literature of the said problem and have developed a complete understanding of the components used, their construction and working.
- Development of a Mathematical Model (2-weeks): A mathematical model governing the dynamics of the system has been developed and it will be transformed to discrete form through Matlab functions and its accuracy will be checked.
- Assembling (1-week): The hardware system has been assembled. Some loose connections in the servo potentiometers created problems to get correct readings and have now been repaired.
- Controller Design & Implementation (2-weeks): Controller will designed mathematically and will be implemented to the physical system through hardware-in-the-loop simulation.
- Testing (2-weeks): Tested the electrical wiring and circuit connections of the system successfully after assembling.
- Final Results (1-week): Whole project along with controller will be implemented and finalized results will be compiled.
- Report writing (1-week): Documentation and report of the project will be completed in the last two weeks of the project.
In this article, basic introduction to the case study has been given. Then, different parts of coupled liquid tank system have been described in detail. It is nonlinear system with 3 tanks, 3 level sensors, and one actuator. The purpose of the objective has been stated and method has been proposed to accomplish the objective in specified amount of time. In the end, project timeline is given.
Next articles in this this series would explain the complete design and implementation procedure of a digital controller design for the non-linear coupled liquid tank system. Subscribe to the blog to receive next articles in you inbox.
You may also want to read how wind power plants work and the NEMA codes for electrical equipment.
If you liked this article, then please subscribe to our YouTube Channel for video tutorials and project descriptions. You can also find us on Facebook. Give us your feedback in the comments section.
Leave a Reply