Speed measurement method and speed measurement system

By designing a speed measurement system including pulse encoder, unit timer, pulse counter, capture timer and speed calculator, the problem of segmented speed measurement during full-speed segment speed measurement is solved, and high-precision and high-efficiency speed measurement is achieved.

CN119595936APending Publication Date: 2025-03-11SUZHOU WATECH ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411766927.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing speed measurement technology has problems with segmented speed measurement when measuring speed in full speed segment, resulting in low speed measurement accuracy and efficiency.

Method used

A speed measurement system is designed, including a pulse encoder, unit timer, pulse counter, capture timer and speed calculator. By obtaining the pulse counting sequence and capturing timing sequence, the average speed is calculated to achieve high-precision speed measurement in the full speed segment.

Benefits of technology

The system can achieve high-precision speed measurement in the full speed segment, avoid segmented speed measurement, and improve speed measurement accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119595936A_ABST
    Figure CN119595936A_ABST
Patent Text Reader

Abstract

The invention provides a speed measurement method and system, and the system comprises a pulse encoder which is used for outputting a quadrature coded pulse; a unit timer for generating a unit timing event based on a unit timing period; the pulse counter is connected to the pulse encoder and the unit timer, and is used for carrying out pulse counting on the basis of the orthogonal encoding pulse and responding to the unit timing event to obtain a pulse counting sequence; the capture timer is connected to the pulse encoder and the unit timer and is used for acquiring a first capture timing sequence based on the orthogonal coded pulse and acquiring a second capture timing sequence in response to the unit timing event; and a speed calculator connected to the pulse counter and the capture timer and used for obtaining an average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence. The method is suitable for full-speed-section speed measurement, and the speed measurement precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of speed measurement, and in particular to a speed measurement method and a speed measurement system. Background Art

[0002] In speed measurement technology, pulse encoder is a commonly used sensor that measures the speed of an object by generating a series of pulse signals. The frequency of these pulse signals is proportional to the speed of the object, so the speed of the object can be calculated by measuring the frequency of the pulse signals. In practical applications, pulse encoders are often used to measure the speed of rotating objects, such as motors, generators, turbines, etc.

[0003] The most typical methods of pulse speed measurement are frequency measurement method (M method), period measurement method (T method) and frequency period adaptive method (MT method). The frequency measurement method (M method) is to calculate the number of pulses within a fixed time interval. This method has the advantages of simple implementation and fixed speed measurement interval (sampling period) at any speed, but the maximum error can reach about two pulses. Therefore, it is only suitable for high-speed measurement. At low speeds, the accuracy and measurement resolution of relative speed will be poor. The period measurement method (T method) is to measure the time interval between two adjacent pulses. This method has the advantages of accurate speed measurement at low speeds and negligible measurement time delay, but it is not suitable for high-speed measurement. The frequency period adaptive method (MT method) combines the frequency measurement method (M method) with the period measurement method (T method) for speed measurement, but there are problems such as the need for segmented speed measurement, narrow scope of application, and complex calculation logic. Summary of the invention

[0004] Based on this, it is necessary to provide a speed measurement method and a speed measurement system to address the problems in the above-mentioned background technology, which can at least achieve speed measurement in the full speed range, avoid segmented speed measurement, and improve speed measurement accuracy.

[0005] To achieve the above objectives and other related objectives, one aspect of the present application provides a speed measurement system, comprising:

[0006] A pulse encoder for outputting quadrature coded pulses;

[0007] A unit timer, used to generate a unit timing event based on a unit timing cycle;

[0008] a pulse counter connected to the pulse encoder and the unit timer for counting pulses based on the orthogonal encoded pulses and acquiring a pulse count sequence in response to the unit timing event;

[0009] a capture timer connected to the pulse encoder and the unit timer, for acquiring a first capture timing sequence based on the orthogonal encoded pulse, and acquiring a second capture timing sequence in response to the unit timing event;

[0010] A speed calculator, connected to the pulse counter and the capture timer, is used to obtain an average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

[0011] In one embodiment, the pulse counting sequence includes multiple pulse counting values, and the pulse counting values ​​are used to indicate the accumulated number of pulses; the first capture timing sequence includes multiple first capture timing values, and the first capture timing values ​​are used to indicate the total duration of a single pulse; the second capture timing sequence includes multiple second capture timing values, and the second capture timing values ​​are used to indicate the duration of a single pulse when the unit timing event occurs.

