| In recent years,gas meters have become more and more widely used in people’s daily life.At present,the civil gas meter is mainly diaphragm gas meter.The ultrasonic gas meter has attracted the attention of the domestic and international flow areas due to its advantages of high measurement accuracy,small pressure loss and wide measurement range.Therefore,it is a very interesting topic to carry out on the ultrasonic gas meters.Based on the characteristics of ultrasonic transducers,this thesis makes an in-depth analysis of the principle of time difference measurement.In view of the measurement defect that the sound velocity brings a large error to the measurement results,the improved time difference method flow measurement principle is proposed,and a brief analysis of the factors affecting the accuracy of the flow metering is made.The hardware circuit of the system is mainly divided into MCU circuit,TDC-GP22 timing circuit,ultrasonic transmitting circuit,switching circuit,echo signal mplifyrcuit,band-pass filter circuit,storage circuit,liquid crystal display circuit,RS485 communication circuit and power supply circuit.In the design of ultrasonic transmitting circuit,MOSFET driver ICL7667 chip is used as the core device,combined with TDC-GP22 timing chip,it can drive ultrasonic transducer well under short distance measurement.This circuit has few peripheral devices and low power consumption.The output of the circuit is externally connected to the upstream transducer and the downstream transducer,and this circuit is more practical and is an innovation in the circuit design.U-shaped elbow is selected as the pipeline structure of the system,and the FLUENT flow field analysis software is used to simulate the ultrasonic propagation path and the flow velocity distribution of the pipeline section,which provides a basis for the selection of the flow correction coefficient.The software program design of the system mainly includes system clock initialization,TDC-GP22 timing chip initialization,ultrasonic flight time measurement,time difference post processing,flow rate and flow conversion,LCD display and RS485 communication.The de-extreme average filtering algorithm based on bubble sorting is used to process the measurement time difference to improve the anti-interference of the system.After completing the hardware circuit design of the system and the software program design,the whole machine debugging of the system is performed.The experimental test is carried out on the built system.Due to the limited experimental conditions,the measurement results cannot be calibrated.Therefore,under static conditions,the forward and backward flow propagation time are obtained by changing the spacing of the transducers,and the measurement accuracy is obtained by comparing with the theoretical time.When the transducer distance is 7cm~11.5cm,the relative error of the forward and backward flight time is within 0.35%,and the absolute error is within 1μs,which meets the requirements of high-precision measurement. |