A speed measuring device, a speed measuring method and a storage medium of an electric machine

By obtaining the given encoder pulse count of the motor and adjusting the number of pulse filters in the peripheral module, the error problem of incremental encoder speed measurement at low and high speeds is solved, realizing fast and efficient calculation of motor speed measurement.

CN115356501BActive Publication Date: 2026-01-13SHENZHEN HPMONT TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210994255.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2026-01-13
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

Existing incremental encoder speed measurement methods have large errors at low and high speeds, are complex to process and computationally complex, resulting in slow speed measurement.

Method used

By obtaining the given encoder pulse count of the motor in the current pulse width modulation cycle, the deviation results of multiple peripheral modules are determined, the number of pulse filters of the target peripheral module is adjusted, and the feedback speed of the motor is quickly calculated using the processor.

Benefits of technology

It enables the rapid and accurate acquisition of motor feedback speed within different speed ranges, simplifies algorithm execution, and reduces CPU computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115356501B_ABST
    Figure CN115356501B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a speed measuring device, a speed measuring method and a storage medium of a motor, and is used in the technical field of motors. The speed measuring device comprises an incremental encoder, a processor, a memory and a plurality of peripheral modules, the memory stores executable program codes, and the processor is used to realize the following steps when executing the executable program codes: acquiring a given encoder pulse number of the incremental encoder in a current pulse width modulation period of the motor; determining a deviation result of a motor rotating speed obtained by the plurality of peripheral modules and a preset motor rotating speed according to the given encoder pulse number; determining a target peripheral module from the plurality of peripheral modules according to the deviation result, and adjusting the pulse filtering number of the target peripheral module to obtain a target pulse filtering number; and obtaining the feedback speed of the motor according to the target pulse filtering number. The target peripheral module is determined through the deviation result, and the feedback speed of the motor can be quickly obtained according to the target peripheral module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor technology, and in particular to a speed measuring device, speed measuring method and storage medium for a motor. Background Technology

[0002] An electric motor is a device that converts electrical energy into mechanical energy. It utilizes energized coils (stator windings) to generate a rotating magnetic field, which acts on the rotor to create magnetoelectric torque. Electric motors are very convenient to use and control, possessing capabilities such as self-starting, acceleration, braking, and reversal, meeting various operational requirements, and offering high efficiency. Speed ​​measurement is necessary in various applications of electric motors. Current methods for measuring motor speed often employ incremental encoders.

[0003] Currently, incremental encoder speed measurement methods mainly include the T-method, the M-method, and the M / T method. The traditional T-method has a large error at high speeds, while the traditional M-method has a large error at low speeds. There are currently two main methods used in industrial applications: 1. Using the T-method for low speeds and the M-method for high speeds; 2. The M / T method. The first method requires addressing the transition between low and high speeds, which is more complex. The second method heavily relies on the execution cycle of the speed measurement algorithm, requiring uniform execution time, and the algorithm's long execution time increases the computational complexity of the CPU.

[0004] Therefore, existing incremental encoder speed measurement methods require a lot of time and are slow when measuring the speed of a motor. Summary of the Invention

[0005] This application provides a speed measuring device, speed measuring method, and storage medium for a motor, which can quickly obtain the feedback speed of the motor.

[0006] This application provides a speed measuring device for a motor, comprising: an incremental encoder, a processor, a memory, and multiple peripheral modules. The memory stores executable program code, and the processor is used to implement the following steps when executing the executable program code:

[0007] Obtain the given encoder pulse number of the incremental encoder in the current pulse width modulation cycle of the motor;

[0008] Based on the given encoder pulse count, determine the deviation between the motor speed obtained by the multiple peripheral modules and the preset motor speed;

[0009] Based on the deviation results, a target peripheral module is determined from the plurality of peripheral modules, and the number of pulse filters of the target peripheral module is adjusted to obtain the target number of pulse filters;

[0010] The feedback speed of the motor is obtained based on the target number of pulse filters.

[0011] Furthermore, obtaining the given encoder pulse number of the incremental encoder in the current pulse width modulation cycle of the motor includes:

