CN102928040A - Ship-lock multi-channel water level measuring system and filter method thereof - Google Patents

Ship-lock multi-channel water level measuring system and filter method thereof Download PDF

Info

Publication number
CN102928040A
CN102928040A CN2012104304007A CN201210430400A CN102928040A CN 102928040 A CN102928040 A CN 102928040A CN 2012104304007 A CN2012104304007 A CN 2012104304007A CN 201210430400 A CN201210430400 A CN 201210430400A CN 102928040 A CN102928040 A CN 102928040A
Authority
CN
China
Prior art keywords
water level
converter
signal conditioning
links
conditioning circuit
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.)
Granted
Application number
CN2012104304007A
Other languages
Chinese (zh)
Other versions
CN102928040B (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.)
Jiangsu University of Science and Technology
Original Assignee
Jiangsu University of Science and 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 Jiangsu University of Science and Technology filed Critical Jiangsu University of Science and Technology
Priority to CN201210430400.7A priority Critical patent/CN102928040B/en
Publication of CN102928040A publication Critical patent/CN102928040A/en
Application granted granted Critical
Publication of CN102928040B publication Critical patent/CN102928040B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Arrangements For Transmission Of Measured Signals (AREA)
  • Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)

Abstract

本发明公开了一种船闸多通道水位测量系统及滤波方法,系统由多水位传感器、数据采集模块、远程监控PC机、GSM模块及通信网络等组成。以单片机为下位微控制器,采用高精度A/D转换器,实时监测船闸上下游、闸室等多测量点水位,并将多路数据打包重构后利用485总线远程传送到上位监控PC机以实时显示各点水位值,并通过GSM短消息模块及其无线网络将水位信息发送给指定手机用户,同时也支持手机用户随时利用GSM网络主动索取各点水位值。系统采用基于单片机中值滤波基础上的FIR滤波,有易于实现和系统绝对稳定的优势。本发明成本低、精度高、抗干扰能力强、人机交互友好。

Figure 201210430400

The invention discloses a ship lock multi-channel water level measuring system and a filtering method. The system is composed of multi-water level sensors, a data acquisition module, a remote monitoring PC, a GSM module, a communication network and the like. Using the single-chip microcomputer as the lower-level microcontroller, using high-precision A/D converters, real-time monitoring of water levels at multiple measurement points such as the upstream and downstream of the ship lock, and lock chambers, and repacking and reconstructing the multi-channel data, and using the 485 bus to remotely transmit them to the upper monitoring PC. Display the water level of each point in real time, and send the water level information to designated mobile phone users through the GSM short message module and its wireless network, and also support mobile phone users to use the GSM network to actively ask for the water level of each point at any time. The system adopts FIR filtering based on the median filtering of single-chip microcomputer, which has the advantages of easy implementation and absolute stability of the system. The invention has the advantages of low cost, high precision, strong anti-interference ability and friendly human-computer interaction.

Figure 201210430400

Description

船闸多通道水位测量系统及滤波方法Multi-channel water level measurement system and filtering method for ship lock

技术领域technical field

本发明涉及一种测量系统,尤其涉及一种船闸多通道水位测量系统及滤波方法。The invention relates to a measurement system, in particular to a ship lock multi-channel water level measurement system and a filtering method.

背景技术Background technique

船闸站水位实时监测是船闸运行管理及船舶安全通航提出的必然要求。船闸调度人员必须时刻关注船闸上、下游及闸室内水位的变化,准确可靠的水位数据使得船舶过闸工序自动化成为可能,从而大大减轻船舶过闸的难度和船闸调度人员的工作强度;同时,船闸站也十分有必要让船民朋友及时掌握随时变化的上、下游水位信息,以便他们主动做出是动身出航还是停航靠岸的选择。然而,目前许多船闸站的水位测量设施陈旧,技术较为落后,自动化程度不够,水位信息准确度不高,有些甚至依靠工作人员观察水标尺刻度,大大影响了船闸运行调度的安全性、经济性与高效性。另外,船闸站大多依靠人工通过广播系统甚至黑板报进行水位消息发布,形式较为单一,人性化程度不高,受众面有限,广大船民想了解船闸实时水位信息较为困难,因此往往错过最佳过闸时机,也给船闸运行调度造成诸多不便。故设计一种面向船闸工程应用的多通道水位实时监测、远程传送及短消息交互系统,对改善和提高船闸的水位自动化监测水平,实现船闸站调度的安全运行以及提高过往船舶的人性化服务质量有重要的现实意义。The real-time monitoring of the water level of the lock station is an inevitable requirement for the operation management of the lock and the safe navigation of ships. Ship lock dispatchers must always pay attention to changes in the water level upstream, downstream, and in the lock chamber. Accurate and reliable water level data make it possible for ships to automatically pass through the lock, thereby greatly reducing the difficulty of ships passing through the lock and the work intensity of ship lock dispatchers. At the same time, the ship lock It is also very necessary for the friends of the boat people to keep abreast of the changing upstream and downstream water level information in a timely manner, so that they can take the initiative to make a choice whether to set sail or stop and dock. However, at present, the water level measurement facilities in many ship lock stations are outdated, the technology is relatively backward, the degree of automation is not enough, and the accuracy of water level information is not high. Efficiency. In addition, ship lock stations mostly rely on manual release of water level information through the broadcast system or even blackboard newspapers. The form is relatively simple, the degree of humanization is not high, and the audience is limited. The timing also caused a lot of inconvenience to the operation and scheduling of the lock. Therefore, a multi-channel water level real-time monitoring, remote transmission and short message interaction system for ship lock engineering applications is designed to improve and enhance the water level automatic monitoring level of ship locks, realize the safe operation of ship lock station dispatching and improve the humanized service quality of passing ships has important practical significance.

中国专利说明书200710068013.2公开了一种无线水位监测系统,以解决现有水位监测系统中,监测的数据无法实时传输,而只能实地取得的问题。但其不足之处在于:1)在空间传播的电磁波,除有用信号外,还存在大量的干扰,如来自其它通信系统的互调、邻频、同频等干扰,还有来自现场的电磁干扰,以及天电等自然现象干扰。而这些干扰往往会造成监测系统无法正常通信;2)该监测系统硬件成本高,各测量点水位数据的收集无法充分保证实时性;3)水位监测与信息发布没有进行有机集成,无法将各点水位信息及时告知用户,限制了系统的应用范围。Chinese patent specification 200710068013.2 discloses a wireless water level monitoring system to solve the problem in the existing water level monitoring system that the monitored data cannot be transmitted in real time but can only be obtained on the spot. But its shortcomings are: 1) In addition to useful signals, electromagnetic waves propagating in space also have a lot of interference, such as intermodulation, adjacent frequency, same frequency interference from other communication systems, and electromagnetic interference from the scene , and interference from natural phenomena such as sky electricity. These interferences often cause the monitoring system to fail to communicate normally; 2) The hardware cost of the monitoring system is high, and the collection of water level data at each measurement point cannot fully guarantee real-time performance; 3) Water level monitoring and information release are not organically integrated, so it is impossible to The water level information informs the user in time, which limits the scope of application of the system.

陈永刚等人在论文“船闸水位与水位差值激光监测系统的原理与实践”【山东交通科技,2010(1)】介绍了一种应用现代激光测距技术对原有船闸的水位测量系统进行升级改造的方法,但该方法存在以下问题:1)激光测距传感器价格昂贵,使用条件较为苛刻,且反射浮板安装较困难;2)环境温度的变化、测井内长期寄生的昆虫、蜘蛛网等杂物会阻挡激光光束,必须定期消除;3)系统的扩展性较差,不利于多通道水位的实时巡回测量。In the paper "Principle and Practice of Laser Monitoring System for Ship Lock Water Level and Water Level Difference" [Shandong Communications Technology, 2010 (1)], Chen Yonggang and others introduced a modern laser ranging technology to upgrade the water level measurement system of the original ship lock. However, this method has the following problems: 1) The laser ranging sensor is expensive, the use conditions are relatively harsh, and the installation of the reflective floating plate is difficult; 2) The change of the ambient temperature, the long-term parasitic insects and spider webs in the logging Such debris will block the laser beam and must be eliminated regularly; 3) The scalability of the system is poor, which is not conducive to real-time itinerant measurement of multi-channel water levels.

现有技术的水位压力传感器实时输出无周期连续变化的电流信号。在复杂的水环境中实际使用时,存在各种形式的干扰源,如船闸站启闭机房内各种动力设备的启动和运行时所产生的大电流冲击、220V电网电压的波动与波形畸变干扰、电磁辐射、长距离传输导致的电流信号衰减、雷电产生的过电压等。以上干扰一旦侵入测量系统输入通道,无疑会造成数据采集误差加大或淹没传感器有用信号成分,严重时甚至会破坏整个测量系统的运行。The water level pressure sensor in the prior art outputs a non-periodically continuously changing current signal in real time. In actual use in a complex water environment, there are various forms of interference sources, such as the large current impact generated by the start-up and operation of various power equipment in the hoist room of the ship lock station, the fluctuation of the 220V grid voltage and the interference of waveform distortion , electromagnetic radiation, current signal attenuation caused by long-distance transmission, overvoltage caused by lightning, etc. Once the above interference invades the input channel of the measurement system, it will undoubtedly increase the data acquisition error or submerge the useful signal components of the sensor, and even destroy the operation of the entire measurement system in severe cases.