[0012] In one embodiment, the method of obtaining the average speed based on the unit timing period, the pulse count sequence, the first capture timing sequence and the second capture timing sequence includes: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of a first pulse, a first capture timing value of a first pulse and a second capture timing value of a first pulse, and obtaining a first time difference value based on a difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of a second pulse, a first capture timing value of the second pulse and a second capture timing value of the second pulse, and obtaining a second time difference value based on the second capture timing value of the second pulse; obtaining a speed measurement time based on the unit timing period, the first time difference value and the second time difference value; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the average speed based on the speed measurement pulse number and the speed measurement time.

[0013] In one embodiment, the average speed is:

[0014]

[0015] Wherein, v represents the average speed, x(k) represents the pulse count value when the second unit timing event occurs, x(k-1) represents the pulse count value when the first unit timing event occurs, T represents the unit timing period, t(n-1) represents the first captured timing value of the first pulse, T(k-1) represents the second captured timing value when the first unit timing event occurs, T(k) represents the second captured timing value when the second unit timing event occurs, and f represents the system clock frequency.

[0016] In one embodiment, the speed calculator is also used to obtain a first speed based on the unit timing period and the event capture sequence, including: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of a first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of a second pulse; using the unit timing period as a speed measurement time; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the first speed based on the speed measurement pulse number and the speed measurement time.

[0017] In one embodiment, the speed calculator is further used to obtain a second speed based on the first capture timing sequence, including: in response to a first unit timing event occurring during a first pulse, obtaining a first capture timing value of the first pulse; and obtaining the second speed based on the first capture timing value of the first pulse.

[0018] In one embodiment, the speed measurement system further includes a unit timing register. When the timing of the unit timer reaches a preset value of the unit timing register, the unit timer is reset and the unit timing event is generated.

[0019] In one embodiment, the speed measurement system further includes a condition factor register, and when the ratio of the first capture timing value to the clock frequency is less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain the average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence; when the ratio of the first capture timing value to the clock frequency is not less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain the second speed based on the first capture timing sequence.

[0020] Another aspect of the present invention provides a speed measurement method, comprising:

[0021] performing pulse counting based on the orthogonal coded pulses, and acquiring a pulse count sequence in response to a unit timing event;

[0022] Acquire a first capture timing sequence based on the orthogonal coded pulses, and acquire a second capture timing sequence in response to a unit timing event;

[0023] An average speed is obtained based on a unit timing period, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

[0024] In one embodiment, the method of obtaining the average speed based on the unit timing period, the pulse count sequence, the first capture timing sequence and the second capture timing sequence includes: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of the first pulse, a first capture timing value of the first pulse and a second capture timing value of the first pulse, and obtaining a first time difference value based on a difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of the second pulse, a first capture timing value of the second pulse and a second capture timing value of the second pulse, and obtaining a second time difference value based on the second capture timing value of the second pulse; obtaining a speed measurement time based on the unit timing period, the first time difference value and the second time difference value; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the average speed based on the speed measurement pulse number and the speed measurement time.

[0025] According to the speed measurement method and speed measurement system provided by the present invention, a pulse counting sequence is obtained through a pulse counter, and a first capture timing sequence is obtained based on an orthogonal coded pulse through a capture timer, and a second capture timing sequence is obtained in response to a unit timing event, and then an accurate speed measurement time corresponding to the pulse count is obtained based on the first capture timing sequence and the second capture timing sequence to obtain an accurate average speed. The speed measurement method and speed measurement system are suitable for speed measurement in the full speed range, and improve the speed measurement accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to better describe and illustrate the embodiments and / or examples of those applications disclosed herein, reference may be made to one or more drawings. The additional details or examples used to describe the drawings should not be considered as limiting the scope of any of the disclosed applications, the embodiments and / or examples currently described, and the best modes of these applications currently understood.

[0027] FIG1 is a schematic structural diagram of a speed measurement system provided in one embodiment;

[0028] FIG2 is a schematic diagram of signals of a speed measurement system provided in one embodiment;

[0029] Figure 3 A flowchart of a speed measurement system provided in one embodiment;

[0030] Figure 4 FIG. 4 is a flow chart of a speed measurement method provided in an embodiment.

[0031] Description of reference numerals:

[0032] 10. Pulse encoder; 20. Unit timer; 30. Pulse counter; 40. Capture timer; 50. Speed ​​calculator. DETAILED DESCRIPTION