[0012] According to the formula: The given encoder pulse number is obtained. ; wherein, the Given a speed for the motor, the The encoder pulse count of the incremental encoder, the This refers to the carrier frequency of the frequency converter.

[0013] Furthermore, the plurality of peripheral modules include a first peripheral module and a second peripheral module;

[0014] The step of determining the deviation between the motor speed obtained by the multiple peripheral modules and the preset motor speed based on the given encoder pulse number includes:

[0015] like If the deviation result is determined to be that the motor speed obtained by the first peripheral module is less than the preset motor speed;

[0016] like If the deviation result is determined to be that the motor speed obtained by the first peripheral module is greater than the preset motor speed;

[0017] like If the deviation result is determined to be that the motor speed obtained by the second peripheral module is less than the preset motor speed;

[0018] like If the deviation result is determined to be that the motor speed obtained by the second peripheral module is greater than the preset motor speed;

[0019] Among them, the The number of pulse filters in the first peripheral module is [number], and [number] is [number]. The The number of pulse filters in the second peripheral module is denoted as , and ; The given encoder pulse count obtained by the first peripheral module. The given encoder pulse count is obtained by the second peripheral module.

[0020] Furthermore, the step of determining the target peripheral module from the plurality of peripheral modules based on the deviation result, and adjusting the number of pulse filters of the target peripheral module to obtain the target number of pulse filters includes:

[0021] If the deviation result is that the motor speed obtained by the first peripheral module is less than the preset motor speed, then the first peripheral module is determined to be the target peripheral module, and the number of pulse filters of the first peripheral module is increased to obtain the target number of pulse filters;

[0022] If the deviation result is that the motor speed obtained by the first peripheral module is greater than the preset motor speed, then the first peripheral module is determined to be the target peripheral module, and the number of pulse filters of the first peripheral module is reduced to obtain the target number of pulse filters;

[0023] If the deviation result is that the motor speed obtained by the second peripheral module is less than the preset motor speed, then the second peripheral module is determined to be the target peripheral module, and the number of pulse filters of the second peripheral module is increased to obtain the target number of pulse filters;

[0024] If the deviation result is that the motor speed obtained by the second peripheral module is greater than the preset motor speed, then the second peripheral module is determined to be the target peripheral module, and the number of pulse filters of the second peripheral module is reduced to obtain the target number of pulse filters.

[0025] Furthermore, the step of increasing the number of pulse filters of the first peripheral module to obtain the target number of pulse filters includes: setting... ;

[0026] The step of reducing the number of pulse filters in the first peripheral module to obtain the target number of pulse filters includes: setting... ;

[0027] The step of increasing the number of pulse filters in the second peripheral module to obtain the target number of pulse filters includes: setting... ;

[0028] The step of reducing the number of pulse filters in the second peripheral module to obtain the target number of pulse filters includes: setting... .

[0029] Furthermore, obtaining the feedback speed of the motor based on the target pulse filtering number includes:

[0030] When the first peripheral module is the target peripheral module, then according to the formula:

[0031] The feedback speed of the motor is obtained. , wherein This is the pulse counting time of the first peripheral module;

[0032] When the second peripheral module is the target peripheral module, then according to the formula:

[0033] The feedback speed of the motor is obtained. , wherein For one pulse counting time of the second peripheral module, and the It is positively correlated with the number of target pulse filters.

[0034] Furthermore, the processor is also configured to, in each adjacent preset clock cycle, acquire the first pulse signal and the second pulse signal of the first peripheral module and the second peripheral module, respectively, to obtain the... and the The first pulse signal leads the second pulse signal, and both the first pulse signal and the second pulse signal are pulse signals generated by the incremental encoder to measure the speed of the motor.

[0035] This application also provides a method for measuring the speed of a motor, including:

[0036] Obtain the given encoder pulse count of the motor in the current pulse width modulation cycle;

[0037] The deviation of the motor speed is determined based on the given encoder pulse count;

[0038] Adjust the number of pulse filters based on the deviation results;

[0039] The feedback speed of the motor is obtained based on the adjusted number of pulse filters.

[0040] This application also provides a speed measuring device for a motor, comprising:

[0041] The acquisition unit is used to acquire the number of encoder pulses of the motor in the current pulse width modulation period;