为了改善船闸的水位自动化监测水平、实现船闸站调度的安全运行、提高过往船舶的过闸效率及提供人性化服务,设计一种船闸多通道水位测量系统,以解决现有技术水位传感器数据采集易受干扰,采集自动化程度不高、信息发布形式单一、人机交互性不强等问题具有重要的现实意义。In order to improve the water level automatic monitoring level of the ship lock, realize the safe operation of the ship lock station dispatching, improve the efficiency of passing ships through the lock and provide humanized services, a multi-channel water level measurement system for the ship lock is designed to solve the problem of the existing water level sensor data collection is difficult. Interference, low degree of automation of collection, single form of information release, and weak human-computer interaction have important practical significance.

发明内容Contents of the invention

本发明的目的在于提供一种船闸多通道水位测量系统及滤波方法,解决现有技术数据采集易受干扰,采集自动化程度不高、信息发布形式单一、人机交互性不强等技术问题。The purpose of the present invention is to provide a ship lock multi-channel water level measurement system and a filtering method to solve the technical problems of the prior art that data collection is susceptible to interference, the degree of collection automation is not high, the form of information release is single, and the human-computer interaction is not strong.

本发明的目的通过以下技术方案予以实现:The purpose of the present invention is achieved through the following technical solutions:

一种船闸多通道水位测量系统,包括上游水位传感器、下游水位传感器、闸室水位传感器、数据采集模块、RS485网络、485/232转换器、远程监控PC机、GSM模块、手机用户,所述数据采集模块包括信号调理电路A、信号调理电路B、信号调理电路C、多路开关、A/D转换电路、单片机、电源管理模块、按键、数码管、TTL/485转换电路,所述上游水位传感器、下游水位传感器、闸室水位传感器分别与信号调理电路A、信号调理电路B、信号调理电路C相连,所述信号调理电路A、信号调理电路B、信号调理电路C与多路开关输入端相连,多路开关输出端与A/D转换电路相连,所述A/D转换电路、电源管理模块、按键、数码管分别与单片机相连,所述TTL/485转换电路一端与单片机相连,另一端接入RS485网络,所述485/232转换器一端接入RS485网络,另一端接远程监控PC机,所述GSM模块与远程监控PC机相连并通过无线通信网络与手机用户通信。A multi-channel water level measurement system for a ship lock, including an upstream water level sensor, a downstream water level sensor, a lock chamber water level sensor, a data acquisition module, an RS485 network, a 485/232 converter, a remote monitoring PC, a GSM module, and a mobile phone user. The acquisition module includes a signal conditioning circuit A, a signal conditioning circuit B, a signal conditioning circuit C, a multi-way switch, an A/D conversion circuit, a single-chip microcomputer, a power management module, buttons, a digital tube, a TTL/485 conversion circuit, and the upstream water level sensor , the downstream water level sensor, and the sluice chamber water level sensor are respectively connected to the signal conditioning circuit A, the signal conditioning circuit B, and the signal conditioning circuit C, and the signal conditioning circuit A, the signal conditioning circuit B, and the signal conditioning circuit C are connected to the multi-way switch input terminal , the multi-way switch output end is connected with the A/D conversion circuit, and the A/D conversion circuit, power management module, button, and digital tube are respectively connected with the single-chip microcomputer, and one end of the TTL/485 conversion circuit is connected with the single-chip microcomputer, and the other end is connected with the single-chip microcomputer. One end of the 485/232 converter is connected to the RS485 network, and the other end is connected to the remote monitoring PC. The GSM module is connected to the remote monitoring PC and communicates with the mobile phone user through the wireless communication network.

一种船闸多通道水位测量系统的滤波方法,该方法包括以下步骤:A filtering method for a ship lock multi-channel water level measurement system, the method comprising the following steps:

1)对被测参数进行中值滤波,即对被测参数连续采样多次,将采样值进行排序,选取中间值为本次有效采样值;1) Median filtering is performed on the measured parameters, that is, the measured parameters are continuously sampled multiple times, the sampling values are sorted, and the median value is selected as the effective sampling value for this time;

2)对被测参数进行有限脉冲响应滤波,先给定理想滤波器的频率特性Hd(ejw);2) Perform finite impulse response filtering on the measured parameters, and first give the frequency characteristic Hd(e jw ) of the ideal filter;

3)计算理想滤波器的单位抽样响应,

Figure BDA00002342690900021
3) Compute the unit sample response of the ideal filter,
Figure BDA00002342690900021

4)设置滤波器形式、窗函数类型、窗口长度N;4) Set filter form, window function type, window length N;

5)调用MATLAB函数计算滤波器系数w(n);5) Call the MATLAB function to calculate the filter coefficient w(n);

6)计算所设计滤波器的单位抽样响应h(n)=hd(n)w(n);6) Calculate the unit sampling response h(n)=h d (n)w(n) of the designed filter;

7)将设计好的N个h(n)序列存入对应存储区;7) Store the designed N h(n) sequences into the corresponding storage area;

8)将中值滤波结果x1作为x(n)存入对应存储区;8) Store the median filtering result x1 as x(n) into the corresponding storage area;

9)循环读取h(n)、x(n)值进行卷积运算,求得在线滤波结果

Figure BDA00002342690900031
9) Circularly read h(n) and x(n) values for convolution operation to obtain online filtering results
Figure BDA00002342690900031

本发明的目的还可以通过以下技术措施来进一步实现:The object of the present invention can also be further realized by the following technical measures:

前述一种船闸多通道水位测量系统,其中信号调理电路A、信号调理电路B、信号调理电路C分别包括I/V转换电路、跟随器、低通滤波器,所述低通滤波器为巴特沃斯二阶形式,所述I/V转换电路输入端与水位传感器连接,所述I/V转换电路输出端与跟随器输入端相连,跟随器输出端与低通滤波器相连。The aforementioned multi-channel water level measurement system for ship locks, wherein the signal conditioning circuit A, the signal conditioning circuit B, and the signal conditioning circuit C respectively include an I/V conversion circuit, a follower, and a low-pass filter, and the low-pass filter is Butterwater In the second-order form, the input end of the I/V conversion circuit is connected to the water level sensor, the output end of the I/V conversion circuit is connected to the input end of the follower, and the output end of the follower is connected to the low-pass filter.

前述一种船闸多通道水位测量系统,其中A/D转换电路包括A/D转换器101、复杂可编程逻辑器件CPLD 102、基准电压芯片103,所述A/D转换器101型号为MAX195,所述CPLD 102型号为EPM7128S,所述基准电压芯片103型号为MAX6250,所述A/D转换器101的AIN端为待转换模拟信号的输入通道,所述A/D转换器101的CLK端与CPLD 102的4FPCLK端相连,所述A/D转换器101的EOC端与CPLD 102的EOC端相连,所述A/D转换器101的CONV端与CPLD 102的CONV端相连,所述A/D转换器101的DOUT端与CPLD 102的SDIN端相连,所述A/D转换器101的RESET端接收单片机发出的自校准信号,所述A/D转换器101的REF端与基准电压芯片103的OUT端相连,,所述CPLD 102的START端接收单片机发出的A/D转换启动信号,所述CPLD 102的AD0~7与单片机的并口相连。The aforementioned multi-channel water level measurement system for ship locks, wherein the A/D conversion circuit includes an A/D converter 101, a complex programmable logic device CPLD 102, and a reference voltage chip 103, and the model of the A/D converter 101 is MAX195, so The CPLD 102 model is EPM7128S, the reference voltage chip 103 model is MAX6250, the AIN end of the A/D converter 101 is the input channel of the analog signal to be converted, and the CLK end of the A/D converter 101 is connected to the CPLD The 4FPCLK end of 102 is connected, the EOC end of the A/D converter 101 is connected with the EOC end of the CPLD 102, the CONV end of the A/D converter 101 is connected with the CONV end of the CPLD 102, and the A/D conversion The DOUT end of the device 101 is connected with the SDIN end of the CPLD 102, the RESET end of the A/D converter 101 receives the self-calibration signal sent by the microcontroller, and the REF end of the A/D converter 101 is connected to the OUT of the reference voltage chip 103 The terminals are connected, and the START terminal of the CPLD 102 receives the A/D conversion start signal sent by the single-chip microcomputer, and the AD 0-7 of the CPLD 102 are connected with the parallel port of the single-chip microcomputer.

