The processing method of high-throughput torque measurement data based on Labview
Technical field
The present invention relates to TT&C system information technology field, in particular to a kind of high-throughput torque based on Labview
The processing method of measurement data.
Background technique
In the current informationization epoch, for high-throughput, the requirement of high accuracy measurement and control system is higher and higher.And for numerous
For relevant enterprise, the raising of observation and control technology is all urgent need, and the accuracy positioned, corresponding rapidity, high-throughput
Data transmission etc. all has far-reaching influence for the development of enterprise, and especially the development of China's modern industry is with greater need for new technique
Support.And the appearance of observation and control technology just meets the demand of people.By applying observation and control technology, work can not only be stepped up
Industry production efficiency improves a series of accuracy of fine measuring instruments, while also enriching the type of emerging technology and industry,
The fast development of China's industrial sector has been pushed to a certain extent.Under the background of made in China 2025, observation and control technology has
Greatly application and promotional value, need people to further investigate.
FPGA (Field-ProgrammableGateArray), i.e. field programmable gate array, be PAL, GAL,
The product further developed on the basis of the programming devices such as CPLD, as one of field specific integrated circuit (ASIC)
Semi-custom circuit and occur, not only solved the deficiency of custom circuit, but also to overcome original programming device gate circuit number limited
The shortcomings that.With the circuit design that hardware description language (Verilog or VHDL) is completed, simple synthesis and cloth can be passed through
Office, is quickly burned on FPGA and is tested, and is the technology mainstream of modern IC designs verifying.These editable elements can be by
For realizing some basic logic gates (such as AND, OR, XOR, NOT) or more more complicated combination function such as
Decoder or mathematical equation.Inside most of FPGA, also for example touched comprising memory cell in these editable elements
Send out device (Flip-flop) or other more complete block of memory.
Summary of the invention
It solves torque data the object of the present invention is to provide one kind and realizes high speed acquisition and data under Labview environment
The processing method of the high-throughput torque measurement data based on Labview of the problems such as high speed flow table.
For this purpose, technical solution of the present invention is as follows:
A kind of processing method of the high-throughput torque measurement data based on Labview, steps are as follows:
S1, the frequency signal for chronologically obtaining torque sensor transmission;
S2, the rising edge for reading the incoming frequency signal of torque sensor using high frequency clock in FPGA module, Zhi Daoda
To the data renewal time of setting, the count value of high frequency clock between first rising edge and the last one rising edge is obtained in terms of
The time between first rising edge and the last one rising edge is calculated, and obtains the number of rising edge, and then calculates torque biography
The actual output frequency of sensor;
S3, the frequency information being calculated by step S2 is uploaded to Real-Time real-time system by DMA-FIFO,
Frequency is scaled actual torque value by Real-Time real-time system and is stored.
Further, in step sl, frequency is built between FPGA module and torque sensor using NI6584 adapter
Rate signal differential channel, makes FPGA module receive differential frequency signal from torque sensor.In the step, in Labvi ew
It develops in environment, using differential signal acquisition frequency information, realizes the purpose for inhibiting common mode interference.
Further, frequency signal differential path is built method particularly includes: NI6584 adapter is inserted into FPGA
In the interface of module board, while the pin 4 of NI6584 adapter Single port and the pin 1 of torque sensor port being connected
It connects, and the pin of this Single port 5 is connect with the pin 4 of torque sensor.
Further, the specific implementation step of step S2 are as follows:
The onboard clock of S201, frequency multiplication FPGA module obtain high frequency clock;
S202, data collection cycle is determined;
S203, in data collection cycle, using high frequency clock identification torque sensor frequency signal rising edge, work as knowledge
Started counting after being clipped to first rising edge, until collection period terminates, then by searching for the last one rising edge when meter
Numerical value obtains the number for the rising edge that high frequency clock recognizes;
S204, count value obtained in step S203 is obtained acquiring used in several rising edges multiplied by high frequency clock cycles
Time, then the number that rising edge occurs is obtained into the corresponding frequency of frequency signal divided by the time used in several rising edges is acquired
Value, the i.e. actual frequency of torque sensor.
Wherein, in above-mentioned steps S202, data collection cycle is manually set according to data characteristics.In above-mentioned steps S204
Medium-high frequency clock cycle value is one week of high frequency clock that the onboard clock of FPGA module is obtained by the frequency multiplication step of step S203
The time of phase;In addition, reading rising edge number in specified period using high frequency clock, guarantee to consolidate again while acquisition precision
Fixed number according to transmission period.
Further, in step s3, frequency data are transmitted using DMA-FIFO, this is because DMA-FIFO is
The dual port buffer of one first in, first out, i.e., first data first entered in it are moved out of, and one of mouth is storage
The input port of device, another mouthful are the delivery outlets of memory, can realize: 1) cache to continuous data flow, are prevented
Only lose data when into machine and storage operation, 2) data put together and carry out can avoid frequent bus behaviour into machine and storage
Make, offloading the CPU, 3) allow system to carry out dma operation, improve the transmission speed of data;And then use Real-Time
Flow data in real-time system reading DMA-FIFO and the reason of frequency information is converted to torque information is, one is to make
Frequency data circulation is changed to torque data stream with Real-Time real-time system, it is higher compared to directly using host computer to have
Real-time, can guarantee that data flow is continually and steadily transmitted;Secondly, the store function of Real-Time real-time system is realized to torque
Data flow is individually stored into its disk, and when host computer needs to call torque data, Real-Time real-time system can will be turned round
Square data flow is transferred to host computer by way of network flow immediately.In addition, Real-Time real-time system also has good expansion
Malleability;It therefore, can by DMA-FIFO transmission frequency information to Real-Time real-time system in Labview exploitation environment
Reasonable distribution hardware resource makes hardware in system play respective advantage.
Compared with prior art, the processing method of the high-throughput torque measurement data based on Labview has as follows
The utility model has the advantages that
1) this method can by adjusting data collection cycle at any time, facilitate the alignment for carrying out multichannel data with synchronize adopt
Collection;
2) this method will not lose a large amount of countings because of the change by measured frequency, cause the change of final resolution ratio, make
The resolution ratio of data is constant in measurement range;
3) this method can be realized high-speed transfer torque data, and 1 second volume of transmitted data can achieve 25000;
4) this method makes frequency data stream high speed, lossless using Real-Time real-time system by cooperating with FPGA
Be transmitted to Real-Time real-time system carry out torque data stream high-speed transitions and storage, realization respectively exert advantages of oneself
The characteristics of, optimize system resource.
Detailed description of the invention
Fig. 1 is the flow chart of the processing method of the high-throughput torque measurement data of the invention based on Labview;
Fig. 2 is the mode of connection schematic diagram of the NI6584 adapter and torque sensor in the embodiment of the present invention.
Specific embodiment
With reference to the accompanying drawing and specific embodiment the present invention is described further, but following embodiments are absolutely not to this hair
It is bright to have any restrictions.
As shown in Figure 1, being somebody's turn to do the specific processing step of the processing method of the high-throughput torque measurement data based on Labview
It is as follows:
S1, the frequency signal for chronologically obtaining torque sensor transmission;
S2, the rising edge for being read the incoming frequency signal of torque sensor using high frequency clock in FPGA, are set until reaching
Fixed data renewal time, obtain the count value of high frequency clock between first rising edge and the last one rising edge to obtain on
The number on edge is risen, and then calculates the actual output frequency of torque sensor;
S3, the frequency information being calculated by step S2 is uploaded to Real-Time system by DMA-FIFO, by
Frequency is scaled actual torque value and stored by Real-Time system.
Specifically, this method is controlled by sequentially connected torque sensor, NI6584 adapter, FPGA board, NI8840
Device and host computer are realized;Wherein, equipped with Real-Time real-time system on NI8840 controller.
Torque sensor is mounted in shafting, and output signal is frequency signal, can detect size of the axis by torque.Tool
For body, the torque measurement of torque sensor uses strain principles of electrical measurement, i.e., when strain axis is influenced to generate small shape by torsion
After change, be pasted onto strain gauge resistance value on strain axis and corresponding variation occur, by the Strain Meter Set with same strain characteristic at
Measuring bridge, the variation that the variation of strain resistor can be changed into voltage signal measures, then by torque information with frequency
The form of signal is sent to signal receiving end.Frequency is higher, indicates that the torque value measured is bigger, and frequency is lower, indicates to measure
Torque value is smaller.
In the method, signal receiving end, that is, FPGA module uses fpga chip to be conducive to as acquisition chip subsequent
Multiple sensor acquires the alignment of data, improves the synchronization degree of data acquisition.Wherein, torque sensor uses NI6584 adapter
Configuration FPGA whole port is differential path, and the RS422 by being connected between NI6584 adapter and torque sensor connects
Mouthful, the frequency signal for making FPGA module that differential lane receiver torque sensor be utilized to issue, to reduce common mode interference when acquisition.
Specifically, NI6584 adapter is inserted into the board interface of FPGA module, meanwhile, by NI6584 adapter
The pin 4 and pin 5 of Single port are connect with the pin 1 of torque sensor port and pin 4, complete NI6584 adapter, torque
The connection of sensor and FPGA module, in addition, torque sensor port pinout 2 is connect 24V power cathode, pin 3 connects 24V power supply
Anode, as shown in Figure 2.
The board of FPGA module handles the differential frequency signal received from torque sensor.Wherein, it improves
To the precision of torque sensor frequency identification, there are two types of methods: first is that improving FPGA clock frequency.Clock frequency is higher, the same to period
Under counts it is also more, the counting between torque sensor rising edge is divided smaller, makes the measurement of frequency more
Precisely;Specifically, clock frequency is lower, fewer with the counts under the period, reduces so that counting, resolution ratio decline;Second
A method is to extend data collection cycle, makes in a cycle that collected rising edge number is more, high frequency clock can count
Time extend, the value of counting also accordingly increases, and improves the resolution ratio of measurement.And it balances use above two side simultaneously
Method then can not only guarantee that the update cycle of data was unlikely to too long, but also guarantee that the resolution ratio of frequency identification is met the requirements.Meanwhile
Such compound algorithm also helps the synchronization of multichannel data, and guarantees the acquisition precision of data.
Therefore, the maximum frequency multiplication multiple that the multiple of frequency multiplication uses FPGA module can be realized in this example;Data acquisition
Period is to be manually set, it is contemplated that torque has fluctuation, i.e. the slot effect of the servo motor of driving shafting rotation can make
Output torque generates high frequency periodic variation, thus, data collection cycle is set as 40 microseconds.
For this purpose, the specific processing step of FPGA module is as follows:
S201, the onboard clock of frequency multiplication in FPGA module obtain high frequency clock, to generate high-frequency counter;
S202, data collection cycle is determined, i.e. FPGA module time that a data are updated within this time;
S203, in a data collection cycle using the rising edge of high frequency clock identification torque sensor, when recognizing
It is started counting after first rising edge, until collection period terminates, searches counting size when the last one rising edge, so that it may
Know that high frequency clock shares how many times counting between several rising edges.
In above-mentioned treatment process, high frequency clock for identification the number of rising edge with to this number rising edge experience when
Between counted, and be stored in the register of FPGA module, onboard clock is stored in by other calculation procedure calling
Count value in the register of FPGA module completes subsequent calculating and updates collected frequency values, realizes hardware resource
Reasonable distribution;
S204, in same data collection cycle, if the count value of high frequency clock is acquired multiplied by high frequency clock cycles
The rising edge number measured is then obtained frequency divided by the time used in several rising edges is acquired by the time used in dry rising edge
The numerical value for the actual frequency that rate value, i.e. torque sensor measure.
Successively, it repeats the above steps S203~S204 to the frequency data in subsequent each data collection cycle, with this
Analogize, finally obtains the frequency flow data of torque sensor.
The frequency flow data handled by FPGA module is transmitted to Real-Time real-time system by DMA-FIFO.
Wherein, direct memory access is referred to for DMA-FIFO, DMA, is a kind of without CPU and directly from the number of memory access data
According to switch mode.Data transmission under PIO mode between hard disk and memory is controlled by CPU;And in dma mode, CPU
Instruction need only be assigned to dma controller, allow dma controller to handle the transmission of data, Data Transfer Done again feeds back information
To CPU, cpu resource occupation rate is thus largely alleviated.And FIFO is the dual port buffer of a first in, first out, i.e.,
First data first entered in it is moved out of, and one of mouth is the input port of memory, another mouth is memory
Delivery outlet.Therefore, data high-speed can be made using DMA-FIFO, lossless be transmitted to Real-Time real-time system.
The frequency that Real-Time real-time system sends DMA-FIFO as the conversion of dedicated frequency signal and storage device
Rate flow data is converted to torque flow data, and the torque flow data stored within the system is sent to host computer by network flow,
Work is analyzed in the drafting and other data for carrying out change in torque curve.
In conclusion being somebody's turn to do the processing method of the high-throughput torque measurement data based on Labview realizes torque data
High speed acquisition, high speed storing solves asking for high speed acquisition of the torque data under Labview environment and data high-speed flow table
Topic, and the algorithm complexity that this method is related to is not high, suitable for the torque acquisition system of various instrument and equipments, has good
Use value and promotion prospect.
The above embodiment is interpreted as being merely to illustrate the present invention rather than limit the scope of the invention.?
After the content for having read record of the invention, technical staff can be made various changes or modifications the present invention, these equivalent changes
Change and modification equally falls into the scope of the claims in the present invention.