[0042] The determining unit is used to determine the deviation result of the motor speed based on the given encoder pulse number;

[0043] An adjustment unit is used to adjust the number of pulse filters based on the deviation result;

[0044] An execution unit is used to obtain the feedback speed of the motor based on the adjusted number of pulse filters.

[0045] This application also provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes instructions that, when executed on a computer, cause the computer to perform the above-described speed measurement method.

[0046] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0047] In this embodiment, the following steps are taken: First, a given encoder pulse count from the incremental encoder is obtained during the current pulse width modulation cycle of the motor. Based on this given encoder pulse count, the deviation between the motor speed obtained from multiple peripheral modules and a preset motor speed is determined. Then, a target peripheral module is selected from the multiple peripheral modules based on the deviation result, and the number of pulse filters in the target peripheral module is adjusted to obtain the target number of pulse filters. Finally, the feedback speed of the motor is obtained based on the target number of pulse filters. By determining the target peripheral module through the deviation result, the feedback speed of the motor can be quickly obtained based on the target peripheral module. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0049] Figure 1 This is a flowchart of a motor speed measurement process disclosed in an embodiment of this application;

[0050] Figure 2 This is a diagram of a speed measuring device for an electric motor disclosed in an embodiment of this application;

[0051] Figure 3 This is a schematic diagram of the pulse signal of an encoder disclosed in an embodiment of this application;

[0052] Figure 4 This is a flowchart of the speed measurement process for another motor disclosed in an embodiment of this application;

[0053] Figure 5 This is a diagram of a speed measuring device for another motor disclosed in an embodiment of this application. Detailed Implementation

[0054] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0055] In the description of the embodiments of this application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0056] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific circumstances.

[0057] Existing incremental encoder speed measurement methods for motors require addressing the transition between low and high speeds, which is complex; or they rely on the execution cycle of the speed measurement algorithm, requiring uniform time and resulting in long algorithm execution times, increasing CPU computational complexity and requiring significant time, thus slowing down the speed measurement. Therefore, this application provides a motor speed measurement device that can quickly obtain the motor's feedback speed, such as... Figure 2 As shown:

[0058] The speed measuring device includes an incremental encoder, a processor (CPU), a memory, and multiple peripheral modules (QEP1 and QEP2). The peripheral modules are housed within the processor and controlled by the processor. Each peripheral module's QEPA pin is connected to the incremental encoder's QEPA pin, and each peripheral module's QEPB pin is connected to the incremental encoder's QEPB pin. These peripheral modules typically contain motor decoding and speed calculation algorithm hardware. The incremental encoder is connected to the motor, usually mounted on the motor's shaft. It generates QEPA and QEPB pulse signals by measuring the motor's speed; these two signals are typically 90 degrees out of phase. The incremental encoder uses hardware circuitry to send the QEPA pulse signal to the QEPA pin of each peripheral module and the QEPB pulse signal to the QEPB pin of each peripheral module.

[0059] The speed measuring device's memory stores executable program code, and the processor is used to implement, when executing the executable program code, such as... Figure 1 The steps shown are as follows:

[0060] 101. Obtain the given encoder pulse count for the motor in the current pulse width modulation cycle.

[0061] The speed measuring device can obtain the given encoder pulse count of the incremental encoder in the current pulse width modulation cycle of the motor; specifically, it can be obtained according to the formula: To obtain the given encoder pulse number ;in, For the given speed of the motor, This refers to the encoder pulse count of an incremental encoder. This refers to the inverter carrier frequency. When calculating the given encoder pulse count for each PWM cycle, the given speed may vary, and the given encoder pulse count obtained in different PWM cycles may differ.

[0062] 102. Determine the deviation of the motor speed based on the given encoder pulse count.