[0033] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0035] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present application. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.

[0036] It should be noted that the illustrations provided in this embodiment only illustrate the basic concept of the present application in a schematic manner. Although the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation, the type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout type may also be more complicated.

[0037] In pulse speed measurement, the frequency measurement method (M method) is suitable for high-speed measurement, and the period measurement method (T method) is suitable for low-speed measurement. For the measurement of the medium-speed section, the measurement results are usually optimized or combined after the M method and T method are used respectively. For the measurement of the full-speed section, segmented speed measurement is required.

[0038] In view of the above problems, the present invention provides a speed measurement system, such as Figure 1 As shown, including:

[0039] A pulse encoder 10, for outputting orthogonal coded pulses;

[0040] A unit timer 20, for generating a unit timing event based on a unit timing cycle;

[0041] a pulse counter 30 for counting pulses based on the orthogonal coded pulses and acquiring a pulse count sequence in response to the unit timing event;

[0042] A capture timer 40, configured to acquire a first capture timing sequence based on the orthogonal encoding pulse, and acquire a second capture timing sequence in response to the unit timing event;

[0043] The speed calculator 50 is configured to obtain an average speed based on the unit timing cycle, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

[0044] In one embodiment, the pulse encoder 10 comprises an orthogonal pulse encoder for outputting orthogonal coded pulses, such as Figure 2 As shown. In the field of encoder technology, the orthogonal pulse encoder is a common type of encoder. It measures the position and speed of an object by generating two orthogonal pulse signals. The phase difference between the two pulse signals is 90 degrees, so the position and speed of the object can be calculated by measuring the phase difference between the two pulse signals.

[0045] In one embodiment, the pulse encoder 10 is used to output uniform pulses or non-uniform pulses. When the time period of a single pulse output by the pulse encoder 10 is consistent, it is a uniform pulse; when the time period of a single pulse output by the pulse encoder 10 is inconsistent, it is a non-uniform pulse. For uniform pulses, since the pulse period is a fixed value, the relationship between the duration and the number of pulses can be established based on the pulse period in the prior art, and the integer code value of the encoder can be expanded to a floating-point digital value (that is, an integer value with a decimal value). However, for non-uniform pulses, since the pulse period is not a fixed value, the relationship between the duration and the number of pulses cannot be established. The above-mentioned method of expanding the integer code value of the encoder to a floating-point digital value is not applicable to non-uniform pulses. In the present application, the encoder only uses integer code values, does not involve the conversion between duration and number of pulses, and is applicable to uniform pulses and non-uniform pulses.

[0046] Exemplarily, the speed measurement system further includes a unit timing register. When the timing of the unit timer 20 reaches a preset value of the unit timing register, the unit timer is reset and the unit timing event is generated.

[0047] In one embodiment, the preset value of the unit timing register (UPRD) is the unit timing period, and the range of the unit timing period includes 0.1μs~10μs, such as 0.1μs, 1μs, 5μs, and 10μs. The unit timer starts timing from zero. When the preset value of the unit timing register is reached, a unit time out (UTO) event is generated, and the unit timer is cleared. Specifically, refer to Figure 2 As shown, the unit timer 20 generates a first unit timing event, and at the same time, the unit timer 20 is reset and starts timing from zero. When the preset value of the unit timing register, that is, the unit timing period (T), is reached, the unit timer generates a second unit timing event.

[0048] Exemplarily, the pulse counter 30 is used to count pulses based on the orthogonal coded pulses, and to obtain a pulse count sequence in response to the unit timing event. The pulse count sequence includes a plurality of pulse count values, and the pulse count values ​​are used to represent the accumulated number of pulses.

[0049] In one embodiment, the pulse counter 30 (CNT) counts pulses based on the edge of the orthogonal coded pulse. For example, the pulse counter 30 counts plus or minus one based on the positive edge or negative edge of the orthogonal coded pulse. It should be noted that the pulse counting needs to uniformly use the positive edge or the negative edge. Specifically, Figure 2 In the example shown, a count is added based on the positive edge of the orthogonal coded pulse, the first unit timing event occurs during the first pulse, and the pulse count value x(k-1) of the first pulse is obtained, the second unit timing event occurs during the second pulse, and the pulse count value x(k) of the second pulse is obtained, and in response to more unit timing events, a pulse count sequence can be obtained: ..., x(k-1), x(k), ...

