University College of Southeast Norway LM-900 Level Tank Hans-Petter Halvorsen, 2016.10.26 http://home.hit.no/~hansha
Table of Contents Table of Contents... ii 1 Introduction... 1 2 System Description... 2 2.1 Operation... 2 2.1.1 Power... 2 2.1.2 Pump (inflow)... 2 2.1.3 Valve (outflow)... 3 2.1.4 Level measurement... 3 2.2 Connectors, switches, and indicators... 3 2.3 Mathematical model... 4 3 Fuji PYZ5 PID-controller... 5 4 NI USB-6008... 7 5 LabVIEW Control Design & Simulation Module... 9 5.1 PID Control... 13 ii
1 Introduction This document gives a short description of the liquid tank of the LM-900 Level Control System. The LM-900 Level Control System has a built-in Fuji PYZ5 PID-controller. The focus will be to connect the system to a PC and create a simulation and control system in LabVIEW, C#.NET, etc. A proper development tool would be LabVIEW with LabVIEW Control Design & Simulation Module and LabVIEW PID and Fuzzy Logic Toolkit. A proper DAQ device would be the NI USB-6008 DAQ device from National Instruments, the inventor of LabVIEW. The NI USB-6008 DAQ device is simple to configure and use. The NI USB-6008 DAQ device is described in detail in the document NI USB-6008 DAQ Device.pdf. All documents are available from http://home.hit.no/~hansha/. 1
2 System Description The Figure below shows the liquid tank (LM-900 Level Control System). 2.1 Operation 2.1.1 Power The tank is powered via a mains switch. 2.1.2 Pump (inflow) A pump fills the tank with water from the reservoir. The pump speed can be controlled by a voltage signal in the range 0-5V. The pump can be controlled by an external voltage signal at the FROM PC connector, or by the inbuilt Fuji level controller. The LOCAL/PC switch is used to select between external control and internal control. 2
3 System Description 2.1.3 Valve (outflow) Water flows from the bottom of the tank to the reservoir via a pipe in which there is a manually operated valve. 2.1.4 Level Measurement The water level is measured by a level sensor. The measurement is a voltage signal in the range 0-5V available at the TO PC connector. This voltage range corresponds to a level range of 0-20 cm, approximately (unless you need a more accurate relation, you can assume this range in your applications). The level sensor is based on measurement of the air pressure in the air pipe. The higher level - the higher hydrostatic pressure at the pipe outlet at the bottom. The pipe must always be filled by air - no water. You adjust the purge meter to ensure that the pipe is filled by air (bubbles should be seen from the pipe). 2.2 Connectors, switches, and indicators Connectors: The FROM PC connectors (the upper is plus, and the lower is minus or ground): Connect here the analog output (AO) signal from the I/O equipment (e.g. DAQ card, DAQPad, FieldPoint).
4 System Description The TO PC connector (the upper is plus, and the lower is minus or ground): Connect here the analog input (AI) signal to the I/O equipment. The LOCAL/PC switch: In PC position measurement and control is via I/O equipment (as PC with I/O card). In LOCAL position the internal PID controller Fuji PYZ5 PID-controller is used for control. Other connectors are for interlocking functions (normally not used in simple applications). LED indicators (light emitting diodes) PV and OUT are for indicating level measurement (PV = Process Value) and control signal (OUT). 2.3 Mathematical model A simple mathematical model of the water tank is as follows: or Ax = K(u u ( ) F +,- x = 1 A K(u u () F +,- Where: x [cm] is the level u [V] is the pump control signal to the pump u 0 is the bias voltage needed to get any flow (with u less than u0 there is no flow into the tank) A [cm2] is the cross-sectional area K [(cm3/s)/v] is the pump gain F out [cm3/s] is the outflow through the valve (this outflow can be modeled more accurately taking into account the valve characteristic expressing the relation between pressure drop across the valve and the flow through the valve).
3 Fuji PYZ5 PID-controller The LM-900 Level Control System has a built-in Fuji PYZ5 PID-controller. The built-in controller is described in detail in the Instruction Manual Fuji PYZ5 PID Controller.pdf. The Fuji PYZ5 PID-controller Display: 5
6 System Description
4 NI USB-6008 NI USB-6008 DAQ device is a simple and low-cost multifunction I/O device from National Instruments. The device has the following specifications: 8 analog inputs (12-bit, 10 ks/s) 2 analog outputs (12-bit, 150 S/s) 12 digital I/O USB connection, No extra power-supply neeeded Compatible with LabVIEW, LabWindows/CVI, and Measurement Studio for Visual Studio.NET NI-DAQmx driver software The NI USB-6008 is well suited for education purposes due to its small size and easy USB connection. The NI USB-6008 DAQ device is described in detail (how the NI USB-6008 DAQ device works and how to use it in LabVIEW) in the document NI USB-6008 DAQ Device.pdf. The document is available from: http://home.hit.no/~hansha/. 7
8 System Description For more details, see http://sine.ni.com/nips/cds/view/p/lang/en/nid/14604
5 LabVIEW Control Design & Simulation Module LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Instruments. The graphical language is named "G". For more information about LabVIEW, go through the training kit An Introduction to LabVIEW. This document and other information about LabVIEW are available from: http://home.hit.no/~hansha/. In LabVIEW there is an additional module for design and simulation of control systems, called LabVIEW Control Design and Simulation Module and a toolkit called LabVIEW PID and Fuzzy Logic Toolkit. Control Design and Simulation VIs are available from the Control Design and Simulation palette: In the Simulation Sub palette we have the Control and Simulation Loop which is very useful in simulations: 9
10 LabVIEW Control Design & Simulation Module In the Continuous Linear Systems Sub palette we want to create a simulation model: The most used blocks are Integrator, Transport Delay, State-Space and Transfer Function. The Signal Arithmetic Sub palette is also useful when creating a simulation model:
11 LabVIEW Control Design & Simulation Module Example: Simulation Model Below we see an example of a simulation model created in LabVIEW. Example: Simulation Below we see an example of a simulation model using the Control and Simulation Loop. Notice the following: Click on the border of the simulation loop and select Configure Simulation Parameters
12 LabVIEW Control Design & Simulation Module The following window appears (Configure Simulation Parameters): In this window you set some Parameters regarding the simulation, some important are: Final Time (s) set how long the simulation should last. For an infinite time set Inf. Enable Synchronized Timing - Specifies that you want to synchronize the timing of the Control & Simulation Loop to a timing source. To enable synchronization, place a checkmark in this checkbox and then choose a timing source from the Source type list box.
13 LabVIEW Control Design & Simulation Module Click the Help button for more details. You may also set some of these Parameters in the Block Diagram: You may use the mouse to increase the numbers of Parameters and right-click and select Select Input. 5.1 PID Control In the PID Sub palette we have the functions/subvis for PID Control. I recommend that you use the PID Advanced.vi. Example: PID Control Below we see how we can use the PID Advanvanced.vi in order to control a simulated Model.
14 LabVIEW Control Design & Simulation Module
Hans-Petter Halvorsen, M.Sc. E-mail: hans.p.halvorsen@hit.no Blog: http://home.hit.no/~hansha/ University College of Southeast Norway www.usn.no