[0063] The speed measuring device can determine the deviation between the motor speed obtained from multiple peripheral modules and a preset motor speed based on a given encoder pulse count. This preset motor speed is generally the actual speed of the motor. The multiple peripheral modules include a first peripheral module QEP1 and a second peripheral module QEP2. Specifically, if... If the deviation result is determined to be that the motor speed obtained by the first peripheral module QEP1 is less than the preset motor speed, that is, the actual motor speed is too high; if If the deviation result is determined to be that the motor speed obtained by the first peripheral module QEP1 is greater than the preset motor speed, that is, the actual motor speed is too low; if If the deviation result is determined to be that the motor speed obtained by the second peripheral module QEP2 is less than the preset motor speed, that is, the actual motor speed is too high; if If the deviation result is determined to be that the motor speed obtained by the second peripheral module is greater than the preset motor speed, that is, the actual motor speed is too low. The number of pulse filters for the first peripheral module QEP1, and ; The number of pulse filters for the second peripheral module QEP2, and ; The given encoder pulse count obtained by the first peripheral module. The given encoder pulse count is obtained by the second peripheral module.

[0064] 103. Adjust the number of pulse filters based on the deviation results.

[0065] After obtaining the deviation result, the target peripheral module can be determined from multiple peripheral modules based on the deviation result, and the number of pulse filters of the target peripheral module can be adjusted to obtain the target number of pulse filters. Specifically, if the deviation result is that the motor speed obtained by the first peripheral module QEP1 is less than the preset motor speed, then the first peripheral module QEP1 is determined as the target peripheral module, and the number of pulse filters of the first peripheral module QEP1 is increased to obtain the target number of pulse filters; that is, when it is determined that the actual motor speed is too high, the number of pulse filters of the first peripheral module QEP1 needs to be increased. This increase in the number of pulse filters of the first peripheral module to obtain the target number of pulse filters can be achieved by setting... This involves incrementing the pulse filter count of the first peripheral module QEP1 by one and assigning it to the pulse filter count of the second peripheral module QEP2.

[0066] If the deviation result indicates that the motor speed obtained by the first peripheral module QEP1 is greater than the preset motor speed, then the first peripheral module is determined to be the target peripheral module, and the number of pulse filters in the first peripheral module QEP1 is reduced to obtain the target number of pulse filters; that is, when the actual motor speed is determined to be small, the number of pulse filters in the first peripheral module QEP1 needs to be reduced. This reduction of the number of pulse filters in the first peripheral module QEP1 to obtain the target number of pulse filters can be achieved by setting... The pulse filter count of the first peripheral module QEP1 is reduced by one, and the result is assigned to the pulse filter count of the second peripheral module QEP2.

[0067] If the deviation result indicates that the motor speed obtained by the second peripheral module QEP2 is less than the preset motor speed, then the second peripheral module QEP2 is determined as the target peripheral module, and the number of pulse filters in the second peripheral module QEP2 is increased to obtain the target number of pulse filters. That is, when the actual motor speed is determined to be too high, the number of pulse filters in the second peripheral module QEP1 needs to be increased. This increase in the number of pulse filters in the second peripheral module QEP2 to obtain the target number of pulse filters can be achieved by setting... .

[0068] If the deviation result shows that the motor speed obtained by the second peripheral module is greater than the preset motor speed, then the second peripheral module is determined to be the target peripheral module, and the number of pulse filters in the second peripheral module is reduced to obtain the target number of pulse filters. That is, when the actual motor speed is determined to be smaller, the number of pulse filters in the second peripheral module QEP2 needs to be reduced. This reduction in the number of pulse filters in the second peripheral module QEP2 to obtain the target number of pulse filters can be achieved by setting... .

[0069] 104. The feedback speed of the motor is obtained based on the adjusted number of pulse filters.

[0070] The speed measuring device obtains the motor's feedback speed based on the target pulse filter count after adjustment of the pulse filter count. Specifically, when the first peripheral module QEP1 is the target peripheral module, the speed can be determined according to the formula:

[0071] The feedback speed of the motor is obtained. ,in, This is the pulse counting time for the first peripheral module QEP1. It is understandable that... With the above It is a positive correlation, that is The larger it is, the more it should The larger it gets, the bigger it becomes.

[0072] When the second peripheral module QEP2 is the target peripheral module, then according to the formula:

[0073] The feedback speed of the motor is obtained. ,in, This is the pulse counting time for the second peripheral module QEP2. It is understandable that... With the above It is a positive correlation, that is The larger it is, the more it should The larger it gets, the bigger it becomes.

