The Design of Modularized Oil Tank Measurement and Control Intelligent Unit

In this study, we design a modular intelligent measurement and control unit applied to the on-site oil storage tank to meet acquisition and processing of signals from typical liquid level meters, pressure transmitters, temperature sensors and others with various parameters, multiple protocols and hardware interfaces. We transmit metering parameters of each oil tank to the upper management database through the standard CAN bus. On the basis of the equipment, the distributed measurement and control network for storage tanks of the oil depot is built, which can be adapted to features of storage tanks in the oil depot (scattered and widely distributed) and overcome shortcomings of various instruments in the traditional metering system, such as mutual imcompatibility, different complex structures, great integration difficulty and so forth.


INTRODUCTION
As an important component of the integrated automation system of oil depots, the automatic metering system of oil storage tanks has become the essential means for operation and safety management of oil depots after many years of development.Because metering accuracy of the current oil tank metering system is insufficient, with incompatible instrument protocols, various system buses, difficulty in integration with other systems, a general-type intelligent measurement and control unit for oil tanks is designed, which is applicable to various oil tanks and mainstream metering devices, a variety of metering methods with intelligent data processing, field data display, flexible configuration and so on, therefore the automatic metering system (suitable for all oil depots) of distributed oil tanks can be quickly and effectively constructed by means of the IMCU.Yang (1999) analyses the field bus technology and application.Ma et al. (1999) study the SCM-based advanced c language application programming.Zhang (2003) shows the software design based on lonworks technology tanks measurement management systems -on-site data processor.Ma and Zhou (1998) study the data acquisition and processing technology.Xu and Peng (1998) have a research of the SCM-based advanced c51 language application programming.
In this study, we design a modular intelligent measurement and control unit applied to the on-site oil storage tank to meet acquisition and processing of signals from typical liquid level meters, pressure transmitters, temperature sensors and others with various parameters, multiple protocols and hardware interfaces.We transmit metering parameters of each oil tank to the upper management database through the standard CAN bus.On the basis of the equipment, the distributed measurement and control network for storage tanks of the oil depot is built, which can be adapted to features of storage tanks in the oil depot (scattered and widely distributed) and overcome shortcomings of various instruments in the traditional metering system, such as mutual imcompatibility, different complex structures, great integration difficulty and so forth.

OVERALL DESIGN OF IMCU IN THE OIL STORAGE TANK
Main usage of the IMCU is to meter and monitor oils of oil storage tanks, including metering of liquid level, water level, average temperature and oil pressure, conversion of volume, density and mass of oils.The IMCU should be capable of real-time monitoring of oil pressure (plus-minus) of oil storage tanks, oil gas concentration near oil storage tanks and temperature and humidity of oil storage cave depots, capable of onsite display of all metering parameters, monitoring parameters and alarm information of oil tanks.Those data can be transmitted to the control room through the field bus, and the configuration software is used to display monitoring, metering and alarm information as well as working condition of instruments and the system in a centralized way.

Selection of the metering method:
In order to ensure metering accuracy, the conventional international method, HTMS, is utilized as the metering method of the monitoring unit, and meanwhile LTG and HTG Fig. 1: Measurement parameters and calculation method with medium and small-sized investment can be taken into account as well.In the system, the high-accuracy liquid level meter is used to measure the liquid level of oils, the average temperature sensor for temperature of oils, the pressure transmitter for oil pressure and oil tank steam pressure (plus-minus), these parameters are acquired through the measurement & control unit, and then oil density, volume and mass are obtained through calculation in accordance with the strapping table for internal storage.Measurement parameters and the calculation method are shown in Fig. 1: The formula used here is expressed as follows: Apparent density Overall structure of the system: Measurement and control network structure of the SCADA system in the oil storage tank of the oil depot includes three layers, the bottom layer is used to place the primary instrument, mainly including the liquid level meter, the average temperature sensor, the pressure transducer, the combustible gas concentration sensor, the ambient temperature and humidity sensor and so forth; the medium layer is the distributed field bus control network, mainly including intelligent measurement and control unit of the oil storage tank, the field bus network etc; the top layer is the monitoring and metering management system for the oil storage tank based on the Ethernet network, mainly including the central monitoring station, monitoring configuration software, database and so on.The system structure is illustrated in Fig. 2.

HARDWARE STRUCTURE AND FUNCTION IMPLEMENTATION OF THE MEASUREMENT AND CONTROL UNIT
To meet different requirements for the monitoring system of oil storage tanks, hardware of the measurement and control unit is designed according to the modular design idea, mainly including the master control platform module, the serial port module, the onoff input and output module, the current analog input module, the RTD module and the keyboard module.The module structure is illustrated in Fig. 3.