[0050] In one embodiment, the speed measurement pulse number △x = x(k)- x(k-1)-1 is obtained based on the pulse count value x(k-1) of the first pulse and the pulse count value x(k) of the second pulse. Specifically, refer to Figure 2 As shown, for example, when x(k-1)=10, x(k)=14, and the first unit timing event and the second unit timing event include 3 complete pulses for speed measurement, △x=14-10-1=3.

[0051] Exemplarily, the capture timer 40 is used to obtain a first capture timing sequence based on the orthogonal coded pulse, and to obtain a second capture timing sequence in response to the unit timing event. The first capture timing sequence includes a plurality of first capture timing values, and the first capture timing value is used to represent the total duration of a single pulse; the second capture timing sequence includes a plurality of second capture timing values, and the second capture timing value is used to represent the duration of a single pulse when the unit timing event occurs.

[0052] In one embodiment, the capture timer 40 (CAPTMR) acquires the first capture timing sequence based on the edge of the orthogonal coding pulse. For example, the capture timer 40 counts the total duration of a single pulse based on the positive edge or negative edge of the orthogonal coding pulse. Specifically, Figure 2 In the example shown, the capture timer 40 is reset at the edge of the orthogonal encoding pulse, and then starts counting. At the edge of the next orthogonal encoding pulse, the value of the current capture timer 40 is latched into the corresponding first latch register (CAPTMRLAT A), and the value of the capture timer 40 is cleared. The process is repeated to obtain the first capture timing value of each pulse in sequence. For example, the first unit timing event occurs during the first pulse, and the first capture timing value t(n-1) of the first pulse is obtained, and then the first capture timing value t(n) of the adjacent pulse after the first pulse is obtained in sequence. Based on this, the first capture timing sequence can be obtained: ..., t(n-1), t(n), ...

[0053] In one embodiment, the capture timer 40 acquires the second capture timing sequence in response to the unit timing event. Figure 2 In the example shown, when a unit timing event (UTO) occurs, the value of the current capture timer 40 is latched into the corresponding second latch register (CAPTMRLAT B), and the value of the capture timer is not cleared until the edge of the next orthogonal encoding pulse. For example, the first unit timing event occurs during the first pulse, and the second capture timing value T (k-1) of the first pulse is obtained. The second unit timing event occurs during the second pulse, and the second capture timing value T (k) of the second pulse is obtained. In response to more unit timing events, a second capture timing sequence can be obtained: ..., T (k-1), T (k), ...

[0054] Exemplarily, the speed calculator 50 is used to obtain the average speed based on the unit timing period, the pulse count sequence, the first capture timing sequence and the second capture timing sequence, including: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of the first pulse, a first capture timing value of the first pulse, and a second capture timing value of the first pulse, and obtaining a first time difference based on the difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of the second pulse, a first capture timing value of the second pulse, and a second capture timing value of the second pulse, and obtaining a second time difference based on the second capture timing value of the second pulse; obtaining a speed measurement time based on the unit timing period, the first time difference and the second time difference; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the average speed based on the speed measurement pulse number and the speed measurement time.

[0055] In one embodiment, the first time difference is obtained based on the difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse. Specifically, the first capture timing value of the first pulse is t(n-1), the second capture timing value of the first pulse is T(k-1), and the first time difference △T1= , where f represents the system clock frequency. Further, the second time difference is obtained based on the second capture timing value of the second pulse. Specifically, the second capture timing value of the second pulse is T(k), and the second time difference △T2= = , where f represents the system clock frequency. Further, the speed measurement time △T is obtained based on the unit timing period T, the first time difference △T1 and the second time difference △T2. Specifically, the speed measurement time △T=T-△T1-△T2= , where f represents the system clock frequency. Further, the average speed is obtained based on the speed measurement pulse number △x and the speed measurement time △T:

[0056] (Equation 1)

[0057] Wherein, x(k) represents the pulse count value when the second unit timing event occurs, x(k-1) represents the pulse count value when the first unit timing event occurs, T represents the unit timing period, t(n-1) represents the first capture timing value of the first pulse, T(k-1) represents the second capture timing value when the first unit timing event occurs, T(k) represents the second capture timing value when the second unit timing event occurs, and f represents the system clock frequency.

