Rotating speed measuring device and rotating speed measuring method
By using a PI speed signal acquisition circuit and an adaptive sliding window depth processing MCU microcontroller, the problems of periodic error and electromagnetic interference in traditional speed measurement are solved, achieving more accurate speed measurement and wire breakage detection.
Patent Information
- Application Number
- CN202511618036.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2025-12-05
AI Technical Summary
Traditional speed measurement methods suffer from periodic errors and electromagnetic interference, leading to inaccurate measurements.
A speed measurement method using a PI speed signal acquisition circuit, an MCU microcontroller, and an adaptive sliding window depth is adopted. Through filtering and shaping, sliding window processing, and speed calculation, outliers are eliminated, reducing hardware complexity.
It improves the accuracy and anti-interference ability of speed measurement, reduces periodic errors, and enhances the ability to detect wire breakage.
Smart Images

Figure CN121068945A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of rotational speed detection, and particularly relates to a rotational speed measuring device and a measuring method. BACKGROUND
[0002] A rotating device is a mechanical structure that rotates by using certain energy, and is one of the mechanical structures commonly used in many fields. The rotational speed condition of the rotating device in some scenarios reflects the operating state in the scenario. Therefore, by monitoring the rotational speed condition of the rotating device, the operating state of the rotating device can be determined. When an abnormal rotational speed is monitored, corresponding measures can be taken in time to reduce the accident rate and reduce losses, so the accuracy of rotational speed measurement is an important factor for determining the correctness of operation.
[0003] However, the working environment of the rotating device may have high-strength electromagnetic interference, or various factors affecting the measurement accuracy caused by the aging of the device, such that in order to minimize the measurement error and provide accurate rotational speed information for the protection device, it is one of the main measures to protect the measurement accuracy to eliminate the influence of interference on measurement.
[0004] The traditional measurement scheme is to measure the rotational speed by frequency measurement or cycle measurement. The above measurement scheme will produce a cycle error. When the frequency of the measured signal is closer to the sampling frequency, the error will become larger, and even seriously deviate from the true value. At the same time, the rotational speed measuring device is easily affected by electromagnetic interference, or small jitter interference caused by the aging of the sensor fixation and other mechanical reasons, which will cause inaccurate measurement.
[0005] Therefore, the purpose of the present application is to solve the problem of one cycle error in the traditional measurement scheme by complementing the square wave cycle change caused by high-frequency pulse interference, using the characteristic that the rotational speed will not change suddenly, eliminating some abnormal values according to the count difference of two samplings, ensuring the accuracy of the rotational speed measurement of the rotating device, and solving the defect of one cycle error in the traditional measurement scheme. At the same time, a software method is used to detect the broken line condition, and the complexity of the hardware is reduced. SUMMARY
[0006] The purpose of the present application is to provide a rotational speed measuring device and a measuring method to solve the problem of one cycle error in the traditional measurement scheme in the prior art.
[0007] Specifically, the technical problem to be solved by the present application is to solve the defects in the prior art. In a first aspect, the present application provides a rotational speed measuring device, comprising a PI rotational speed signal acquisition circuit and a MCU microcontroller. The MCU microcontroller comprises a square wave shaping unit, a sampling counting unit, a sliding window processing unit, and a rotational speed calculation unit, The PI rotation speed signal acquisition circuit is configured to send a PI input square wave signal obtained by processing the acquired signal to the MCU microcontroller. The square wave shaping unit is configured to process the complement shaping of the PI input square wave signal and send the complement-shaped square wave to the sampling counting unit. The sampling counting unit is configured to determine the square wave counting value input into the sliding window processing unit according to a comparison between the absolute value of the counting difference between two adjacent square waves and an allowable error threshold value. The sliding window processing unit is configured to automatically adjust the sliding window depth according to the input square wave counting value. The sliding window processing unit is configured to send the adjusted window depth to the rotation speed calculation unit. The rotation speed calculation unit is configured to calculate the rotation speed according to the adjusted window depth to obtain a rotation speed measurement result.
[0008] In an embodiment of the rotation speed measurement device according to the application, the square wave shaping unit is configured to filter out high-frequency interference in the PI input square wave signal by setting a filter parameter to restore the original square wave.
[0009] In an embodiment of the rotation speed measurement device according to the application, the square wave shaping unit is configured to: The square wave shaping unit detects the level width between the rising edge and the falling edge or the falling edge and the rising edge, compares the detected level width with a set filter level width, and if the width between the two edges is less than the set filter width value, the output square wave remains at the previous level; if the width between the two edges is greater than the set filter width value, the level of the output square wave is flipped from the previous level, and the complement-shaped PI input square wave signal is sent to the sampling counting unit.
[0010] In an embodiment of the rotation speed measurement device according to the application, the MCU microcontroller further includes an abnormal point detection unit between the sampling counting unit and the sliding window processing unit. The abnormal point detection unit detects the result of the sampling counting unit, including: The sampling counting unit counts two rising edges of the PI input square wave signal to obtain the period information of a square wave, and the abnormal point detection unit takes the absolute value of the difference between two adjacent square wave counts, and if the absolute value is greater than a set allowable error threshold value , the current sampling count is discarded , the last sampling count is sent to the sliding window processing unit; if the absolute value is not greater than the allowable error threshold value , the current sampling count Sent to the sliding window processing unit: ; ; in: It is the allowable error threshold; It is the difference between two consecutive square wave counts.
[0011] In one embodiment of the rotational speed measuring device according to the present invention, the sliding window processing unit adjusts the sliding window depth of the sampling count, including: The sampling count of the input square wave signal for each PI input is denoted as . The set of the entire sliding window at the nth sampling is denoted as: ; The average value of the nth sampling count is: ; Where: M is the depth of the sliding window; During the (n+1)th sampling, the entire data within the sliding window is shifted to the left once, and the (n+1)th sampled data is... Place it on the far right of the sliding window. After removing and moving a sliding window, the set of all sliding windows is denoted as: ; The average value of the (n+1)th sampling count is: ; The sliding window depth is divided into multiple levels. The standard sampling count value corresponding to the standard square wave is calculated based on the sampling frequency in the multiple levels. The sliding window processing unit automatically adjusts the sliding window depth by comparing the input sampling count value with the standard value each time.
[0012] In one embodiment of the speed measuring device according to the present invention, the speed calculation unit performs speed calculation based on the adjusted window depth as follows: The formula for calculating the frequency of the nth measured square wave is: ; The formula for calculating the nth rotational speed is: ; Where: R n The rotational speed is the speed calculated in the nth time; K is the proportionality coefficient between rotational speed and frequency. Sampling frequency value; The formula for calculating the frequency of the (n+1)th measured square wave is: ; The (n+1)th rotation speed calculation formula is: .
[0013] In an embodiment of the rotation speed measuring device according to the application, the sliding window processing unit adjusts the sliding window depth according to the sampling count, including: when the sampling count in the current sampling is less than the sampling count corresponding to the minimum value of the square wave frequency of the next gear in the frequency increasing direction, i.e., the rotation speed is accelerated, the square wave frequency is increased, and the sampling count value is decreased, the gear is locked, and the maximum sliding window depth of the gear is determined; every time a sampling count value is input, the sliding window depth M is increased by 1 until M reaches the maximum depth value corresponding to the gear. i When the sampling count N i is equal to or greater than the standard sampling count value of the lock-in frequency of the square wave frequency of the next gear in the frequency decreasing direction, i.e., the rotation speed is slowed down, the square wave frequency is decreased, and the sampling count value is increased, the depth of the sliding window is adjusted to the maximum depth value of the gear. In other cases, the depth value of the sliding window remains unchanged.
[0014] In an embodiment of the rotation speed measuring device according to the application, the PI rotation speed signal is input into the PI rotation speed signal acquisition circuit and is filtered and shaped to obtain a PI input square wave signal.
[0015] In an embodiment of the rotation speed measuring device according to the application, the MCU microcontroller further includes a broken line detection unit that detects the broken line of the input PI input square wave signal.
[0016] In a second aspect, the application provides a rotation speed measuring method, which uses the rotation speed measuring device described above to measure the rotation speed, and the steps of the broken line detection unit detecting the broken line of the input PI square wave signal are as follows: (1) Start the rotation speed measuring device and initialize it; (2) Start the timer when the initialization is completed, and when the broken line detection unit detects the level change of the PI input square wave signal, the timer is cleared and starts timing again; (3) Wait for the next level change, and if the timer times out, it is determined that the PI input causes the period of the previous and subsequent levels detected by the timer to be greater than the maximum period of the PI input square wave signal of the speed measuring device, so that the input broken line is determined.
[0017] Compared with the prior art, the application has the following positive effects: 1、 the rotational speed measurement method provided by the application, through setting the parameter of the timer to be greater than the maximum square wave period required by the equipment input, when detecting the input signal level change, clearing the timer and re-timing, when the timer generates an overtime interrupt, the interrupt processing operation will report a broken line warning.
[0018] 2、 the rotational speed measurement method provided by the application, the adaptive sliding window depth is adopted, different depth windows are used for frequency calculation of signals of different frequencies, the accuracy is guaranteed, and the data update waiting time at low speed is reduced.
[0019] 3、 the rotational speed measurement method provided by the application, by providing a filter width register, the interference below the filter width in the input waveform is eliminated, the original square wave waveform is restored, and the measurement accuracy is guaranteed. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 it is the distribution schematic view of the rotational speed measurement device in the application; Figure 2 it is the schematic view of the waveform processing unit in the MCU microcontroller in the application; Figure 3 it is the flowchart of the broken line detection process in the application; Figure 4 it is the interference pulse completion schematic view in the square wave shaping process in the application, wherein, Figure 4 (a) in the figure is the original input waveform graph with interference, Figure 4 (b) in the figure is the waveform after shaping with filter parameters greater than t1 and less than t2, Figure 4 (c) in the figure is the waveform after shaping with filter parameters greater than t2; Figure 5 it is the flowchart of the rotational speed measurement process in the application; Figure 6 it is the sliding schematic view of the sliding window in the application; Figure 7 it is the flowchart of the automatic adjustment of the sliding window depth in the application. DETAILED DESCRIPTION
[0021] Below, the example embodiments according to the application will be described in detail with reference to the drawings. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments of the application, and it should be understood that the application is not limited by the example embodiments described here.
[0022] It can be understood that the term "one" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of one element can be one, and in another embodiment, the number of the element can be multiple, and the term "one" cannot be understood as a limitation on the number. "Multiple" refers to greater than or equal to two.
[0023] Although ordinal numbers such as "first", "second", or the like will be used in describing various components, those components are not limited thereby. The terminology is used merely for the purpose of distinguishing one component from another. For example, a first component could be termed a second component, and, similarly, a second component could be termed a first component, without departing from the teachings of the present application. The terminology "and / or" as used herein refers to and encompasses any and all combinations of one or more of the associated listed items.
[0024] The terminology used herein is for the purpose of describing various embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "has", when used in this specification, specify the presence of stated features, numbers, operations, components, elements, or combinations thereof, but do not preclude the presence or addition of one or more other features, numbers, operations, components, elements, or combinations thereof.
[0025] The present application is further described in conjunction with the specific embodiments thereof. Figures 1-7 The specific embodiments thereof are described in conjunction with the specific embodiments thereof.
[0026] As Figure 1 The present application is further described in conjunction with the specific embodiments thereof. The hardware of the rotational speed measuring device mainly comprises a PI rotational speed signal acquisition circuit, an AI sampling circuit, a DO latch circuit, an AO digital-analog conversion and V-I conversion circuit, and the signal transmission of the field side and the system side is isolated.
[0027] The rotational speed measuring device in the present application comprises a PI rotational speed signal acquisition circuit and a MCU microcontroller. The PI rotational speed signal is input into the PI rotational speed signal acquisition circuit and a PI input square wave signal is obtained after filtering and shaping, and the PI input square wave signal is sent into the MCU microcontroller. The filtering width register is used to eliminate the interference below the filtering width in the input waveform, restore the waveform of the original square wave, and ensure the accuracy of measurement.
[0028] The present application is further described in conjunction with the specific embodiments thereof. Figure 2 The waveform processing unit in the MCU microcontroller is shown in the schematic diagram. The speed measurement and detection functions in the MCU microcontroller in the rotational speed measuring device mainly comprise a broken line detection unit, a square wave shaping unit, a sampling counting unit, an abnormal point detection unit, a sliding window processing unit, and a rotational speed calculation unit. The PI input square wave signal is sequentially processed by a square wave shaping unit, a sampling counting unit, an abnormal point detection unit, a sliding window processing unit and a rotating speed calculation unit in the MCU microcontroller to obtain a rotating speed measurement result. The MCU microcontroller further comprises a wire break detection unit which detects the wire break of the input PI input square wave signal.
[0029] Specifically, Figure 3 The figure is a flowchart of the wire break detection process of the application; when the wire break detection unit detects the change of the PI input square wave level, the timer is cleared and restarted, and the next level change is waited for; if the timer times out, it is judged that the input is wire broken.
[0030] Figure 4 The figure is a schematic diagram of the interference pulse completion in the square wave shaping process; when the PI input waveform has high-frequency interference, the original square wave can be restored by setting the corresponding filtering parameters to filter out the interference; the square wave shaping unit detects the level width between the rising edge and the falling edge or the falling edge and the rising edge, and compares the level width with the set filtering level width; if the width between the two edges is less than the set filtering width value, the output square wave remains the previous level; if the width between the two edges is greater than the set filtering width value, the level of the output square wave is flipped from the previous level; the completed and shaped square wave is sent to the sampling counting unit; Wherein Figure 4 (a) in the figure is an original input waveform with interference; the waveforms from left to right are first low level, first high level after one rising edge, second low level after one falling edge, second high level after one rising edge, third low level after one falling edge, third high level after one rising edge, fourth low level after one falling edge, fourth high level after one rising edge, and fifth low level after one falling edge; the second low level has a level width t1, and the third low level has a level width t2; Wherein Figure 4 (b) in the figure is the waveform after shaping with filtering parameters greater than t1 and less than t2; according to the comparison with the set filtering level width, if the width between the two edges is less than the set filtering width value, the output square wave remains the previous level; that is, because Figure 4 The second low level in the original input waveform with interference in (a) has a level width t1, which is less than the set filtering width value, so Figure 4The second low level of the output square wave in (b) needs to be shaped to keep the previous level, i.e., the level of the first high level; and according to if the width between two edges is greater than the set filter width value, the level of the output square wave is flipped from the previous level, because Figure 4 The third low level in the original input waveform graph with interference in (a) is the level width t2, which is greater than the set filter width value, i.e., Figure 4 The third low level of the output square wave in (b) needs to be shaped to flip the previous level, i.e., the level of the second high level; wherein Figure 4 The waveform after shaping of the filter parameter ≥ t2 in (c); according to comparison with the set filter level width, if the width between two edges is less than the set filter width value, the output square wave still keeps the previous level; i.e., because Figure 4 The second low level in the original input waveform graph with interference in (a) is the level width t1, which is less than the set filter width value, thus, Figure 4 The second low level of the output square wave in (b) needs to be shaped to keep the previous level, i.e., the level of the first high level; because Figure 4 The third low level in the original input waveform graph with interference in (a) is the level width t2, which is less than the set filter width value, i.e., Figure 5 The third low level of the output square wave in (b) needs to be shaped to keep the previous level, i.e., the level of the second high level; Figure 6 The flowchart of the rotational speed measurement processing in the application; the sampling counting unit detects the edges of the input PI square wave, and if the level width is greater than the set filter level, outputs the square wave, and samples and counts the square wave; if the level width is equal to or less than the set filter level, outputs the square wave after completing the level, and samples and counts the square wave, and judges whether there is a mutation point in the PI square wave, if there is a mutation point, fills in the last counting value; if there is no mutation point, fills in the current counting value (specifically, the absolute value of the difference between the square wave counts of adjacent two times is greater than the set allowed error threshold value , the current sampling count is discarded, and the last count is sent to the sliding window processing unit; if the absolute value is not greater than the allowed error threshold value , the current count is sent to the sliding window processing unit: ; ; wherein: is the allowed error threshold value; is the difference between the square wave counts of adjacent two times).
[0031] Calculate the rotational speed based on the entered count value.
[0032] Figure 7 This is a schematic diagram of the sliding window data sliding in this invention; the sampling count of each input square wave is denoted as... The set of the entire sliding window at the nth sampling is denoted as: ; The formula for calculating the frequency of the nth measured square wave is: ; The formula for calculating the nth rotational speed is: ; The average value of the nth sampling count is: ; Where: R n Let be the rotational speed calculated in the nth time; K be the proportionality coefficient between rotational speed and frequency; and M be the depth of the sliding window. Sampling frequency value.
[0033] During the (n+1)th sampling, the entire data within the sliding window is shifted to the left once, and the (n+1)th sampled data is... Place it on the far right of the sliding window. After removing and moving a sliding window, the set of all sliding windows is denoted as: ; The formula for calculating the frequency of the (n+1)th measured square wave is: ; The formula for calculating the rotational speed at the (n+1)th time is: ; The average value of the (n+1)th sampling count is: ; This is a flowchart illustrating the automatic adjustment of the sliding window depth by the sliding window processing unit in this invention. To reduce computational complexity while ensuring computational accuracy, the sliding window processing unit automatically adjusts the sliding window depth based on the input sample count value. The sliding window depth is divided into six levels: Level 1 is [0, 100) Hz, corresponding to a window depth M of 1; Level 2 is [100, 500) Hz, corresponding to a window depth M of 2; Level 3 is [500, 1K) Hz, corresponding to a window depth M of 4; Level 4 is [1K, 3K) Hz, corresponding to a window depth M of 8; Level 5 is [3K, 10K) Hz, corresponding to a window depth M of 16; and Level 6 is [10K, +∞) Hz, corresponding to a window depth M of 32.
[0034] When this And the sampling count N i When the sampling count value is equal to or less than the minimum square wave frequency of the next gear in the frequency increasing direction, that is, when the rotation speed increases, the square wave frequency increases, the sampling count value decreases, the gear is locked, and the maximum sliding window depth of the gear is determined. For each input sampling count value, the sliding window depth M is incremented by 1 until M reaches the maximum depth value corresponding to the gear.
[0035] When this And the sampling count N i When the sampling count value is equal to or greater than the standard sampling count value of the locked frequency in the next gear's square wave frequency in the frequency decreasing direction, that is, the rotation speed slows down, the square wave frequency decreases, and the sampling count value increases, gear locking is performed. The locked frequency is any frequency value between 70% and 90% of the maximum value of the square wave frequency in the next gear (preferably 80% of the maximum value in this embodiment). Based on the six gears, the sampling frequencies can be used to calculate the standard sampling count values corresponding to the standard 100Hz, 100*0.8 = 80Hz, 500Hz, 500*0.8 = 400Hz, 1kHz, 1kHz*0.8 = 800Hz, 3kHz, 3kHz*0.8 = 2.4kHz, 10kHz, and 10kHz*0.8 = 8kHz square waves. The sliding window processing unit automatically adjusts the sliding window depth by comparing the input sampling count value with the standard value each time.
[0036] To avoid the phenomenon that the sliding window depth keeps changing due to the fluctuation of the sampling count around the standard count value of the gear when the actual speed is very close to the boundary value of a certain gear, the window depth will not be reduced immediately when the speed drops to the maximum speed pulse count of the gear. Instead, the window depth will be directly adjusted to the maximum depth value of the gear when the sampling count drops to any frequency value between 70-90% of the maximum frequency of the square wave of the gear (preferably 80% of the maximum frequency in this embodiment).
[0037] The sliding window processing unit sends the final adjusted window depth to the speed calculation unit, which then calculates the speed based on the adjusted window depth.
[0038] In other cases, the depth of the sliding window remains unchanged.
[0039] The speed measuring device in this invention converts the rotational speed signal from the field sensor into a square wave through filtering, amplification, comparison, and shaping. The MCU calculates the rotational speed of the rotating equipment by multiplying the square wave signal frequency by a proportional coefficient K. The measurement method provided by this invention can supplement the input square wave signal according to the set filtering parameters. The supplemented signal is sampled, and the pulse count between two rising edges is recorded. It is determined whether the count is an anomaly, and some abnormal data can be removed from the calculation. The pulse count is sent to a sliding window, and the size of the sliding window can be automatically adjusted according to the pulse count value. When a new data is sent to the sliding window, a rotational speed calculation is performed.
[0040] This invention provides a filter width register to eliminate interference below the filter width in the input waveform, recover the original square wave waveform, and ensure the accuracy of the measurement.
[0041] This invention employs an adaptive sliding window depth, using windows of different depths to calculate frequencies for signals of different frequencies, ensuring accuracy and reducing computational complexity.
[0042] This invention sets the timer parameter to be greater than the maximum square wave period required by the device input. When a change in the input signal level is detected, the timer is cleared and the timing is restarted. When the timer generates a timeout interrupt, the interrupt handling operation will report a disconnection warning.
[0043] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0044] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
[0045] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0046] It should also be noted that, in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0047] The steps of the methods or algorithms described in conjunction with the embodiments disclosed in this invention can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0048] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in this invention may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A rotational speed measuring device, characterized by The PI rotation speed signal acquisition circuit, the MCU microcontroller, the square wave shaping unit, the sampling counting unit, the sliding window processing unit and the rotation speed calculation unit are connected in sequence. The PI rotation speed signal acquisition circuit is used for obtaining the PI input square wave signal after processing the collected signal and sending the PI input square wave signal to the MCU microcontroller. The square wave shaping unit is used for processing the complement shaping of the PI input square wave signal and sending the square wave after the complement shaping to the sampling counting unit. The sampling counting unit is used for judging the square wave counting value input into the sliding window processing unit according to the comparison between the absolute value of the counting difference of the adjacent two square waves and the allowable error threshold value. The sliding window processing unit is used for automatically adjusting the sliding window depth according to the input square wave counting value. The sliding window processing unit is used for sending the adjusted window depth size to the rotation speed calculation unit. The rotation speed calculation unit is used for calculating the rotation speed according to the adjusted window depth to obtain the rotation speed measurement result.
2. The rotational speed measuring device according to claim 1, characterized in that The square wave shaping unit is used for filtering out the high-frequency interference of the PI input square wave signal by setting the filtering parameter to restore the original square wave.
3. The rotational speed measuring device according to claim 2, characterized in that The square wave shaping unit is specifically used for: The square wave shaping unit is used for detecting the level width between the rising edge and the falling edge or the falling edge and the rising edge, comparing the width with the set filtering level width, outputting the square wave to keep the previous level if the width between the two edges is less than the set filtering width value, and outputting the square wave to flip the previous level if the width between the two edges is greater than the set filtering width value.
4. The rotational speed measuring device according to claim 1, wherein The MCU microcontroller further includes an abnormal point detection unit, which is located between the sampling counting unit and the sliding window processing unit. The abnormal point detection unit detects the result of the sampling counting unit, including: The sampling counting unit counts two rising edges of a PI input square wave signal, obtains square wave period information, and the abnormal point detection unit takes the absolute value of the difference between two adjacent square wave counts, and if the absolute value is greater than a set allowable error threshold value , then discard the current sampling count , and send the last sampling count to the sliding window processing unit; if the absolute value is not greater than the allowable error threshold value , then send the current sampling count to the sliding window processing unit ; ; wherein: is an allowed error threshold value; is a difference between two adjacent square wave counts.
5. The rotational speed measuring device according to claim 4, characterized in that The sliding window processing unit adjusts the sliding window depth according to the sampling counting, including: The sample count of the input square wave of each PI input square wave signal is recorded as The set of the entire sliding window at the nth sample is recorded as: ; The average value of the nth sampling counting is: ; Wherein: M is the depth of the sliding window. The data in the sliding window is moved to the left as a whole once at the n+1 sampling time, the n+1 sampling data is put to the rightmost side of the sliding window, and the sliding window is removed, and the set of the whole sliding window after the movement is recorded as: ; The average value of the (n+1)th sampling counting is: ; The depth of the sliding window is divided into multiple gears; the standard sampling counting value corresponding to the standard square wave is calculated according to the sampling frequency in the multiple gears, and the sliding window processing unit compares the input sampling counting value with the standard value to automatically adjust the sliding window depth.
6. The rotational speed measuring device according to claim 5, characterized in that The rotation speed calculation unit calculates the rotation speed according to the adjusted window depth, including the following: The frequency calculation formula of the nth measured square wave is: ; The rotation speed calculation formula of the nth is: ; wherein: is the rotational speed for the nth calculation; K is a proportional coefficient of the rotational speed and the frequency; is the sampling frequency value; The frequency calculation formula of the (n+1)th measured square wave is: ; The rotation speed calculation formula of the (n+1)th is: 。 7. The rotational speed measuring device according to claim 4, wherein The sliding window processing unit adjusts the sliding window depth according to the sampling counting, including: When the sampling in this time And the sampling count N i When the sampling count is equal to or less than the sampling count value corresponding to the minimum value of the square wave frequency of the next gear in the frequency increasing direction, that is, the speed increases, the square wave frequency increases, and the sampling count value decreases; the gear is locked, and the maximum sliding window depth of the gear is determined. Every input sampling count value increases the sliding window depth M by 1, and the sliding window depth M reaches the maximum depth value corresponding to the gear. When the present and the sampling count N i equal to or greater than the standard sampling count value of the locked frequency in the next gear of the frequency reduction direction, i.e. the speed is slowed down, the square wave frequency is reduced, and the sampling count value is increased; the depth of the sliding window is adjusted to the maximum depth value of the gear; In other cases, the depth value of the sliding window remains unchanged.
8. The rotational speed measuring device according to claim 1, wherein The PI rotation speed signal is input into the PI rotation speed signal acquisition circuit and the PI input square wave signal is obtained after filtering and shaping.
9. The rotational speed measuring device according to claim 1, wherein The MCU microcontroller further includes a broken line detection unit, which detects the broken line of the input PI input square wave signal.
10. A method of measuring rotational speed using a rotational speed measuring device as claimed in claim 9, characterized in that The broken line detection unit detects the input PI square wave signal as follows: (1) Start the rotation speed measuring device and initialize it; (2) Start the timer when the initialization is finished, and when the broken line detection unit detects the level change of the PI input square wave signal, the timer is cleared and starts timing again; (3) Wait for the next level change, and if the timer times out, it is judged that the PI input is interrupted, so that the period of the previous and next levels detected by the timer is greater than the maximum period of the PI input square wave signal of the speed measuring device, and thus it is judged that the input is broken.
Citation Information
Patent Citations
Rotation speed measurement method with anti-shake function
CN103675324A
Rotating speed measurement method and system, and tachometer
CN105403725A
Pulse width detection circuit
CN112924762A
Low-distortion pulse filter circuit
CN115603703A
Method and device for measuring rotating speed of steam turbine
CN119881370A