1. Introduction
In the crude oil pipeline transportation process in the petroleum industry, crude oil needs to be transferred between enterprises, making flow meters widely used. Metering accuracy is a critical parameter, affecting the economic benefits and reputation of enterprises. In recent years, with the rapid development of industrial control technology, programmable logic controllers (PLCs) have been widely adopted in the industrial control field, adding specialized control functions such as PID regulation, servo functions, and high-speed counting (HSC) functions, while also possessing high reliability. This makes it possible to achieve automatic crude oil metering using PLCs. Therefore, we utilize industrial computers (IPCs) and PLCs to construct a new type of distributed automatic crude oil metering system. This system can transmit data to the control center via Ethernet.
This project has been successfully applied at several metering stations along the Shandong-Ningxia long-distance pipeline, achieving excellent calibration results in terms of measurement accuracy, system stability, work efficiency, reliability, and operability.
2. System Working Principle and Hardware Configuration
2.1 Working principle of the control system
The system structure is shown in Figure 1. When using pipeline oil transportation, the corresponding electric valves are opened/closed via the PLC in the field control room to switch processes and activate the corresponding flow meters. The flow meter transmitter transmits pulse signals...
The pulse is transmitted to the PLC, which uses a high-speed counting module to collect the number of pulses emitted by the flow meter and converts it into a volume value under standard conditions. Simultaneously, the PLC collects the fluid pressure and temperature in real time (provided by pressure and temperature transmitters, respectively). All data is sent to the host IPC via Ethernet. The IPC, combining the real-time fluid pressure and temperature values, calls the crude oil metering database, converts the measured cumulative value into a cumulative value under standard conditions (20℃, 101325Pa), and stores the data on the IPC's hard drive. Furthermore, the IPC can drive a printer to print a metering report.
2.2 Software and hardware configuration of the control system
The control system mainly consists of primary equipment, secondary equipment, control components, and software. Primary equipment mainly includes pressure gauges, thermometers, flow meters, etc.; secondary equipment mainly includes temperature transmitters, pressure transmitters, pulse transmitters, electric valves, etc.; control components mainly include PLCs, IPCs (configuration network cards), printers, hubs, and application software, etc., see Figure 1.
2.2.1 Hardware Part
(1) IPC: To ensure the high reliability of the system, the Dell GX260 computer, which is widely used in China, was selected. The specific configuration is as follows: PⅢ 1.7GHz CPU, 256MB memory, 40GB hard disk, SONY 21-inch flat screen monitor, 64MB graphics card, sound card and speakers (for alarm and notification), etc.
(2) PLC: The Rockwell A2BPLC from the United States is selected as the control core of the system. Its characteristics include high reliability, powerful functions, and good scalability. The specific configuration is as follows: CPU is 17472L551B (with built-in Ethernet communication port); the analog input (AI) module is 17462NI4, which has four high-level analog input terminals, can input standard signals such as 4mA to 20mA, 12-bit A/D conversion accuracy, and has input overshoot monitoring function and measurement filtering anti-interference function; the analog output (AO) module is 17462NO4I, which has four analog output terminals, requires no external power supply, and can output various standard signals, including 0mA to 20mA, 4mA to 20mA, ±10V, etc. The following modules are selected: the 17462I×16 digital input module, which features 16 single-ended isolated 24VDC inputs, all equipped with filters to ensure a maximum noise immunity of 0.1ms and filter out line power supply interference; the 17462O×16 digital output module, which features 8 relay outputs, internal overload and short-circuit protection, and channel fault self-diagnosis; and the 17462HSCE HSC module, which can count pulses with a maximum frequency of 40kHz, enabling up counting, down counting, or up/down counting.
(3) Network Function: Based on the design requirement for remote real-time monitoring of on-site data, each IPC is equipped with one network card. Strong anti-interference capabilities are used between PLCs and IPCs, and between IPCs themselves.
Ethernet was established using shielded twisted-pair cable. Considering the distance between the field metering room and the dispatch room, an 8-channel high-speed hub from 3COM was added to the middle of the line to ensure reliable data transmission.
(4) Flow meter: The UF2Ⅱ type rotor flow meter from OVAL Corporation of Japan is used. It has the advantages of high accuracy, wide flow range and good repeatability. The flow meter field part is equipped with a non-return-to-zero counter and regulator. The flow conversion and transmission part is the PG30EP type pulse transmitter from OVAL Corporation.
(5) Temperature and pressure instruments: Both temperature transmitters and pressure transmitters can provide standard signals of 4mA to 20mA.
(6) Electric valve: The electric valve can be fully opened or fully closed by a DC 24V switch output. At the same time, the electric valve provides passive position signal output and status signal output.
2.2.2 Software Components
The system's software mainly includes platform software, PLC programming software, and IPC configuration software.
(1) System platform software: Windows 2000 is used as the system platform. The system password and operator instructions are set, and some functions of the software are blocked to restrict the operation of the system and prevent unauthorized users from entering the system.
(2) PLC programming software: Rslogix500 from A2B is used. It is a programming software suite based on the Windows environment, specifically designed for A2B500 series PLCs. It supports multiple language modes such as ladder diagram (LD), instruction statement list (IL), and sequential function chart (SFC). It has functions such as online programming, diagnosis and online simulation debugging. It can support Ethernet and communication protocols or communication buses such as DF1 Full Duplex, DH485, and DF1 Half Duplex Master/Slave.
(3) IPC configuration software: Citect5.0, a well-known industrial control software from the Australian company SEAT, is selected. This software can run on the Windows NT/2000 platform and has the characteristics of fast sampling speed, strong real-time performance, high reliability, convenient configuration, diverse alarm modes, simple creation of real-time and historical trend curves, and can be seamlessly linked with other application software such as VB, VC, VF, Excel, etc., to flexibly and conveniently realize data retrieval and report printing.
3. Data flow and software process of the control system
3.1 Data Flow
(1) The PLC reads the field temperature and pressure data (standard 4mA~20mA signal) through the analog input module, and converts them into standard engineering units according to the different instrument ranges; it reads the pulse signal of the flow meter through the high-speed counting module, and the main program calls the metering subroutine to calculate the instantaneous and cumulative values of the flow according to the pulse flow ratio; it automatically switches the process by controlling the opening and closing of the electric valve of the digital input/output module.
(2) The IPC uses the communication module to read data from the PLC and...
The data is recorded in the local historical database. The application reads and displays the instantaneous and cumulative values of the field data and flow rate. At the same time, the PLC also reads and executes the IPC's operation instructions through the communication module.
(3) The PLC transmits the collected and calculated parameters of the flow meter under test to the IPC. The IPC combines the real-time pressure and temperature values of the fluid, calls the crude oil metering database, converts the measured cumulative values into cumulative values under standard conditions, and the IPC calls the Excel reporting system to record them, driving the printer to automatically print out the metering report.
3.2 Software Flow
The software flow is shown in Figure 2.
Based on the above derivation results, the logic diagram is shown in Figure 4.
In summary, when implementing the functional expansion of a priority encoder (taking T4148 as an example), the design method can be summarized as follows: the enable input of the highest bit chip is used as the overall enable input, and the enable output of the lowest bit chip is used as the overall enable output. Between two adjacent chips, the enable output of the higher bit chip is connected to the enable input of the lower bit chip. The overall expansion terminal YEX is the logical AND of the expansion terminals of each chip. In the overall code output, the lower 3 bits (Z2, Z1, Z0) are the logical AND of the outputs Y2, Y1, and Y0 of each chip. The higher bit output must be implemented using the expansion terminal YEX. When four T4148 chips are used to form a 32-line to 5-line priority encoder, the truth table of the expansion terminals and the higher bit code output can be listed as shown in Table 4.
4. Conclusion
Although this article discusses the extended design method of priority encoders, the same approach can be used to extend other logic functional components.