[0058] For medium-speed speed measurement, high speed measurement accuracy requirements, and variable speed movement, the part of the first time difference △T1 and the second time difference △T2 relative to the unit timing period T cannot be ignored. Therefore, using the above equation 1 to calculate the average speed can achieve accurate calculation of the speed, and the above average speed method is also applicable to high-speed speed measurement and low-speed speed measurement. Therefore, the above method can cover the full-speed speed measurement of 0~100000rpm, and for the high-speed section, medium-speed section and low-speed section in the full-speed section, the above equation 1 can be used to calculate the average speed without segmented testing.

[0059] In addition, refer to Figure 3 As shown, for high-speed speed measurement or when the speed measurement accuracy is not high, the capture timer 40 can be disabled, and the speed can be measured by the M method only through the pulse counter 30. When the capture timer 40 is disabled, the first capture timing sequence and the second capture timing sequence are all 0 sequences, and equation 1 is simplified to the M method speed measurement formula.

[0060] Exemplarily, the speed calculator is also used to obtain a first speed based on the unit timing period and the event capture sequence, including: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of a first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of a second pulse; using the unit timing period as a speed measurement time; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the first speed based on the speed measurement pulse number and the speed measurement time.

[0061] In one embodiment, the first unit timing event occurs during the first pulse, and the pulse count value x(k-1) of the first pulse is obtained; the second unit timing event occurs during the second pulse, and the pulse count value x(k) of the second pulse is obtained, and the unit timing period T is used as the speed measurement time; the speed measurement pulse number △x = x(k)- x(k-1)-1 is obtained based on the pulse count value of the first pulse and the pulse count value of the second pulse, and the first speed is obtained based on the speed measurement pulse number △x and the speed measurement time. .

[0062] Exemplarily, the speed measurement system also includes a condition factor register, and when the ratio of the first capture timing value to the clock frequency is less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain the average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence; when the ratio of the first capture timing value to the clock frequency is not less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain the second speed based on the first capture timing sequence.

[0063] Reference Figure 3 As shown, when the capture timer 40 is enabled, for the low-speed section speed measurement, the above average speed method still needs to set the unit timing period to a larger value, but even so, there are only a few orthogonal encoding pulse edges in the unit timing period, and considering the variable speed movement, the average speed obtained in this way may have a certain error in the speed measurement. At this time, considering that the event refresh frequency of the orthogonal encoding pulse edge is not high, it can automatically switch to the T method for speed measurement.

[0064] In one embodiment, the setting value of the condition factor η is in the range of 0.01 to 0.5, for example, 0.01, 0.1, 0.5. Figure 3 As shown, when the ratio of the first capture timing value t(n) of any pulse to the clock frequency f is less than the product of the condition factor η and the unit timing period T, that is, when t(n) / f<ηT, the above average speed is used for speed measurement. When t(n) / f≥ηT, the T method is used for speed measurement; specifically, refer to Figure 2 As shown, a first unit timing event occurs during the first pulse. When the first capture timing value of the first pulse t(n-1) / f≥ηT, the speed is measured by the capture timer 40 using the T method. The second speed is obtained based on the first capture timing value of the first pulse. .

[0065] The speed measurement system provided by the present invention can meet the high-precision speed measurement of the full speed section by the average speed method. At the same time, it can also perform M-method speed measurement by disabling the capture timer 40 and perform T-method speed measurement by setting the condition factor η, thereby meeting the use requirements of various application scenarios. In addition, the operation logic of the capture timer 40, the unit timer 20 and the pulse counter 30 is simple. After being reset and set, the speed calculation method can be automatically switched, which reduces the addition of complex speed segmentation judgment branches in the upper computer software program, improves the running efficiency of the program, and saves memory resources.

[0066] The present invention also provides a speed measurement method, such as Figure 4 As shown, including:

[0067] Step S401: performing pulse counting based on orthogonal coded pulses, and obtaining a pulse counting sequence in response to a unit timing event;

[0068] Step S402: acquiring a first capture timing sequence based on the orthogonal coded pulse, and acquiring a second capture timing sequence in response to a unit timing event;

[0069] Step S403: obtaining an average speed based on a unit timing cycle, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