[0074] Furthermore, the processor of the speed measuring device is also used to acquire the first pulse signal QEPA and the second pulse signal QEPB of the first peripheral module QEP1 and the second peripheral module QEP2 respectively in each adjacent preset clock cycle, and obtain... as well as The preset clock period can be either an 8-bit clock period or a 16-bit clock period; the specific timeframe is not limited here. The first pulse signal QEPA leads the second pulse signal QEPB, and both the first pulse signal QEPA and the second pulse signal QEPB are pulse signals generated by the incremental encoder to measure the speed of the motor. It is understandable that... Figure 3 As shown, the speed measuring device can be configured with a first peripheral module QEP1 and a second peripheral module QEP2 of the processor, respectively. A QCLK signal is generated at each edge of the first pulse signal QEPA and the second pulse signal QEPB. At intervals of several QCLK signal edges, QCTMR signals are captured, and the following are obtained: as well as .

[0075] In this embodiment, the following steps are taken: First, a given encoder pulse count from the incremental encoder is obtained during the current pulse width modulation cycle of the motor. Based on this given encoder pulse count, the deviation between the motor speed obtained from multiple peripheral modules and a preset motor speed is determined. Then, a target peripheral module is selected from the multiple peripheral modules based on the deviation result, and the number of pulse filters in the target peripheral module is adjusted to obtain the target number of pulse filters. Finally, the feedback speed of the motor is obtained based on the target number of pulse filters. By determining the target peripheral module through the deviation result, the feedback speed of the motor can be quickly obtained based on the target peripheral module. Selecting a suitable QEP1 or QEP2 allows for rapid calculation of the feedback speed. Meanwhile, there is no precise timing requirement for the execution time of the speed measurement module, which makes the most of the peripheral functions and clock accuracy of the processor (chip) itself to achieve high efficiency and high accuracy of the speed measurement method.

[0076] Furthermore, in one feasible solution, such as Figure 4 As shown, the relevant parameters of the first peripheral module QEP1 and the second peripheral module QEP2 can be set as follows, and the appropriate QEP1 or QEP2 can be selected to calculate the feedback speed. Specifically: calculate... ,according to After obtaining the initial number of pulse filters for the first peripheral module, the first step is to calculate the feedback speed. ,set up ;calculate ;like If so, proceed to step two; if If so, proceed to step three. Step two: Calculate the feedback speed. ,set up ;calculate ;like If so, then jump back to step one; if Then skip to step four. Step three: Calculate the feedback speed. ,set up ;calculate ;like If so, then skip to step four; if Then jump back to step one. Step four: Calculate the feedback speed. ,set up ;calculate ;like If so, then jump back to step three; if If so, then jump back to step two.

[0077] This application also provides a speed measuring device for a motor, such as... Figure 5 As shown, it includes:

[0078] The acquisition unit 501 is used to acquire the given encoder pulse number of the motor in the current pulse width modulation period;

[0079] The determining unit 502 is used to determine the deviation result of the motor speed based on the given encoder pulse number;

[0080] Adjustment unit 503 is used to adjust the number of pulse filters according to the deviation result;

[0081] The execution unit 504 is used to obtain the feedback speed of the motor based on the adjusted number of pulse filters.

[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0083] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0084] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0085] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0086] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A speed measuring device for an electric machine, the speed measuring device comprising: An incremental encoder, a processor, a memory and a plurality of peripheral modules, wherein the plurality of peripheral modules are arranged on the processor, and the plurality of peripheral modules are controlled by the processor; a QEPA pin of each of the peripheral modules is connected with a QEPA pin of the incremental encoder, and a QEPB pin of each of the peripheral modules is connected with a QEPB pin of the incremental encoder; the memory stores executable program codes, and the processor is configured to implement the following steps when executing the executable program codes: obtaining a given encoder pulse number of the incremental encoder in a current pulse width modulation period of the motor; determining a deviation result of a motor speed obtained by the plurality of peripheral modules from a preset motor speed according to the given encoder pulse number; determining a target peripheral module from the plurality of peripheral modules according to the deviation result, and adjusting a pulse filtering number of the target peripheral module to obtain a target pulse filtering number; wherein the pulse filtering number of the target peripheral module is log2 (the given encoder pulse number obtained by the target peripheral module); obtaining a feedback speed of the motor according to the target pulse filtering number. The step of obtaining the given encoder pulse number of the incremental encoder in the current pulse width modulation period of the motor comprises: According to the formula: , the given encoder pulse number PwmPulseSet is obtained; wherein the NSet is the given speed of the motor, the PgPulse is the encoder pulse number of the incremental encoder, and the Fc is the frequency converter carrier frequency.

