Gas flowmeter is a commonly used instrument. The bell-shaped gas flow standard device is a metrological standard device that uses air as the medium to verify, calibrate and detect gas flowmeters. It is mainly suitable for the verification, calibration and type evaluation of velocity, volumetric and differential pressure gas flowmeters, and can also be used for research on gas flow measurement. Based on the C8051F350 single-chip microcomputer, this paper transforms the existing bell-shaped device and designs a gas flowmeter detector.
Overview of Gas Flow Meter Calibration Technology
At present, the calibration methods of gas flow meters can be broadly divided into two types: direct measurement and indirect measurement.
The direct measurement method uses actual fluid for measurement verification. Its specific definition is to use a standard device (standard flow meter or measuring instrument) in series with the measured flow meter, and compare the cumulative flow values of the fluid measured by the two to obtain the measurement error of the measured flow meter. The real flow detection method has the characteristics of the verification environment being consistent with the working environment, the flow value is accurate and reliable, and it truly reflects the measurement characteristics of the measured flow meter. The real flow detection method can be divided into offline real flow detection and online real flow detection. Offline real flow detection is mainly carried out in the laboratory, that is, the flow meter to be tested is connected in series with the flow standard device in the laboratory, and the flow meter measurement error is measured under the laboratory reference conditions. This method can ensure accurate measurement under laboratory conditions, but ignores its measurement characteristics under working conditions. Online real flow detection is to install the standard flow meter on the reserved calibration pipeline behind the measured flow meter, use the actual fluid for measurement, and obtain the actual working error through on-site online detection.
The indirect measurement method is a method of indirectly obtaining the indication error of the measured flow meter by measuring several physical quantities related to the flow value and calculating the errors of several related physical quantities.
Gas flow meter detector principle
Working principle of the bell jar device
The bell-shaped gas flow standard device is one of the main forms of gas flow standard devices. It is relatively simple to use it to calibrate the flowmeter when the pressure is not high (generally less than 10kPa) and the flow rate is not large. The device can be divided into exhaust type and intake type according to the direction of air flow. Its characteristics are: ① It is suitable for calibrating gas flowmeters with low pressure and small flow rate; ② In the exhaust type device, the gas pressure flowing through the flowmeter to be tested is very low, close to atmospheric pressure, and the gas humidity is very high, which affects the test result, so humidity correction is necessary; ③ The intake type device requires a dry and stable gas source to ensure that the dryness of the calibration gas meets the specified requirements and to ensure that the air flow pressure, temperature and flow rate of the test pipe section are constant, which makes it more difficult to establish an intake type device than an exhaust type device; ④ Since the internal pressure of the bell jar is only determined by its own gravity, the gravity of the counterweight, the buoyancy of the liquid and the tension of the compensation mechanism, the internal pressure is constant regardless of whether it is an exhaust type or an intake type.
The standard volume of the bell jar is obtained by measuring the displacement of the bell jar. The automatic measurement of the displacement of the bell jar is an important part of the detector (bell jar device). The grating ruler is a high-precision displacement measuring element, which has been widely used in the fields of precision instruments, high-precision precision machining, etc. The grating ruler is used in the detector as a displacement sensing element of the bell jar measuring cylinder, which can accurately correspond to the volume of the bell jar. The principle of the detector is that when the bell jar descends, the gas in the bell jar flows through the flow meter to be tested through the connecting pipeline. At the same time as the bell jar descends, the grating ruler converts the height of the bell jar descent into a pulse signal, which is transmitted to the computer after conditioning by the hardware interface circuit. The computer converts it into a gas standard volume or volume flow rate after compensation correction and other calculation processing. In addition, the calibrated detector is equipped with a baffle and a photoelectric sensor. The volume between the two baffles of the bell jar is fixed. The time it takes for the baffle to pass through the photoelectric sensor can be measured, and the standard volume or volume flow rate of the exhaust gas can also be obtained. By comparing the measured value with the volume or flow indicated by the flow meter to be tested, the basic error of the flow meter to be tested can be obtained.
Flow calculation formula
The volume of gas discharged from the bell jar during the measuring time t is VS, then the volume flow rate passing through the calibrated flow meter is
In formula (1), PS, TS, ZS are the absolute pressure (Pa), thermodynamic temperature (K) and gas compressibility coefficient in the bell jar, respectively; Pm, Tm, Zm are the absolute pressure (Pa), thermodynamic temperature (K) and gas compressibility coefficient before the flow meter, respectively; Vs is the gas volume (m3) discharged from the bell jar under the PS and TS states; Vm is the gas volume (m3) discharged from the bell jar under the Pm and Tm states; t is the measurement time (s).
By comparing (qv)s with the displayed value (qv)m of the calibrated flow meter, the relative error of the calibrated flow meter can be calculated as:
For velocity flowmeters, the instrument factor of the flowmeter is calibrated by the standard volume discharged by the bell device and the number of pulses output by the calibrated flowmeter.
Basic structure of gas flow meter detector
The gas flow meter detector uses the C8051F350 single-chip microcomputer as its core to monitor all measured values. Its basic structure is shown in Figure 1.
In order to ensure that the temperature difference between the air temperature in the bell jar and the liquid temperature in the tank meets the specified requirements, the temperature of the detector should be strictly controlled, so five temperature sampling points are set up, and temperature and humidity sensors are added to monitor the on-site calibration environment. All signals monitored by the detector are as follows: ① Bell jar, five-way temperature including the top temperature of the jar, the upper, middle and lower temperatures in the jar, and the liquid temperature; ② The flowmeter being tested, the temperature, pressure, differential pressure, and analog flowmeter signal before the flowmeter is calibrated; ③ Environment, room temperature and humidity; ④ Pulse signal, bell jar grating ruler, baffle, limit, and pulse flowmeter signal.
Gas flow meter detector hardware design
The hardware part of the gas flow meter detector is composed of single-chip microcomputer, communication, valve control and voltage conversion circuits. It is controlled by a computer to complete various verification instructions and realize functions such as real-time data acquisition and high-precision timing.
Introduction to C8051F350 MCU
The detector uses C8051F350 MCU as the control core. It is a highly integrated mixed signal system-on-chip MCU that integrates rich on-chip resources such as PGA, ADC, DAC, etc. It has the advantages of low power consumption, high resolution, small package, high cost performance, etc. It is an ideal choice for high-precision measurement applications. The input and output of the MCU signal are shown in Figure 2.
Functional characteristics of C8051F350 microcontroller: ① 70% of the instructions are executed in 1 or 2 system clock cycles, so that the system clock frequency can be reduced while ensuring the system speed requirements, thereby reducing system power consumption; ② PGA can be amplified 1~128 times, suitable for direct measurement of small signals; ③ 8-channel 24-bit ADC, its nonlinearity can reach 0.0015%, ensuring high accuracy of the system; ④ 8kB on-chip FLASH memory ensures sufficient code space for the linear correction program of the sensor, and one of the sectors (512 bytes) can be Used as non-volatile memory to store system calibration parameters; ⑤ High-precision programmable 24.5MHz internal oscillator, ±2% accuracy, can support crystal-free UART operation; ⑥ 768 bytes of internal RAM, can be used to store large amounts of data required for linearization operations; ⑦ Programmable counter/timer array, can achieve 16-bit PWM, with simple peripheral circuits can achieve D/A conversion; ⑧ 32-pin LQFP package, saves PCB area, can be used for miniaturized products; ⑨ On-chip debugging circuit provides full-speed, non-intrusive in-system debugging to ensure easy development.
There are four external oscillator circuits for the C8051F350 chip. The crystal is selected as the external oscillator source in the design. In order to facilitate the setting of the baud rate, Y1 shown in Figure 2 is 22.1184MHz. The C8051F350 chip has a total of 17 digital I/O ports, of which P2.0/C2D is used for JTAG debugging. After the hardware connection and cross switch configuration, the remaining 16 ports have the following pin functions: P0.0 grating ruler input pulse count; P0.2, P0.3 connect external crystal oscillator; P0.4, P0.5 serial communication; P0.6 bell cover baffle, limit signal (INT0 interrupt); P0.7 flow meter pulse signal (INT1 interrupt); P1.0 button (power-on reset); P1.1, P1.2 microcontroller read baffle and limit signal; P1.4 control CD4053; P1.5~P1.7 control 74HC595, P0.1, P1.3 are vacant.
Detector signal acquisition
The flow signals output by pressure, temperature sensors and some gas flow meters are current signals (4mA~20mA). Considering the ADC input range, a 100Ω precision resistor can be used to convert the current signal into a corresponding 0.4V~2V voltage signal.
The C8051F350 microcontroller has an 8-channel 24-bit programmable AD converter, and there are 16 analog quantities to be converted in the detector. In order to solve the problem of insufficient channels, a bidirectional analog switch CD4053 can be used.
Set the ADC to use the internal reference voltage, and after zero point calibration and slope calibration, make the ADC output the initial value when the input is 4mA, and the full-scale value when the input is 20mA. Read the high 16 bits of the AD conversion result and send them to the computer, which then calculates the corresponding value based on the linear interpolation table provided by each transmitter.
Gas flow meter signal adjustment circuit
The gas flow meter signal is output in pulse mode, part of which is a standard pulse signal (TTL level), and the other part is a high-level signal between 3V and 30V. Therefore, a comparator is used to design an input pulse adjustment circuit to simplify the circuit. The adjustment circuit can identify these two parts of the pulse signal and convert the high-level signal into a TTL level. The flow meter signal adjustment circuit is shown in Figure 3, where f2 is the input of the flow pulse. Set the reference voltage V2. When the input is lower than the reference voltage, the output GND=0V; when the input voltage is higher than the reference voltage, the comparator output voltage Vcc=5V. The signal output by the comparator is optically isolated and power amplified, and then input to the P0.7 pin of the microcontroller.
Multi-way solenoid valve control circuit
According to the calibration procedures and flow meter range, multiple calibration flow points need to be set during calibration. Take 10 flow calibration points between 0.5m3/h and 128m3/h, corresponding to 10 solenoid valves to control the flow. Manually input the required flow value during calibration, and the computer automatically opens the corresponding solenoid valve or solenoid valve combination according to the flow value corresponding to the solenoid valve.
The detector uses the C8051F350 single-chip microcomputer to execute the opening and closing of the solenoid valve and control the blower. In order to occupy as few I/O ports of the single-chip microcomputer as possible, the 74HC595 chip is introduced. As shown in Figure 4, a serial port multi-way valve control circuit is designed. The 74HC595 contains an 8-bit serial input, serial/parallel output shift register and an 8-bit three-state output latch. Connect Q7 of the first 74HC595 to SER of the second one. The single-chip microcomputer only needs to control the SER, SRCLK and RCLK pins of the first 74HC595 to control the opening and closing of multi-way valves and blowers.
Software Design of Gas Flow Meter Detector
The software design of the gas flow meter detector uses Delphi programming technology to process the data sent by the lower computer, obtain the verification results, and save the verification data in the SQL SERVER database system. The controller part of the detector system is responsible for collecting data and executing instructions, while the design of the verification interface, database design and data processing are completed on the computer.
Controller software design
As shown in Figure 5, the controller software design includes the A/D sampling module, communication module, timing module and counting module design.
(1) Counting and timing
The gas flow meter detector uses an interrupt method to count the bell baffle pulses, flow meter output pulses and grating ruler pulses. At the same time, the detector must time the standard time, generate a 1s interrupt, and generate a baud rate during communication. The C8051F350 microcontroller can meet the counting and timing requirements. It has a programmable counter array (PCA). The PCA is set to count the input pulses. In most cases, it only needs to control its start and stop, and then read the count value. T0 is used to count the pulse signal of the flow meter being tested; T1 is the serial communication baud rate generator; T2 is used for standard time timing and 1s timing.
(2) Communications
The C8051F350 microcontroller communicates with the computer using the RS-232C serial port, with a baud rate of 115200bps. During actual communication, the effective instructions issued by the computer are compiled into a set of codes, and after the microcontroller executes the command, the data returned contains another set of codes corresponding to this operation. In this way, the host computer and the microcontroller program can be written at the same time, and after writing, they can be used together like a puzzle; and the data format is agreed upon, and the command can be changed by modifying the data format code on the host computer.
(3) Verification method
The calibration personnel set the relevant calibration parameters on the computer and send them to the single-chip microcomputer through the serial port. The calibration process is shown in Figure 6. First, lift the bell jar to the specified position, and start the calibration after setting the calibration method and parameters. The calibration methods that have been implemented are: ① Bell jar constant volume method: mainly calibrate the pulse output flowmeter and calibrate the flowmeter instrument coefficient; ② Flowmeter constant volume method: mainly calibrate the standard flow pulse signal output flowmeter, use the flow comparison method, and calibrate the relative error of the flowmeter; ③ Analog calibration method: similar to method ①, use baffle constant volume, and control the collection of the flowmeter analog quantity by the start and end baffle numbers and perform A/D conversion, sampling once per 1s; ④ Manual method: similar to method ②, mainly calibrate the flowmeter with manual reading, and the calibration personnel control the start and end of the timing and grating ruler pulse counting.
In the process of calibrating various flow meters, the single-chip computer collects pressure, temperature and other sensor data every 1 second, and reads the number of grating ruler pulses corresponding to the displacement of the bell jar and the number of baffles passed by the bell jar, the number of pulses output by the flow meter and other data, and sends them to the computer for display and flow value compensation calculation. When the bell jar drops to the bottom, it stays for 3 seconds, and then the computer sends a bell jar lifting command to lift the bell jar for the next calibration.
Computer software design
Computers are mainly used to set flow meter calibration parameters, analyze and calculate calibration errors, and manage data.
(1) Computer function module
The detector adopts Delphi programming to design and develop the user interface, and uses SQL Server database to manage the calibration data. The computer functional modules include system parameter setting, data acquisition and processing, data query, data modification, calibration report printing and calibration personnel management modules.
(2) Computer data processing
The data processing method varies depending on the verification method. Taking verification method ① as an example, the flow meter instrument coefficient and error are calculated according to the following formula. First, determine the instrument coefficient ki of each flow verification point.
Software Settings
(1) Setting permissions
The personnel who log in to the software are divided into different permissions. The highest permission is the system administrator with all permissions. The administrator can generate operators and debuggers or other customized personnel with different permissions. The operator permissions include testing instruments, calling test records, etc., and their permissions are specified by the system administrator; the debugger permissions include modifying the internal settings of the software, setting system data, etc.
(2) Set system parameters
After the system is built, some corresponding system parameters must be set to ensure the normal operation of the detector and the high detection accuracy of the instrument, including:
① Bell jar meter coefficient: It means that each pulse of the pulses emitted by the rotary encoder represents the volume of gas discharged from the bell jar. It is a fixed parameter of the bell jar and needs to be calibrated once a year. This coefficient must be set in the detection software, otherwise the flow meter under test cannot be detected.
② Flow meter instrument coefficient: indicates that each pulse in the pulses emitted by the flow meter represents the volume of gas flowing through the flow meter, and the unit is liter per pulse (L/N). It must be input before detection and must also be set. It can be set as a fixed parameter or a variable parameter of the flow meter.
③ Standard conditions: It is the standard state condition of the gas, that is, the atmospheric pressure is 101.325kPa and the temperature is 293.15K (20℃).
④ Stabilization time after the bell is lifted to the specified height: After the bell is lifted, it will vibrate during the rising and stopping process in a short period of time. The bell can be stabilized by setting the stabilization time to reduce the system error. The larger the parameter setting, the smaller the vibration of the bell and the better the detection effect, but it will also reduce the detection efficiency.
⑤ The number of stable pulses at the beginning of the bell jar detection descent: The bell jar goes through a stationary and descending process during the descent stage, and vibration will occur at the beginning of the descent. By setting the pulses at the beginning of the bell jar descent to not be measured, the bell jar can reduce vibration during this period of non-measurement and reduce system errors. The larger the parameter setting, the smaller the bell jar vibration and the better the detection effect, but it will also reduce the detection efficiency.
⑥ Number of falling pulses after the test is completed: After the bell cover is tested, it cannot stop falling immediately. It must stop the pulse counting first and then stop the bell cover. This parameter is set to meet the requirement of stopping the pulse counting first and then stopping the bell cover. The setting of this parameter should not be too large to ensure that the detection stop time and the bell cover stop falling time are staggered.
3) Set the verification certificate format
Including setting paper size, font size, text position, etc.
Conclusion
Gas flow meters are often used in production and life, and their accuracy is closely related to the safety of the entire production and life. In the face of the growing demand for flow meter calibration and testing, it is very important to improve the working efficiency and accuracy level of the detection instrument. This paper uses the C8051F350 single-chip microcomputer as the control core, improves the bell device, installs a precision grating ruler as the bell displacement sensor element, and adds a multi-channel sensor to design a gas flow meter detector. The detector is controlled by single-chip microcomputer data acquisition, which improves the reliability and accuracy of the collected data; the detector is simple in composition and easy to maintain; during the calibration process, the detector completely controls the detection process and calculates the calibration results, which improves the detection accuracy and has universal applicability.
Previous article:51 MCU serial communication design and input and output introduction
Next article:Summary of experience of stepper motor on 51 single chip microcomputer development board
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- PYB Nano UF2 bootloader beta version
- Is there any place in Beijing that can do small batch ASIC bare die bonding?
- How ADI builds a bridge from the physical world to the digital world through product changes
- 【AT32F421 Review】+ CoreMark score
- Unboxing Review
- EEWORLD University Hall----Digital Image Processing (MATLAB) Shandong University (Jiang Mingyan)
- [RT-Thread reading notes] First acquaintance
- Support jesd204b protocol high-speed DAC chip AD9144-FMC-EBZ configuration notes
- How the Circuit Works
- Did you know? TI's 77Ghz single-chip mmWave sensor enables automated parking