[0070] Exemplarily, the method of obtaining the average speed based on the unit timing period, the pulse count sequence, the first capture timing sequence and the second capture timing sequence includes: in response to a first unit timing event occurring during a first pulse, obtaining a pulse count value of the first pulse, a first capture timing value of the first pulse, and a second capture timing value of the first pulse, and obtaining a first time difference value based on a difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; in response to a second unit timing event occurring during a second pulse, obtaining a pulse count value of the second pulse, a first capture timing value of the second pulse, and a second capture timing value of the second pulse, and obtaining a second time difference value based on the second capture timing value of the second pulse; obtaining a speed measurement time based on the unit timing period, the first time difference value and the second time difference value; obtaining a speed measurement pulse number based on the pulse count value of the first pulse and the pulse count value of the second pulse; and obtaining the average speed based on the speed measurement pulse number and the speed measurement time.

[0071] In one embodiment, based on the edge of the orthogonal coded pulse, the first unit timing event occurs during the first pulse, and the pulse count value x(k-1) of the first pulse is obtained. The second unit timing event occurs during the second pulse, and the pulse count value x(k) of the second pulse is obtained. In response to more unit timing events, a pulse count sequence can be obtained: ..., x(k-1), x(k), .... Based on the pulse count value x(k-1) of the first pulse and the pulse count value x(k) of the second pulse, the speed measurement pulse number △x = x(k)- x(k-1)-1 is obtained. Specifically, refer to Figure 2 As shown, for example, when x(k-1)=10, x(k)=14, and the first unit timing event and the second unit timing event include 3 complete pulses for speed measurement, △x=14-10-1=3.

[0072] In one embodiment, the first unit timing event occurs during the first pulse, and the first capture timing value t(n-1) of the first pulse is obtained, and then the first capture timing value t(n) of the adjacent pulse after the first pulse is obtained in sequence. Based on this, the first capture timing sequence can be obtained: ..., t(n-1), t(n), .... The first unit timing event occurs during the first pulse, and the second capture timing value T(k-1) of the first pulse is obtained. The second unit timing event occurs during the second pulse, and the second capture timing value T(k) of the second pulse is obtained. In response to more unit timing events, the second capture timing sequence can be obtained: ..., T(k-1), T(k), ....

[0073] Further, a first time difference is obtained based on the difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse. Specifically, the first capture timing value of the first pulse is t(n-1), the second capture timing value of the first pulse is T(k-1), and the first time difference △T1= , where f represents the system clock frequency. Further, the second time difference is obtained based on the second capture timing value of the second pulse. Specifically, the second capture timing value of the second pulse is T(k), and the second time difference △T2= = , where f represents the system clock frequency. Further, the speed measurement time is obtained based on the unit timing cycle, the first time difference and the second time difference. Specifically, the speed measurement time △T=T-△T1-△T2= , where f represents the system clock frequency. Further, the average speed is obtained based on the speed measurement pulse number △x and the speed measurement time △T:

[0074] (Equation 1)

[0075] Wherein, x(k) represents the pulse count value when the second unit timing event occurs, x(k-1) represents the pulse count value when the first unit timing event occurs, T represents the unit timing period, t(n-1) represents the first capture timing value of the first pulse, T(k-1) represents the second capture timing value when the first unit timing event occurs, T(k) represents the second capture timing value when the second unit timing event occurs, and f represents the system clock frequency.

[0076] According to the speed measurement method and speed measurement system provided by the present invention, a pulse counting sequence is obtained through a pulse counter, and a first capture timing sequence is obtained based on an orthogonal coded pulse through a capture timer, and a second capture timing sequence is obtained in response to a unit timing event, and then an accurate speed measurement time corresponding to the pulse count is obtained based on the first capture timing sequence and the second capture timing sequence to obtain an accurate average speed. The speed measurement method and speed measurement system are suitable for speed measurement in the full speed range, and improve the speed measurement accuracy and efficiency.

[0077] Please note that the above embodiments are for illustrative purposes only and are not intended to limit the present application.

[0078] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0079] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0080] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.

Claims

1. A speed measurement system, characterized in that: include: A pulse encoder for outputting quadrature coded pulses; A unit timer, used to generate a unit timing event based on a unit timing cycle; a pulse counter connected to the pulse encoder and the unit timer for counting pulses based on the orthogonal encoded pulses and acquiring a pulse count sequence in response to the unit timing event; a capture timer connected to the pulse encoder and the unit timer, for acquiring a first capture timing sequence based on the orthogonal encoded pulse, and acquiring a second capture timing sequence in response to the unit timing event; A speed calculator, connected to the pulse counter and the capture timer, is used to obtain an average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

