CN111722012B - Pulse counting frequency measurement method and device - Google Patents
Pulse counting frequency measurement method and device Download PDFInfo
- Publication number
- CN111722012B CN111722012B CN201910220001.XA CN201910220001A CN111722012B CN 111722012 B CN111722012 B CN 111722012B CN 201910220001 A CN201910220001 A CN 201910220001A CN 111722012 B CN111722012 B CN 111722012B
- Authority
- CN
- China
- Prior art keywords
- pulse
- frequency
- pulses
- time
- time window
- 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.)
- Active
Links
- 238000000691 measurement method Methods 0.000 title claims abstract description 8
- 238000000034 method Methods 0.000 claims abstract description 27
- 238000005259 measurement Methods 0.000 claims abstract description 24
- 238000001914 filtration Methods 0.000 claims abstract description 8
- 230000008859 change Effects 0.000 claims description 8
- 238000007493 shaping process Methods 0.000 abstract description 8
- 238000009825 accumulation Methods 0.000 abstract description 2
- 238000012545 processing Methods 0.000 description 13
- 238000002955 isolation Methods 0.000 description 5
- 230000007547 defect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R23/00—Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
- G01R23/02—Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage
- G01R23/10—Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage by converting frequency into a train of pulses, which are then counted, i.e. converting the signal into a square wave
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02E—REDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
- Y02E30/00—Energy generation of nuclear origin
- Y02E30/30—Nuclear fission reactors
Abstract
The invention discloses a pulse counting frequency measurement method and a device, wherein an FPGA is used for filtering and shaping the filtered and shaped pulse to obtain a normal pulse, pulse accumulation is carried out on the normal pulse, the accumulated pulse quantity signal is marked with a time mark and sent to an MCU, and a moving time window method is used for pulse frequency measurement; the hardware combination scheme of the FPGA and the MCU is adopted, the pulse frequency is calculated according to a moving time window method, the pulse counting and frequency measuring precision is effectively ensured, and the measuring device is simple and has wide application value.
Description
Technical Field
The invention relates to a pulse counting frequency measurement method and device, and belongs to the technical field of industrial process control automation.
Background
The pulse counting and frequency measurement are needed for motor rotation speed, encoder displacement detection and the like widely existing in the technical field of industrial process control automation, and the defects of poor real-time performance and low calculation precision exist for pulse counting and frequency measurement in the prior art.
Disclosure of Invention
The present invention is directed to a pulse counting and frequency measuring method and apparatus, which solve one of the above-mentioned drawbacks or defects caused by the prior art.
In order to achieve the above purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a pulse counting and frequency measuring method, the counting and frequency measuring method comprising the steps of:
isolating and shaping the pulse signal;
filtering illegal pulses with pulse width exceeding a set measurement range;
accumulating the pulses to obtain accumulated pulse quantity, and marking a time mark on the accumulated pulse quantity signal;
the frequency of the pulses is calculated based on the moving time window method and the time stamped pulse quantity signal.
Further, the method for calculating the pulse frequency according to the moving time window method comprises the steps of formulating a time window and a step length according to the frequency measurement range;
when the change of the pulse quantity is zero and the state time for keeping the change quantity at zero exceeds the set time, the pulse count value is cleared.
In another aspect, the present invention also provides a pulse counting and frequency measuring device, including:
the pulse processing module is used for: the pulse processing device is used for accumulating the pulses to obtain accumulated pulse quantity, and marking a time mark on the accumulated pulse quantity signal;
and a data processing module: for calculating the frequency of the pulses based on the moving time window method and the time stamped pulse quantity signal.
Preferably, the pulse processing module is implemented by an FPGA.
Preferably, the data processing module is implemented by a microprocessor comprising an MCU.
Further, the device also comprises a pulse isolation module for isolating the pulse signal and a pulse shaping module for shaping the pulse signal.
Further, the device also comprises a filtering module for filtering illegal pulses with pulse width exceeding the set measuring range.
The pulse counting frequency measurement method and device provided by the invention have the advantages that the pulse processing module is used for filtering illegal pulses with pulse width exceeding the measurement range, normal pulses are obtained, the normal pulses are accumulated, the accumulated pulse quantity signals are marked with time marks and are sent to the data processing module, the pulse frequency measurement is carried out by using the moving time window method, the pulse frequency is calculated by using the hardware combination scheme of the pulse processing module and the data processing module by using the moving time window method, the pulse counting and frequency measurement precision is effectively ensured, the frequency range of the pulse frequency measurement is ensured, and the pulse counting frequency measurement device provided by the invention is simple and has wide application value.
Drawings
Fig. 1 is a schematic connection diagram of a pulse counting and frequency measuring device according to an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
The method comprises the steps of generating counting pulses by using an encoder, sending pulse signals into a high-speed optical coupler isolator, carrying out signal isolation on the pulses through the high-speed optical coupler isolator according to fig. 1, carrying out pulse signal following, comparing and shaping on the pulse signals subjected to signal isolation sequentially through a voltage follower, a hysteresis comparator and an MOS, converting the pulse signals into high and low levels, and entering an FPGA, wherein the isolation and shaping of the pulse signals are completed through the steps.
Pulse signals subjected to pulse isolation and shaping are transmitted into an FPGA for pulse processing:
the FPGA captures the isolated and shaped pulse signals, filters illegal pulses with pulse width exceeding the set measurement range, and acquires normal pulses: in one embodiment, the set frequency measurement range of the pulses is 0-100KHz, the frequency measurement range of the pulses is determined by the performance of the FPGA, and the duty cycle is 50%, so that the pulses with the pulse width less than 2 mu s exceed the set measurement range, and the pulses with the pulse width less than 2 mu s are considered illegal pulses; the FPGA filters the pulse with the pulse width smaller than 2 mu s to obtain a normal pulse; according to the parameter setting of the FPGA used in the embodiment, the threshold of the highest deflection high level of the pulse quantity is 15V, the threshold of the return low level is about 5.2V, and the illegal pulse is filtered through the steps, so that the screening of pulse signals is completed;
the FPGA accumulates the normal pulses after screening to obtain accumulated pulse quantity, and marks the accumulated pulse quantity signals with time marks, wherein the time marks take the clock of the FPGA as a reference, so that the unification and the matching of the counting and time data interfaces are ensured.
And simultaneously transmitting the accumulated pulse quantity and the corresponding clock to the MCU for data processing:
the MCU receives pulse quantity signals transmitted by the FPGA and marked with time marks, and in a counting mode, the pulse number obtained by accumulating the pulses through the FPGA is directly used as a counting value of the pulses;
the MCU calculates the frequency of the pulse according to a moving time window method in a frequency measurement mode:
when the pulse frequency is calculated by using a moving time window method, a time window and a step length are designated by an improved method of frequency measurement precision of pattern matching, and it is clear that the step length corresponds to the interval time of the moving time window, the frequency is divided into a high frequency band, a medium frequency band and a low frequency band according to the frequency measurement range, the time window and the step length are respectively designated according to different frequency bands, and the relationship between the time window and the step length accords with: the time window is larger than the step length, the low-frequency time window is larger than the intermediate-frequency time window and the high-frequency time window, and the low-frequency step length is larger than the intermediate-frequency step length and is larger than the high-frequency step length;
acquiring the pulse number in a certain time window according to a moving time window method, and calculating the pulse frequency according to the time window and the pulse number in the time window;
when the MCU detects that the change of the pulse quantity is zero and the state time for keeping the change quantity at zero exceeds 2s, the pulse count value is cleared, so that no pulse quantity is input at present.
And transmitting the pulse number and the frequency calculated by the MCU into a data receiving device for storage.
The pulse counting frequency measuring device and the pulse counting frequency measuring method provided by the embodiment of the invention can count and measure 8 paths of pulse signals at the same time, thereby saving hardware cost; the pulse frequency measuring range reaches 0-100KHz, and the measuring precision is less than 0.1%.
The embodiment of the invention provides a pulse counting frequency measurement method and a pulse counting frequency measurement device, which are characterized in that an FPGA is used for filtering and shaping filtered and illegally processed pulses to obtain normal pulses, pulse accumulation is carried out on the normal pulses to obtain accumulated pulse quantity, an accumulated pulse quantity signal is clocked into an MCU, and pulse frequency measurement is carried out by using a moving time window method; the hardware combination scheme of the FPGA and the MCU is adopted, the pulse frequency is calculated by using a moving time window method, the pulse counting and frequency measuring precision is effectively ensured, the frequency range of pulse frequency measuring is ensured, and the measuring device is simple and has wide application value.
While the foregoing is only a preferred embodiment of the present invention, it should be noted that, for those skilled in the art, several improvements and modifications may be made without departing from the technical principles of the present invention, for example, the pulse counting and frequency measurement method and apparatus provided by the present invention may be used to measure multiple paths of pulse signals including but not limited to 8 paths at the same time, and the apparatus for processing pulse signals includes but not limited to FPGA, and the apparatus for processing data includes but not limited to MCU; such modifications and variations are also considered to be a departure from the scope of the invention.
Claims (2)
1. A pulse count frequency measurement device, the device comprising:
and (3) FPGA: the device is used for capturing isolated and shaped pulse signals, filtering illegal pulses with pulse width exceeding a set measurement range and obtaining normal pulses; wherein, the pulse with the pulse width smaller than 2 mu s is an illegal pulse;
and (3) FPGA: the method comprises the steps of accumulating normal pulses, obtaining accumulated pulse quantity, and marking a time mark on an accumulated pulse quantity signal; the time scale takes the clock of the FPGA as a reference;
MCU: for calculating the frequency of the pulses based on the moving time window method and the time stamped pulse quantity signal;
the method for calculating the frequency of pulses from a moving time window method and a time stamped pulse quantity signal comprises: setting a time window and a step length according to the frequency measurement range; when the change of the pulse quantity is zero and the state time for keeping the change quantity at zero exceeds the set time, the pulse count value is cleared.
2. A pulse count frequency measurement method, the method comprising the steps of:
capturing the isolated and shaped pulse signals, filtering illegal pulses with pulse width exceeding a set measurement range, and obtaining normal pulses; wherein, the pulse with the pulse width smaller than 2 mu s is an illegal pulse;
accumulating the normal pulses to obtain accumulated pulse quantity, and marking a time mark on the accumulated pulse quantity signal; the time scale takes the clock of the FPGA as a reference;
calculating the frequency of the pulse according to a moving time window method and a pulse quantity signal marked with a time mark;
the method for calculating the frequency of pulses from a moving time window method and a time stamped pulse quantity signal comprises: setting a time window and a step length according to the frequency measurement range; when the change of the pulse quantity is zero and the state time for keeping the change quantity at zero exceeds the set time, the pulse count value is cleared.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910220001.XA CN111722012B (en) | 2019-03-22 | 2019-03-22 | Pulse counting frequency measurement method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910220001.XA CN111722012B (en) | 2019-03-22 | 2019-03-22 | Pulse counting frequency measurement method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111722012A CN111722012A (en) | 2020-09-29 |
CN111722012B true CN111722012B (en) | 2024-03-15 |
Family
ID=72562691
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910220001.XA Active CN111722012B (en) | 2019-03-22 | 2019-03-22 | Pulse counting frequency measurement method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111722012B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114371342B (en) * | 2022-03-21 | 2022-05-27 | 国仪量子(合肥)技术有限公司 | FPGA (field programmable Gate array), real-time signal frequency measurement method based on FPGA and lock-in amplifier |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5142170A (en) * | 1991-03-28 | 1992-08-25 | Rockwell International Corporation | High repetition rate signal reject apparatus and method |
CN101566641A (en) * | 2009-03-06 | 2009-10-28 | 深圳市双合电脑系统股份有限公司 | Power system transmission line parameter synchronic measurement and recording device |
CN102128981A (en) * | 2010-12-29 | 2011-07-20 | 上海大学 | Method for measuring pulse signal period |
CN105629061A (en) * | 2016-03-22 | 2016-06-01 | 桂林电子科技大学 | Precise frequency measurement device based on high-stability wide reference pulse |
CN205404703U (en) * | 2016-02-29 | 2016-07-27 | 重庆电力高等专科学校 | Electric energy quality disturbance alarm system |
CN105866542A (en) * | 2016-05-23 | 2016-08-17 | 南京航空航天大学 | High-accuracy sliding frequency measurement method |
CN107782964A (en) * | 2017-09-29 | 2018-03-09 | 北京广利核系统工程有限公司 | Alternative output pulse signal frequency and measuring system, the measuring method counted |
CN109116107A (en) * | 2018-08-21 | 2019-01-01 | 山东中创软件商用中间件股份有限公司 | A kind of digital frequency meter |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
ES2545098T3 (en) * | 2010-07-26 | 2015-09-08 | Prysmian S.P.A. | Apparatus and procedure for monitoring an electrical energy transmission system through partial discharge analysis |
EP2912773B1 (en) * | 2012-10-24 | 2019-12-04 | ABB Schweiz AG | Pulse frequency measurement device and method and control system |
-
2019
- 2019-03-22 CN CN201910220001.XA patent/CN111722012B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5142170A (en) * | 1991-03-28 | 1992-08-25 | Rockwell International Corporation | High repetition rate signal reject apparatus and method |
CN101566641A (en) * | 2009-03-06 | 2009-10-28 | 深圳市双合电脑系统股份有限公司 | Power system transmission line parameter synchronic measurement and recording device |
CN102128981A (en) * | 2010-12-29 | 2011-07-20 | 上海大学 | Method for measuring pulse signal period |
CN205404703U (en) * | 2016-02-29 | 2016-07-27 | 重庆电力高等专科学校 | Electric energy quality disturbance alarm system |
CN105629061A (en) * | 2016-03-22 | 2016-06-01 | 桂林电子科技大学 | Precise frequency measurement device based on high-stability wide reference pulse |
CN105866542A (en) * | 2016-05-23 | 2016-08-17 | 南京航空航天大学 | High-accuracy sliding frequency measurement method |
CN107782964A (en) * | 2017-09-29 | 2018-03-09 | 北京广利核系统工程有限公司 | Alternative output pulse signal frequency and measuring system, the measuring method counted |
CN109116107A (en) * | 2018-08-21 | 2019-01-01 | 山东中创软件商用中间件股份有限公司 | A kind of digital frequency meter |
Non-Patent Citations (3)
Title |
---|
刘海军.《仪器仪表用户》.2017,第18-20页. * |
刘海军.基于单片机的改进型变闸门测频法.《仪器仪表用户》.2017, * |
基于单片机的改进型变闸门测频法;刘海军;《仪器仪表用户》;20171231;第18-20页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111722012A (en) | 2020-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100575965C (en) | A kind of method of measuring frequency of single-chip | |
CN111726115B (en) | Frequency division and counting system and method for pulse signals of rotary pulse encoder | |
CN111722012B (en) | Pulse counting frequency measurement method and device | |
CN113212180B (en) | Maglev train, suspension control system and vertical damping signal calculation method | |
EP2965458B1 (en) | Dithering circuit for sampling serial data transmission | |
US20110013689A1 (en) | Digital signal receiver | |
CN108964868B (en) | FPGA-based ultrahigh frequency RFID reader-writer Miller subcarrier decoding method | |
CN1145331C (en) | Method for detecting pilot signals | |
CN110673532B (en) | Pulse signal processing and collecting device | |
CN112496565B (en) | Device for realizing signal processing of servo system of laser cutting head | |
CN111726585A (en) | Big data information management system | |
CN111380597A (en) | Flow abnormity detection method and circuit of phase difference type ultrasonic flowmeter | |
CN210690814U (en) | High-order amplification-fitting time discrimination circuit of pulse laser radar | |
CN210283611U (en) | Detection system of printing machine | |
CN107917741B (en) | Counting device, counting method and gas meter | |
CN211406003U (en) | Decoding system of Manchester code | |
CN102832911A (en) | Digital signal recovery method and device | |
CN110687362A (en) | Real-time phase noise testing method | |
CN106209708A (en) | The signal processing method of a kind of radio-frequency transmitter and device, receiver and system | |
CN204614003U (en) | A kind of Novel machine electric-type counter | |
CN108759993B (en) | Water meter assembly with self-adaptive meter calibrating function | |
CN109327282A (en) | A kind of Manchester reception coding/decoding method and its circuit delimited based on position | |
CN210724984U (en) | Industrial robot safety monitoring device based on image processing | |
CN113176451B (en) | Pulse signal detection method based on table look-up method | |
CN102174722B (en) | Digital detection method and system for thickness of fed cotton silver of drawing frame |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |