Rotor angle subdivision method and device, computer equipment and storage medium

By obtaining the flip signal of the encoder and calculating the time difference between its rising and falling edges, determining the number of subdivided steps of the rotor angle, the problem of improving control accuracy in the prior art is solved, and high-precision rotor angle measurement and control are achieved , reducing system costs.

CN119401873APending Publication Date: 2025-02-07CHANGSHA YINGWEITENG ELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411450865.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the field of industrial automation, it is difficult for the prior art to achieve higher control accuracy without increasing control costs, especially in the precise measurement of rotor angles.

Method used

By obtaining the flip signal corresponding to the orthogonal pulse signal of the encoder, and determining the total number of subdivided steps of the angle to be subdivided according to the time difference between the rising and falling edges of the flip signal, thereby achieving high accuracy of the rotor motion process segmentation.

Benefits of technology

Without relying on higher specification encoders, the control accuracy is significantly improved, the demand for high-precision control of the rotor is met, while simplifying the signal processing process and reducing system costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119401873A_ABST
    Figure CN119401873A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of rotor angle subdivision, and provides a rotor angle subdivision method and device, computer equipment and a storage medium. The subdivision method of the rotor angle comprises the following steps: acquiring an overturning signal corresponding to an orthogonal pulse signal of an encoder; obtaining a to-be-subdivided angle of the overturning signal; determining the total subdivision step number of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the overturning signal; and determining the current subdivision angle of the rotor according to the total subdivision step number and the angle to be subdivided. The control precision can be obviously improved under the condition of not depending on an encoder with a higher specification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of motor control technology, and in particular, relates to a rotor angle subdivision method, device, computer equipment and storage medium. Background Art

[0002] In the field of industrial automation, motor encoders play a key role in converting rotation or displacement information into electrical signals. Among them, AB orthogonal pulse signals are a common input method, which mainly relies on the rising or falling edge of the signal to count to track the rotation angle of the motor. However, with the continuous improvement of control accuracy requirements, it is often necessary to turn to higher specification encoders, which directly leads to an increase in system costs. Therefore, how to ensure higher control accuracy without increasing control costs has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide a rotor angle subdivision method, apparatus, computer equipment, and storage medium, which can achieve a significant improvement in control accuracy without relying on a higher specification encoder.

[0004] In the first aspect, an embodiment of the present application provides a method for subdividing a rotor angle, the method comprising: obtaining a flip signal corresponding to an orthogonal pulse signal of an encoder; obtaining the angle to be subdivided of the flip signal; determining the total number of subdivision steps of the angle to be subdivided based on the time difference between the rising edge and the falling edge of the flip signal; determining the current subdivision angle of the rotor based on the total number of subdivision steps and the angle to be subdivided.

[0005] In one of the embodiments of the first aspect, obtaining a flip signal corresponding to an orthogonal pulse signal of an encoder includes: obtaining the orthogonal pulse signal output by the encoder; and performing XOR processing on the orthogonal pulse signal to obtain a flip signal.

[0006] In one embodiment of the first aspect, obtaining the angle to be subdivided of the flip signal includes: determining the angle to be subdivided of the flip signal according to encoder count values ​​obtained at adjacent moments, the number of lines of the encoder in one rotation, and the number of pole pairs of the motor.

[0007] In one of the embodiments of the first aspect, determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal includes: obtaining the current operating cycle of the encoder; determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal and the current operating cycle.

[0008] In one of the embodiments of the first aspect, the total number of subdivision steps includes the current number of subdivision steps; determining the current subdivision angle of the rotor based on the total number of subdivision steps and the angle to be subdivided includes: determining the current subdivision step corresponding to the current operating cycle of the encoder; determining the current subdivision angle of the rotor based on the total number of subdivision steps, the current number of subdivision steps and the angle to be subdivided.

[0009] In one of the embodiments of the first aspect, the method also includes: determining the target subdivision angle of the rotor corresponding to the next edge of the flip signal when the current subdivision step number is the same as the total subdivision step number; determining the predicted rotor angle corresponding to the next edge of the flip signal based on the target subdivision angle and the first main angle of the rotor; the first main angle of the rotor is a reference angle corresponding to the current edge of the flip signal of the rotor; determining whether the rotor angle is accurate based on the predicted rotor angle and the second main angle of the rotor; the second main angle of the rotor is a reference angle corresponding to the next edge of the flip signal of the rotor.