2. The speed measurement system according to claim 1, characterized in that: The pulse counting sequence includes multiple pulse counting values, and the pulse counting values ​​are used to indicate the accumulated number of pulses; the first capture timing sequence includes multiple first capture timing values, and the first capture timing values ​​are used to indicate the total duration of a single pulse; the second capture timing sequence includes multiple second capture timing values, and the second capture timing values ​​are used to indicate the duration of a single pulse when the unit timing event occurs.

3. The speed measurement system according to claim 1 or 2, characterized in that: The obtaining of the average speed based on the unit timing cycle, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence comprises: In response to a first unit timing event occurring during a first pulse, a pulse count value of the first pulse, a first capture timing value of the first pulse, and a second capture timing value of the first pulse are acquired, and a first time difference value is obtained based on a difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; In response to a second unit timing event occurring during a second pulse, acquiring a pulse count value of the second pulse, a first capture timing value of the second pulse, and a second capture timing value of the second pulse, and obtaining a second time difference value based on the second capture timing value of the second pulse; Obtaining a speed measurement time based on the unit timing period, the first time difference, and the second time difference; obtaining a speed measurement pulse number based on a pulse count value of the first pulse and a pulse count value of the second pulse; The average speed is obtained based on the speed measurement pulse number and the speed measurement time.

4. The speed measurement system according to claim 3, characterized in that , the average speed is: Wherein, v represents the average speed, x(k) represents the pulse count value when the second unit timing event occurs, x(k-1) represents the pulse count value when the first unit timing event occurs, T represents the unit timing period, t(n-1) represents the first captured timing value of the first pulse, T(k-1) represents the second captured timing value when the first unit timing event occurs, T(k) represents the second captured timing value when the second unit timing event occurs, and f represents the system clock frequency.

5. The speed measurement system according to claim 1 or 2, characterized in that: The speed calculator is further used to obtain a first speed based on the unit timing cycle and the event capture sequence, including: In response to a first unit timing event occurring during a first pulse, acquiring a pulse count value of the first pulse; In response to a second unit timing event occurring during a second pulse, acquiring a pulse count value of the second pulse; The unit timing period is used as the speed measurement time; obtaining a speed measurement pulse number based on a pulse count value of the first pulse and a pulse count value of the second pulse; The first speed is obtained based on the speed measurement pulse number and the speed measurement time.

6. The speed measurement system according to claim 1 or 2, characterized in that: The speed calculator is further used to obtain a second speed based on the first capture timing sequence, including: In response to a first unit timing event occurring during the first pulse, acquiring a first capture timing value of the first pulse; The second speed is obtained based on a first capture timing value of the first pulse.

7. The speed measurement system according to claim 1, characterized in that: It also includes a unit timing register. When the timing of the unit timer reaches a preset value of the unit timing register, the unit timer is reset and the unit timing event is generated.

8. The speed measurement system according to claim 5, characterized in that: Also includes condition factor registers, When the ratio of the first capture timing value to the clock frequency is less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain an average speed based on the unit timing period, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence; When the ratio of the first capture timing value to the clock frequency is not less than the product of the condition factor and the unit timing period, the speed calculator is used to obtain a second speed based on the first capture timing sequence.

9. A speed measurement method, characterized in that: include: performing pulse counting based on the orthogonal coded pulses, and acquiring a pulse count sequence in response to a unit timing event; Acquire a first capture timing sequence based on the orthogonal coded pulses, and acquire a second capture timing sequence in response to a unit timing event; An average speed is obtained based on a unit timing period, the pulse counting sequence, the first capture timing sequence, and the second capture timing sequence.

10. The speed measurement method according to claim 9, characterized in that: The obtaining of the average speed based on the unit timing cycle, the pulse counting sequence, the first capture timing sequence and the second capture timing sequence comprises: In response to a first unit timing event occurring during a first pulse, a pulse count value of the first pulse, a first capture timing value of the first pulse, and a second capture timing value of the first pulse are acquired, and a first time difference value is obtained based on a difference between the first capture timing value of the first pulse and the second capture timing value of the first pulse; In response to a second unit timing event occurring during a second pulse, acquiring a pulse count value of the second pulse, a first capture timing value of the second pulse, and a second capture timing value of the second pulse, and obtaining a second time difference value based on the second capture timing value of the second pulse; Obtaining a speed measurement time based on the unit timing period, the first time difference, and the second time difference; obtaining a speed measurement pulse number based on a pulse count value of the first pulse and a pulse count value of the second pulse; The average speed is obtained based on the speed measurement pulse number and the speed measurement time.