Module design of the master control platform:
The master platform module includes sub-modules of power supply and CPU, module extension backplane inside.The sub-module of power supply supports switch of DC24V to DC5V and DC3.3V, which provides power for other modules in the case from the backplane connector.The UART signal of the CPU module is transmitted out from the backplane and changed into RS233 (signal) to communicate with the external intelligent liquid crystal terminal.DC24V input of the power supply is equipped with surge protection, burst protection, electrostatic protection, and reverse connection protection and so on.RS232 connector is provided with electrostatic protection, filtering protection and isolation etc.The module of power supply provides a 24 V input, a 24 V output and a RS232 connector.The sub-module of power supply is designed as Fig. 4.
ColdFire V4-series high-performance processor, MCF54415, is used in the CPU module, with a 128 M on-board DDR2 RAM, a 256MB on-board NAND

Design of serial communications module:
The serial port module is mainly used to connect RS485-based MTS magnetostrictive liquid level meter, SABB Radar liquid level meter and the servo liquid level meter manufactured by Honeywell-Enraf Company, which is applied to acquisition of liquid level, water level of oils in storage tanks and other data.The UART signal of the CPU module is transmitted out through the backplane of the serial port module, and changed into RS485 and RS232 (signal) to achieve communication between the measurement and control node and field instruments.The serial port module provides three RS485 channels and two RS232 channels outwards.The serial port module is designed as Fig. 6.

Design of analog input module:
The analog input module is mainly used for acquisition of 4-20 mA output signals from the pressure transmitter, the

Design of RTD module:
The RTD module is used to acquire temperature signal of the average temperature sensor based on the PT100 platinum resistor, and signals of 4 temperature spots at most may be measured.SPI and GPIO signals of the CPU module The RTD module are transmitted out through the backplane of the RTD module to connect the ADC channel, so as to implement sampling of the two-wiresystem/three-wire-system Pt100 resistor, and to detect the temperature parameter with an error of less than 0.1°C.A 24 bit chip with the SPI connector is used in ADC, in which the Analog Front End (AFE) is integrated to reduce the total channel error.The RTD module provides 4 two-wire-system/three-wire-system resistor connectors.The RTD module is designed as Fig. 8. Keyboard module: I2C, GPIO and UART signals of the CPU module are transmitted out through the backplane of the keyboard module, I2C and GPIO are connected with the keyboard scan chip to achieve scan of the external 4×5 keyboard and obtain the input command from the keyboard, which is used for the onsite operators to set oil tank type, Offset of data, the measuring range and other parameters displayed on the measurement and control unit.The UART signal is connected to the Lon Works MODEM to realize networking of nodes and external Lon Work's bus equipment.The keyboard module provides one 9-wire keyboard scan interface and one Lon Works bus interface outwards.

SOFTWARE DESIGN OF MEASUREMENT AND CONTROL NODES
Software design of measurement and control nodes should abide by the software engineering design philosophy of "Top-down Design, Stepwise Detailing", mainly including the configuration module, the bus transmission module, the serial-port signal acquisition module, the analog input acquisition module, the RTD acquisition module, the HART signal acquisition module, the processing module of switching values, the computation and display module, the man-machine interaction module etc.The software program flow is illustrated as Fig. 9.
Fig. 2: Structure and configuration of SCADA system in the oil storage tank FLASH and a 4 MB on-board SPI FLASH, which can satisfy acquisition, operation and storage of large volume data as well as other requirements.Multichannel I2C, SPI, UART and GPIO signals included in MCF54415 are extended out through the backplane so as to achieve control of other modules in the case and communication with them.RS485, CAN and RS232 are extended out from the front panel to implement communication and networking with other measurement and control units at different distance.USB and the Ethernet communication connectors are reserved for node maintenance and other communication.The CPU module is equipped with one USB interface, one Ethernet connector, one CAN connector, one RS485 connector and one RS232 connector.The CPU sub-module is designed as Fig. 5.

Fig. 4 :
Fig. 4: Hardware structure of power supply in the master control platform

Fig. 9 :
Fig. 9: Software flow pattern DI/DO module: The DI/DO module is utilized to acquire alarm signal input of the liquid level switch and the oil-gas concentration senor, to provide control output of the on-site audible and visual alarm and to control on-off action of valves, and so on.I2C and GPIO signals are transmitted from the backplane of the DI/DO module to connect I/O expansion chips, so as to implement input detection of on-site dry contacts and control output of relays.The DI/DO module provides four dry-contact inputs, four 24VDC/3A and 220VAC/1A relay outputs outwards.