[0010] In one of the embodiments of the first aspect, determining whether the rotor angle is accurate is performed based on the rotor predicted angle and the rotor second main angle, including: determining the angle difference between the rotor predicted angle and the rotor second main angle; if the angle difference is greater than a preset difference, determining that the rotor angle is inaccurate.

[0011] In a second aspect, an embodiment of the present application provides a rotor angle subdivision device, the rotor angle subdivision device comprising:

[0012] The first acquisition module is used to acquire the flip signal corresponding to the orthogonal pulse signal of the encoder.

[0013] The second acquisition module is used to acquire the angle to be subdivided of the flip signal.

[0014] The first determination module is used to determine the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal.

[0015] The second determination module is used to determine the current subdivision angle of the rotor according to the total number of subdivision steps and the angle to be subdivided.

[0016] In a third aspect, an embodiment of the present application provides a motor comprising the rotor angle subdivision device of the second aspect.

[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in order to increase the control accuracy of the encoder, the flip signal corresponding to the orthogonal pulse signal of the encoder is obtained, and the number of steps to be subdivided of the flip signal is obtained. Based on the time difference between the rising edge and the falling edge of the flip signal, the number of steps required for the angle to be subdivided, that is, the total number of subdivision steps, is determined, thereby realizing high-precision segmentation of the rotor motion process, thereby providing a data basis for the angle measurement of finer forces, so as to be able to capture more subtle angle changes, and achieving a significant improvement in control accuracy without relying on a higher specification encoder, thereby meeting the demand for high-precision control of the rotor. Secondly, due to the complexity of the phase relationship of the orthogonal pulse signal, and the flip signal as a direct embodiment of the relative change and movement direction of the orthogonal pulse signal, by obtaining the total number of subdivision steps of the flip signal, its pulse characteristics make the detection of rotation changes more intuitive and easy to implement, simplifying the signal processing process. Through this method, not only the problem of rising system costs caused by having to use high-cost encoders due to the pursuit of high precision is effectively reduced, but also the number of subdivision steps can be adjusted according to actual needs, enhancing the flexibility and adaptability of the encoder to meet different control accuracy requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 It is a schematic diagram of the architecture of a rotor angle subdivision system provided by an embodiment of the present application;

[0020] Figure 2 is a schematic flow chart of a rotor angle subdivision method provided in an embodiment of the present application;

[0021] Figure 3 It is a signal waveform diagram of an orthogonal pulse signal converted into a flip signal provided by an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of the effect of subdividing angles provided by another embodiment of the present application;

[0023] Figure 5 is a schematic structural diagram of a rotor angle subdivision device provided in one embodiment of the present application;

[0024] Figure 6 is a structural diagram of a computer device provided in one embodiment of the present application; DETAILED DESCRIPTION

[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0028] As used in the specification and appended claims of this application, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.

[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0031] To facilitate understanding of the embodiments of the present application, some terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0032] At present, there are many types of encoders in the field of industrial control, among which encoders with specifications such as 1024 lines and 2500 lines are widely used because they can meet most production needs. However, there are still many low-resolution encoders such as 100 lines and 250 lines on the market. Although they have advantages in cost control, they pose significant challenges to vector control, especially the accurate measurement of rotor angle. Especially in terms of accurate measurement of rotor angle, low resolution directly leads to decreased control efficiency, weakened control ability and increased energy consumption. However, with the continuous improvement of control accuracy requirements, it is often necessary to turn to higher-specification encoders, which directly leads to an increase in system costs. Therefore, how to ensure higher control accuracy without increasing control costs has become a technical problem that needs to be solved urgently.

[0033] Based on this, the embodiment of the present application provides a rotor angle subdivision method, device, computer equipment and storage medium. The technical principle of the method is: by performing XOR gate processing on the orthogonal pulse signal, the flip signal of the orthogonal pulse signal is obtained, and by subdividing the time difference between the rising edge and the falling edge in the flip signal, the number of steps required to rotate from the leading edge to the trailing edge in a time difference in the flip signal is obtained, that is, the total number of subdivision steps. And the number of edges of the flip signal when the rotor rotates one circle is obtained; so as to determine the first main angle of the rotor at the current edge according to the number of edges. Afterwards, the current subdivision angle is determined by the subdivision steps (including the total number of subdivision steps and the current number of subdivision steps) and the first main angle of the rotor at the current edge, and the current angle of the rotor is predicted accordingly. Thereby, a significant improvement in control accuracy is achieved without relying on a higher specification encoder.

[0034] Before describing the embodiments of the present application, a structure to which the technical solution of the present application can be applied is first described. Figure 1 The embodiment of the present application provides a rotor angle subdivision system, which includes: an encoder 10 and a rotor 20, wherein the encoder 10 includes an encoder module 101, an XOR gate module 102, a timer 103, and a controller 104. The encoder module 101 is connected to the XOR gate module 102, the XOR gate module 102 is connected to the timer 103, and the timer 103 is connected to the controller 104.

[0035] In a possible implementation, the encoder module 101 outputs an orthogonal pulse signal (including an A-phase signal and a B-phase signal) to the XOR gate module 102, and the XOR gate module 102 performs an XOR operation on the A-phase signal and the B-phase signal to obtain a flip signal. The start signal of the timer 103 can come from the output of the XOR gate module 102, indicating a change in the signal. When the XOR gate module 102 detects a change, the timer 103 starts timing. The output signal of the timer 103 can be used for the controller 104, and the controller 104 executes the corresponding control logic according to the output signal of the timer 103. The signal output by the controller 104 can act on the rotor 20. Specifically, a motor driver can also be connected between the controller 104 and the rotor 20, and the controller 104 outputs a signal to the motor driver, and the motor driver adjusts the current and voltage according to the signal of the controller 104, so that the rotor 20 starts to rotate or changes its rotation speed and direction.

[0036] It is understandable that the above only briefly describes the connection method between the various modules, but the embodiments of the present application are not limited to the connection method shown. For example, the controller 104 receives a connection from the XOR gate module 102, receives a signal input from the XOR gate module 102, and executes corresponding control logic based on the signal.

[0037] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0038] Figure 2 A flowchart of an image processing method provided in an embodiment of the present application. The method may include:

[0039] S101, obtaining a flip signal corresponding to the orthogonal pulse signal of an encoder.

[0040] Optionally, the orthogonal pulse signal is that the A phase and B phase of the incremental encoder can output rectangular wave pulse signals respectively, which are recorded as A signal and B signal, and the phase difference between the two signals is ninety degrees.

[0041] Optionally, the flip signal is a rectangular wave pulse signal, and the flip signal is used to characterize the relative change and movement direction of the orthogonal pulse signal.

[0042] In a possible implementation, obtaining a flip signal corresponding to an orthogonal pulse signal of an encoder includes: obtaining the orthogonal pulse signal output by the encoder; and performing XOR processing on the orthogonal pulse signal to obtain the flip signal.

[0043] Optionally, when one of the A signal and the B signal changes from a high level to a low level (or vice versa) while the other remains unchanged, the output of the XOR process will flip.

[0044] In some embodiments, reference Figure 3 , provides a signal waveform diagram of converting an AB orthogonal pulse signal into a flip signal. The flip signal is obtained by performing XOR gate processing on the AB orthogonal pulse signal, that is, A^B=A⊕B, A^B represents a flip signal. When the phase difference between the A signal and the B signal changes (that is, the rising edge of one signal meets the falling edge of the other signal, or vice versa), the output of the XOR gate will flip. Since the phase difference of the AB orthogonal pulse signal is constant at 90°, the output of the XOR gate will flip once every time the A and B signals change (that is, half of a cycle).

[0045] Based on the above, optionally, the period of the orthogonal pulse signal is twice the period of the flip signal.

[0046] S102: Obtain the angle to be subdivided of the flip signal.

[0047] In some embodiments, the angle to be subdivided is the rotation angle of the motor corresponding to half a cycle of the flip signal, that is, the angle between two adjacent edges is the angle to be subdivided.

[0048] It is understandable that in practical applications, the period length of the flip signal corresponding to the angle to be subdivided can be determined according to actual needs. For example, the angle to be subdivided can also be the rotation angle of the motor corresponding to one period. The embodiment of the present application does not impose any limitation on this.

[0049] Optionally, the angle to be subdivided of the flip signal is determined according to encoder count values ​​obtained at adjacent moments, the number of lines of one rotation of the encoder, and the number of pole pairs of the motor.

[0050] In one implementation, the angle to be subdivided of the flip signal is determined according to the encoder count value obtained at the first moment, the encoder count value obtained at the second moment, the number of lines of one rotation of the encoder, and the number of pole pairs of the motor, wherein the second moment is located after the first moment and adjacent to the first moment.

[0051] Further, the angle to be subdivided E is calculated according to the following formula: θ :

[0052]

[0053] Among them, Enc represents the number of lines of the encoder in one rotation, p l Indicates the number of motor pole pairs, Pg indicates the encoder count value, Pg (a2) Indicates the encoder count value at the second moment (a2), Pg(a1) Indicates the encoder count value at the first moment (a1).

[0054] In a possible implementation, the encoder Pg obtained at adjacent moments (a1) With Pg (a2) The difference between the count values ​​is 1, so the above formula can be transformed into the following formula:

[0055]

[0056] S103, determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal.

[0057] Optionally, the time difference is used to characterize the time interval between the leading edge and the trailing edge with a phase difference of 90° in the flip signal, and the total subdivision step number is used to characterize the number of steps required to rotate from the leading edge to the trailing edge in two adjacent edges in the flip signal.

[0058] In some embodiments, the leading edge can be a rising edge or a falling edge. The leading edge is determined by the current angle of the rotor, that is, it is determined according to the current angular position of the rotor. It represents the key position information captured by the encoder when detecting the rotation of the rotor, and this information directly reflects the angular state of the rotor.

[0059] Optionally, the leading edge refers to the edge of the flip signal that changes from one state to another. In a clock signal, if the starting state of the leading edge is low, the leading edge is the rising edge of the signal jumping from low level to high level; if the starting state of the leading edge is high level, the leading edge is the falling edge of the signal jumping from high level to low level. The trailing edge is the edge immediately following the leading edge, which returns from the current state to the starting state in the flip signal. In a clock signal, if the leading edge is a rising edge, the trailing edge is the subsequent falling edge; and vice versa.

[0060] In one implementation, the encoder generates a preset number of pulses per revolution (e.g., 1000 pulses / revolution). Each pulse represents a specific angle (e.g., 360° / 1000=0.36°). By obtaining the number of subdivision steps, each pulse can be further divided into multiple small steps. For example, if each pulse is subdivided into 4 steps, each pulse will generate 4 subdivided pulses, providing a total of 4000 pulses / revolution. This improves the encoder accuracy, allowing the control system to more accurately position and control motion.

[0061] In a possible implementation, the total number of subdivision steps may be obtained by integer subdivision or non-integer subdivision. Integer subdivision is to divide each pulse evenly into several parts. For example, each pulse is subdivided into multiples of 2, 4, 8, etc. Non-integer subdivision refers to the situation in which the total number of subdivision steps is not an integer during the subdivision process.

[0062] S104: Determine the current subdivision angle of the rotor according to the total number of subdivision steps and the angle to be subdivided.

[0063] Optionally, a first main angle of the rotor is obtained, and a current position of the rotor is determined based on the first main angle of the rotor and a current subdivision angle of the rotor.

[0064] The first main angle of the rotor is the reference angle corresponding to the current edge of the rotor flip signal. The reference angle refers to the angle value corresponding to each edge in the flip signal. These values ​​may be pre-set and used as a reference for encoder measurement. The current edge corresponds to the most recent signal change point that the rotor passes during the rotation of the encoder.

[0065] Optionally, the current angle of the rotor is the sum of the first main angle of the rotor and the current subdivision angle.

[0066] In this embodiment, in order to increase the control accuracy of the encoder, the flip signal corresponding to the orthogonal pulse signal of the encoder is obtained, and the number of steps to be subdivided of the flip signal is obtained. Based on the time difference between the rising edge and the falling edge of the flip signal, the number of steps required for the angle to be subdivided, that is, the total number of subdivided steps, is determined, thereby realizing high-precision segmentation of the rotor motion process, thereby providing a data basis for the angle measurement of finer forces, so as to be able to capture more subtle angle changes, and achieving a significant improvement in control accuracy without relying on a higher specification encoder, thereby meeting the demand for high-precision control of the rotor. Secondly, due to the complexity of the phase relationship of the orthogonal pulse signal, and the flip signal as a direct embodiment of the relative change and movement direction of the orthogonal pulse signal, by obtaining the total number of subdivided steps of the flip signal, its pulse characteristics make the detection of rotation changes more intuitive and easy to implement, simplifying the signal processing process. Through this method, not only the problem of rising system costs caused by having to use high-cost encoders due to the pursuit of high precision is effectively reduced, but also the number of subdivided steps can be adjusted according to actual needs, enhancing the flexibility and adaptability of the encoder to meet different control accuracy requirements.

[0067] In one embodiment of the present application, the total number of subdivision steps of the angle to be subdivided is determined based on the time difference between the rising edge and the falling edge of the flip signal, including: obtaining the current operating cycle of the encoder; determining the total number of subdivision steps of the angle to be subdivided based on the time difference between the rising edge and the falling edge of the flip signal and the current operating cycle.

[0068] Optionally, the encoder indicates position changes by outputting a pulse signal. An interrupt service routine can be used to respond to the pulse signal. When the flip signal in the encoder changes, an interrupt is triggered and a counter is updated to obtain the current operating cycle. Alternatively, the output signal of the encoder (i.e., the flip signal) is connected to the input port of a microcontroller or PLC. A counter is set in the microcontroller or PLC to record the pulse signal of the encoder. Whenever the flip signal changes, the value of the counter is updated.

[0069] In one implementation, a preset interruption operation cycle is obtained; and the total number of subdivision steps of the angle to be subdivided is determined according to the time difference between the rising edge and the falling edge of the flip signal and the preset interruption operation cycle.

[0070] The preset interrupt operation cycle is used to characterize the size of each step in the total number of subdivided steps.

[0071] In some embodiments, the preset interrupt operation cycle is used to divide the time difference between the rising edge and the falling edge into a plurality of time periods, and one of the plurality of time periods to which the encoder currently rotates is the current operation cycle.

[0072] Optionally, the preset interrupt operation cycle can be obtained according to the time consumed by the encoder for each calculation, which is recorded as the time consumption. That is, the preset interrupt operation cycle is not less than the time consumption.

[0073] Optionally, the interrupt operation period is preset to 125 μs.

[0074] In some embodiments, according to the formula Convert the time difference T into the total number of subdivision steps, that is, the maximum number of times the system can process within the time difference T. Assuming that each calculation takes 125μs, the total number of times that can be calculated is defined as the total number of subdivision steps T. step .

[0075] Furthermore, the calculated decimal is rounded to get T step It should be noted that the interrupt operation cycle is not limited to 125 μs and can be modified according to actual conditions.

[0076] In one embodiment of the present application, the total number of subdivision steps includes the current number of subdivision steps; the current subdivision angle of the rotor is determined based on the total number of subdivision steps and the angle to be subdivided, including: determining the current number of subdivision steps corresponding to the current operating cycle of the encoder; determining the current subdivision angle of the rotor based on the total number of subdivision steps, the current number of subdivision steps and the angle to be subdivided.

[0077] Optionally, the total number of subdivision steps refers to the number of small steps divided into each full step, which contains a number of subdivision steps. For example, if the angle to be subdivided corresponding to each full step of a motor is 1°, and the total number of subdivision steps is 8, then the unit subdivision angle corresponding to each subdivision step is 0.125°. The unit subdivision angle refers to the angle corresponding to each subdivision step.

[0078] Optionally, the current subdivision step number refers to the current step position of the motor.

[0079] For example, assuming that the total number of subdivision steps is 8, it means that each complete step is subdivided into 8 small steps; the angle to be subdivided is 1°, that is, the motor rotates 1° for each complete step, and the unit subdivision angle is determined according to the angle to be subdivided and the total number of subdivision steps: unit subdivision angle = angle to be subdivided / total number of subdivision steps, that is, unit subdivision angle = 1° / 8 = 0.125°; assuming that the rotor has rotated through the current edge according to the control signal, assuming that the current number of subdivision steps is 5 (indicating that the rotor has rotated 5 subdivision steps). Current subdivision angle = current number of subdivision steps × unit subdivision angle, that is, current subdivision angle = 5 × 0.125° = 0.625°.

[0080] Furthermore, the first main angle of the rotor corresponding to the current edge is assumed to be 2°, based on the current position of the rotor after passing the current edge.

[0081] Furthermore, the number of lines of the encoder in one rotation and the number of pulses currently recorded are obtained. After determining the first main angle of the rotor when the rotor passes the current edge, the current subdivision angle of the rotor is determined based on the total subdivision steps, the current subdivision steps and the angle to be subdivided.

[0082] Specifically, the current subdivision angle E is calculated according to the following formula: θm :

[0083]

[0084] Among them, E θ Indicates the angle to be subdivided, Enc indicates the number of lines per encoder rotation, T step Indicates the total number of subdivision steps, p l Indicates the number of pole pairs of the motor, m indicates the current number of subdivision steps, and the value range of m is [1, 2, ..., T step ].

[0085] In one embodiment of the present application, the method also includes: determining a target subdivision angle of the rotor corresponding to the next edge of the flip signal when the current subdivision step number is the same as the total subdivision step number; determining a predicted rotor angle corresponding to the next edge of the flip signal based on the target subdivision angle and the first main angle of the rotor; the first main angle of the rotor is a reference angle of the rotor corresponding to the current edge of the flip signal; determining whether the rotor angle is accurate based on the predicted rotor angle and the second main angle of the rotor; the second main angle of the rotor is a reference angle of the rotor corresponding to the next edge of the flip signal.

[0086] Optionally, the main angle is the rotor angle (ie, reference angle) at the edge of the flip signal, and the main angle may be preset and used as a reference for encoder measurement. The current edge corresponds to the most recent signal change point that the rotor in the encoder passes through.

[0087] In some embodiments, the current edge is a rising edge or a falling edge. The current edge is determined based on the current angular position of the rotor. It represents the key position information captured by the encoder when detecting the rotation of the rotor, which directly reflects the angular state of the rotor.

[0088] Optionally, if the current edge is a rising edge, the next edge is a falling edge; if the current edge is a falling edge, the next edge is a rising edge.

[0089] In one embodiment of the present application, obtaining the rotor first main angle of the current edge in the encoder's flip signal includes: obtaining the number of pulses currently recorded; and determining the rotor first main angle of the current edge according to the number of pulses.

[0090] Optionally, each pulse of the orthogonal pulse signal will generate a rising edge and a falling edge in phase A and phase B respectively, so each pulse will generate 4 edges (A phase rising edge, A phase falling edge, B phase rising edge, B phase falling edge). The flip signal actually has the same total number of edges as the orthogonal pulse signal. Assuming that the encoder outputs N pulses per revolution, the total number of edges is 4N (2N rising edges and 2N falling edges).

[0091] In some embodiments, the number of pole pairs of the motor, the number of lines per encoder rotation, and the currently recorded encoder count value are obtained, and the first main angle of the current edge is determined based on the number of pole pairs of the motor, the number of lines per encoder rotation, and the currently recorded number of pulses.

[0092] Specifically, the first main angle E is calculated according to the following formula: θi :

[0093]

[0094] Among them, Enc represents the number of lines of the encoder in one rotation, pl Indicates the number of pole pairs of the motor, E θi Represents the first main angle of the i-th edge, where i represents the encoder count value currently recorded.

[0095] The encoder count is determined by the number of pulses generated by the edge change. Each pulse corresponds to a position change of the encoder.

[0096] For better understanding, refer to Figure 4 , assuming the total number of subdivision steps is T step , which means that each complete step is subdivided into T step In order to simplify the representation, T step Replaced by n, the corresponding unit subdivision angle within a time difference includes E θ1 、E θ2 ,……,E θ(n-1) 、E θn . Assume that the current edge is Figure 4 When the rotor rotates to the edge a2, the rotor first main angle E of the edge a2 is determined. θa2 On this basis, assuming that the current subdivision angle E θm For E θ2 Get the current subdivision angle of the current step. For example, first use the formula Find the unit subdivision angle, then E θ2 =2×E θ1 Furthermore, the current position of the rotor = E θ2 +E θa2 .

[0097] Optionally, the target subdivision angle is the angle of the current subdivision angle at the edge.

[0098] In one embodiment of the present application, whether the rotor angle is accurate is determined based on the rotor predicted angle and the rotor second main angle, including: determining the angle difference between the rotor predicted angle and the rotor second main angle; if the angle difference is greater than a preset difference, determining that the rotor angle is inaccurate.

[0099] Optionally, whether the prediction of the target subdivision angle is accurate is determined based on the angle difference between the second main angle of the rotor at the next edge and the predicted angle of the next edge. If the target subdivision angle of the second main angle of the rotor at the next edge and the predicted angle of the next edge are within a preset difference, it means that the current angle of the rotor is accurate. If the difference between the second main angle of the rotor at the next edge and the predicted angle of the next edge is outside the preset difference, it means that the current angle of the rotor is inaccurate. The inaccurate current angle of the rotor indicates that the estimated value is inaccurate or the external pulse is lost, and a shutdown alarm can be taken to provide protection in advance to avoid damage to the equipment.

[0100] Optionally, the rotor second main angle of the next edge can be calculated by adding a step angle to the rotor first main angle of the current edge. The step angle is determined by the set number of steps of the encoder and has nothing to do with the number of subdivision steps.

[0101] In practical applications, the method provided in the embodiment of the present application can be used to convert low-line encoder signals into higher-line analog signals, thereby implementing a FOC (Field-Oriented Control) vector control strategy. This method is of great significance for improving the accuracy of vector control, enhancing torque output, and reducing current consumption and energy consumption.

[0102] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0103] Corresponding to the above embodiment Figure 2 The subdivision method of the rotor angle, Figure 5 A structural block diagram of a rotor angle subdivision device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0104] Reference Figure 5 The rotor angle subdivision device includes: a first acquisition module 501, a second acquisition module 502, a first determination module 503 and a second determination module 504.

[0105] A first acquisition module 501 is used to acquire a flip signal corresponding to the orthogonal pulse signal of the encoder;

[0106] The second acquisition module 502 is used to acquire the angle to be subdivided of the flip signal;

[0107] A first determination module 503, used to determine the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal;

[0108] The second determination module 504 is used to determine the current subdivision angle of the rotor according to the total subdivision steps and the angle to be subdivided.

[0109] In one embodiment of the present application, the first acquisition module 501 is specifically used to acquire the orthogonal pulse signal output by the encoder; perform XOR processing on the orthogonal pulse signal to obtain a flip signal.

[0110] In one embodiment of the present application, the second acquisition module 502 is specifically used to determine the angle to be subdivided of the flip signal according to the encoder count values ​​obtained at adjacent moments, the number of lines of the encoder rotating one circle, and the number of pole pairs of the motor.

[0111] In one embodiment of the present application, the first determination module 503 is specifically used to obtain the current operating cycle of the encoder; and determine the total number of subdivision steps of the angle to be subdivided based on the time difference between the rising edge and the falling edge of the flip signal and the current operating cycle.

[0112] In one embodiment of the present application, the total subdivision step number includes the current subdivision step number; the second determination module 504 is specifically used to determine the current subdivision step number corresponding to the current operating cycle of the encoder; and determine the current subdivision angle of the rotor based on the total subdivision step number, the current subdivision step number and the angle to be subdivided.

[0113] In one embodiment of the present application, the second determination module 504 is also used to determine the target subdivision angle of the rotor corresponding to the next edge of the flip signal when the current subdivision step number is the same as the total subdivision step number; determine the rotor prediction angle corresponding to the next edge of the flip signal based on the target subdivision angle and the first main angle of the rotor; the first main angle of the rotor is a reference angle corresponding to the current edge of the flip signal of the rotor; determine whether the rotor angle is accurate based on the rotor prediction angle and the second main angle of the rotor; the second main angle of the rotor is a reference angle corresponding to the next edge of the flip signal of the rotor.

[0114] In one embodiment of the present application, the second determination module 504 is specifically used to determine the angle difference between the predicted rotor angle and the second main rotor angle; if the angle difference is greater than a preset difference, it is determined that the rotor angle is inaccurate.

[0115] It should be understood that the units recorded in the rotor angle subdivision device are similar to those in the reference Figure 2 The various steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the rotor angle subdivision device and the units contained therein, and will not be repeated here. The rotor angle subdivision device can be pre-implemented in a browser or other security application of a computer device, or can be loaded into the browser or its security application of a computer device by downloading or the like. The corresponding units in the rotor angle subdivision device can cooperate with the units in the computer device to implement the solution of the embodiment of the present application.

[0116] The several modules or units mentioned in the above detailed description are not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0117] It should be noted that for details not disclosed in the rotor angle subdivision device in the embodiment of the present application, please refer to the details disclosed in the above embodiments of the present application, and no further details will be given here.

[0118] In a possible implementation, an embodiment of the present application further provides a motor, comprising the above-mentioned rotor angle subdivision device.

[0119] Reference below Figure 6 , Figure 6 A schematic diagram of the structure of a computer device suitable for implementing the embodiments of the present application is shown. Figure 6 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation instructions of the computer device are also stored. The CPU 601, the ROM 602 and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0120] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0121] In particular, according to an embodiment of the present application, the above reference flow chart Figure 2 The described process can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the computer device of the present application are executed.

[0122] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used or used in combination with an instruction-executing computer device, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium such as a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0123] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operating instructions of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the aforementioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operating instruction, or can be implemented with a combination of dedicated hardware and computer instructions.

[0124] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor, for example, it may be described as follows: a processor includes an acquisition module, a merging module, and a transmission module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0125] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the computer device described in the above embodiment, or may exist independently without being assembled into the computer device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the rotor angle subdivision method described in the present application or. For example, it can be executed Figure 2 The individual steps of the method for the subdivision of the rotor angle are shown.

[0126] The present application embodiment provides a computer program product, which includes instructions. When the instructions are executed, the method described in the present application embodiment is executed. For example, Figure 2 The individual steps of the method for the subdivision of the rotor angle are shown.

[0127] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A rotor angle subdivision method, characterized in that: include: Obtain the flip signal corresponding to the orthogonal pulse signal of the encoder; Obtaining the angle to be subdivided of the flip signal; Determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal; The current subdivision angle of the rotor is determined according to the total number of subdivision steps and the angle to be subdivided.

2. The method according to claim 1, characterized in that The method of obtaining a flip signal corresponding to the orthogonal pulse signal of the encoder includes: Obtain the orthogonal pulse signal output by the encoder; The orthogonal pulse signal is subjected to XOR processing to obtain a flip signal.

3. The method according to claim 1, characterized in that The step of obtaining the angle to be subdivided of the flip signal includes: The angle to be subdivided of the flip signal is determined according to the encoder count values ​​obtained at adjacent moments, the number of lines of one rotation of the encoder, and the number of pole pairs of the motor.

4. The method according to claim 1, characterized in that: Determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal comprises: Get the current operation cycle of the encoder; The total number of subdivided steps of the angle to be subdivided is determined according to the time difference between the rising edge and the falling edge of the flip signal and the current operation cycle.

5. The method according to any one of claims 1 to 4, characterized in that The total subdivision steps include the current subdivision steps; Determining the current subdivision angle of the rotor according to the total number of subdivision steps and the angle to be subdivided includes: Determine the current number of subdivision steps corresponding to the current operating cycle of the encoder; The current subdivision angle of the rotor is determined according to the total subdivision step number, the current subdivision step number and the angle to be subdivided.

6. The method according to claim 5, characterized in that The method further comprises: In a case where the current subdivision step number is the same as the total subdivision step number, determining a target subdivision angle of the rotor corresponding to a next edge of the flip signal; Determine the predicted rotor angle corresponding to the next edge of the flip signal according to the target subdivision angle and the first main angle of the rotor; the first main angle of the rotor is a reference angle corresponding to the current edge of the flip signal of the rotor; Whether the rotor angle is accurate is determined based on the predicted rotor angle and the second main rotor angle; the second main rotor angle is a reference angle corresponding to the next edge of the rotor flip signal.

7. The method according to claim 6, characterized in that The step of determining whether the rotor angle is accurate according to the predicted rotor angle and the second main rotor angle includes: Determining an angle difference between the predicted rotor angle and a second main rotor angle; If the angle difference is greater than a preset difference, it is determined that the rotor angle is inaccurate.

8. A rotor angle subdivision device, characterized in that: The device comprises: A first acquisition module is used to acquire a flip signal corresponding to the orthogonal pulse signal of the encoder; A second acquisition module, used for acquiring the angle to be subdivided of the flip signal; A first determining module, used for determining the total number of subdivision steps of the angle to be subdivided according to the time difference between the rising edge and the falling edge of the flip signal; The second determination module is used to determine the current subdivision angle of the rotor according to the total subdivision steps and the angle to be subdivided.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.