与现有技术相比,本发明的有益效果是:通过GSM短消息模块及其无线网络将水位信息发送给指定手机用户,同时也支持手机用户随时利用GSM网络主动索取各点水位值,信息发布实时、快捷、人机交互性强;数据采集模块采用了“单片机+CPLD”的架构,以便在提高数据采集速度的同时,有效地减少外围数字电路的复杂程度,提高硬件电路的可靠性;系统采用基于单片机中值滤波基础上的FIR滤波,以更大程度地抑制“毛刺”现象,提高信噪比,使信号波形更为平滑,有易于实现和系统绝对稳定的优势。本发明成本低、精度高、抗干扰能力强、人机交互友好。Compared with the prior art, the beneficial effect of the present invention is: the water level information is sent to the specified mobile phone user through the GSM short message module and its wireless network, and the mobile phone user is also supported to use the GSM network to actively ask for the water level value of each point at any time, and the information is released. Real-time, fast, and strong human-computer interaction; the data acquisition module adopts the "single-chip microcomputer + CPLD" architecture, so as to improve the speed of data acquisition while effectively reducing the complexity of peripheral digital circuits and improving the reliability of hardware circuits; the system The FIR filter based on the median filter of the single-chip microcomputer is used to suppress the "glitch" phenomenon to a greater extent, improve the signal-to-noise ratio, and make the signal waveform smoother, which has the advantages of easy implementation and absolute stability of the system. The invention has the advantages of low cost, high precision, strong anti-interference ability and friendly human-computer interaction.

附图说明Description of drawings

图1是本发明船闸多通道水位测量系统结构图;Fig. 1 is a structural diagram of the ship lock multi-channel water level measurement system of the present invention;

图2是本发明投入式水位传感器结构图;Fig. 2 is a structural diagram of the drop-in water level sensor of the present invention;

图3是本发明数据采集模块的信号调理电路结构图;Fig. 3 is the signal conditioning circuit structural diagram of data acquisition module of the present invention;

图4是本发明A/D转换接口电路图;Fig. 4 is A/D conversion interface circuit diagram of the present invention;

图5是本发明CPLD功能原理图;Fig. 5 is a functional schematic diagram of CPLD of the present invention;

图6是本发明单片机主程序流程图;Fig. 6 is a flow chart of the main program of the single-chip microcomputer of the present invention;

图7是本发明单片机中值滤波流程图;Fig. 7 is the flow chart of single-chip microcomputer median filter of the present invention;

图8是本发明PC机FIR滤波流程图。Fig. 8 is a flow chart of PC FIR filtering in the present invention.

具体实施方式Detailed ways

下面结合附图和具体实施例对本发明作进一步说明。The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

如图1所示,船闸多通道水位测量系统,包括上游水位传感器、下游水位传感器、闸室水位传感器、数据采集模块、RS485网络、485/232转换器、远程监控PC机、GSM模块、手机用户,所述数据采集模块包括信号调理电路A、信号调理电路B、信号调理电路C、多路开关、A/D转换电路、单片机、电源管理模块、按键、数码管、TTL/485转换电路,所述上游水位传感器、下游水位传感器、闸室水位传感器分别与信号调理电路A、信号调理电路B、信号调理电路C相连,所述信号调理电路A、信号调理电路B、信号调理电路C与多路开关输入端相连,多路开关输出端与A/D转换电路相连,所述A/D转换电路、电源管理模块、按键、数码管分别与单片机相连,所述TTL/485转换电路一端与单片机相连,另一端接入RS485网络,所述485/232转换器一端接入RS485网络,另一端接远程监控PC机,所述GSM模块与远程监控PC机相连并通过无线通信网络与手机用户通信。As shown in Figure 1, the ship lock multi-channel water level measurement system includes upstream water level sensor, downstream water level sensor, lock chamber water level sensor, data acquisition module, RS485 network, 485/232 converter, remote monitoring PC, GSM module, mobile phone user , the data acquisition module includes a signal conditioning circuit A, a signal conditioning circuit B, a signal conditioning circuit C, a multi-way switch, an A/D conversion circuit, a single-chip microcomputer, a power management module, buttons, a digital tube, a TTL/485 conversion circuit, the The upstream water level sensor, the downstream water level sensor, and the sluice chamber water level sensor are connected to the signal conditioning circuit A, signal conditioning circuit B, and signal conditioning circuit C respectively, and the signal conditioning circuit A, signal conditioning circuit B, and signal conditioning circuit C are connected to multiple The switch input terminals are connected, the multi-channel switch output terminals are connected with the A/D conversion circuit, the A/D conversion circuit, the power management module, the keys, and the digital tubes are respectively connected with the single-chip microcomputer, and one end of the TTL/485 conversion circuit is connected with the single-chip microcomputer , the other end is connected to the RS485 network, one end of the 485/232 converter is connected to the RS485 network, and the other end is connected to the remote monitoring PC, the GSM module is connected to the remote monitoring PC and communicates with the mobile phone user through the wireless communication network.

如图3所示,本系统的信号调理电路A、信号调理电路B、信号调理电路C分别包括I/V转换电路、跟随器、低通滤波器,所述低通滤波器为巴特沃斯二阶形式,所述I/V转换电路输入端与水位传感器连接,所述I/V转换电路输出端与跟随器输入端相连,跟随器输出端与低通滤波器相连。As shown in Figure 3, the signal conditioning circuit A, the signal conditioning circuit B, and the signal conditioning circuit C of this system respectively include an I/V conversion circuit, a follower, and a low-pass filter, and the low-pass filter is Butterworth II Step form, the input end of the I/V conversion circuit is connected to the water level sensor, the output end of the I/V conversion circuit is connected to the input end of the follower, and the output end of the follower is connected to the low-pass filter.

如图4所示,其中A/D转换电路包括A/D转换器101、CPLD 102、基准电压芯片103,所述A/D转换器101型号为MAX195,所述CPLD 102型号为EPM7128S,所述基准电压芯片103型号为MAX6250,所述A/D转换器101的AIN端为待转换模拟信号的输入通道,所述A/D转换器101的CLK端与CPLD 102的4FPCLK端相连,所述A/D转换器101的EOC端与CPLD 102的EOC端相连,所述A/D转换器101的CONV端与CPLD 102的CONV端相连,所述A/D转换器101的DOUT端与CPLD 102的SDIN端相连,所述A/D转换器101的RESET端接收单片机发出的自校准信号,所述A/D转换器101的REF端与基准电压芯片103的OUT端相连,,所述CPLD102的START端接收单片机发出的A/D转换启动信号,所述CPLD 102的AD0~7与单片机的并口相连。As shown in Figure 4, wherein A/D conversion circuit comprises A/D converter 101, CPLD 102, reference voltage chip 103, described A/D converter 101 model is MAX195, and described CPLD 102 model is EPM7128S, described Reference voltage chip 103 model is MAX6250, and the AIN end of described A/D converter 101 is the input channel of the analog signal to be converted, and the CLK end of described A/D converter 101 is connected with the 4FPCLK end of CPLD 102, and described A The EOC end of the /D converter 101 is connected with the EOC end of the CPLD 102, the CONV end of the A/D converter 101 is connected with the CONV end of the CPLD 102, and the DOUT end of the A/D converter 101 is connected with the CPLD 102 The SDIN end is connected, the RESET end of the A/D converter 101 receives the self-calibration signal sent by the single-chip microcomputer, the REF end of the A/D converter 101 is connected with the OUT end of the reference voltage chip 103, and the START of the CPLD102 The end receives the A/D conversion start signal sent by the single-chip microcomputer, and the AD 0-7 of the CPLD 102 is connected with the parallel port of the single-chip microcomputer.

本发明采用的水位压力传感器实时输出无周期连续变化的电流信号。实际使用中,一般水位波动频率为3~4Hz,波动范围不超过10cm,传感器输出信号往往呈现为一个变化缓慢的标准电流信号、几赫兹的低频交流信号以及若干小幅值高频噪声成分的叠加。同时,系统现场运行工况环境比较复杂,存在各种形式的干扰源,如船闸站启闭机房内各种动力设备的启动和运行时所产生的大电流冲击、220V电网电压的波动与波形畸变干扰、电磁辐射、长距离传输导致的电流信号衰减、雷电产生的过电压等。以上干扰一旦侵入系统输入通道,无疑会造成数据采集误差加大或淹没传感器有用信号成分,严重时甚至会破坏整个测量系统的运行。因此,在具体实施本发明时,在系统的测量精度、抗干扰能力及工作稳定性方面采取了进一步的技术措施。The water level pressure sensor adopted in the present invention outputs a current signal without period and continuous variation in real time. In actual use, the general water level fluctuation frequency is 3-4Hz, and the fluctuation range does not exceed 10cm. The sensor output signal often presents a superposition of a slowly changing standard current signal, a few Hz low-frequency AC signals, and several small-amplitude high-frequency noise components. . At the same time, the on-site operating conditions of the system are relatively complex, and there are various sources of interference, such as the large current impact generated by the start-up and operation of various power equipment in the hoist room of the ship lock station, the fluctuation and waveform distortion of the 220V grid voltage Interference, electromagnetic radiation, current signal attenuation caused by long-distance transmission, overvoltage caused by lightning, etc. Once the above interference invades the input channel of the system, it will undoubtedly increase the data acquisition error or submerge the useful signal components of the sensor, and even destroy the operation of the entire measurement system in severe cases. Therefore, when implementing the present invention, further technical measures have been taken in terms of measurement accuracy, anti-interference ability and working stability of the system.

