[go: up one dir, main page]

CN100385207C - A low-cost intelligent vortex flowmeter signal processing system based on DSP - Google Patents

A low-cost intelligent vortex flowmeter signal processing system based on DSP Download PDF

Info

Publication number
CN100385207C
CN100385207C CNB2005100410581A CN200510041058A CN100385207C CN 100385207 C CN100385207 C CN 100385207C CN B2005100410581 A CNB2005100410581 A CN B2005100410581A CN 200510041058 A CN200510041058 A CN 200510041058A CN 100385207 C CN100385207 C CN 100385207C
Authority
CN
China
Prior art keywords
signal
dsp
flow
circuit
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2005100410581A
Other languages
Chinese (zh)
Other versions
CN1737506A (en
Inventor
徐科军
王肖芬
陈智渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei University of Technology filed Critical Hefei University of Technology
Priority to CNB2005100410581A priority Critical patent/CN100385207C/en
Publication of CN1737506A publication Critical patent/CN1737506A/en
Application granted granted Critical
Publication of CN100385207C publication Critical patent/CN100385207C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measuring Volume Flow (AREA)

Abstract

基于DSP的低成本智能涡街流量计信号处理系统,其特征是由模拟信号调理模块、DSP芯片及外扩RAM、EEPROM、低电压监测电路、LCD显示、键盘输入、模拟量输出、脉冲输出及电源管理模块组成;本发明系统采用周期图谱分析与数字滤波相结合的方法,处理涡街流量传感器的输出信号,在现场有管道振动和流体流场不稳定的情况下,准确测量流体的流量。该系统体积小、成本低、功能齐全。

Figure 200510041058

DSP-based low-cost intelligent vortex flowmeter signal processing system, which is characterized by analog signal conditioning module, DSP chip and external expansion RAM, EEPROM, low voltage monitoring circuit, LCD display, keyboard input, analog output, pulse output and Composed of power management modules; the system of the present invention adopts the method of combining periodic map analysis and digital filtering to process the output signal of the vortex flow sensor, and accurately measure the flow of the fluid when there is pipeline vibration and fluid flow field instability on site. The system is small in size, low in cost and complete in function.

Figure 200510041058

Description

基于DSP的低成本智能涡街流量计信号处理系统 A low-cost intelligent vortex flowmeter signal processing system based on DSP

技术领域: Technical field:

本发明涉及一种流量测量仪表,特别是一种以数字信号处理器(DSP)为核心、周期图谱分析与数字滤波相结合的低成本的涡街流量计信号处理系统。The invention relates to a flow measuring instrument, in particular to a low-cost vortex flowmeter signal processing system with a digital signal processor (DSP) as the core and a combination of periodic graph analysis and digital filtering.

背景技术: Background technique:

涡街流量计因其测量部分无可动部件,磨损、压损小,理想量程比大,可测流体介质多,在流体流量测量领域应用广泛。但是,涡街流量传感器易受流体脉动、管道或其它振动源的影响,传统的信号处理方法,即放大、整形、滤波、计数不能有效地抑制噪声,所以测量精度不高;为了抑制噪声所设的门槛电平会影响量程比,导致无法测量小流量;对于不同量程、不同的被测流体,传统的信号处理系统需要更换不同的处理电路和参数。为此,国内外不少研究者对涡街流量计信号处理做了许多研究,并研制相应的系统。The vortex flowmeter is widely used in the field of fluid flow measurement because it has no moving parts in the measurement part, has small wear and pressure loss, has a large ideal range ratio, and can measure many fluid media. However, the vortex flow sensor is easily affected by fluid pulsation, pipeline or other vibration sources. Traditional signal processing methods, namely amplification, shaping, filtering and counting, cannot effectively suppress noise, so the measurement accuracy is not high; The threshold level will affect the turndown ratio, resulting in the inability to measure small flows; for different ranges and different measured fluids, the traditional signal processing system needs to replace different processing circuits and parameters. For this reason, many researchers at home and abroad have done a lot of research on the signal processing of vortex flowmeters and developed corresponding systems.

国外SCHLATTER,Gerald,L.对强噪声情况下的涡街传感器输出信号进行了研究,发现噪声信号和涡街信号频谱特性不同,可以对噪声和信号建立不同的模板,从而提出利用频域转换和互相关功率谱结果,根据建立的噪声模版和涡街信号模板消除信号中的强噪声(“Signal processing method and apparatus for flowmeter”,WO 90/04230,19 April1990)。但是,噪声情况复杂,建立模板不易,实际应用困难。Foreign SCHLATTER, Gerald, L. studied the output signal of the vortex street sensor under the condition of strong noise, and found that the noise signal and the vortex street signal have different spectral characteristics, and different templates can be established for the noise and signal, thus proposing the use of frequency domain conversion and According to the cross-correlation power spectrum results, the strong noise in the signal is eliminated according to the established noise template and vortex signal template ("Signal processing method and apparatus for flowmeter", WO 90/04230, 19 April1990). However, the noise situation is complicated, it is not easy to establish a template, and it is difficult to apply it in practice.

美国Foxboro公司采用两组滤波器来处理涡街传感器信号:一组为即时的自适应带通滤波器,另一组为非即时的可调带通滤波器(“Adaptive filter with sweep filteranalyzer for a vortex flowmeter”,US6212975,10 April 2001)。对于混有噪声的涡街流量传感器信号,同时分成两路进行处理。一路用自适应带通滤波器跟踪其涡街频率,滤掉噪声,得到流量;另一路用可调带通滤波器检测信号中噪声情况,观察流体流动状态,若发现异常情况就报警。在用自适应带通滤波器处理涡街信号时,必须先要知道当前涡街频率的具体范围,才能确定滤波器的参数,而涡街频率变化的范围较宽,当流量变化较大时,滤波器参数的配置需要较长时间或者配置不当,造成测量误差。Foxboro Corporation of the United States uses two sets of filters to process vortex sensor signals: one set is an instant adaptive band-pass filter, and the other set is a non-instantaneous adjustable band-pass filter ("Adaptive filter with sweep filter analyzer for a vortex flowmeter", US6212975, 10 April 2001). For the vortex flow sensor signal mixed with noise, it is divided into two channels for processing. One way uses an adaptive band-pass filter to track its vortex frequency, filters out noise, and obtains the flow rate; the other uses an adjustable band-pass filter to detect the noise in the signal, observe the fluid flow state, and call the police if abnormal conditions are found. When using an adaptive band-pass filter to process vortex signals, it is necessary to know the specific range of the current vortex frequency before determining the parameters of the filter, and the range of vortex frequency changes is wide. When the flow rate changes greatly, The configuration of the filter parameters takes a long time or is improperly configured, resulting in measurement errors.

日本Yokogawa(横河)公司研究先做谱分析再带通滤波的方法处理涡街信号,即先对涡街信号进行谱分析,确定当前涡街频率的大致位置;再选择相应的带通滤波器进行滤波(“VORTEX FLOWMETER”,JP2001153698,08 June 2001)。没有考虑到当气体流量大时,管道振动造成传感器信号出现较强的低频噪声干扰,这将使谱分析结果出错。Japan's Yokogawa (Yokogawa) company researches the method of spectral analysis first and then bandpass filtering to process the vortex signal, that is, first conduct spectral analysis on the vortex signal to determine the approximate position of the current vortex frequency; then select the corresponding bandpass filter Filtering ("VORTEX FLOWMETER", JP2001153698, 08 June 2001). It is not considered that when the gas flow rate is large, the pipeline vibration will cause strong low-frequency noise interference in the sensor signal, which will make the spectrum analysis result wrong.

国内重庆大学蒙建波等介绍采用基于最小均方自适应算法的现代谱分析处理流量信号(自动化学报,1992,18(3):362-366“自适应频率测量方法(AMF)在涡街流量计中的应用”)。由漩涡发生体、热线探针、前置处理电路和APPLE微机构成测量系统,验证了谱分析方法用于涡街流量计信号的处理的可行性。但是,没有研究计算的精度、实时性和小型化等关键技术问题,没有应用于实际的流量计中。此外,我们研究表明,这种方法对谐波干扰的抑制能力较差。Domestic Chongqing University Meng Jianbo et al introduced the use of modern spectral analysis based on the least mean square adaptive algorithm to process flow signals (Acta application in the meter"). The measurement system is composed of vortex generator, hot wire probe, pre-processing circuit and APPLE microcomputer, which verifies the feasibility of spectral analysis method for signal processing of vortex flowmeter. However, the key technical issues such as calculation accuracy, real-time and miniaturization have not been studied, and they have not been applied to actual flowmeters. In addition, our study shows that this method is less capable of suppressing harmonic interference.

合肥工业大学徐科军等分别采用周期图谱分析方法、基于Burg的现代谱分析方法、自适应陷波滤波方法和小波变换方法对涡街流量传感器的信号进行处理(仪表技术与传感器,1995,(5):22-25“涡街流量计信号处理的软件方法”;仪器仪表学报,2000,21(2):222-224“涡街流量计信号估计的自适应陷波方法”;仪器仪表学报,2001,22(3):255-260“基于DSP具有谱分析功能的涡街流量计信号处理系统”;仪器仪表学报,2001,22(6):636-639“基于小波变换的涡街流量计信号处理方法”),并且选用ADSP2181作为微处理器,以周期图谱分析为核心算法,研制了涡街流量计数字信号处理系统(“涡街流量计数字信号处理系统”,中国发明专利,专利号:ZL99101209.7,申请日:1999.1.8,授权公告日:2003.4.2)。该系统通过了安徽省流量仪表计量检定站的测试,结果证明谱分析方法可提高抑制噪声的能力和扩大量程比。但是,该系统器件较多,控制较复杂,体积偏大,与实际推广应用还有一定差距。Xu Kejun of Hefei University of Technology, etc. used the periodic map analysis method, the modern spectrum analysis method based on Burg, the adaptive notch filter method and the wavelet transform method to process the signal of the vortex flow sensor (Instrument Technology and Sensors, 1995, ( 5): 22-25 "Software method for signal processing of vortex flowmeter"; Journal of Instrumentation, 2000, 21(2): 222-224 "Adaptive notch method for signal estimation of vortex flowmeter"; Journal of Instrumentation , 2001, 22(3): 255-260 "Signal processing system of vortex flowmeter with spectrum analysis function based on DSP"; Meter signal processing method"), and ADSP2181 was selected as the microprocessor, and the core algorithm was periodic map analysis, and the digital signal processing system of the vortex flowmeter was developed ("Vortex flowmeter digital signal processing system", Chinese invention patent, patent No.: ZL99101209.7, application date: 1999.1.8, authorization announcement date: 2003.4.2). The system has passed the test of Anhui Provincial Flow Meter Calibration Station, and the results prove that the spectral analysis method can improve the ability to suppress noise and expand the range ratio. However, the system has many components, complex control, and large volume, which still has a certain gap with the actual popularization and application.

天津大学张涛和段瑞峰等采用松弛陷波周期图谱方法分析涡街流量计信号,拓展流量计量程下限,并且以该算法为核心,研制了基于DSP和MSP430相结合的双核结构数字信号处理系统(“低功耗数字式涡街流量计”,中国专利,申请号:200410019008.9,申请日:2004.4.14)。双核结构的涡街流量计数字信号处理系统利用MSP430单片机的控制能力,实现数据的采样和系统外设的控制;DSP利用其HPI口接收MSP430采集的数据,进行信号处理,再将结果送回MSP430。该系统结构较复杂,成本较高。Zhang Tao and Duan Ruifeng of Tianjin University used the relaxation notch period map method to analyze the signal of vortex flowmeter, and expanded the lower limit of flowmeter range, and with this algorithm as the core, developed a dual-core structure digital signal processing system based on the combination of DSP and MSP430 ( "Low power consumption digital vortex flowmeter", Chinese patent, application number: 200410019008.9, application date: 2004.4.14). The digital signal processing system of the vortex flowmeter with dual-core structure utilizes the control capability of MSP430 single-chip microcomputer to realize data sampling and control of system peripherals; DSP uses its HPI port to receive the data collected by MSP430, perform signal processing, and then send the result back to MSP430 . The system structure is more complicated and the cost is higher.

中南大学喻海清和黎亚龙采用自适应陷波滤波方法估计涡街频率,选用TMS320LF2407A为处理器,设计了涡街流量计数字信号处理系统的硬件框图和软件流程图(计算技术与自动化,2001,20(3):159-162“基于DSP的涡街流量计信号处理系统的设计”)。但是,论文中没有给出算法的计算结果、系统的具体实现方案、实验测试结果以及系统的性能指标。Yu Haiqing and Li Yalong of Central South University used the adaptive notch filter method to estimate the vortex frequency, and selected TMS320LF2407A as the processor to design the hardware block diagram and software flow chart of the vortex flowmeter digital signal processing system (Computing Technology and Automation, 2001, 20 (3): 159-162 "Design of DSP-based Vortex Flowmeter Signal Processing System"). However, the calculation results of the algorithm, the specific implementation scheme of the system, the experimental test results and the performance indicators of the system are not given in the paper.

发明内容: Invention content:

本发明是为避免上述现有技术所存在的不足之处,提供一种体积小、成本低、功能齐全的基于DSP的低成本智能涡街流量计信号处理系统,以数字信号处理器为核心的、采用周期图谱分析与数字滤波相结合,处理涡街传感器的输出信号以及温度和压力传感器的信号,在现场有管道振动和流体流场不稳定的情况下,准确测量流体的流量。The present invention is to avoid the disadvantages of the above-mentioned prior art, and provides a low-cost intelligent vortex flowmeter signal processing system based on DSP with small volume, low cost and complete functions. , Using the combination of periodic map analysis and digital filtering to process the output signal of the vortex sensor and the signal of the temperature and pressure sensor, and accurately measure the flow of the fluid when there is pipeline vibration and fluid flow field instability on site.

本发明系统由模拟信号调理模块、DSP芯片及外扩RAM、EEPROM、低电压监测电路、LCD显示、键盘输入、模拟量输出、脉冲输出及电源管理模块组成;The system of the present invention is composed of an analog signal conditioning module, a DSP chip, an externally expanded RAM, an EEPROM, a low voltage monitoring circuit, an LCD display, a keyboard input, an analog output, a pulse output and a power management module;

本发明系统的特点是所述的模拟信号调理模块中包括有温度信号调理电路、压力信号调理电路和流量传感器信号调理电路,所述的温度信号调理电路由电桥和差分放大电路组成,所述的压力信号调理电路由I/V变换电路组成,所述的流量传感器信号调理电路由电荷放大电路、带限幅功能的有源带通滤波电路和具有固定增益的低通滤波电路组成;所述系统接受传感单元输出的温度、压力及流量检测信号并经所述模拟信号调理模块处理后送到所述DSP;由所述DSP利用其内部集成的A/D转换模块和环形数据缓冲区对所述三路电信号进行定时采样、定时计算、边采样边计算;所述DSP对其采样得到的可能混有由干扰引起的噪声的流量传感器信号进行数字滤波,再采用周期图谱分析方法对滤波后的数据进行谱分析和频谱校正;根据多次计算结果进行平均,确定出最大功率谱值,得到它所对应的频率,即为信号的频率;再根据仪表系数和通过温度、压力补偿,实时计算得出瞬时流量和累积流量;所述DSP利用其内部定时器比较输出功能将瞬时流量数据以脉冲形式由脉冲输出单元输出;所述DSP利用其内部集成的SPI模块将瞬时流量数据发送给所述模拟量输出单元,以4~20mA电流的模拟量形式输出;所述的DSP将瞬时流量、累积流量、温度和压力显示在所述的LCD上;通过键盘进行设置的包括有仪表系数、系统采样频率、采样点数、多次谱分析的平均次数、数字滤波器系数;由所述EEPROM保存所述键盘输入的仪表系数和计算出的累积流量;所述低电压监测电路负责在系统掉电时向所述DSP提出中断请求,并在系统完全掉电之前将测量结果保存于所述EEPROM中。The system of the present invention is characterized in that the analog signal conditioning module includes a temperature signal conditioning circuit, a pressure signal conditioning circuit and a flow sensor signal conditioning circuit, the temperature signal conditioning circuit is composed of a bridge and a differential amplifier circuit, the The pressure signal conditioning circuit is composed of an I/V conversion circuit, and the flow sensor signal conditioning circuit is composed of a charge amplification circuit, an active band-pass filter circuit with a limiting function and a low-pass filter circuit with a fixed gain; The system accepts the temperature, pressure and flow detection signals output by the sensing unit and sends them to the DSP after being processed by the analog signal conditioning module; the DSP uses its internal integrated A/D conversion module and ring data buffer to pair The three electrical signals are subjected to timing sampling, timing calculation, and calculation while sampling; the DSP performs digital filtering on the flow sensor signal that may be mixed with noise caused by interference, and then uses a periodic map analysis method to filter Perform spectrum analysis and spectrum correction on the final data; average the results of multiple calculations to determine the maximum power spectrum value and obtain its corresponding frequency, which is the frequency of the signal; then according to the instrument coefficient and through temperature and pressure compensation, real-time Calculate the instantaneous flow and cumulative flow; the DSP uses its internal timer comparison output function to output the instantaneous flow data in pulse form from the pulse output unit; the DSP uses its internal integrated SPI module to send the instantaneous flow data to the The above-mentioned analog quantity output unit is output in the form of analog quantity of 4-20mA current; the above-mentioned DSP displays the instantaneous flow, accumulated flow, temperature and pressure on the above-mentioned LCD; Sampling frequency, number of sampling points, average number of times of multiple spectrum analysis, digital filter coefficient; the instrument coefficient input by the keyboard and the accumulated flow calculated are saved by the EEPROM; the low voltage monitoring circuit is responsible for when the system is powered off An interrupt request is raised to the DSP, and the measurement result is saved in the EEPROM before the system is completely powered off.

本发明系统特点也在于利用所述DSP芯片内部定时器的周期中断,实现对所述温度、压力和流量信号的定时采样,采样得到的数据放入环形数据缓冲区内,并且定时对采样得到的流量信号进行所述的功率谱分析,边计算边采样,相邻两次分析处理的流量数据部分重叠覆盖。The system feature of the present invention is also to utilize the periodic interruption of the internal timer of the DSP chip to realize the regular sampling of the temperature, pressure and flow signals, the data obtained by the sampling is put into the ring data buffer, and the sampled data are regularly sampled. The power spectrum analysis is performed on the flow signal, and sampling is performed while calculation is performed, and the flow data of two adjacent analysis processes are partially overlapped and covered.

本发明系统特点也在于所述的DSP芯片为TMS320LF2407A,其内部集成有32K的FLASH、A/D转换功能模块、2个事件管理器、看门狗、串行外设接口SPI、串行通信接口SCI、CAN功能模块。The system characteristic of the present invention also is that described DSP chip is TMS320LF2407A, and it is internally integrated with 32K FLASH, A/D conversion function module, 2 event managers, watchdog, serial peripheral interface SPI, serial communication interface SCI, CAN function modules.

本发明系统特点也在于根据所述涡街流量计的量程范围,通过所述键盘设置采样频率和采样点数,以控制所述功率谱分析的计算精度;所述DSP芯片采用重心频谱校正方法以进一步提高频率的计算精度;根据所述流量传感器特性,通过所述键盘分段设置仪表系数,提高流量的测量精度;通过温度和压力补偿的表格,对流量计算结果进行非线性校正,提高过热气体和饱和蒸汽流量的测量精度。The feature of the system of the present invention is also that according to the range range of the vortex flowmeter, the sampling frequency and the number of sampling points are set through the keyboard to control the calculation accuracy of the power spectrum analysis; the DSP chip adopts the barycenter spectrum correction method to further Improve the calculation accuracy of the frequency; according to the characteristics of the flow sensor, set the instrument coefficient in sections through the keyboard to improve the measurement accuracy of the flow; through the temperature and pressure compensation table, perform nonlinear correction on the flow calculation results to improve the superheated gas and Measurement accuracy of saturated steam flow.

本发明系统特点也在于利用所述的DSP芯片内部定时器,用比较的方式输出脉冲,并通过比较中断对输出的脉冲周期进行动态补偿。The feature of the system of the present invention is also that the internal timer of the DSP chip is used to output pulses in a comparison mode, and the output pulse period is dynamically compensated by comparison interruption.

与已有技术相比,本发明的有益效果体现在:Compared with the prior art, the beneficial effects of the present invention are reflected in:

1、本发明系统采用周期图谱分析为核心的信号处理算法,配合数字滤波,消除了由强低频管道振动等干扰对测量结果造成的影响,提高了仪表抑制噪声能力,扩展量程比;1. The system of the present invention adopts the signal processing algorithm with periodic map analysis as the core, cooperates with digital filtering, eliminates the influence caused by interference such as strong and low-frequency pipeline vibration on the measurement results, improves the ability of the instrument to suppress noise, and expands the range ratio;

2、本发明系统定时采样,定时计算,边采样边计算,利用环形数据缓冲区,最新采样数据刷新最老数据,实现对流量的实时测量;针对不同口径仪表工作特性,通过面板对算法参数进行最佳配置,同时,频谱校正,分段设置仪表系数,温度和压力补偿,提高仪表测量的准确度;根据谱分析算法特点,对涡街传感器信号采用限幅放大而不是程控放大,解决涡街传感器信号强度变化很大从而需要修改电路参数的问题。2. The system of the present invention samples at regular intervals, calculates at regular intervals, calculates while sampling, and uses the ring data buffer to update the oldest data with the latest sampling data to realize real-time measurement of the flow rate; according to the working characteristics of instruments with different calibers, the algorithm parameters are adjusted through the panel Optimum configuration, at the same time, spectrum correction, set instrument coefficients, temperature and pressure compensation in sections, improve the accuracy of instrument measurement; according to the characteristics of spectrum analysis algorithm, use limiting amplification instead of program-controlled amplification for vortex street sensor signals to solve vortex street Problems where the signal strength of the sensor varies widely requiring modification of circuit parameters.

3、本发明系统可以通过选用片内资源丰富的DSP芯片TMS320LF2407A,减少系统所需外设器件,缩小系统体积,降低成本,同时实现数字仪表所需的多方面功能。3. By selecting the DSP chip TMS320LF2407A with rich on-chip resources, the system of the present invention can reduce the peripheral devices required by the system, reduce the volume of the system, reduce the cost, and realize various functions required by the digital instrument at the same time.

附图说明: Description of drawings:

图1是本发明系统的硬件框图。Fig. 1 is a hardware block diagram of the system of the present invention.

图2是本发明系统中流量传感器信号调理电路原理图。Fig. 2 is a schematic diagram of the flow sensor signal conditioning circuit in the system of the present invention.

图3是本发明系统中温度传感器信号的电桥及放大电路原理图。Fig. 3 is a schematic diagram of the electric bridge and amplifying circuit of the temperature sensor signal in the system of the present invention.

图4是本发明系统中处理压力变送器输出信号的I/V变换电路原理图。Fig. 4 is a schematic diagram of the I/V conversion circuit for processing the output signal of the pressure transmitter in the system of the present invention.

图5是本发明系统中DSP芯片管脚接线示意图。Fig. 5 is a schematic diagram of the pin connection of the DSP chip in the system of the present invention.

图6是本发明系统中DSP芯片的外扩RAM管脚接线示意图。Fig. 6 is a schematic diagram of wiring of externally expanded RAM pins of the DSP chip in the system of the present invention.

图7是本发明系统中EEPROM管脚接线示意图。Fig. 7 is a schematic diagram of EEPROM pin wiring in the system of the present invention.

图8是本发明系统中低电压监测电路原理。Fig. 8 is the principle of the low voltage monitoring circuit in the system of the present invention.

图9是本发明系统中键盘电路原理图。Fig. 9 is a schematic diagram of the keyboard circuit in the system of the present invention.

图10是本发明系统中段式液晶平面示意图。Fig. 10 is a schematic plan view of the mid-segment liquid crystal in the system of the present invention.

图11是本发明系统中DSP芯片与LCD显示电路连接电路。Fig. 11 is the connection circuit between the DSP chip and the LCD display circuit in the system of the present invention.

图12是本发明系统中脉冲输出电路原理图。Fig. 12 is a schematic diagram of the pulse output circuit in the system of the present invention.

图13是本发明系统中4~20mA电流输出电路原理图。Fig. 13 is a schematic diagram of the 4-20mA current output circuit in the system of the present invention.

图14是本发明系统电源电路原理路。Fig. 14 is a schematic diagram of the power supply circuit of the system of the present invention.

图15是本发明系统控制框图。Fig. 15 is a control block diagram of the system of the present invention.

图16是本发明系统的信号处理算法基本流程图。Fig. 16 is a basic flowchart of the signal processing algorithm of the system of the present invention.

图17是本发明系统的键盘扫描流程图。Fig. 17 is a keyboard scanning flow chart of the system of the present invention.

图18是本发明系统的主监控程序流程图。Fig. 18 is a flow chart of the main monitoring program of the system of the present invention.

具体实施方式: Detailed ways:

参见图1,本实施例由模拟信号调理模块、TMS320LF2407A(TI公司的DSP芯片)及外扩RAM、E2PROM、低电压监测电路、LCD显示、键盘输入、模拟量输出电路、脉冲输出电路和电源管理模块组成。Referring to Fig. 1, the present embodiment is made up of analog signal conditioning module, TMS320LF2407A (the DSP chip of TI company) and external expansion RAM, E2PROM, low voltage monitoring circuit, LCD display, keyboard input, analog quantity output circuit, pulse output circuit and power management Module composition.

涡街流量计是利用流体动力学中卡门漩涡原理制成。当流体管道中放入漩涡发生体,就会在其下游两侧产生两列有规律的漩涡,漩涡释放频率与流体流量成线性关系,即:Vortex flowmeters are made using the Karman vortex principle in fluid dynamics. When the vortex generating body is placed in the fluid pipeline, two regular vortices will be generated on both sides of its downstream, and the frequency of vortex release is linearly related to the fluid flow rate, namely:

Q=k*fQ=k*f

式中,Q为流体体积流量,k为仪表系数,f为漩涡释放频率,即涡街频率。In the formula, Q is the fluid volume flow rate, k is the instrument coefficient, and f is the vortex release frequency, that is, the vortex street frequency.

安装在漩涡发生体内的传感器(如:压电传感器)将代表涡街频率的信号拾取出来,转换成电信号输出。其特点是幅值小(毫伏级)、与流量大小的平方成近似比例关系,以及内阻很大。在理想情况下,传感器输出信号为正弦波,但由于受仪表安装条件、流体脉动、管道振动等因素的影响,信号中混有各种噪声。本实施例中设置有模拟信号调理模块,如图1所示。其中有涡街传感器信号调理电路,其电路原理如图2所示,先采用电荷放大器U1A对流量传感器的输出信号进行阻抗变换,同时进行预放大。电荷放大器选用高输入阻抗的MOS型运放,C1、C2为隔直电容,C8为反馈电容,R2为反馈电阻,防止反馈电容C8饱和。C9、R3为平衡电容、电阻。电阻R1为匹配电阻,防止传感器输出信号饱和。传感器的输出信号线应该屏蔽,屏蔽层的一端接仪表的外壳,另一端在与信号处理系统的地相连接。电荷放大器输出信号的幅值变化很大。为了将信号放大到接近A/D转换器的满量程,充分利用其转换精度,在电荷放大器之后再对信号进行适当的放大。为了消除或减少电路噪声、流体脉动噪声和管道振动对测量的影响,还需要使用低通和高通滤波电路。所以,采用U2B和U2C两个运算放大器组成两级有源放大滤波电路。第一级为一个具有限幅功能的有源带通滤波器。该带通滤波器由一个高通滤波器和一个二阶的低通滤波器组成,高通截止频率由C10、R4和R5决定,低通滤波器的截止频率由R4、C11、R5、R7、R8和C12决定。当信号幅度较小时,整个有源滤波器在通带内的增益为(R7+R8)/(R4+R5):当输入信号幅度增大,二极管导通后,输出电压幅度为Vd+Vin×(R7)/(R4+R5),这里的Vd为二极管正向压降,Vin为电荷放大器输出电压。第二级为一个固定增益的低通滤波器,这里采用了一个无限增益负反馈结构的有源滤波电路,主要由运算放大器U2C组成,进一步减少高频噪声的影响。经过两级滤波,信号通过一个由U2A组成的缓冲电路,送入DSP芯片中的A/D转换模块。The sensor (such as: piezoelectric sensor) installed in the vortex generating body picks up the signal representing the frequency of the vortex street and converts it into an electrical signal for output. It is characterized by a small amplitude (millivolt level), an approximate proportional relationship with the square of the flow rate, and a large internal resistance. In an ideal situation, the sensor output signal is a sine wave, but due to the influence of instrument installation conditions, fluid pulsation, pipeline vibration and other factors, the signal is mixed with various noises. In this embodiment, an analog signal conditioning module is provided, as shown in FIG. 1 . Among them is the signal conditioning circuit of the vortex street sensor. The circuit principle is shown in Figure 2. Firstly, the charge amplifier U1A is used to perform impedance transformation on the output signal of the flow sensor and pre-amplify at the same time. The charge amplifier uses a MOS type operational amplifier with high input impedance, C1 and C2 are DC blocking capacitors, C8 is a feedback capacitor, and R2 is a feedback resistor to prevent the feedback capacitor C8 from being saturated. C9 and R3 are balancing capacitors and resistors. Resistor R1 is a matching resistor to prevent sensor output signal saturation. The output signal line of the sensor should be shielded, one end of the shielding layer is connected to the shell of the instrument, and the other end is connected to the ground of the signal processing system. The amplitude of the output signal of the charge amplifier varies greatly. In order to amplify the signal close to the full scale of the A/D converter and make full use of its conversion accuracy, the signal is properly amplified after the charge amplifier. In order to eliminate or reduce the influence of circuit noise, fluid pulsation noise and pipeline vibration on the measurement, it is also necessary to use low-pass and high-pass filter circuits. Therefore, two operational amplifiers U2B and U2C are used to form a two-stage active amplifier filter circuit. The first stage is an active bandpass filter with limiting function. The band-pass filter consists of a high-pass filter and a second-order low-pass filter. The high-pass cut-off frequency is determined by C10, R4 and R5, and the low-pass filter's cut-off frequency is determined by R4, C11, R5, R7, R8 and C12 decided. When the signal amplitude is small, the gain of the entire active filter in the passband is (R7+R8)/(R4+R5): when the input signal amplitude increases and the diode is turned on, the output voltage amplitude is Vd+Vin× (R7)/(R4+R5), where Vd is the forward voltage drop of the diode, and Vin is the output voltage of the charge amplifier. The second stage is a fixed-gain low-pass filter. An active filter circuit with an infinite-gain negative feedback structure is used here, which is mainly composed of an operational amplifier U2C to further reduce the impact of high-frequency noise. After two stages of filtering, the signal is sent to the A/D conversion module in the DSP chip through a buffer circuit composed of U2A.

考虑到测量蒸汽时需要进行温度和压力的补偿,所以,在模拟信号输入及调理单元中设置了接收温度传感器和压力变送器信号的调理电路。温度传感器采用Pt100铂电阻,信号调理电路采用三线制桥路结构,再使用一片专用仪表放大器U3来放大两个桥臂之间的电压差,如图3所示。采用了一个I/V变换电路将压力变送器输出的4-20mA电流信号转换为电压信号,如图4所示。这两路信号也送入DSP芯片中的A/D转换模块。Considering that temperature and pressure compensation are required when measuring steam, a conditioning circuit for receiving signals from temperature sensors and pressure transmitters is set in the analog signal input and conditioning unit. The temperature sensor adopts Pt100 platinum resistance, the signal conditioning circuit adopts a three-wire bridge structure, and a dedicated instrumentation amplifier U3 is used to amplify the voltage difference between the two bridge arms, as shown in Figure 3. An I/V conversion circuit is used to convert the 4-20mA current signal output by the pressure transmitter into a voltage signal, as shown in Figure 4. These two signals are also sent to the A/D conversion module in the DSP chip.

本发明系统选用的TI公司的DSP芯片TMS320LF2407A(以下简称2407A)为处理核心,如图5所示。该DSP芯片运算能力强,最高运算速度为40MIPS,指令周期25ns,内部带有一个16*16位的硬件乘法器,足以实时实现FFT算法。更重要的是2407A片内集成有丰富的片上外设,例如,内部集成了A/D模块,最多可支持16个通道的信号转换,转换周期最快达375ns,10位的转换精度。考虑到系统提取的是涡街信号的频率,因此该10位A/D可满足要求。该芯片还集成有32k的FLASH、2个事件管理器(包含4个通用定时器,支持比较、PWM发生、捕获、正交编码和2个外部中断等功能)、看门狗、串行外设接口SPI、串行通讯接口SCI、CAN和多功能复用I/O口等,这样不仅容易实现和扩展仪表的功能,而且关键可减少系统的外部器件,减小系统电路板设计面积,可提高系统可靠性。2407A集成的功能模块安排如下:定时器1周期中断启动A/D转换;定时器3的周期中断用于定时扫描键盘、定时对LCD进行操作;利用定时器2的比较功能输出脉冲,同时运用其比较中断对输出的脉冲进行动态补偿,减小工作时钟对发出脉冲精度的影响;看门狗模块对处理系统运行进行监测,若程序“跑飞”,就复位系统;SPI模块向系统的模拟量输出电路发送控制信号和数据,输出4~20mA电流信号。The DSP chip TMS320LF2407A (hereinafter referred to as 2407A) of TI Company selected by the system of the present invention is the processing core, as shown in FIG. 5 . The DSP chip has strong computing power, the highest computing speed is 40MIPS, and the instruction cycle is 25ns. It has a 16*16-bit hardware multiplier inside, which is enough to realize the FFT algorithm in real time. More importantly, 2407A integrates rich on-chip peripherals, for example, it integrates A/D module inside, which can support up to 16 channels of signal conversion, the fastest conversion cycle is 375ns, and the conversion accuracy is 10 bits. Considering that what the system extracts is the frequency of the vortex signal, the 10-bit A/D can meet the requirements. The chip also integrates 32k FLASH, 2 event managers (including 4 general-purpose timers, supporting functions such as comparison, PWM generation, capture, quadrature encoding, and 2 external interrupts), watchdog, and serial peripherals Interface SPI, serial communication interface SCI, CAN and multi-function multiplexing I/O port, etc., not only easy to realize and expand the function of the instrument, but also can reduce the external components of the system, reduce the design area of the system circuit board, and improve the System reliability. The integrated functional modules of 2407A are arranged as follows: Timer 1 cycle interrupt starts A/D conversion; Timer 3 cycle interrupt is used to regularly scan the keyboard and operate the LCD regularly; use the comparison function of Timer 2 to output pulses, and use its Comparing interrupts dynamically compensates the output pulses to reduce the impact of the working clock on the accuracy of the pulses; the watchdog module monitors the operation of the processing system, and resets the system if the program "runs away"; the SPI module sends analog data to the system The output circuit sends control signals and data, and outputs 4-20mA current signals.

由于2407A内部只集成有544字节的双口RAM和2K的单口RAM,无法满足算法运算的需要,因此利用2407A外部16根地址线和16根数据线,外扩了64k的RAM,如图6所示。Since 2407A only integrates 544 bytes of dual-port RAM and 2K single-port RAM, which cannot meet the needs of algorithm operations, 64k of RAM is expanded by using 16 external address lines and 16 data lines of 2407A, as shown in Figure 6 shown.

本发明系统选择了一块EEPROM,保存测量结果和仪表系数,如图7所示。运用2407A多功能复用口对EEPROM进行控制和数据读写,其中PBO接EEPROM的片选CS、PB1接CLK、PB2接输入数据线DI、PB3接输出数据线DO。The system of the present invention selects an EEPROM to store measurement results and instrument coefficients, as shown in Figure 7. Use the 2407A multi-function multiplex port to control and read and write data to the EEPROM, where PBO is connected to the chip select CS of the EEPROM, PB1 is connected to CLK, PB2 is connected to the input data line DI, and PB3 is connected to the output data line DO.

本发明系统设计了一个低压检测模块,如图8所示。当该模块检测到电压低于设定值时,立即拉低2407A的PDPINTA管脚的电平,向2407A发出紧急中断请求。由于该中断优先级最高,所以2407A立即应答,在系统掉电之前将测量结果保存到EEPEOM中。The system of the present invention designs a low-voltage detection module, as shown in FIG. 8 . When the module detects that the voltage is lower than the set value, it immediately pulls down the level of the PDPINTA pin of 2407A, and sends an emergency interrupt request to 2407A. Because the interrupt priority is the highest, 2407A responds immediately, and saves the measurement results to EEPEOM before the system is powered off.

本发明系统设计由键盘和LCD组成的人机接口,实现仪表参数的设置和就地显示测量结果。键盘安排有4键:设定键(SET)、移位键(SFT)、递增键(INC)和确认键(ENTR),分别与2407A的复用口PA4、PA5、PA6和PA7相接,通过定时器3周期中断进行定时扫描,键盘电路如图9所示。选用串行接口段式LCD,平面图如图10所示。该LCD带有两行显示:上行左侧可显示P、T、Q三种符号,右侧可显示6位数据;下行可显示8位数据;另外右侧还带有14个提示条码。2407A利用多功能复用口与LCD连接,PB7接CS、PB6接WR、PB5接DATA,如图11所示。LCD有两种工作状态,一位显示状态;二为设置状态。通过设定键切换两种工作状态。在显示状态下,通过确认键切换三种模式:一是流量显示模式,该模式为默认模式,LCD上行左侧符号为显示“Q”,代表流量,右侧数据为用于显示瞬时流量,LCD下行则显示累计流量;第二种模式显示压力,符号位显示“P”,上行右侧无显示,下行显示测量的压力值;第三种模式显示温度,符号位显示“T”,上行右侧无显示,下行显示测量的温度值。设置状态下,LCD符号位无显示,上行右侧显示参数序号,下行显示该参数的数值,且下行有“激活”数字位,呈闪烁状,激活位可通过移位键移动位置,递增键可改变激活数字位的值,确认键则将修改过的值传递给参数,修改该参数后,LCD进入下一个仪表参数修改画面。The system of the present invention designs a man-machine interface composed of a keyboard and an LCD to realize setting of instrument parameters and displaying measurement results on the spot. There are 4 keys arranged on the keyboard: set key (SET), shift key (SFT), increment key (INC) and confirmation key (ENTR), which are respectively connected with multiplex ports PA4, PA5, PA6 and PA7 of 2407A, through Timer 3 cycle interrupts for regular scanning, the keyboard circuit is shown in Figure 9. The serial interface segment LCD is selected, and the plan view is shown in Figure 10. The LCD has two lines of display: P, T, and Q symbols can be displayed on the left side of the upper line, and 6-digit data can be displayed on the right side; 8-digit data can be displayed on the lower line; in addition, there are 14 prompt barcodes on the right side. 2407A is connected to LCD by multi-function port, PB7 is connected to CS, PB6 is connected to WR, PB5 is connected to DATA, as shown in Figure 11. The LCD has two working states, one is the display state; the other is the setting state. Switch between the two working states by setting the key. In the display state, press the confirmation key to switch between three modes: one is the flow display mode, which is the default mode. The symbol on the left side of the upper line of the LCD is to display "Q", representing the flow rate, and the data on the right side is used to display the instantaneous flow rate. LCD The lower line displays the accumulated flow; the second mode displays pressure, the sign position displays "P", the upper line shows no display on the right, and the lower line displays the measured pressure value; the third mode displays temperature, the sign position displays "T", and the upper line displays "T" on the right side. No display, the lower row displays the measured temperature value. In the setting state, the LCD symbol is not displayed, the parameter number is displayed on the right side of the upper row, and the value of the parameter is displayed on the lower row, and there is an "activation" digit on the lower row, which is flashing. The activation digit can be moved by the shift key, and the increment key can be Change the value of the active digit, and the confirm key will pass the modified value to the parameter. After modifying the parameter, the LCD enters the next instrument parameter modification screen.

本发明系统利用2407A定时器比较输出功能来实现脉冲输出,脉冲输出部分电路如图12所示。根据测量的频率值和系统使用的时钟频率,计算出定时器所需要的周期预置数,从而确定输出脉冲的频率。而比较输出单元的设定值则用来设置输出脉冲的占空比,通常把占空比设置为1。最终输出的脉冲信号即为处理后的瞬时流量信号,供系统校验和实际应用中上位机进行测量计数,同时还按照用户要求设定为整量化脉冲信号输出,即一个脉冲代表一定的体积流量。The system of the present invention utilizes the comparative output function of the 2407A timer to realize the pulse output, and the pulse output part circuit is shown in FIG. 12 . According to the measured frequency value and the clock frequency used by the system, calculate the preset number of cycles required by the timer, so as to determine the frequency of the output pulse. The set value of the comparison output unit is used to set the duty cycle of the output pulse, usually the duty cycle is set to 1. The final output pulse signal is the processed instantaneous flow signal, which is used for system calibration and actual application of the host computer for measurement and counting. At the same time, it is also set as an integer pulse signal output according to user requirements, that is, one pulse represents a certain volume flow. .

本发明系统采用了DAC(数/模转换)和V/I(电压/电流转换)电路来实现4-20mA的电流输出,如图13所示。2407A运算得出频率后,根据用户预先设定的上下限频率值,将频率折算为相应的数字量送给DAC,DAC转换为电压,再由V/I转换成电流信号输出。本发明系统对于模拟电路部分和数字电路部分单独供电,以防干扰。模拟部分需要5V,数字部分同时需要5V和3.3V。一般仪表都是以24V或者12V供电,考虑到系统低功耗的要求,系统采用了高效率DC/DC转换电源,将输入的12V或者24V电压转换为5V电压,再经过低压差稳压器(LDO)完成5V/3.3V转换,提供给数字电路部分。系统模拟部分电源供应要求较高,因此直接通过线性稳压电路供应,如图14所示。The system of the present invention adopts DAC (digital/analog conversion) and V/I (voltage/current conversion) circuits to realize the current output of 4-20mA, as shown in FIG. 13 . After the 2407A calculates the frequency, according to the upper and lower limit frequency values preset by the user, the frequency is converted into a corresponding digital quantity and sent to the DAC. The DAC converts it into a voltage, and then converts it into a current signal output by V/I. The system of the present invention provides separate power supply for the analog circuit part and the digital circuit part to prevent interference. The analog part requires 5V, and the digital part requires both 5V and 3.3V. Generally, instruments are powered by 24V or 12V. Considering the requirements of low power consumption of the system, the system adopts a high-efficiency DC/DC conversion power supply, which converts the input 12V or 24V voltage into 5V voltage, and then passes through the low dropout voltage regulator ( LDO) completes the 5V/3.3V conversion and provides it to the digital circuit part. The power supply requirements of the analog part of the system are relatively high, so it is directly supplied through the linear voltage regulator circuit, as shown in Figure 14.

本发明系统的主要任务是采用选定的信号处理算法完成流量测量,并具备脉冲输出、电流输出、仪表系数的设定、测量结果的保存。因此,功能很多,软件设计复杂。为了便于系统的设计和维护,将完成特定功能或类似功能的子程序组合成模块即功能模块,然后由一个主监控程序统一调用。这些功能模块之间也可以相互调用。系统的软件框图如图15所示。The main task of the system of the present invention is to use the selected signal processing algorithm to complete the flow measurement, and it has the functions of pulse output, current output, setting of instrument coefficient and storage of measurement results. Therefore, there are many functions and the software design is complicated. In order to facilitate the design and maintenance of the system, the subroutines that complete specific functions or similar functions are combined into modules, namely function modules, which are then uniformly called by a main monitoring program. These functional modules can also call each other. The software block diagram of the system is shown in Figure 15.

初始化模块主要包括2407A的初始化、LCD的初始化、程序全局变量的初始化。The initialization module mainly includes the initialization of 2407A, the initialization of LCD, and the initialization of program global variables.

2407A片内集成了许多功能模块,系统中使用了包括具有排序功能的A/D、串行外设接口SPI、通用I/O口、看门狗、仿真口、事件管理器、时钟锁相环(PLL)等,每个功能模块使用前均需初始化相应寄存器,确定其工作模式。The 2407A chip integrates many functional modules, including A/D with sorting function, serial peripheral interface SPI, general I/O port, watchdog, emulation port, event manager, clock phase-locked loop (PLL), etc., each functional module needs to initialize the corresponding register before use to determine its working mode.

系统程序中设置了许多全局变量,反映系统当前工作状态,方便各模块子程序的调用,其中一些变量需要初始化,便于下一步程序的进行。这些变量大致分为两类:需保存的全局变量和非保存的全局变量。需保存的全局变量一般指仪表的参数,一般可通过键盘设置改变或系统掉电自动保存于EEPROM中。初始化时,将参数值从EEPROM中取出,放于相应的全局变量中;非保存的全局变量不需保存于EEPROM中,但某些程序模块频繁调用,如三角函数表,若每次均调用三角函数,必会降低程序效率,因此可在初始化模块中将需要使用的数值配置好,可提高程序的执行速度。Many global variables are set in the system program to reflect the current working status of the system and facilitate the calling of subroutines of each module. Some of the variables need to be initialized to facilitate the next step of the program. These variables are roughly divided into two categories: global variables that need to be saved and global variables that are not saved. The global variables to be saved generally refer to the parameters of the instrument, which can be changed through keyboard settings or automatically saved in EEPROM when the system is powered off. When initializing, take the parameter value from EEPROM and put it in the corresponding global variable; the unsaved global variable does not need to be saved in EEPROM, but some program modules are frequently called, such as the trigonometric function table, if the trigonometric function table is called every time function will reduce the efficiency of the program, so the values to be used can be configured in the initialization module, which can improve the execution speed of the program.

系统上电后,LCD要显示如瞬时流量、累计流量等,具体内容按实际需要确定。LCD在使用前需要初始化,初始化步骤按LCD说明书进行。LCD初始化主要为:控制引脚初始化、写命令字、定义内部振荡器、启振内部振荡器、初始化显示内容等。After the system is powered on, the LCD should display such as instantaneous flow, cumulative flow, etc. The specific content is determined according to actual needs. The LCD needs to be initialized before use, and the initialization steps are carried out according to the LCD manual. LCD initialization mainly includes: control pin initialization, write command word, define internal oscillator, start internal oscillator, initialize display content, etc.

宏定义也是系统初始化的一部分,由预编译指令来实现。系统中存在许多子程序需要用到的常量,例如定时器中断的周期、LCD刷新频率、温度和压力的测量范围以及保存于EEPROM的仪表参数对应地址等。为减少存储空间,便于系统的维护,这些常量可以在宏定义模块中定义。Macro definitions are also part of system initialization, implemented by precompiled instructions. There are many constants that need to be used by subroutines in the system, such as the period of timer interrupt, LCD refresh frequency, the measurement range of temperature and pressure, and the corresponding address of the instrument parameters stored in EEPROM. In order to reduce storage space and facilitate system maintenance, these constants can be defined in the macro definition module.

信号处理模块完成涡街信号的谱分析处理、瞬时流量计算、温度和压力补偿等任务。系统采用的周期图谱分析算法,其基本过程为:对采样来的数据组进行FFT变换,然后计算各个离散频率点的功率谱,再根据能量最大原则,初步估计出信号的频率。然后需要进行重心频谱校正,以提高频率估计的精度。同时,还需要对多次计算结果进行平均,减小系统随机误差造成的影响。根据实际情况,通过键盘设置采样频率、采样点数和平均次数等参数,以控制算法精度。图16是本发明系统的信号处理算法流程图。The signal processing module completes tasks such as spectrum analysis and processing of vortex signal, instantaneous flow calculation, temperature and pressure compensation, etc. The basic process of the periodogram analysis algorithm adopted by the system is: perform FFT transformation on the sampled data group, then calculate the power spectrum of each discrete frequency point, and then preliminarily estimate the frequency of the signal according to the principle of maximum energy. Centroid spectrum correction is then required to improve the accuracy of frequency estimation. At the same time, it is also necessary to average the results of multiple calculations to reduce the impact of system random errors. According to the actual situation, parameters such as sampling frequency, number of sampling points and average times are set through the keyboard to control the accuracy of the algorithm. Fig. 16 is a flow chart of the signal processing algorithm of the system of the present invention.

根据求出的信号频率和系统设定的仪表系数计算出瞬时流量。对于小流量,由于涡街流量计工作原理的限制或者可能噪声占优,采样的信号不一定代表流量,所以要切除。Calculate the instantaneous flow rate based on the obtained signal frequency and the instrument coefficient set by the system. For small flows, due to the limitation of the working principle of the vortex flowmeter or possible noise dominance, the sampled signal does not necessarily represent the flow, so it should be cut off.

流体的密度受温度、压力影响较大,特别是在流体为气体时,因此在测量流体质量流量时,要进行温度和压力补偿。不同的流体流量受温度和压力的影响不同。本系统根据待测流体配有四种不同的补偿方式:液体、一般气体、过热蒸汽和饱和蒸汽。液体流量一般受压力温度因素影响小,因此不进行补偿;一般气体流量随压力和温度的变化具有一定规律,对其流量的补偿可通过一般气体温压补偿公式进行;过热蒸汽和饱和蒸汽的流量补偿通过各自的温度压力密度表进行查表插值实现。The density of the fluid is greatly affected by temperature and pressure, especially when the fluid is a gas. Therefore, temperature and pressure compensation must be performed when measuring the mass flow rate of the fluid. Different fluid flows are affected differently by temperature and pressure. The system is equipped with four different compensation methods according to the fluid to be measured: liquid, general gas, superheated steam and saturated steam. Liquid flow is generally not affected by pressure and temperature factors, so it is not compensated; general gas flow has a certain law with the change of pressure and temperature, and its flow compensation can be carried out through the general gas temperature and pressure compensation formula; the flow of superheated steam and saturated steam Compensation is realized through look-up table interpolation of respective temperature, pressure and density tables.

本发明具备的4~20mA电流输出,用于反映流量的测量结果,以配合工业现场DCS控制系统的需要。具体过程为:系统计算出结果之后,通过2407A集成的串行外设接口SPI将10位数据串行输出至D/A转换器,转换为电压后再经过V/I转换,输出4~20mA电流。在软件中,只需定时向初始化后的SPI模块中发送寄存器SPITXBUF写入具体数据即可。The 4-20mA current output provided by the present invention is used to reflect the measurement result of the flow rate, so as to meet the needs of the DCS control system on the industrial site. The specific process is: after the system calculates the result, the 10-bit data is serially output to the D/A converter through the serial peripheral interface SPI integrated in the 2407A, converted into a voltage, and then converted by V/I to output a current of 4-20mA . In the software, it is only necessary to write specific data to the send register SPITXBUF in the initialized SPI module at regular intervals.

脉冲输出模块利用2407A管理器B中的通用定时器T4,提供系统的脉冲输出。首先初始化管理器B,系统进入主循环后,不断向寄存器T4PR和T4CMPR中写入瞬时流量所对应的数据。具体公式为:The pulse output module uses the general timer T4 in the 2407A manager B to provide the pulse output of the system. First initialize manager B. After the system enters the main loop, it continuously writes the data corresponding to the instantaneous flow into the registers T4PR and T4CMPR. The specific formula is:

TT 44 PRPR == CLKCLK flowflow -- 11

T4CMPR=0.5*T4PRT4CMPR=0.5*T4PR

其中,CLK、flow分别为定时器计数时钟、计算出的瞬时流量。寄存器T4PR和T4CMPR为16位整型,因此计算结果的小数部分被忽略,这必然带来输出频率的误差。在软件设计时,可利用定时器的比较中断,将小数部分累加,对输出脉冲的周期进行动态补偿,提高发出脉冲的精度。Among them, CLK and flow are respectively the counting clock of the timer and the calculated instantaneous flow. The registers T4PR and T4CMPR are 16-bit integers, so the fractional part of the calculation result is ignored, which will inevitably lead to an error in the output frequency. In the software design, the comparison interrupt of the timer can be used to accumulate the fractional part, and dynamically compensate the period of the output pulse to improve the accuracy of the pulse.

人机接口模块由键盘和LCD组成,LCD负责显示仪表测量结果和仪表参数;键盘则配合LCD,修改仪表参数,切换LCD工作状态。The human-machine interface module is composed of a keyboard and an LCD. The LCD is responsible for displaying the measurement results and parameters of the instrument; the keyboard cooperates with the LCD to modify the instrument parameters and switch the working status of the LCD.

键盘扫描流程图如图17所示。图中Counter为软件去抖动所用的计数器,First为辨别键盘连续操作的变量,T为键盘连续操作时的时间间隔。The flow chart of keyboard scanning is shown in Figure 17. In the figure, Counter is the counter used for software debounce, First is the variable for distinguishing continuous operation of the keyboard, and T is the time interval for continuous operation of the keyboard.

2407A允许处理6个核心级可屏蔽中断,采用一个集中化的外设中断扩展控制器来处理所有片内外设和外部引脚中断的优先级以及中断的响应。当外设中断有效时,其相应的中断向量就自动存入外设中断向量寄存器(PIVR)中,CPU应答时从PIVR中读取中断向量,到中断向量表中找到中断服务子程序的入口。中断模块的编程主要是中断向量表的填写和中断服务子程序的具体操作。The 2407A allows processing of 6 core-level maskable interrupts, and uses a centralized peripheral interrupt expansion controller to handle all on-chip peripherals and external pin interrupt priorities and interrupt responses. When the peripheral interrupt is valid, its corresponding interrupt vector is automatically stored in the peripheral interrupt vector register (PIVR). When the CPU responds, it reads the interrupt vector from the PIVR and finds the entry of the interrupt service subroutine in the interrupt vector table. The programming of the interrupt module is mainly the filling of the interrupt vector table and the specific operation of the interrupt service subroutine.

本系统采用了三个核心中断:INT1、INT2和INT3。The system uses three core interrupts: INT1, INT2 and INT3.

INT1中包含了两个外设中断,分别为来自PDPINTA和A/D转换完成的中断。PDPINTA管脚用于监测系统电压,当系统掉电时,外部监测电路通过PDPINTA向DSP发出中断请求,要求保存累积流量于EEPROM中。此中断的优先级为最高。第二个中断用于信号采样,系统安排2407A的定时器1周期中断自动触发启动A/D模块,该A/D模块集成一个自动排序模块,一次可采样转换多达16路信号,本系统需要采3路信号:流量、温度和压力。A/D完成一次转换后,将转换量化的结果放于结果寄存器,同时向CPU发送中断请求。该中断响应后,中断服务子程序将结果寄存器的数值保存于数据缓冲区,同时进行流量信号的数字滤波。INT1 contains two peripheral interrupts, which are interrupts from PDPINTA and A/D conversion completion. The PDPINTA pin is used to monitor the system voltage. When the system is powered off, the external monitoring circuit sends an interrupt request to the DSP through PDPINTA, requesting to save the accumulated flow in EEPROM. This interrupt has the highest priority. The second interrupt is used for signal sampling. The system arranges the timer 1 period interrupt of 2407A to automatically trigger and start the A/D module. The A/D module integrates an automatic sorting module, which can sample and convert up to 16 signals at a time. This system needs Take 3 signals: flow, temperature and pressure. After the A/D completes a conversion, it puts the quantized result of the conversion in the result register, and sends an interrupt request to the CPU at the same time. After the interrupt response, the interrupt service subroutine saves the value of the result register in the data buffer, and performs digital filtering of the flow signal at the same time.

INT2由定时器3的周期中断触发。在INT2的中断服务子程序中,配有4个软件计数器。第一个用于处理键盘的扫描,当计数器计数到一定数值时,调用键盘扫描程序,若有按键按下时则执行相应按键操作,若无,则退出。第二个用于执行LCD的刷新:若LCD处于显示状态,则定时刷新LCD的显示值。第三个用于完成LCD设置状态下的选中激活数字位的闪烁动作。最后一个用于监测并恢复LCD工作状态。若LCD处于设置状态下,且已超过一定时间仍无按键操作,即系统默认不再进行设置操作,自动返回LCD的显示状态,继续显示测量结果。因为此中断主要用于对键盘和LCD显示操作,对时间要求不是很高,所以该中断优先级为低优先级。INT2 is triggered by the periodic interrupt of Timer3. In the interrupt service subroutine of INT2, there are 4 software counters. The first one is used to process the scanning of the keyboard. When the counter counts to a certain value, the keyboard scanning program is called. If there is a key pressed, the corresponding key operation will be executed. If there is no key, it will exit. The second one is used to refresh the LCD: if the LCD is in the display state, the display value of the LCD will be refreshed regularly. The third is used to complete the blinking action of the selected active digit in the LCD setting state. The last one is used to monitor and restore LCD working status. If the LCD is in the setting state, and there is no key operation for a certain period of time, the system will no longer perform the setting operation by default, and automatically return to the LCD display state and continue to display the measurement results. Because this interrupt is mainly used to operate the keyboard and LCD display, and the time requirement is not very high, so the interrupt priority is low priority.

1NT3由定时器4的比较中断触发,表示系统当前输出一个脉冲。因为要求输出的脉冲频率无法总与工作时钟保持整数倍关系,因此输出的脉冲总存在一定的误差。利用此中断,可对输出脉冲的周期进行动态补偿,提高输出脉冲的精度。同时利用此中断,对输出脉冲进行累加,便于累计流量。1NT3 is triggered by the comparison interrupt of timer 4, indicating that the system currently outputs a pulse. Because the pulse frequency required to be output cannot always maintain an integer multiple of the working clock, there is always a certain error in the output pulse. Using this interrupt, the period of the output pulse can be dynamically compensated to improve the accuracy of the output pulse. At the same time, the interrupt is used to accumulate the output pulses, which is convenient for accumulating flow.

为了便于程序的维护,所有定时器的中断周期在宏定义模块中定义,在初始化模块赋值给相应寄存器。另外,在中断向量表中相应位置填入对应中断服务子程序的入口。In order to facilitate the maintenance of the program, the interrupt periods of all timers are defined in the macro definition module and assigned to the corresponding registers in the initialization module. In addition, fill in the entry of the corresponding interrupt service subroutine in the corresponding position in the interrupt vector table.

DSP芯片内集成的看门狗模块用于保证系统故障恢复。看门狗有一个硬件计数器,从上电复位后开始连续计数,当计数器溢出时触发系统复位。所以,在适当位置加入看门狗计数器复位清零语句,防止看门狗计数器溢出。如果系统陷入软件故障,造成死机,看门狗计数器就会溢出,从而复位系统。The watchdog module integrated in the DSP chip is used to guarantee the recovery of the system failure. The watchdog has a hardware counter, which starts counting continuously after power-on reset, and triggers a system reset when the counter overflows. Therefore, add a watchdog counter reset and clear statement at an appropriate position to prevent the watchdog counter from overflowing. If the system is caught in a software glitch, causing it to freeze, the watchdog counter will overflow and reset the system.

主监控程序是整个信号处理系统的总调度程序,调用各个模块中的子程序,实现仪表所有功能。基本过程为:系统上电复位后,立即进行初始化;初始化后,根据采样得到的涡街信号进行周期图谱信号处理,计算出信号频率;然后根据所设定的仪表系数,计算瞬时流量;根据不同的待测流体,选择不同的温度和压力补偿方式,进行温度和压力补偿;测量出流量后,则输出相应的脉冲量和标准的4~20mA的电流;完成输出后,若系统有需要修改仪表参数的信号,则进行仪表参数修改,之后,主监控程序将返回至信号处理之前,继续进行信号处理,依次不断循环完成仪表的流量实时测量,其流程如图18所示。The main monitoring program is the general scheduler of the entire signal processing system, which calls the subroutines in each module to realize all the functions of the instrument. The basic process is as follows: after the system is powered on and reset, it is initialized immediately; after initialization, the periodic map signal is processed according to the sampled vortex signal, and the signal frequency is calculated; then the instantaneous flow is calculated according to the set meter coefficient; according to different Select different temperature and pressure compensation methods for the fluid to be measured, and perform temperature and pressure compensation; after measuring the flow, output the corresponding pulse amount and standard 4-20mA current; after completing the output, if the system needs to modify the instrument parameter signal, modify the instrument parameters, after that, the main monitoring program will return to the signal processing, continue to process the signal, and complete the real-time measurement of the flow of the instrument in a continuous cycle. The process is shown in Figure 18.

Claims (5)

1. low cost intelligent vortex shedding flowmeter signal processing system based on DSP, by analog signal conditioner module, dsp chip and extend out that RAM, EEPROM, low-voltage observation circuit, LCD show, keyboard input, analog quantity output, pulse output and power management module form; It is characterized in that including in the described analog signal conditioner module temperature signal regulation circuit, pressure signal conditioning circuit and flow sensor signal modulate circuit, described temperature signal regulation circuit is made up of electric bridge and differential amplifier circuit, described pressure signal conditioning circuit is made up of the I/V translation circuit, and described flow sensor signal modulate circuit is made up of the active bandwidth-limited circuit of charge amplifying circuit, band amplitude limit function and low-pass filter circuit with fixed gain; Described system accepts temperature, pressure and the flow detecting signal of sensing unit output and deliver to described DSP after described analog signal conditioner resume module; Utilize its inner integrated A/D modular converter and annular data buffer that temperature, pressure and flow three road electric signal are carried out timing sampling and regularly calculating by described DSP, or calculate on the sampling edge limit; Described DSP carries out digital filtering to the flow sensor signal that may be mixed with the noise that is caused by interference that its sampling obtains, and adopts the power spectrum analysis method that filtered data are carried out analysis of spectrum and frequency spectrum correction again; Average according to result of calculation repeatedly, determine peak power spectrum value, obtain its pairing frequency, be the frequency of signal; According to instrument coefficient with by temperature, pressure compensation, calculate instantaneous delivery and integrated flux in real time again; Described DSP utilizes its timer internal to compare output function the instantaneous delivery data is exported by the pulse output unit with impulse form; Described DSP utilizes its inner integrated SPI module that the instantaneous delivery data are sent to described analog quantity output unit, with the analog quantity form output of 4~20mA electric current; Described DSP is presented at instantaneous delivery, integrated flux, temperature and pressure on the described LCD; Include instrument coefficient, systematic sampling frequency, sampling number, repeatedly average time, the digital filter coefficient of analysis of spectrum by what keyboard was provided with; Preserve the instrument coefficient of described keyboard input and the integrated flux that calculates by described EEPROM; Described low-voltage observation circuit is responsible for proposing interrupt request to described DSP when system's power down, and before the complete power down of system measurement result is stored among the described EEPROM.
2. according to the described low cost intelligent vortex shedding flowmeter signal processing system of claim 1 based on DSP, it is characterized in that utilizing the cycle interruption of described dsp chip timer internal, realization is to the timing sampling of described temperature, pressure and flow signal, the data that sampling obtains are put into annular data buffer, and regularly the flow signal that sampling is obtained carries out described analysis of spectrum, sampling edge is calculated on the limit, the covering of overlapping of the data on flows of adjacent twice analyzing and processing.
3. according to the described low cost intelligent vortex shedding flowmeter signal processing system of claim 1 based on DSP, it is characterized in that described dsp chip is TMS320LF2407A, its inside is integrated with FLASH, the A/D conversion functional module of 32K, 2 task managers, house dog, serial peripheral equipment interface SPI, serial communication interface SCI, CAN functional module.
4. according to the described low cost intelligent vortex shedding flowmeter signal processing system of claim 1 based on DSP, it is characterized in that range ability according to described vortex shedding flow meter, by described keyboard sample frequency and sampling number are set, to control the computational accuracy of described power spectrumanalysis; Described dsp chip adopts the computational accuracy of center of gravity spectrum correcting method with further raising frequency; According to described flow sensor characteristic, by described keyboard segment instrument coefficient is set, improve the measuring accuracy of flow; Form by the temperature and pressure compensation carries out gamma correction to flow result of calculation, improves the measuring accuracy of overheated gas and saturated vapour flow.
5. according to the described low cost intelligent vortex shedding flowmeter signal processing system of claim 1 based on DSP, it is characterized in that utilizing described dsp chip timer internal, export pulse with mode relatively, and by interrupting that relatively the recurrence interval of output is carried out dynamic compensation.
CNB2005100410581A 2005-07-13 2005-07-13 A low-cost intelligent vortex flowmeter signal processing system based on DSP Expired - Fee Related CN100385207C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100410581A CN100385207C (en) 2005-07-13 2005-07-13 A low-cost intelligent vortex flowmeter signal processing system based on DSP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100410581A CN100385207C (en) 2005-07-13 2005-07-13 A low-cost intelligent vortex flowmeter signal processing system based on DSP

Publications (2)

Publication Number Publication Date
CN1737506A CN1737506A (en) 2006-02-22
CN100385207C true CN100385207C (en) 2008-04-30

Family

ID=36080386

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100410581A Expired - Fee Related CN100385207C (en) 2005-07-13 2005-07-13 A low-cost intelligent vortex flowmeter signal processing system based on DSP

Country Status (1)

Country Link
CN (1) CN100385207C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107687875A (en) * 2017-08-17 2018-02-13 合肥工业大学 A kind of magnetic vortex street flowmeter for measuring gassiness the flow of conductive liquid

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102175286B (en) * 2011-01-19 2012-11-21 南京航空航天大学 Signal processing method for turbine flow meter
CN102297709A (en) * 2011-05-19 2011-12-28 常州大学 Wireless industrial flow transducer
CN103148897A (en) * 2013-02-01 2013-06-12 浙江大学 Digital intelligent vortex shedding flowmeter based on DSP and metering method of same
CN105650064B (en) * 2016-03-06 2018-01-12 浙江大学 A kind of Pneumatic position control device based on DSP
CN106679741B (en) * 2016-12-20 2019-06-04 重庆川仪自动化股份有限公司 Method and system for processing anti-interference signal based on vortex flowmeter
CN108759875B (en) * 2018-06-04 2020-06-26 合肥工业大学 Sensor dynamic compensation method based on system identification and frequency response correction
CN109668599B (en) * 2019-01-16 2024-03-26 江苏华海测控技术有限公司 Coriolis mass flowmeter
CN115326151A (en) * 2022-08-11 2022-11-11 北京三盈联合石油技术有限公司 A vortex gas flowmeter for oil and gas recovery and a flow correction method for segmented coefficients
CN117782237B (en) * 2023-12-29 2025-01-14 河北大学 A measurement module for an average velocity tube vortex street integrated sensor

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6170338B1 (en) * 1997-03-27 2001-01-09 Rosemont Inc. Vortex flowmeter with signal processing
CN1104628C (en) * 1999-01-08 2003-04-02 合肥工业大学 Digital signal processing system of vortex street flowmeter
CN1206516C (en) * 1999-09-14 2005-06-15 横河电机株式会社 Swirl flowmeater

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6170338B1 (en) * 1997-03-27 2001-01-09 Rosemont Inc. Vortex flowmeter with signal processing
CN1104628C (en) * 1999-01-08 2003-04-02 合肥工业大学 Digital signal processing system of vortex street flowmeter
CN1206516C (en) * 1999-09-14 2005-06-15 横河电机株式会社 Swirl flowmeater

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
具HART通信功能的智能涡街流量计设计. 陈祥荣,居滋培.自动化与仪器仪表,第1期. 2000
具HART通信功能的智能涡街流量计设计. 陈祥荣,居滋培.自动化与仪器仪表,第1期. 2000 *
基于DSP、具有谱分析功能的涡街流量计信号处理系统. 徐科军,吕讯竑,陈荣保,苏建徽,张崇巍.仪器仪表学报,第22卷第3期. 2001
基于DSP、具有谱分析功能的涡街流量计信号处理系统. 徐科军,吕讯竑,陈荣保,苏建徽,张崇巍.仪器仪表学报,第22卷第3期. 2001 *
基于FFT的频谱校正方法及应用. 黄云志,徐科军.仪器仪表学报,第22卷第3期. 2001
基于FFT的频谱校正方法及应用. 黄云志,徐科军.仪器仪表学报,第22卷第3期. 2001 *
基于自适应陷波的涡街流量计信号处理系统. 徐科军,汪安民,吕讯竑,陈荣保,苏建徽.计量学报,第21卷第3期. 2000
基于自适应陷波的涡街流量计信号处理系统. 徐科军,汪安民,吕讯竑,陈荣保,苏建徽.计量学报,第21卷第3期. 2000 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107687875A (en) * 2017-08-17 2018-02-13 合肥工业大学 A kind of magnetic vortex street flowmeter for measuring gassiness the flow of conductive liquid
CN107687875B (en) * 2017-08-17 2021-06-22 合肥工业大学 An electromagnetic vortex flowmeter for measuring the flow of gas-containing conductive liquid

Also Published As

Publication number Publication date
CN1737506A (en) 2006-02-22

Similar Documents

Publication Publication Date Title
CN106679741B (en) Method and system for processing anti-interference signal based on vortex flowmeter
CN100470207C (en) Two-wire vortex flowmeter
CN101476906B (en) Anti-strong fixed interference digital signal processing system of vortex street flowmeter
CN108593022B (en) A kind of Transient Electromagnetic flow transmitter based on differential interference compensation
CN100385207C (en) A low-cost intelligent vortex flowmeter signal processing system based on DSP
CN101701834A (en) Digital Vortex Flowmeter Based on Dual Sensors Against Strong Interference
CN101451864A (en) Improved low power consumption two-wire system vortex shedding flowmeter
CN101893465A (en) A Signal Processing System of Electromagnetic Flowmeter Based on DSP
CN103528634B (en) A kind of coriolis mass flowmeters cloud transmission digital signal processing device and method
CN103163380A (en) Micro-ohm resistance measurement system based on LabVIEW developing platform
CN101614566A (en) Low power consumption two-wire vortex flowmeter based on fast Fourier transform
CN107687875B (en) An electromagnetic vortex flowmeter for measuring the flow of gas-containing conductive liquid
CN1095538C (en) Ke's mass flowmeter digital signal processing system
CN102322904B (en) Vortex shedding flow meter based on self-adaptive fast Fourier transformation
CN111351535A (en) Signal processing method of high-frequency sine wave excitation electromagnetic flowmeter
CN101644590A (en) Anti-strong interference vortex street flowmeter digital signal processing system based on single sensor
CN1104628C (en) Digital signal processing system of vortex street flowmeter
CN106123973B (en) Vortex-shedding meter based on cross-correlation analysis measurement low reynolds number flow
CN103454519A (en) System and method for calculation/liquid crystal display of electrical parameters of active power filter
CN202158875U (en) Vortex flow meter
CN101881638A (en) Vortex street flowmeter signal digital processing system based on MCU (Microprogrammed Control Unit)
CN108680210B (en) Transient electromagnetic flow transmitter based on voltage and current differential
CN202103632U (en) Intelligent ultrasonic signal filtering circuit
CN206192942U (en) Little water wide range coulometer summation circuit for appearance
CN105241602A (en) High-precision pressure acquisition method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080430

Termination date: 20140713

EXPY Termination of patent right or utility model