具有测偏载功能的嵌入式轨道衡称重系统
Embedded track scale weighing system with eccentric load function
技术领域Technical field
本发明涉及轨道衡称重系统,特别涉及一种具有测偏载功能的嵌入式轨道衡称重系统。The invention relates to a railway scale weighing system, in particular to an embedded railway scale weighing system with an eccentric load carrying function.
背景技术Background technique
目前,国内轨道衡计量系统,大多都使用称重传感器全并联方式,然后通过信号放大以及A/D转换,把传感器的信号传输给工控计算机,工控计算机根据一定的算法进行逻辑判别,从而得出重量。这种结构,主要缺点在于:At present, most of the domestic railway scale measurement systems use the load cell full parallel mode, and then the signal of the sensor is transmitted to the industrial computer through signal amplification and A/D conversion. The industrial computer performs logical identification according to a certain algorithm to obtain the weight. . The main disadvantages of this structure are:
(1)不能判别来车方向,不能进行方向差补偿;(1) The direction of the incoming vehicle cannot be discriminated, and the direction difference compensation cannot be performed;
(2)由于传感器全部并联,这样,当发生故障时,不能立即找出哪个传感器问题;(2) Since the sensors are all connected in parallel, in the event of a fault, it is not possible to find out which sensor problem immediately;
(3)不能实现偏载检测功能;(3) The eccentricity detection function cannot be implemented;
(4)由于靠工控计算机进行数据采集和计算,又是动态实时控制,对计算机实时性要求很高,而WINDOWS系统又是多任务系统。因此,占用CPU非常高,不易实现多任务处理。(4) Due to the data acquisition and calculation by the industrial computer, it is also dynamic real-time control, which requires high real-time computer, and the WINDOWS system is a multi-tasking system. Therefore, the CPU usage is very high and it is not easy to implement multitasking.
工控计算机做数据采集和处理工作时,系统资源是由WINDOWS系统统一调度的,应用程序不能直接控制系统资源,如果采用高级的数据处理算法,一方面对系统资源占用较多,增加系统负担,使系统运行速度变慢,另一方面,在有限的时间内操作系统不能提供足够的资源完成相应的数据处理工作。When the industrial computer performs data collection and processing, the system resources are uniformly scheduled by the WINDOWS system. The application program cannot directly control the system resources. If advanced data processing algorithms are used, on the one hand, the system resources are occupied more, and the system burden is increased. The system runs slower. On the other hand, the operating system cannot provide enough resources to complete the corresponding data processing work within a limited time.
发明内容Summary of the invention
本发明的目的在于,解决现有轨道衡计量系统的工控计算机同时进行数据采集、处理,和数据库管理和人机界面交互的工作,对系统资源占用较多的技术问题。The object of the present invention is to solve the technical problem that the industrial control computer of the existing railway scale measuring system simultaneously performs data collection and processing, and interacts with the database management and the human-machine interface, and occupies more system resources.
为达到上述目的,本发明提供一种具有测偏载功能的嵌入式轨道衡称重系统,包括多个传感器和信号处理系统;To achieve the above object, the present invention provides an embedded track scale weighing system having an eccentric load carrying function, comprising a plurality of sensors and a signal processing system;
所述多个传感器用于将被检测车辆的轮重信息转换为模拟信号;The plurality of sensors are configured to convert wheel weight information of the detected vehicle into an analog signal;
所述信号处理系统用于采集和处理所述多个传感器输出的轮重信息的模拟信号,包括信号调理模块,嵌入式数据采集模块,总线模块和微处理模块;The signal processing system is configured to collect and process analog signals of wheel weight information output by the plurality of sensors, including a signal conditioning module, an embedded data acquisition module, a bus module, and a micro processing module;
所述多个传感器分别连接到所述信号调理模块的多个输入端;The plurality of sensors are respectively connected to a plurality of inputs of the signal conditioning module;
所述信号调理模块的多个输出端分别与所述嵌入式数据采集模块的多路输入端连接;所述嵌入式数据采集模块用于将轮重信息的模拟信号转化为轮重信息的数字信号,并存储;The plurality of output ends of the signal conditioning module are respectively connected to the multiple input ends of the embedded data acquisition module; the embedded data acquisition module is configured to convert the analog signal of the wheel weight information into a digital signal of the wheel weight information And store;
所述嵌入式数据采集模块通过所述总线模块与所述微处理模块连接;The embedded data acquisition module is connected to the micro processing module through the bus module;
所述微处理模块用于对所述轮重信息的数字信号进行分析,计算结果。The micro processing module is configured to analyze the digital signal of the wheel weight information and calculate a result.
优选地,所述嵌入式数据采集模块包括多路选择模块,通道选择控制模块,逻辑控制模块,时钟发生模块,模数转换模块和存储模块;Preferably, the embedded data acquisition module comprises a multiple selection module, a channel selection control module, a logic control module, a clock generation module, an analog to digital conversion module and a storage module;
所述多路选择模块的多路输入端与所述输入信号调理模块的多路输出端分别连接;The multiple input ends of the multiple selection module are respectively connected to the multiple output ends of the input signal conditioning module;
所述通道选择控制模块用于根据所述传感器数目,设定数据采集通道的通道范围,输出一个传感器对应的地址信号至所述多路选择模块;The channel selection control module is configured to set a channel range of the data collection channel according to the number of the sensors, and output an address signal corresponding to the sensor to the multiple selection module;
所述多路选择模块用于根据所述地址信号选通所述一个传感器,将所述一个传感器采集的轮重信息模拟信号传输给所述模数转换模块;The multiplex selection module is configured to strobe the one sensor according to the address signal, and transmit the wheel weight information analog signal collected by the one sensor to the analog to digital conversion module;
所述模数转换模块用于将所述一个传感器采集的轮重信息模拟信号转换为数字信号,传输给所述存储模块存储;The analog-to-digital conversion module is configured to convert a wheel weight information analog signal collected by the one sensor into a digital signal, and transmit the data to the storage module for storage;
所述时钟发生模块用于通过逻辑控制模块产生多个时钟信号;The clock generation module is configured to generate a plurality of clock signals by using a logic control module;
所述逻辑控制模块用于提供所述多路选择模块,通道选择控制模块,模数转换模块以及存储模块所需要的状态和控制时序逻辑,控制所述多路选择模块和模数转换模块进行数据采集,并提供所述存储模块的接口时序,将所述多个传感器采集的轮重信息的数字信号的存储到所述存储模块中。The logic control module is configured to provide the multi-path selection module, the channel selection control module, the analog-to-digital conversion module, and the state and control sequence logic required by the storage module, and control the multi-path selection module and the analog-to-digital conversion module to perform data Collecting and providing an interface timing of the storage module, and storing the digital signal of the wheel weight information collected by the plurality of sensors into the storage module.
本发明的有益效果在于,把信号实时采集、处理部分与上位机的数据库管理和人机界面部分分离,提高采样、处理部分程序的可靠性,而不增加上位机的负担。使用PC104体系,把有实时性要求的信号采集工作由嵌入式数据采集模块独立完成,保证可靠连续的采样,满足实时性要求。本发明具有测偏载功能的嵌入式轨道衡称重系统能够独立处理数据运算工作,可以提高数据采集和处理过程的可控性和可靠性。The invention has the beneficial effects that the real-time data acquisition and processing part is separated from the database management and the human-machine interface part of the upper computer, thereby improving the reliability of sampling and processing part of the program without increasing the burden on the upper computer. Using the PC104 system, the signal acquisition work with real-time requirements is independently completed by the embedded data acquisition module, ensuring reliable and continuous sampling to meet real-time requirements. The embedded track scale weighing system with the function of measuring the partial load can independently process the data calculation work, and can improve the controllability and reliability of the data acquisition and processing process.
本发明可共用现有的称重系统的机械设备,在原有的称重系统的机械设备不变的情况下,仅仅将原有接线盒中传感器的并联连接方式改变为独立接入,即可完成系统改装,进行车辆超偏载判断。The invention can share the mechanical equipment of the existing weighing system. In the case that the mechanical equipment of the original weighing system is unchanged, only the parallel connection mode of the sensors in the original junction box can be changed to independent access, and the completion can be completed. The system is modified to judge the vehicle's over-eccentric load.
附图说明DRAWINGS
图1所示为本发明实施例一具有测偏载功能的嵌入式轨道衡称重系统的结构示意图;1 is a schematic structural view of an embedded track scale weighing system with an offset load function according to an embodiment of the present invention;
图2所示为本发明实施例二嵌入式数据采集模块的结构示意图;2 is a schematic structural diagram of an embedded data collection module according to Embodiment 2 of the present invention;
图3所示为本发明中断控制方式时的工作流程;Figure 3 shows the workflow of the interrupt control mode of the present invention;
图4所示为本发明查询方式时的工作流程;Figure 4 shows the workflow of the query mode of the present invention;
图5所示为本发明实施例三嵌入式数据采集模块的结构示意图;FIG. 5 is a schematic structural diagram of an embedded data acquisition module according to Embodiment 3 of the present invention; FIG.
图6所示为本发明实施例四嵌入式数据采集模块的结构示意图。FIG. 6 is a schematic structural diagram of an embedded data acquisition module according to Embodiment 4 of the present invention.
其中:among them:
1-钢轨;11~16-传感器;2-信号处理系统;21-信号调理模块;22-嵌入式数据采集模块;221-多路选择模块;222-通道选择控制模块;223-逻辑控制模块;2231-采样数据存取控制模块;2232-中断控制模块;224-时钟发生模块;225-模数转换模块;226-存储模块;23-总线模块;24-微处理模块;25-电源系统;301~310步骤;401~410步骤;501~503隔离电路模块;504-低通滤波模块;601~数字量输入输出模块。1-rail; 11~16-sensor; 2-signal processing system; 21-signal conditioning module; 22-embedded data acquisition module; 221-multiplex selection module; 222-channel selection control module; 223-logic control module; 2231-Sampling data access control module; 2223-interrupt control module; 224-clock generation module; 225-analog-to-digital conversion module; 226-storage module; 23-bus module; 24-microprocessing module; 25-power system; ~310 steps; 401~410 steps; 501~503 isolation circuit modules; 504-low pass filter modules; 601~ digital input and output modules.
具体实施方式detailed description
以下实施例用于说明本发明,但不用来限制本发明的范围。The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
实施例一 Embodiment 1
实施例一用于说明本发明应用于不断轨称重时的结构。 Embodiment 1 is used to explain the structure in which the present invention is applied to continuous rail weighing.
请参照图1所示,为本发明具有测偏载功能的嵌入式轨道衡称重系统的结构示意图,其包括:第一传感器11,第二传感器12,第三传感器13,第四传感器14,第五传感器15,第六传感器16分别设置在钢轨1下部,并与钢轨1充分接触,将被检测车辆的轮重信息转换为模拟信号,以及信号处理系统2,用于采集和处理所述多个传感器输出的模拟信号。本实施例中共设置了12只传感器,优选地,也可设置16只传感器。传感器的数目并不限制本发明的保护范围。Please refer to FIG. 1 , which is a schematic structural diagram of an embedded railway scale weighing system with an eccentric load function according to the present invention, which includes: a first sensor 11 , a second sensor 12 , a third sensor 13 , and a fourth sensor 14 . The five sensors 15, the sixth sensor 16 are respectively disposed at the lower portion of the rail 1 and are in full contact with the rail 1, converting the wheel weight information of the detected vehicle into an analog signal, and the signal processing system 2 for collecting and processing the plurality of The analog signal output by the sensor. A total of 12 sensors are provided in this embodiment, and preferably, only 16 sensors can be provided. The number of sensors does not limit the scope of protection of the present invention.
所述多只传感器可以为等间距设置的压力传感器或者剪力传感器,例如,相邻的两组压力传感器中心距离为760mm,相邻的两组剪力传感器中心距离为1520mm,在另外一根钢轨上的相应位置也安装同样的传感器。上述的安装方式仅仅说明本实施例的一种应用情况,并不限制本发明的保护范围。The plurality of sensors may be equal-distance pressure sensors or shear sensors. For example, the adjacent two sets of pressure sensors have a center distance of 760 mm, and the adjacent two sets of shear sensors have a center distance of 1520 mm on the other rail. The same sensor is also installed at the corresponding position. The above installation manner only illustrates one application of the embodiment, and does not limit the scope of protection of the present invention.
或者,本发明也可以应用于传统的断轨称重方式,在这种情况下,所述的多只传感器安装在轨道底部的基础框架结构中,通过机械称重台面感知车辆的轮重信息。Alternatively, the present invention can also be applied to a conventional track-breaking weighing method, in which case the plurality of sensors are mounted in a base frame structure at the bottom of the track, and the wheel weight information of the vehicle is sensed by a mechanical weighing table.
如图1所示,所述的信号处理系统2由信号调理模块21,嵌入式数据采集模块22,总线模块23,微处理模块24以及电源系统25组成。As shown in FIG. 1, the signal processing system 2 is composed of a signal conditioning module 21, an embedded data acquisition module 22, a bus module 23, a micro processing module 24, and a power supply system 25.
其中,所述多只传感器采集到的多个模拟信号分别连接到信号调理模块21的多个输入端,分别输入信号调理模块21单独进行放大、滤波,使用低通滤波器滤除信号中的高频干扰信号。在实施例一中,信号调理模块21的滤波和放大电路选用的是进口的低温漂、低噪声、高可靠性、高集成度的AD芯片,具有共模抑制比高、精度高的优点。滤波器采用有源低通滤波电路加端口元件低通滤波等三级滤波,用于消除多只传感器输出信号中包含的高频干扰成分,因此,抗干扰能力极强,解决了单组信号传输易受影响的问题,同时加装有零点调整和增益调整的电位器,以确保每组信号性能的一致性。The plurality of analog signals collected by the plurality of sensors are respectively connected to the plurality of input ends of the signal conditioning module 21, and the input signal conditioning module 21 separately performs amplification and filtering, and filters the high in the signal by using a low-pass filter. Frequency interference signal. In the first embodiment, the filtering and amplifying circuit of the signal conditioning module 21 selects an imported low-temperature drift, low-noise, high-reliability, high-integration AD chip, which has the advantages of high common mode rejection ratio and high precision. The filter adopts three-stage filtering such as active low-pass filter circuit and low-pass filtering of port components, which is used to eliminate high-frequency interference components contained in the output signals of multiple sensors. Therefore, the anti-interference ability is extremely strong, and the single-group signal transmission is solved. A problem that is susceptible, plus a potentiometer with zero adjustment and gain adjustment to ensure consistent performance across each group of signals.
输入信号调理模块21的多路输出端分别与嵌入式数据采集模块22的多路输入端连接。嵌入式数据采集模块22将输入的模拟信号转化为数字信号,并进行存储。嵌入式数据采集模块22通过总线模块23与微处理模块24连接。The multiple outputs of the input signal conditioning module 21 are respectively coupled to the multiple inputs of the embedded data acquisition module 22. The embedded data acquisition module 22 converts the input analog signal into a digital signal and stores it. The embedded data acquisition module 22 is coupled to the microprocessor module 24 via a bus module 23.
总线模块23可以为PC104总线、PCI总线、CAN总线和RS232总线其中之一。The bus module 23 can be one of a PC104 bus, a PCI bus, a CAN bus, and an RS232 bus.
电源系统25分别为信号调理模块21,嵌入式数据采集模块22,总线模块23和微处理模块24提供电力。The power system 25 provides power to the signal conditioning module 21, the embedded data acquisition module 22, the bus module 23, and the microprocessor module 24, respectively.
实施例一中的信号采集系统2,还可设置一人机交互界面(图1中未示出),用于监控系统运行状况,显示系统运行参数和采集的数据。The signal acquisition system 2 in the first embodiment can also be provided with a human-computer interaction interface (not shown in FIG. 1) for monitoring system operation status, displaying system operation parameters and collected data.
实施例一中的信号采集系统2,还可设置以太网数据接口(图1中未示出),通过以太网与上位机连接,微处理模块24与上位机进行通讯。微处理模块24输出序号、总重、车速、前后偏载、左右偏载的结果上传给上位机,把信号实时采集、处理部分与上位机的数据库管理和人机界面部分分离,提高采样、处理部分程序的可靠性,而不增加上位机的负担。The signal acquisition system 2 in the first embodiment can also be provided with an Ethernet data interface (not shown in FIG. 1), connected to the upper computer through the Ethernet, and the micro processing module 24 communicates with the upper computer. The micro-processing module 24 outputs the serial number, total weight, vehicle speed, front-to-back partial load, and left-right partial load results to the upper computer, and separates the real-time signal acquisition and processing part from the database management and human-machine interface of the upper computer to improve sampling and processing. The reliability of some programs without increasing the burden on the host computer.
实施例二 Embodiment 2
实施例二用来说明本发明中嵌入式数据采集模块22的一种实施方式。 Embodiment 2 is used to illustrate an embodiment of the embedded data acquisition module 22 of the present invention.
如图2所示,嵌入式数据采集模块22由多路选择模块221,通道选择控制模块222,逻辑控制模块223,时钟发生模块224,模数转换模块225和存储模块226构成。As shown in FIG. 2, the embedded data acquisition module 22 is composed of a multiple selection module 221, a channel selection control module 222, a logic control module 223, a clock generation module 224, an analog to digital conversion module 225, and a storage module 226.
其中,时钟发生模块224与逻辑控制模块223连接。时钟发生模块224通过逻辑控制模块223产生多个时钟信号,为模数转换模块225、通道选择控制模块222、存储模块226提供基准时钟信号,保证各个模块的时钟同步。The clock generation module 224 is connected to the logic control module 223. The clock generation module 224 generates a plurality of clock signals through the logic control module 223, and provides a reference clock signal to the analog-to-digital conversion module 225, the channel selection control module 222, and the storage module 226 to ensure clock synchronization of each module.
逻辑控制模块223提供多路选择模块221,通道选择控制模块222,模数转换模块225以及存储模块226所需要的各种状态和控制时序逻辑,包括采样速率、存储模块的使用分配、启动停止采样、传输数据、开启/禁止中断等,控制多路选择模块221和模数转换模块225进行数据采集,并提供对存储模块226的接口时序,实现转换数据的存储。The logic control module 223 provides various state and control sequence logics required by the multiple selection module 221, the channel selection control module 222, the analog to digital conversion module 225, and the storage module 226, including the sampling rate, the usage allocation of the storage module, and the start stop sampling. And transmitting data, enabling/disabling interrupts, etc., controlling the multiplex selection module 221 and the analog-to-digital conversion module 225 to perform data acquisition, and providing interface timing to the storage module 226 to implement storage of the converted data.
逻辑控制模块223中包括采样数据存储控制模块2231和中断控制模块2232。其中,采样数据存储控制模块2231用于控制模数转换模块225进行数据转换和存储;中断控制模块2232用于对微处理模块24产生中断信号,将存储模块226内存储的数字信息传输到微处理模块24中。The logic control module 223 includes a sample data storage control module 2231 and an interrupt control module 2232. The sampling data storage control module 2231 is configured to control the analog-to-digital conversion module 225 for data conversion and storage; the interrupt control module 2232 is configured to generate an interrupt signal to the micro processing module 24, and transmit the digital information stored in the storage module 226 to the micro processing. In module 24.
多路选择模块221的多路输入端与输入信号调理模块21的多路输出端分别连接。The multiple input terminals of the multiple selection module 221 are connected to the multiple output terminals of the input signal conditioning module 21, respectively.
通道选择控制模块222根据实际安装的传感器数目,设定数据采集通道的通道范围。每一数据采集通道对应一只传感器。在实施例二中,数据采集通道为12路,优选的,相应于传感器的设置,数据采集通道可为16路。The channel selection control module 222 sets the channel range of the data acquisition channel according to the number of sensors actually installed. Each data acquisition channel corresponds to one sensor. In the second embodiment, the data acquisition channel is 12 channels. Preferably, the data acquisition channel can be 16 channels corresponding to the setting of the sensor.
通道选择控制模块222在逻辑控制模块223的控制下,输出地址信号至多路选择模块221,用于选择来自对应地址信号的某个传感器的信息。通道选择控制模块222还为存储模块226提供各组传感器相应的地址信号,以便存储模数转换结果,使存储模块226中的每组数据信号与各组传感器一一对应。The channel selection control module 222 outputs an address signal to the demultiplexing module 221 under the control of the logic control module 223 for selecting information from a certain sensor of the corresponding address signal. The channel selection control module 222 also provides the storage module 226 with corresponding address signals of each group of sensors to store the analog-to-digital conversion result, so that each set of data signals in the storage module 226 is in one-to-one correspondence with each group of sensors.
多路选择模块221根据通道选择控制模块222输入的二进制地址信号选择输出多路信号中的某一路。The multiplex selection module 221 selects one of the output multiplex signals according to the binary address signal input by the channel selection control module 222.
模数转换模块225完成对输入模拟信号的采样,量化为数字信号,并发送转换完成标志给逻辑控制模块223。采样数据存储控制模块2231发送读取信号给模数转换模块225,将转换完成的数字信号存储在存储模块226中。至此,存储模块226中存储来自于某一组传感器的数字信号,以及该组传感器对应的地址信号。The analog to digital conversion module 225 performs sampling of the input analog signal, quantizes it into a digital signal, and transmits a conversion completion flag to the logic control module 223. The sampled data storage control module 2231 sends a read signal to the analog to digital conversion module 225, and stores the converted digital signal in the storage module 226. So far, the storage module 226 stores digital signals from a certain set of sensors, and address signals corresponding to the set of sensors.
当采集并存储在存储模块226中的数字信号达到一定数量时,为避免存储模块226溢出,微处理模块24将读取存储模块226中的数字信号,并将存储模块226清空。有两种方式实现:中断控制方式和查询方式。To prevent the storage module 226 from overflowing when the digital signals collected and stored in the storage module 226 reach a certain amount, the micro-processing module 24 will read the digital signals in the storage module 226 and empty the storage module 226. There are two ways to achieve this: interrupt control mode and query mode.
其中,中断控制方式如下:Among them, the interrupt control method is as follows:
存储模块226根据自身的存储状态向逻辑控制模块223发送读取请求信号。The storage module 226 sends a read request signal to the logic control module 223 according to its own storage state.
逻辑控制模块223根据存储模块226的读取请求信号,向总线模块23发出中断信号,微处理模块24调用中断程序,逻辑控制模块223通过总线模块23将存储模块226中的数据传输到微处理模块24,完成存储模块226中数据的下载,并在后续程序中完成数据的处理与分析,计算车重,判断车型,判断来车方向,以及判断列车是否超载、偏载。The logic control module 223 sends an interrupt signal to the bus module 23 according to the read request signal of the storage module 226, the micro-processing module 24 calls the interrupt program, and the logic control module 223 transmits the data in the storage module 226 to the micro-processing module through the bus module 23. 24, complete the download of the data in the storage module 226, and complete the processing and analysis of the data in the subsequent procedures, calculate the weight of the vehicle, determine the vehicle type, determine the direction of the incoming vehicle, and determine whether the train is overloaded or eccentric.
其中,查询方式如下:Among them, the query method is as follows:
微处理模块24通过总线模块23向逻辑控制模块223发送查询命令,将查询状态位置1。逻辑控制模块223根据查询命令读取存储模块226中的数字信息,通过总线模块23传送给微处理模块24,微处理模块24在后续程序中完成数据的处理与分析,计算车重,判断车型,判断来车方向,以及判断列车是否超载、偏载。The microprocessor module 24 sends a query command to the logic control module 223 via the bus module 23, setting the query status to one. The logic control module 223 reads the digital information in the storage module 226 according to the query command, and transmits the digital information to the micro processing module 24 through the bus module 23. The micro processing module 24 completes the processing and analysis of the data in the subsequent program, calculates the vehicle weight, and determines the vehicle type. Determine the direction of the car, and determine whether the train is overloaded or eccentric.
当车辆通过本发明具有测偏载功能的嵌入式轨道衡称重系统时,被检测车辆的轮重(转向架)信息通过多只传感器转换为成比例的模拟电压信号,传送到信号调理模块21的对应通道,对信号放大、滤波。由嵌入式数据采集模块22完成A/D转换,数据采集和存储,以及数据上传,上传数据的接收和保存由系统外部的上位机(服务器)完成。When the vehicle passes the embedded track scale weighing system with the eccentric load function of the present invention, the wheel weight (bogie) information of the detected vehicle is converted into a proportional analog voltage signal by a plurality of sensors, and transmitted to the signal conditioning module 21 Corresponding channels, the signal is amplified and filtered. A/D conversion, data acquisition and storage, and data uploading are performed by the embedded data acquisition module 22, and the receiving and saving of the uploaded data is performed by a host computer (server) external to the system.
优选地,在实施例二中模数转换模块225为精度12位,采样率为100KHz。Preferably, in the second embodiment, the analog to digital conversion module 225 has an accuracy of 12 bits and a sampling rate of 100 kHz.
优选地,在实施例二中时钟发生模块224为40MHz晶振。Preferably, in the second embodiment, the clock generation module 224 is a 40 MHz crystal oscillator.
优选地,在实施例二中总线模块23为PC104总线。Preferably, in the second embodiment, the bus module 23 is a PC104 bus.
优选地,在实施例二中存储模块226使用FIFO(First In First
Out先进先出)存储器来实现。利用FIFO存储器的状态标志信号进行数据传输控制。当FIFO存储器中存储的数据为半满状态时,向逻辑控制模块223发送读取请求信号。Preferably, in the second embodiment, the storage module 226 uses FIFO (First In First)
Out first-in first-out) memory to achieve. Data transfer control is performed using the status flag signal of the FIFO memory. When the data stored in the FIFO memory is in a half full state, a read request signal is sent to the logic control module 223.
优选地,在实施例二中逻辑控制模块223由FPGA(Field Programmable Gate
Array,现场可编程门阵列)实现,FPGA做为单独的控制执行模块,通过分频为其他工作模块提供时钟,同时也控制其他模块连接的各部分硬件电路的正常工作。通过编写相应的VHDL(VHSIC
Hardware Description
Language,极高速集成电路硬件描述语言)代码,生成相应的操作电路,实现对信号的锁存、判断和处理以及对各种命令信号的执行和输出信号的控制。Preferably, in the second embodiment, the logic control module 223 is composed of an FPGA (Field Programmable Gate).
Array, Field Programmable Gate Array), FPGA as a separate control execution module, provides clocks for other working modules by dividing the frequency, and also controls the normal operation of all parts of the hardware circuits connected by other modules. By writing the corresponding VHDL (VHSIC
Hardware Description
Language, the very high-speed integrated circuit hardware description language) code, generates the corresponding operation circuit, realizes the latching, judgment and processing of the signal, and the execution of various command signals and the control of the output signal.
本发明采用微处理模块和FPGA的架构实现高速度、高精度、低成本的数据采集方案。多路模拟信号经过信号调理模块21和多路选择模块221后,输入模数转换模块225,模数转换模块225在FPGA的控制下,完成A/D(模/数)转换,并将转换的结果送入FIFO(First
In First
Out先进先出)存储器。微处理模块用于进行系统控制和数据处理,FPGA用于控制数据采集和数据缓存。通过模数转换模块225将输入的模拟信号转换为数字信号,经过FPGA控制的FIFO存储器进行缓存,由微处理模块以中断或查询的方式通过PC104总线接收采集到的数据,微处理模块再对采集的数据进行处理和分析。把信号实时采集、处理部分与上位机的数据库管理和人机界面部分分离,提高采样、处理部分程序的可靠性,而不增加上位机的负担。The invention adopts the architecture of the micro processing module and the FPGA to realize a high speed, high precision and low cost data acquisition scheme. After the multi-channel analog signal passes through the signal conditioning module 21 and the multiplex selection module 221, the analog-to-digital conversion module 225 is input, and the analog-to-digital conversion module 225 performs A/D (Analog/Digital) conversion under the control of the FPGA, and converts the converted The result is sent to the FIFO (First
In First
Out FIFO) memory. The microprocessor module is used for system control and data processing, and the FPGA is used to control data acquisition and data buffering. The input analog signal is converted into a digital signal by the analog-to-digital conversion module 225, and is buffered by the FIFO memory controlled by the FPGA, and the collected data is received by the micro processing module through the PC104 bus in an interrupt or query manner, and the micro processing module collects the data again. The data is processed and analyzed. The real-time data acquisition and processing part is separated from the database management and human-machine interface of the host computer to improve the reliability of sampling and processing part of the program without increasing the burden on the host computer.
图3和图4所示为根据实施例二的本发明具有测偏载功能的嵌入式轨道衡称重系统的工作流程。FIG. 3 and FIG. 4 are diagrams showing the workflow of the embedded track scale weighing system with the eccentric load function according to the second embodiment of the present invention.
图3为微处理模块24设定为中断控制方式时的工作流程。包括步骤:FIG. 3 is a workflow diagram when the microprocessor module 24 is set to the interrupt control mode. Including steps:
步骤301,系统上电,微处理模块24通过总线模块23启动系统。In step 301, the system is powered on, and the microprocessor module 24 starts the system through the bus module 23.
步骤302,系统初始化,逻辑控制模块223设置采样频率,为存储模块226分配使用空间,设置通道选择控制模块222的通道范围。In step 302, the system is initialized, and the logic control module 223 sets the sampling frequency, allocates the use space to the storage module 226, and sets the channel range of the channel selection control module 222.
步骤303,微处理模块24设置中断处理函数,并保存中断向量。In step 303, the microprocessing module 24 sets the interrupt handling function and saves the interrupt vector.
步骤304,微处理模块24启动数据采集模块22。In step 304, the microprocessing module 24 activates the data acquisition module 22.
步骤305,通道选择控制模块222进行通道选择,选择某一传感器的地址信号至多路选择模块221。 Step 305, the channel selection control module 222 performs channel selection, and selects an address signal of a certain sensor to the multiplexing module 221 .
步骤306,逻辑控制模块223启动数据采集模块22,将采集到的该传感器的数字信号存储在存储模块226中,其中存储模块226中存储来自于该传感器的数字信号,以及该传感器对应的地址信号。 Step 306, the logic control module 223 starts the data acquisition module 22, and stores the collected digital signal of the sensor in the storage module 226, wherein the storage module 226 stores the digital signal from the sensor, and the address signal corresponding to the sensor. .
步骤307,逻辑控制模块223判断是否变换数据采集通道。如果是,执行步骤305。如果否,执行步骤308。In step 307, the logic control module 223 determines whether to convert the data acquisition channel. If yes, go to step 305. If no, go to step 308.
步骤308,存储模块226根据自身的存储状态,向逻辑控制模块223发送读取请求,逻辑控制模块223产生中断信号通知微处理模块24,微处理模块24调用中断程序,存储模块226中的数据经由数据传输模块传输至微处理模块24。 Step 308, the storage module 226 sends a read request to the logic control module 223 according to its storage state, the logic control module 223 generates an interrupt signal to notify the micro-processing module 24, the micro-processing module 24 calls the interrupt program, and the data in the storage module 226 is The data transmission module is transmitted to the microprocessing module 24.
步骤309,微处理模块24根据外部命令判断是否继续检测,如果是,则执行步骤305;如果否,则执行步骤310,结束。In step 309, the micro processing module 24 determines whether to continue detecting according to an external command. If yes, step 305 is performed; if not, step 310 is executed to end.
图4为微处理模块24设定为查询方式时的工作流程。包括步骤:FIG. 4 is a workflow diagram when the micro processing module 24 is set to the query mode. Including steps:
步骤401,系统上电,微处理模块24通过总线模块23启动系统。In step 401, the system is powered on, and the microprocessor module 24 starts the system through the bus module 23.
步骤402,系统初始化,逻辑控制模块223设置采样频率,为存储模块226分配使用空间,设置通道选择控制模块222的通道范围。In step 402, the system is initialized, and the logic control module 223 sets the sampling frequency, allocates the use space to the storage module 226, and sets the channel range of the channel selection control module 222.
步骤403,微处理模块24启动数据采集模块22。In step 403, the microprocessor module 24 activates the data acquisition module 22.
步骤404,通道选择控制模块222进行通道选择,选择某一传感器的地址信号至多路选择模块221。 Step 404, the channel selection control module 222 performs channel selection, and selects an address signal of a certain sensor to the multiplexing module 221 .
步骤405,将采集到的某一传感器的数字信号存储在存储模块226中。Step 405: Store the collected digital signal of a certain sensor in the storage module 226.
步骤406,逻辑控制模块223判断是否变换数据采集通道。如果是,执行步骤404。如果否,执行步骤407。In step 406, the logic control module 223 determines whether to convert the data acquisition channel. If yes, go to step 404. If no, go to step 407.
步骤407,逻辑控制模块223接收微处理模块24发出的查询命令。In step 407, the logic control module 223 receives the query command issued by the micro processing module 24.
步骤408,逻辑控制模块223读取存储模块226,存储模块226中的数据经由数据传输模块传输至微处理模块24。 Step 408, the logic control module 223 reads the storage module 226, and the data in the storage module 226 is transmitted to the micro processing module 24 via the data transmission module.
步骤409,微处理模块24根据外部命令判断是否继续检测,如果是,则执行步骤403;如果否,则执行步骤410,结束。In step 409, the micro processing module 24 determines whether to continue detecting according to an external command. If yes, step 403 is performed; if not, step 410 is performed, and the process ends.
微处理模块24获取来自于传感器的检测信号后,根据多只传感器对应的地址信息识别各个车轮的重量。After acquiring the detection signal from the sensor, the micro processing module 24 identifies the weight of each wheel based on the address information corresponding to the plurality of sensors.
分别将列车每节车厢的前转向架下的车轮重量相加,将列车每节车厢的后转向架下的车轮重量相加,然后求差,重量之差超过10吨就为前后轮对偏载。其次,计算每节车厢左侧所有车轮重量LW和右侧车轮所有重量RW,根据重量LW和RW,以及车轮与车厢的中截面的距离,计算货物的重心位置DW,如果重心位置DW与车厢中截面的距离大于100mm,则认定为左右轮对偏载。再次,计算每节车厢所有轮对的重量之和,超过84吨即为超重。The weights of the wheels under the front bogie of each train are added, and the weights of the wheels under the rear bogie of each train are added, and then the difference is obtained. The difference between the weights exceeds 10 tons, which is the front and rear wheel misalignment. . Secondly, calculate the weight LW of all the wheels on the left side of each car and all the weights RW of the right wheel. According to the weights LW and RW, and the distance between the wheel and the middle section of the car, calculate the center of gravity position DW of the cargo, if the center of gravity position DW and the car If the distance of the section is greater than 100mm, it is considered to be the left and right wheelsets. Again, calculate the sum of the weights of all the wheels of each car, over 84 tons is overweight.
当车辆通过检测系统时,每个传感器的受力大小是不同的,由于每个传感器单独接入,可根据多个传感器采集到的车轮重量的变化可判断来车方向。When the vehicle passes the detection system, the force of each sensor is different. Since each sensor is separately connected, the direction of the vehicle can be judged according to the change of the wheel weight collected by the plurality of sensors.
实施例三Embodiment 3
实施例三用来说明本发明中嵌入式数据采集模块22的又一种实施方式。Embodiment 3 is used to illustrate still another embodiment of the embedded data acquisition module 22 of the present invention.
与实施例二不同的是,实施例三中增加了隔离电路模块。Different from the second embodiment, the isolation circuit module is added in the third embodiment.
隔离电路模块可以使用变压器、光电或电容耦合等方式在不同模块之间传递信号,避免直接的电气或物理连接。由于具有测偏载功能的嵌入式轨道衡称重系统所监测的设备可能出现高压瞬变现象,例如雷击,使用隔离电路模块将多个传感器信号与嵌入式数据采集模块22隔离出来,能够保证数据采集模块的安全。另外,具有测偏载功能的嵌入式轨道衡称重系统工作现场的环境会产生很多干扰,如空间电磁干扰等,采用隔离电路模块可以消除这些干扰的影响。Isolation circuit modules can transfer signals between different modules using transformers, optoelectronic or capacitive coupling to avoid direct electrical or physical connections. Since the equipment monitored by the embedded track scale weighing system with the eccentric load function may exhibit high voltage transients, such as lightning strikes, the isolation circuit module is used to isolate multiple sensor signals from the embedded data acquisition module 22 to ensure data acquisition. The security of the module. In addition, the environment of the embedded track scale weighing system with offset load function can generate a lot of interference, such as space electromagnetic interference, etc. The isolation circuit module can eliminate the influence of these interferences.
如图5所示,嵌入式数据采集模块22中设置多个隔离电路模块。其中,多路选择模块221和通道选择控制模块222之间设置隔离电路模块501。模数转换模块225和逻辑控制模块223之间设置隔离电路模块502,模数转换模块225和存储模块226之间设置隔离电路模块503。As shown in FIG. 5, a plurality of isolation circuit modules are disposed in the embedded data acquisition module 22. The isolation circuit module 501 is disposed between the multiple selection module 221 and the channel selection control module 222. An isolation circuit module 502 is disposed between the analog-to-digital conversion module 225 and the logic control module 223, and an isolation circuit module 503 is disposed between the analog-to-digital conversion module 225 and the storage module 226.
优选地,隔离电路模块使用光电耦合器件。光电耦合器件能可靠的实现信号的隔离,并容易构成多种功能状态,如信号隔离、隔离驱动、远距离传送等。Preferably, the isolation circuit module uses a photocoupler device. Photoelectric coupling devices can reliably isolate signals and easily form multiple functional states, such as signal isolation, isolated driving, and long-distance transmission.
优选地,在多路选择模块221和模数转换模块225之间设置低通滤波模块504,用于滤除信号中的高频分量,去除检测到的一些不确定信号对有用信号造成的干扰,并抑制或消除多路信号混叠对数据采集的影响。低通滤波模块504可以采用RC低通滤波器。Preferably, a low-pass filtering module 504 is disposed between the multiplexing module 221 and the analog-to-digital conversion module 225 for filtering high-frequency components in the signal to remove interference caused by some of the detected uncertain signals to the useful signal. And suppress or eliminate the impact of multi-path aliasing on data acquisition. The low pass filtering module 504 can employ an RC low pass filter.
实施例四Embodiment 4
实施例四用来说明本发明中嵌入式数据采集模块22的再一种实施方式。Embodiment 4 is used to illustrate still another embodiment of the embedded data acquisition module 22 of the present invention.
与实施例二不同的是,实施例四中增加了数字量输入输出模块601,数字量输入输出模块601连接至逻辑控制模块223,用于采集外部开关量信号,提供开关量的输入输出,给外接继电器和接近开关等预留辅助功能接口。Different from the second embodiment, the digital input/output module 601 is added to the fourth embodiment, and the digital input/output module 601 is connected to the logic control module 223 for collecting external switch signals and providing input and output of the switch quantity. Reserved auxiliary function interfaces such as external relays and proximity switches.
数字量输入输出模块601可连接安装在轨道上的接近开关,以控制外部继电器的输入输出,计算车辆的轴距,判断车型。The digital input/output module 601 can be connected to a proximity switch mounted on the track to control the input and output of the external relay, calculate the wheelbase of the vehicle, and determine the vehicle type.
工业实用性Industrial applicability
本发明把信号实时采集、处理部分与上位机的数据库管理和人机界面部分分离,提高采样、处理部分程序的可靠性,而不增加上位机的负担。使用PC104体系,把有实时性要求的信号采集工作由嵌入式数据采集模块独立完成,保证可靠连续的采样,满足实时性要求。本发明具有测偏载功能的嵌入式轨道衡称重系统能够独立处理数据运算工作,可以提高数据采集和处理过程的可控性和可靠性,具有工业实用性。The invention separates the real-time signal acquisition and processing part from the database management and the human-machine interface part of the upper computer, and improves the reliability of sampling and processing part of the program without increasing the burden of the upper computer. Using the PC104 system, the signal acquisition work with real-time requirements is independently completed by the embedded data acquisition module, ensuring reliable and continuous sampling to meet real-time requirements. The embedded track scale weighing system with the function of measuring the partial load can independently process the data calculation work, can improve the controllability and reliability of the data acquisition and processing process, and has industrial applicability.