本发明采用了高精度投入式水位传感器,其内部结构如图2所示。其中,惠斯顿电桥由一个在硅弹性膜片上用离子注入和激光修正方法形成的4个阻值相等的扩散电阻组成,在基准电压源保持不变的情况下,如有压力作用在惠斯顿电桥上,电桥则会失去平衡,其输出电压与压力成正比,从而将压力信号转换为电信号。恒流源是传感器温度补偿所需的恒流激励,用于传感器零位温漂补偿和灵敏度温漂补偿。由于传感器的零点和满量程温度补偿是在无输出负载的情况下计算的,电桥电阻又随着温度而变化,因此电桥电压在恒流源激励模式下也将随着温度变化,故选用差分归一放大器来提高输入阻抗高和共模抑制比,其输出信号再经过放大器将微弱电压信号放大到便于测量的范围,并通过V/I转换再进一步转换为4-20mA标准电流,以便远距离传输。非线性校正是通过电阻将输出电压反馈回来,以便控制电桥电压,用于补偿传感器的压力非线性特征。反向极性保护起到保护作用,防止电源极性接反时对系统造成破坏。该水位传感器为两线制输出,一根线是24V DC电源正极端子输入,另一根是4-20mA标准电流信号端子输出。该水位传感器量程0~10米,工作温度-20~80℃,精度等级0.2%FS、非线性度0.06%。The present invention uses a high-precision drop-in water level sensor, the internal structure of which is shown in Figure 2. Among them, the Wheatstone bridge is composed of four diffusion resistors with equal resistance formed by ion implantation and laser correction on the silicon elastic diaphragm. When the reference voltage source remains unchanged, if there is pressure on the On a Wheatstone bridge, the bridge is out of balance and its output voltage is proportional to the pressure, thereby converting the pressure signal into an electrical signal. The constant current source is the constant current excitation required for sensor temperature compensation, and is used for sensor zero temperature drift compensation and sensitivity temperature drift compensation. Since the temperature compensation of the sensor's zero point and full scale is calculated under the condition of no output load, and the resistance of the bridge changes with the temperature, the voltage of the bridge will also change with the temperature in the constant current source excitation mode, so choose The differential normalization amplifier is used to improve the high input impedance and common mode rejection ratio, and the output signal is amplified to a convenient measurement range through the amplifier, and then further converted into a 4-20mA standard current through the V/I conversion, so that the remote distance transmission. The nonlinear correction is to feed back the output voltage through the resistor to control the bridge voltage to compensate the pressure nonlinearity of the sensor. Reverse polarity protection provides protection against damage to the system when the polarity of the power supply is reversed. The water level sensor is a two-wire output, one wire is the input of the positive terminal of the 24V DC power supply, and the other is the output of the 4-20mA standard current signal terminal. The water level sensor has a range of 0 to 10 meters, an operating temperature of -20 to 80°C, an accuracy level of 0.2% FS, and a non-linearity of 0.06%.

本发明采用的RS-485网络具有结构简单、扩展性强等优点。但由于工程环境比较复杂,现场常存在各种形式的干扰源,考虑到系统工作的稳定性和485通信的可靠性,本发明采用了光电耦合器将485网络与数据采集模块进行电气隔离。为保护485收发器不被击穿,在485总线的传输端采用稳压管组成吸收回路。同时,线路中有可能出现某节点的485收发器被击穿的极端情况,由于在485信号输出端串联有两个电阻,也可使得该节点的硬件故障不会影响整个485网络的通信。485总线的始端和末端各接入1只120Ω匹配电阻,可减少线路上传输信号的反射。考虑到系统可能因死机而出现485芯片始终处于发送状态而占用总线的情况,将485收发器的发送使能端接地,可保证485通信的可靠性。The RS-485 network adopted in the present invention has the advantages of simple structure, strong expansibility and the like. However, due to the complex engineering environment, there are often various sources of interference on site. Considering the stability of the system and the reliability of 485 communication, this invention uses a photocoupler to electrically isolate the 485 network from the data acquisition module. In order to protect the 485 transceiver from being broken down, a voltage regulator tube is used at the transmission end of the 485 bus to form an absorption circuit. At the same time, there may be an extreme situation where the 485 transceiver of a certain node is broken down in the line. Since there are two resistors in series at the 485 signal output end, the hardware failure of this node will not affect the communication of the entire 485 network. The beginning and end of the 485 bus are each connected with a 120Ω matching resistor, which can reduce the reflection of the transmission signal on the line. Considering that the system may crash and the 485 chip is always in the sending state and occupies the bus, grounding the sending enable end of the 485 transceiver can ensure the reliability of the 485 communication.

本发明在数据采集模块的A/D转换器和多路开关选型及其接口电路设计方面也采用了相应措施:采用的多路开关芯片MAX4598具有较低的导通电阻,兼容TTL逻辑输入,泄露电流仅为0.1nA;采用的A/D转换芯片MAX195属于逐次逼近型16位模/数转换器,它具有精度高、速度快、功耗低、自校准、三态串行数据输出的特点。工作时,该芯片采用同步转换传输方式,即在A/D转换进行过程中将转换好的上一数据位串行输出(高位在前)。其转换参考电压由低噪声、精密的基准电源芯片MAX6250提供;A/D转换电路外部加有定制的金属屏蔽罩,焊接在印刷电路板上,可屏蔽现场干扰。系统还采用了电源监控芯片MAX706,在数据采集模块上电、掉电、手动复位以及电源电压降低的情况下,其内部复位比较器能输出可靠的复位信号,同时,其内部看门狗电路也能监视单片机的运行,如单片机工作不正常导致程序跑飞,该看门狗就会使单片机自动复位,从而使数据采集重新开始。同时,数据采集模块在布局时将模拟电路与数字电路分开,模拟地和数字地单独布线,并一点共地,以消除公共阻抗耦合。同时加粗电源线,地线采用网格状系统,可减少系统对干扰信号的敏感性。The present invention also adopts corresponding measures in the A/D converter of the data acquisition module, the multi-way switch type selection and the interface circuit design thereof: the multi-way switch chip MAX4598 adopted has lower conduction resistance, is compatible with TTL logic input, The leakage current is only 0.1nA; the A/D conversion chip MAX195 used is a successive approximation 16-bit analog/digital converter, which has the characteristics of high precision, fast speed, low power consumption, self-calibration, and three-state serial data output . When working, the chip adopts the synchronous conversion transmission method, that is, the converted last data bit is serially output during the A/D conversion process (high bit first). The conversion reference voltage is provided by the low-noise, precise reference power chip MAX6250; the A/D conversion circuit is equipped with a custom-made metal shield, which is welded on the printed circuit board, which can shield field interference. The system also adopts the power monitoring chip MAX706. When the data acquisition module is powered on, powered off, manually reset and the power supply voltage drops, its internal reset comparator can output a reliable reset signal. At the same time, its internal watchdog circuit also It can monitor the operation of the single-chip microcomputer. If the single-chip microcomputer is not working properly and the program runs away, the watchdog will automatically reset the single-chip microcomputer, so that the data collection will restart. At the same time, the data acquisition module separates the analog circuit from the digital circuit during the layout, and the analog ground and the digital ground are wired separately, and one point is common to eliminate common impedance coupling. At the same time, the power line is thickened, and the ground line adopts a grid system, which can reduce the system's sensitivity to interference signals.