2. The speed measuring device of claim 1, wherein The plurality of peripheral modules comprise a first peripheral module and a second peripheral module. The step of determining the deviation result of the motor speed obtained by the plurality of peripheral modules from the preset motor speed according to the given encoder pulse number comprises: If , it is determined that the deviation result is that the motor rotating speed obtained by the first peripheral module is less than the preset motor rotating speed; If , it is determined that the deviation result is that the motor rotating speed obtained by the first peripheral module is greater than the preset motor rotating speed; If , it is determined that the deviation result is that the motor rotating speed obtained by the second peripheral module is less than the preset motor rotating speed; If , it is determined that the deviation result is that the motor rotating speed obtained by the second peripheral module is greater than the preset motor rotating speed; Wherein, the QEP1UPPS is the pulse filtering number of the first peripheral module, and ; The QEP2UPPS is the number of pulse filters of the second peripheral module, and ; is the number of given encoder pulses obtained for the first peripheral module, is the number of given encoder pulses obtained for the second peripheral module.

3. The device of claim 2, wherein, The step of determining the target peripheral module from the plurality of peripheral modules according to the deviation result, and adjusting the pulse filtering number of the target peripheral module to obtain the target pulse filtering number comprises: If the deviation result is that the motor speed obtained by the first peripheral module is less than the preset motor speed, the first peripheral module is determined as the target peripheral module, and the pulse filtering number of the first peripheral module is increased to obtain the target pulse filtering number; If the deviation result is that the motor speed obtained by the first peripheral module is greater than the preset motor speed, the first peripheral module is determined as the target peripheral module, and the pulse filtering number of the first peripheral module is decreased to obtain the target pulse filtering number; If the deviation result is that the motor speed obtained by the second peripheral module is less than the preset motor speed, the second peripheral module is determined as the target peripheral module, and the pulse filtering number of the second peripheral module is increased to obtain the target pulse filtering number; If the deviation result is that the motor speed obtained by the second peripheral module is greater than the preset motor speed, the second peripheral module is determined as the target peripheral module, and the pulse filtering number of the second peripheral module is decreased to obtain the target pulse filtering number.

4. The device of claim 3, wherein, The increasing the pulse filtering number of the first peripheral module to obtain the target pulse filtering number comprises: setting ; The reducing the pulse filtering number of the first peripheral module to obtain the target pulse filtering number comprises: ; The increasing the pulse filtering number of the second peripheral module to obtain the target pulse filtering number comprises: setting ; The reducing the pulse filtering number of the second peripheral module to obtain the target pulse filtering number comprises: .

5. The device of claim 4, wherein, The step of obtaining the feedback speed of the motor according to the target pulse filtering number comprises: When the first peripheral module is the target peripheral module, the feedback speed of the motor is obtained according to the formula: obtaining a feedback speed of the motor wherein the is a pulse counting time of the first peripheral module, and the is positively correlated with the target pulse filtering number When the second peripheral module is the target peripheral module, the feedback speed of the motor is obtained according to the formula: , obtaining a feedback speed of the motor , wherein the is a pulse counting time of the second peripheral module, and the is positively correlated with the target pulse filtering number.

6. The device of claim 5, wherein, The processor is further configured to collect first pulse signals and second pulse signals of the first peripheral module and the second peripheral module respectively to obtain the QEP1 QCPRD and the QEP2 QCPRD every adjacent preset clock cycle, wherein the first pulse signals are ahead of the second pulse signals, and the first pulse signals and the second pulse signals are both pulse signals generated by the incremental encoder when measuring the speed of the motor.

Citation Information

Patent Citations

  • Method and device for eliminating MT method speed measurement error of incremental photoelectric encoder

    CN107425759A