船闸多通道水位测量系统选用高精度投入式水位传感器对船闸的上游、下游以及闸室等多点水位进行实时测量,投入式水位传感器分别安装在上游、下游、闸室内水域的底部,其前端充分与水接触。水位传感器将实际水位变成标准电流4-20mA,传感器为两线制输出方式,一根接24VDC的正极,另一根为4~20mA的标准电流输出至数据采集板,该数采模块以节点形式挂接在485网络中,它以高性能51单片机为核心控制器,外围扩展有信号调理、多路开关、A/D转换、CPLD器件、人机接口、485通信接口等电路。其中,信号调理电路主要包括I/V转换、电压跟随和巴特沃斯低通滤波器等。标准电流经I/V转换后,再利用电压跟随器进行阻抗匹配,以提高其带负载的能力;低通滤波器采用巴特沃斯二阶形式,滤除工频信号和环境干扰带来的高频噪声;滤波后的三路传感器信号分别送入多路开关的三个输入通道,然后再连接到A/D转换器,其16位转换结果以串行格式输出;多路开关进行上游、下游、闸室等不同水位测量点的自动切换,实现单一A/D转换器对多通道模拟信号的分时巡回检测。A/D转换器采用逐次逼近型16位串行输出的模/数转换器,它内置有采样保持电路,具有自校准功能,可在本轮转换的同时将上一轮转换好的数据位串行输出,以实现最大转换传输速度,其转换所需参考电压由片外低噪声、高精度基准电压源提供。CPLD芯片主要用于产生A/D逻辑控制信号、A/D转换结果串入/并出的数据格式转换以及端口地址译码等,确保单片机按片外端口访问方式分两次并行读取16位转换结果;人机接口配有按键和数码管,按键和数码管配合使用,用于显示对应测量点的水位值,并便于系统的调试和自检;复位电路除支持上电复位方式外,还配有复位按键,用于系统的手动复位;光电隔离将单片机与485总线之间的串口通信进行有效地隔离,隔离信号有单片机的串口信号RXD、TXD以及用于控制485收发的I/O信号;TTL/485转换由MAX485芯片等构成,其A、B端为适合远程传送的差分信号,直接挂接在485总线上,以便各测量点水位数据能远距离地上传给上位监控PC机。The multi-channel water level measurement system of the ship lock uses high-precision input water level sensors to measure the water level at multiple points such as the upstream, downstream and lock chambers of the ship lock in real time. in contact with water. The water level sensor turns the actual water level into a standard current of 4-20mA. The sensor is a two-wire output mode. One is connected to the positive pole of 24VDC, and the other is a standard current of 4-20mA output to the data acquisition board. The data acquisition module is based on the node The form is attached to the 485 network, which uses high-performance 51 single-chip microcomputer as the core controller, and the peripheral expansion includes circuits such as signal conditioning, multi-way switch, A/D conversion, CPLD device, man-machine interface, and 485 communication interface. Among them, the signal conditioning circuit mainly includes I/V conversion, voltage follower and Butterworth low-pass filter, etc. After the standard current is converted by I/V, the voltage follower is used for impedance matching to improve its ability to carry the load; the low-pass filter adopts the second-order form of Butterworth to filter out the high voltage caused by power frequency signals and environmental interference. frequency noise; the filtered three-way sensor signals are respectively sent to the three input channels of the multi-way switch, and then connected to the A/D converter, and the 16-bit conversion result is output in serial format; the multi-way switch performs upstream and downstream Automatic switching of different water level measurement points such as sluice chamber and sluice chamber realizes time-sharing roving detection of multi-channel analog signals by a single A/D converter. The A/D converter adopts a successive approximation type 16-bit serial output analog/digital converter, which has a built-in sample and hold circuit and has a self-calibration function, which can convert the previous round of converted data bit strings at the same time as the current round of conversion. Line output to achieve maximum conversion transmission speed, the reference voltage required for conversion is provided by an off-chip low-noise, high-precision reference voltage source. The CPLD chip is mainly used to generate A/D logic control signals, data format conversion for serial input/parallel output of A/D conversion results, and port address decoding, etc., to ensure that the single-chip microcomputer reads 16 bits in parallel in two times according to the off-chip port access mode. Conversion results; the man-machine interface is equipped with buttons and digital tubes, and the buttons and digital tubes are used together to display the water level value of the corresponding measurement point and facilitate system debugging and self-test; the reset circuit supports power-on reset mode, and also Equipped with a reset button for manual reset of the system; photoelectric isolation effectively isolates the serial communication between the MCU and the 485 bus. The isolated signals include the serial port signals RXD and TXD of the MCU and the I/O signals used to control 485 transceivers ; TTL/485 conversion is composed of MAX485 chip, etc., and its A and B terminals are differential signals suitable for remote transmission, which are directly connected to the 485 bus, so that the water level data of each measurement point can be remotely uploaded to the upper monitoring PC.

由于CPLD片内具有丰富的逻辑资源及其在系统可编程特性,本发明的数据采集模块采用了“单片机+CPLD”的架构,以便在提高数据采集速度的同时,有效地减少外围数字电路的复杂程度,提高硬件电路的可靠性。在此重点述及数据采集模块中的A/D转换接口电路及CPLD相关功能设计。该模块采用高精度A/D芯片MAX195进行模/数转换,它基于逐次逼近原理,16位转换精度,9.4us转换时间,内置有采样保持电路,具有自校准功能,转换结果以串行方式逐位输出。MAX195采用同步转换传输方式,可在模/数转换进行的过程中将转换好的上一位数据位输出,以实现最大转换传输速度。其接口电路如图4所示。其中,AIN为待转换模拟信号的输入通道,CONV为启动转换信号,EOC为用于判断本次转换是否结束的状态信号,CLK既作为转换时钟又作为串行数据输出时钟,DOUT在CLK下降沿将16位转换结果以串行方式从高位到低位逐位输出。START、RESET分别为单片机发出的A/D转换启动信号和自校准信号。同时,该模块采用CPLD芯片EPM7128S进行部分数字电路的设计,其顶层原理如图5所示。将单片机发出的START信号和由外部有源晶振经4分频后产生的4FPCLK信号进行“或”运算,产生真正意义上的A/D转换启动信号CONV,同时将本次转换好的串行数据从SDIN端输入并根据SRCLK端电平变化将数据逐位移入到两个级联的8位移位寄存器74595中,单片机按照片外端口访问方式分两次读取移位寄存器中锁存的16位转换结果。以上有关控制信号和状态信号之间有如下逻辑关系:Because the CPLD has abundant logic resources and its programmable characteristics in the system, the data acquisition module of the present invention adopts the architecture of "single-chip microcomputer + CPLD", so as to effectively reduce the complexity of peripheral digital circuits while improving the data acquisition speed. Degree, improve the reliability of the hardware circuit. Here we focus on the A/D conversion interface circuit and CPLD related function design in the data acquisition module. This module adopts high-precision A/D chip MAX195 for analog/digital conversion. It is based on successive approximation principle, 16-bit conversion accuracy, 9.4us conversion time, built-in sample and hold circuit, and has self-calibration function. bit output. MAX195 adopts synchronous conversion and transmission mode, which can output the converted last data bit during the process of analog/digital conversion, so as to realize the maximum conversion and transmission speed. Its interface circuit is shown in Figure 4. Among them, AIN is the input channel of the analog signal to be converted, CONV is the start conversion signal, EOC is the status signal used to judge whether the conversion is over, CLK is used as both the conversion clock and the serial data output clock, and DOUT is on the falling edge of CLK Output the 16-bit conversion result bit by bit in a serial manner from high bit to low bit. START and RESET are the A/D conversion start signal and self-calibration signal sent by the microcontroller respectively. At the same time, the module uses CPLD chip EPM7128S to design some digital circuits, and its top-level principle is shown in Figure 5. Perform "OR" operation on the START signal sent by the microcontroller and the 4FPCLK signal generated by the external active crystal oscillator after frequency division by 4 to generate the real A/D conversion start signal CONV, and at the same time convert the converted serial data Input from the SDIN terminal and shift the data bit by bit into two cascaded 8-bit shift registers 74595 according to the level change of the SRCLK terminal. bit conversion result. The above-mentioned control signal and status signal have the following logical relationship:

CONV=START+4FPCLK,

Figure BDA00002342690900071
SRCLK=4FPCLK&EOCCONV=START+4FPCLK,
Figure BDA00002342690900071
SRCLK=4FPCLK&EOC

数据采集模块中的单片机软件编程采用C51语言模块化设计,程序结构清晰,便于系统维护和升级换代。在此仅说明单片机主程序和A/D转换程序。其中,主程序流程图如图6所示,主要完成系统的初始化、数据采集、数字滤波、标度变换和人机接口管理等工作。系统上电之后要对定时器和串行口进行初始化,随时等待上位PC机发出数据采集命令。在循环体中,首先对各通道水位数据进行在线中值滤波,然后通过标度变换将数字量转化成水位值,在等待串口中断的同时对按键进行扫描,如有键按下,则识别被按下的键,并由数码管显示对应通道的水位值;A/D转换相关的中断服务程序主要包括定时器溢出中断(设定采样频率)和INT0外中断(从CPLD中读转换结果),并实现多通道切换、启动A/D转换等功能。A/D采样周期采用单片机片内硬件定时/计数器T0溢出中断和软件计数器的方式共同实现。而利用外中断INT0对同一测量点重复多次采样,是为后续中值滤波做准备。在此,单片机采用基于“冒泡排序”算法的中值滤波来剔除信号中可能存在的个别“坏点”,即对某一被测参数连续采样多次,然后将这些采样值进行排序,选取中间值为本次有效采样值。其实现流程如图7所示,该算法具有计算方便、速度快、存储量小的特点。The single-chip software programming in the data acquisition module adopts C51 language modular design, the program structure is clear, and it is convenient for system maintenance and upgrading. Only the main program of the one-chip computer and the A/D conversion program are described here. Among them, the main program flow chart is shown in Figure 6, which mainly completes the work of system initialization, data acquisition, digital filtering, scale transformation and man-machine interface management. After the system is powered on, the timer and the serial port should be initialized, and the data acquisition command will be sent by the upper PC at any time. In the loop body, the online median filter is first performed on the water level data of each channel, and then the digital value is converted into a water level value through scale transformation, and the key is scanned while waiting for the serial port to be interrupted. If a key is pressed, it will be recognized Press the key, and the digital tube displays the water level value of the corresponding channel; the interrupt service routine related to A/D conversion mainly includes the timer overflow interrupt (setting the sampling frequency) and INT0 external interrupt (reading the conversion result from the CPLD), And realize multi-channel switching, start A/D conversion and other functions. The A/D sampling period adopts the hardware timing/counter T0 overflow interrupt and the software counter in the single chip microcomputer to realize together. The use of external interrupt INT0 to repeatedly sample the same measurement point is to prepare for the subsequent median filter. Here, the single-chip microcomputer adopts the median filter based on the "bubble sorting" algorithm to eliminate individual "bad points" that may exist in the signal, that is, to continuously sample a certain parameter for multiple times, and then sort these sampled values, select The middle value is the effective sampling value of this time. Its implementation process is shown in Figure 7. This algorithm has the characteristics of convenient calculation, fast speed and small storage capacity.

远程监控PC机主要完成上下位机的通信、FIR(Finite Impulse Response,有限脉冲响应)滤波、数据库管理、对GSM短消息模块的操作以及多点水位显示等工作。PC机上应用VB作为开发工具解决系统操作界面的实现问题,该界面主要包括系统运行指示、上下位机连接指示、上下位机通信内容显示、当前多通道水位值显示以及收发短消息的管理等。由于本系统结构相对简单,数据源较为单一,故选用Access数据库作为后台数据库,并用数据访问对象(Data Access Object,DAO)技术连接。其中数据库主要用于对历史水位的记录以及船闸指定用户群(船闸工作人员和船民)的管理。需要说明的是,PC机FIR滤波是在单片机中值滤波的基础上进行的,以更大程度地抑制“毛刺”现象,提高信噪比,使信号波形更为平滑。FIR滤波器在保证幅度特性满足技术要求的同时,具有严格的线性相位特性,有着易于实现和系统绝对稳定的优势。一般地,N阶带有常系数FIR滤波器的输出y(n)与输入序列x(n)之间为卷积关系,其系统差分方程为The remote monitoring PC mainly completes the communication between the upper and lower computers, FIR (Finite Impulse Response, finite impulse response) filtering, database management, operation of the GSM short message module, and multi-point water level display. Using VB as a development tool on the PC to solve the problem of realizing the system operation interface, the interface mainly includes system operation instructions, upper and lower computer connection instructions, upper and lower computer communication content display, current multi-channel water level display, and management of sending and receiving short messages, etc. . Because the structure of this system is relatively simple and the data source is relatively single, the Access database is selected as the background database and connected with Data Access Object (DAO) technology. Among them, the database is mainly used for the record of historical water level and the management of designated user groups of the ship lock (lock staff and boat people). It should be noted that the FIR filter of the PC is based on the median filter of the single-chip microcomputer, so as to suppress the "glitch" phenomenon to a greater extent, improve the signal-to-noise ratio, and make the signal waveform smoother. While ensuring that the amplitude characteristics meet the technical requirements, the FIR filter has strict linear phase characteristics, and has the advantages of easy implementation and absolute stability of the system. Generally, there is a convolution relationship between the output y(n) of an N-order FIR filter with constant coefficients and the input sequence x(n), and its system difference equation is

y ( n ) = x ( n ) * h ( n ) = Σ m = 0 N - 1 x ( m ) h ( n - m ) , 0≤n≤N the y ( no ) = x ( no ) * h ( no ) = Σ m = 0 N - 1 x ( m ) h ( no - m ) , 0≤n≤N

式中:x(n)为输入信号序列;y(n)为输出信号序列;h(n)为系统的单位脉冲响应,对于具有线性相位滤波器,系数偶对称,即h(n)=h(N-n-1)。应用窗函数法进行FIR滤波器的设计,具有滤波参数修改方便、运算简单、精度高、易于实现等特点,其基本设计思想是让待设计的实际滤波器逼近理想特性。本发明针对实际水位信号所包含的频率成分及其特征,为有效剔除高频毛刺干扰对水位真实值的影响,所设计低通滤波器的典型参数为:采样频率fs=150Hz,通带截止频率fp=5Hz,阻带起始频率fst=15Hz,阻带衰减不小于-50dB,窗函数类型采用Hamming窗,滤波器阶数N=30。FIR滤波器设计及在线滤波流程如图8所示,该方法包括以下步骤:In the formula: x(n) is the input signal sequence; y(n) is the output signal sequence; h(n) is the unit impulse response of the system, for a filter with a linear phase, the coefficient is evenly symmetrical, that is, h(n)=h (Nn-1). Applying the window function method to design FIR filters has the characteristics of convenient modification of filter parameters, simple calculation, high precision, and easy implementation. The basic design idea is to make the actual filter to be designed approach the ideal characteristics. The present invention aims at the frequency components and characteristics contained in the actual water level signal, in order to effectively eliminate the influence of high-frequency burr interference on the true value of the water level, the typical parameters of the designed low-pass filter are: sampling frequency f s =150Hz, passband cut-off Frequency f p =5Hz, stop band start frequency f st =15Hz, stop band attenuation not less than -50dB, window function type using Hamming window, filter order N=30. The FIR filter design and online filtering process are shown in Figure 8, the method includes the following steps:

1)对被测参数进行有限脉冲响应滤波,先给定理想滤波器的频率特性Hd(ejw);1) Carry out finite impulse response filtering on the measured parameters, first give the frequency characteristic Hd(e jw ) of the ideal filter;

2)计算理想滤波器的单位抽样响应,

Figure BDA00002342690900082
2) Compute the unit sample response of the ideal filter,
Figure BDA00002342690900082

3)设置滤波器形式、窗函数类型、窗口长度N;3) Set filter form, window function type, window length N;

4)调用MATLAB函数计算滤波器系数w(n);4) Call the MATLAB function to calculate the filter coefficient w(n);

5)计算所设计滤波器的单位抽样响应h(n)=hd(n)w(n);5) Calculate the unit sampling response h(n)=h d (n)w(n) of the designed filter;

6)将设计好的N个h(n)序列存入对应存储区;6) Store the designed N h(n) sequences into the corresponding storage area;

7)将中值滤波结果x1作为x(n)存入对应存储区;7) Store the median filtering result x1 as x(n) into the corresponding storage area;

8)循环读取h(n)、x(n)值进行卷积运算,求得在线滤波结果

Figure BDA00002342690900091
8) Circularly read h(n) and x(n) values for convolution operation to obtain online filtering results
Figure BDA00002342690900091

远程监控PC机也以节点形式挂接在485网络中,其人机操作界面采用VB语言编程,后台采用ACCESS数据库,可以显示各测量点实时水位信息,并将其自动保存到后台数据库中,并对指定手机用户群、短消息收发等进行管理,可方便地进行添减、查询、统计、报表生成、打印等操作。数据采集模块和远程监控PC机之间采用RS485总线连接,数据传送过程中会进行TTL/RS485/RS232不同通讯标准间的自动转换,系统具有良好的扩展性。The remote monitoring PC is also connected to the 485 network in the form of a node. Its man-machine interface adopts VB language programming, and the background adopts the ACCESS database, which can display the real-time water level information of each measuring point and automatically save it in the background database. Manage the designated mobile phone user groups, send and receive short messages, etc., and can conveniently perform operations such as adding and subtracting, querying, statistics, report generation, and printing. The data acquisition module and the remote monitoring PC are connected by RS485 bus. During the data transmission process, automatic conversion between different communication standards of TTL/RS485/RS232 will be carried out. The system has good scalability.

GSM短消息模块TC35通过RS-232串口与PC机连接,PC机按AT指令格式双向传输指令和数据来控制GSM模块进行短消息的接收与发送。该模块与PC机之间的通信测试方法如下:1)RS232串口连接。由于TC35自带RS232串口,故只需将其连接到PC机串口即可。在PC机侧自编软件环境下,选择相应的串口号,并将其参数设置为:波特率9600bps、无奇偶校验位、8数据位、1停止位。2)设置参数,连接测试。输入AT命令,如返回OK,表明计算机与GSM模块已连接成功,GSM模块能够正常工作。为实现短消息收发的功能,需要对GSM模块做如下设置:输入命令AT+CSCS="UCS2″,如返回OK,表明终端设备使用的字符集成功设置为"UCS2";输入命令AT+CACA?,如返回+CSCA:"<sca>",<tosca>(其中sca为字符型短消息中心地址,tosca为整数型sca地址)表明搜寻到最近的短消息服务中心,可建立通信连接;输入命令AT+CMGF=0,如返回OK,表明短消息模式成功设置为PDU模式;输入命令AT+CNMI=2,1,0,0,1,返回OK,表明如有新短消息来到,GSM模块将自动返回提示。3)收发短消息。输入命令AT+CMGS=X,其中X大小等于所发送的字符个数加上15并且用"UCS2"格式表示,再输入处理好的Unicode字符串并发送给GSM模块便可执行发送;如GSM模块收到短消息,则返回数据进行提醒,其格式为:+CMTI:"SM",<index>,PC机通过发送命令AT+CMGR=index即可提取出信息,其中index为未读信息存储位置。The GSM short message module TC35 is connected to the PC through the RS-232 serial port, and the PC controls the GSM module to receive and send short messages by bidirectionally transmitting commands and data in the AT command format. The communication test method between the module and the PC is as follows: 1) RS232 serial port connection. Since TC35 has its own RS232 serial port, it only needs to be connected to the PC serial port. In the self-editing software environment on the PC side, select the corresponding serial port number, and set its parameters as: baud rate 9600bps, no parity bit, 8 data bits, 1 stop bit. 2) Set parameters and connect test. Enter the AT command, if it returns OK, it means that the computer and the GSM module have been connected successfully, and the GSM module can work normally. In order to realize the function of sending and receiving short messages, the GSM module needs to be set as follows: input the command AT+CSCS="UCS2", if it returns OK, it indicates that the character set used by the terminal device is successfully set to "UCS2"; input the command AT+CACA? , such as returning +CSCA: "<sca>",<tosca> (where sca is the address of the character-type short message center, and tosca is the address of the integer-type sca) indicating that the nearest short message service center has been found and a communication connection can be established; enter the command AT+CMGF=0, if it returns OK, it means that the short message mode is successfully set to PDU mode; input the command AT+CNMI=2, 1, 0, 0, 1, return OK, it means that if a new short message arrives, the GSM module will automatically return to the prompt. 3) Send and receive short messages. Enter the command AT+CMGS=X, where the size of X is equal to the number of characters sent plus 15 and expressed in "UCS2" format, and then input the processed Unicode string and send it to the GSM module to execute the sending; such as the GSM module When a short message is received, it will return the data to remind, the format is: +CMTI: "SM", <index>, the PC can extract the information by sending the command AT+CMGR=index, where index is the storage location of the unread information .

本发明中,指定手机用户与系统之间可进行短消息双向交互,即用户被动接收方式和主动索取方式:In the present invention, two-way short message interaction can be carried out between the specified mobile phone user and the system, that is, the passive receiving mode and the active requesting mode of the user:

1)被动接收方式:系统操作人员可根据实际需要在工控机程序中设置多个定时发送时间点,当设定时间到来时,系统会自动将此时刻各测量点水位数据以短消息方式发给指定手机用户群。同时,系统操作人员也可随时手工发送所编辑的其它短消息;1) Passive receiving mode: The system operator can set multiple timing sending time points in the industrial computer program according to the actual needs. When the set time arrives, the system will automatically send the water level data of each measuring point at this time to the Specify the mobile phone user group. At the same time, the system operator can also manually send other edited short messages at any time;

2)用户主动索取方式。在任意时刻,手机用户也可向工控机外挂的GSM模块发送短消息,以获取当前最新水位信息。当用户向GSM模块发送短消息后,工控机首先会进行身份验证,通过身份验证后立即回复当前水位;若未通过,则不会进一步发送信息。如此设计,系统可屏蔽掉非指定用户发出的无效短消息,从而降低系统运行成本,提高船闸服务的针对性和有效性。2) The way the user actively requests. At any time, mobile phone users can also send short messages to the GSM module installed in the industrial computer to obtain the latest water level information. When the user sends a short message to the GSM module, the industrial computer will first perform identity verification, and immediately reply to the current water level after passing the identity verification; if it fails, no further information will be sent. With this design, the system can block invalid short messages sent by non-designated users, thereby reducing system operating costs and improving the pertinence and effectiveness of ship lock services.

除上述实施例外,本发明还可以有其他实施方式,凡采用等同替换或等效变换形成的技术方案,均落在本发明要求的保护范围内。In addition to the above-mentioned embodiments, the present invention can also have other implementations, and all technical solutions formed by equivalent replacement or equivalent transformation fall within the scope of protection required by the present invention.

Claims (4)

1. ship lock Multi-channel water level measuring system, it is characterized in that, comprise the upper pond level sensor, level of tail water sensor, the lock chamber level sensor, data acquisition module, the RS485 network, 485/232 converter, the remote monitoring PC, gsm module, the cellphone subscriber, described data acquisition module comprises signal conditioning circuit A, signal conditioning circuit B, signal conditioning circuit C, multi-way switch, the A/D change-over circuit, single-chip microcomputer, power management module, button, charactron, the TTL/485 change-over circuit, described upper pond level sensor, level of tail water sensor, the lock chamber level sensor respectively with signal conditioning circuit A, signal conditioning circuit B, signal conditioning circuit C links to each other, described signal conditioning circuit A, signal conditioning circuit B, signal conditioning circuit C links to each other with the multi-way switch input end, the multi-way switch output terminal links to each other with the A/D change-over circuit, described A/D change-over circuit, power management module, button, charactron links to each other with single-chip microcomputer respectively, described TTL/485 change-over circuit one end links to each other with single-chip microcomputer, other end access RS485 network, described 485/232 converter, one termination enters the RS485 network, another termination remote monitoring PC, described gsm module links to each other with the remote monitoring PC and communicates by letter with the cellphone subscriber by cordless communication network.
2. ship lock Multi-channel water level measuring system as claimed in claim 1, it is characterized in that, described signal conditioning circuit A, signal conditioning circuit B, signal conditioning circuit C comprise respectively I/V change-over circuit, follower, low-pass filter, described low-pass filter is Butterworth second order form, described I/V change-over circuit input end is connected with level sensor, described I/V change-over circuit output terminal links to each other with the follower input end, and the follower output terminal links to each other with low-pass filter.
3. ship lock Multi-channel water level measuring system as claimed in claim 1 or 2, it is characterized in that, described A/D change-over circuit comprises A/D converter (101), CPLD(102), reference voltage chip (103), described A/D converter (101) model is MAX195, described CPLD (102) model is EPM7128S, described reference voltage chip (103) model is MAX6250, the AIN end of described A/D converter (101) is the input channel of simulating signal to be converted, the CLK end of described A/D converter (101) links to each other with the 4FPCLK end of CPLD (102), the EOC end of described A/D converter (101) links to each other with the EOC end of CPLD (102), the CONV end of described A/D converter (101) links to each other with the CONV end of CPLD (102), the DOUT end of described A/D converter (101) links to each other with the SDIN end of CPLD (102), the RESET termination of described A/D converter (101) is received the self calibration signal that single-chip microcomputer sends, the REF end of described A/D converter (101) links to each other with the OUT end of reference voltage chip (103), the START termination of described CPLD (102) is received the A/D conversion starting signal that single-chip microcomputer sends, the AD of described CPLD (102) 0~7Link to each other with the parallel port of single-chip microcomputer.
4. the filtering method of ship lock Multi-channel water level measuring system as claimed in claim 1 is characterized in that the method may further comprise the steps:
1) measured parameter is carried out medium filtering, namely to measured parameter continuous sampling repeatedly, sampled value is sorted, choosing intermediate value is this efficiently sampling value;
2) measured parameter is carried out finite impulse response filter, first the frequency characteristic Hd (e of given ideal filter Jw);
3) unit sample respo of calculating ideal filter,
Figure FDA00002342690800021
4) filter form, window function type, length of window N are set;
5) Calling MATLAB function calculation coefficients w (n);
6) the unit sample respo h (n) of calculating filter=h d(n) w (n);
7) deposit N h (n) sequence that designs in the corresponding stored district;
8) deposit median-filtered result x1 in the corresponding stored district as x (n);
9) h (n) is read in circulation, x (n) value is carried out convolution algorithm, tries to achieve online filtering result
Figure FDA00002342690800022
CN201210430400.7A 2012-11-01 2012-11-01 Ship lock Multi-channel water level measuring system and filtering method Expired - Fee Related CN102928040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210430400.7A CN102928040B (en) 2012-11-01 2012-11-01 Ship lock Multi-channel water level measuring system and filtering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210430400.7A CN102928040B (en) 2012-11-01 2012-11-01 Ship lock Multi-channel water level measuring system and filtering method

Publications (2)

Publication Number Publication Date
CN102928040A true CN102928040A (en) 2013-02-13
CN102928040B CN102928040B (en) 2015-11-25

Family

ID=47642895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210430400.7A Expired - Fee Related CN102928040B (en) 2012-11-01 2012-11-01 Ship lock Multi-channel water level measuring system and filtering method

Country Status (1)

Country Link
CN (1) CN102928040B (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559367A (en) * 2013-11-13 2014-02-05 交通运输部天津水运工程科学研究所 Combined dispatching simulation and analysis method for multi-line parallel locks
CN104316135A (en) * 2014-11-17 2015-01-28 镇江船舶电器有限责任公司 Marine water level alarm system
CN104330129A (en) * 2014-10-22 2015-02-04 沈阳黎明航空发动机(集团)有限责任公司 Aeroengine force application main pipe oil cup liquid level measuring system
CN104634414A (en) * 2015-01-28 2015-05-20 国家电网公司 Water level measurement method based on Butterworth digital low-pass filter
CN104734666A (en) * 2013-12-19 2015-06-24 鸿富锦精密工业(武汉)有限公司 Chip control circuit
CN105116124A (en) * 2015-08-18 2015-12-02 无锡乐华自动化科技有限公司 Detection method for outdoor water quality collection and detection device
CN105222853A (en) * 2015-05-29 2016-01-06 苏州德锐朗智能科技有限公司 A kind of water level detecting system of powering based on stabilized voltage supply
CN105568732A (en) * 2015-12-17 2016-05-11 镇江市高等专科学校 Disc mill control method
CN105651342A (en) * 2016-03-21 2016-06-08 成都爆米花信息技术有限公司 Multichannel data collection system
CN106123943A (en) * 2016-07-15 2016-11-16 苏州西斯派克检测科技有限公司 A kind of flexible on-line detecting system based on EPA
CN106323420A (en) * 2016-08-31 2017-01-11 浙江水文新技术开发经营公司 Multi-channel water level data collection system
CN106911773A (en) * 2017-02-23 2017-06-30 武汉世纪水元科技股份有限公司 A kind of multiple wireless flow velocity acquisition system
CN107846475A (en) * 2017-12-06 2018-03-27 中国水利水电科学研究院 Intelligent water conservancy information investigating method and measure and control device
CN107894263A (en) * 2017-11-15 2018-04-10 中广核工程有限公司 The apparatus and method of the upstream and downstream liquid level difference of nuclear power station measurement filter screen
CN108107781A (en) * 2017-12-18 2018-06-01 大连海事大学 A kind of ballast water level monitoring system
CN110333079A (en) * 2019-06-25 2019-10-15 南京伟业燃油喷射技术有限公司 A kind of diesel engine comprehensive parameter tester and measuring method
CN111371508A (en) * 2020-03-10 2020-07-03 常州机电职业技术学院 RS485 communication anti-interference module
CN111896079A (en) * 2020-07-31 2020-11-06 长江三峡通航管理局 Multistage ship lock chamber water level monitoring system
CN113247197A (en) * 2021-07-01 2021-08-13 金睛兽数字科技(重庆)有限公司 Ship electronic water gauge measuring method and system
CN116095131A (en) * 2023-04-11 2023-05-09 四川三思德科技有限公司 Reservoir safety monitoring method based on Internet of things

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202938A (en) * 2006-12-15 2008-06-18 天津三星电子有限公司 System for realizing water level remote monitor supervision and early warning by GSM module
CN101551677A (en) * 2009-05-19 2009-10-07 四川中鼎电气控制有限责任公司 Water level automatic control method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202938A (en) * 2006-12-15 2008-06-18 天津三星电子有限公司 System for realizing water level remote monitor supervision and early warning by GSM module
CN101551677A (en) * 2009-05-19 2009-10-07 四川中鼎电气控制有限责任公司 Water level automatic control method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
唐炜等: "基于DSP和单片机的涡流检测数据采集系统", 《测控技术》 *
唐炜等: "联合数字滤波在涡流检测数据采集系统中的应用", 《江苏科技大学学报》 *
张中生等: "关于船闸自动控制系统的设计与应用", 《中国水运》 *

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559367A (en) * 2013-11-13 2014-02-05 交通运输部天津水运工程科学研究所 Combined dispatching simulation and analysis method for multi-line parallel locks
CN103559367B (en) * 2013-11-13 2016-07-06 交通运输部天津水运工程科学研究所 A kind of multi-thread ship lock combined dispatching arranged side by side simulation and the method for analysis
CN104734666A (en) * 2013-12-19 2015-06-24 鸿富锦精密工业(武汉)有限公司 Chip control circuit
CN104330129A (en) * 2014-10-22 2015-02-04 沈阳黎明航空发动机(集团)有限责任公司 Aeroengine force application main pipe oil cup liquid level measuring system
CN104316135A (en) * 2014-11-17 2015-01-28 镇江船舶电器有限责任公司 Marine water level alarm system
CN104634414A (en) * 2015-01-28 2015-05-20 国家电网公司 Water level measurement method based on Butterworth digital low-pass filter
CN105222853A (en) * 2015-05-29 2016-01-06 苏州德锐朗智能科技有限公司 A kind of water level detecting system of powering based on stabilized voltage supply
CN105116124A (en) * 2015-08-18 2015-12-02 无锡乐华自动化科技有限公司 Detection method for outdoor water quality collection and detection device
CN105568732A (en) * 2015-12-17 2016-05-11 镇江市高等专科学校 Disc mill control method
CN105651342A (en) * 2016-03-21 2016-06-08 成都爆米花信息技术有限公司 Multichannel data collection system
CN106123943A (en) * 2016-07-15 2016-11-16 苏州西斯派克检测科技有限公司 A kind of flexible on-line detecting system based on EPA
CN106323420A (en) * 2016-08-31 2017-01-11 浙江水文新技术开发经营公司 Multi-channel water level data collection system
CN106911773A (en) * 2017-02-23 2017-06-30 武汉世纪水元科技股份有限公司 A kind of multiple wireless flow velocity acquisition system
CN107894263A (en) * 2017-11-15 2018-04-10 中广核工程有限公司 The apparatus and method of the upstream and downstream liquid level difference of nuclear power station measurement filter screen
CN107846475A (en) * 2017-12-06 2018-03-27 中国水利水电科学研究院 Intelligent water conservancy information investigating method and measure and control device
CN108107781A (en) * 2017-12-18 2018-06-01 大连海事大学 A kind of ballast water level monitoring system
CN110333079A (en) * 2019-06-25 2019-10-15 南京伟业燃油喷射技术有限公司 A kind of diesel engine comprehensive parameter tester and measuring method
CN111371508A (en) * 2020-03-10 2020-07-03 常州机电职业技术学院 RS485 communication anti-interference module
CN111896079A (en) * 2020-07-31 2020-11-06 长江三峡通航管理局 Multistage ship lock chamber water level monitoring system
CN113247197A (en) * 2021-07-01 2021-08-13 金睛兽数字科技(重庆)有限公司 Ship electronic water gauge measuring method and system
CN113247197B (en) * 2021-07-01 2022-03-15 金睛兽数字科技(重庆)有限公司 Ship electronic water gauge measuring method and system
CN116095131A (en) * 2023-04-11 2023-05-09 四川三思德科技有限公司 Reservoir safety monitoring method based on Internet of things
CN116095131B (en) * 2023-04-11 2023-06-30 四川三思德科技有限公司 Reservoir safety monitoring method based on Internet of things

Also Published As

Publication number Publication date
CN102928040B (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN102928040B (en) Ship lock Multi-channel water level measuring system and filtering method
CN103346846B (en) Communication channel stimulation system of electricity consumption information collection system
CN102436732B (en) A power quality type energy efficiency data acquisition terminal
CN106442678A (en) GSM water quality monitoring system
CN103472433B (en) Intelligent substation electric energy measuring secondary system virtual load error detection device and method
CN108521289A (en) A Power Line Carrier Communication System
Han et al. Hydrological monitoring system design and implementation based on IOT
CN202066937U (en) On-line cable data acquisition terminal
CN108132455A (en) Global error check system based on combining unit
CN208141584U (en) A kind of energy measurement data online acquisition and monitoring system
CN104317978A (en) FPGA-based (field programmable gate array based) PCIE (peripheral component interface express) data collection device with self-checking correcting function and data collection method thereof
CN204287307U (en) Transformer, current detection circuit based on transformer
CN204758062U (en) Intelligent teletransmission gas of thing networking table
CN210444306U (en) Internet of things terminal based on NB-IOT
CN211427481U (en) Function detection device for electricity consumption information acquisition terminal
CN216312755U (en) But remote monitoring&#39;s vary voltage cabinet
CN105301340A (en) Instrument
CN206452412U (en) A kind of HART instrumental analysis platforms based on Internet of Things
CN207780218U (en) Detection device for electronic transformer
CN203786221U (en) Energy efficiency data acquisition terminal possessing two RS485 interfaces
CN211954239U (en) A system for testing metering data acquisition terminals
CN210534212U (en) Smart mobile phone oscilloscope signal node
CN110864728A (en) System and method for testing metering data acquisition terminal
CN202132170U (en) Measurement &amp; control and protection integrated device
CN209345136U (en) A kind of data transmission device analog quantity being converted into digital quantity

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: 20151125

Termination date: 20181101

CF01 Termination of patent right due to non-payment of annual fee