A method and apparatus for determining a subdivided angle of a sine-cosine encoder and a medium

By decomposing the subdivision angle of the sine and cosine encoder into two parts—pulse signal counting and sine and cosine signal calculation—the problem of accumulated error was solved, and higher precision elevator permanent magnet synchronous traction machine drive control was achieved.

CN116317780BActive Publication Date: 2026-02-13SHENZHEN INVT ELECTRIC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310364748.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2026-02-13
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

The existing sine and cosine encoder subdivision angle calculation scheme has a cumulative error problem, which affects the driving accuracy of elevator permanent magnet synchronous traction machines.

Method used

A method for determining the subdivision angle using a sine and cosine encoder is adopted. By acquiring sine and cosine signals, processing them into pulse signals, the start and end positions of the subdivision angle are determined, and the subdivision angle is calculated in two parts: one part is calculated by counting pulse signals, and the other part is calculated by the forward and reverse tangents of the sine and cosine signals, thus avoiding accumulated errors.

Benefits of technology

It effectively eliminates accumulated errors, improves the accuracy and range of subdivision angle calculation, and meets the drive control requirements of elevator permanent magnet synchronous traction machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116317780B_ABST
    Figure CN116317780B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for determining a sine-cosine encoder subdivision angle and a medium thereof, relates to the field of motor control and elevator permanent magnet synchronous traction machine driving, and is used for calculating a subdivision angle. In order to solve the problem of a large error of a current calculation scheme, a calculation method is provided. The method calculates a subdivision angle by determining a starting position and a termination position of the current calculation, so that the calculation process no longer depends on historical calculation results, and the generation of cumulative error is solved from the root. Meanwhile, the method calculates the sine and cosine periods contained between the starting position and the termination position through a pulse signal after sine and cosine signal conditioning. On the one hand, the main part of the subdivision angle is quickly determined, and on the other hand, the remaining part is controlled within one sine and cosine period. Through at most twice of positive and negative tangent calculation, the final subdivision angle can be obtained. The unit time of calculation does not need to be limited within one sine and cosine period, so that the subdivision speed measurement is more flexible, and the error caused by the positive and negative tangent calculation can be effectively controlled.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of motor control and elevator permanent magnet synchronous traction machine driving, in particular to a method and device for determining the subdivision angle of a sine-cosine encoder and a medium. BACKGROUND

[0002] Permanent magnet synchronous traction machines are commonly used in elevator applications. In order to have good dynamic and static responses at any speed and state of the motor, a vector control mode with an encoder is often used. The permanent magnet synchronous traction machine usually uses a sine-cosine encoder. This encoder has A and B sine-cosine analog signals. After processing, the output signal of the encoder can be converted into a "subdivision angle" calculation with a resolution much higher than the actual pulse.

[0003] In current elevator permanent magnet synchronous traction machine driving applications, the sine-cosine encoder subdivision angle calculation scheme either directly accumulates the arctangent of the A and B sine-cosine signals of the sine-cosine encoder to obtain the subdivision angle, or calculates the change of the arctangent and pulse count in each unit time to obtain the subdivision angle.

[0004] The two commonly used schemes both involve the accumulation of arctangent data each time, which is an "incremental" calculation scheme. The interference or sampling error in the A and B sine-cosine signals of the arctangent is also accumulated, which can easily cause cumulative errors. The continuous accumulation of cumulative errors can seriously affect the accuracy of the encoder output signal.

[0005] Therefore, there is an urgent need for a sine-cosine encoder subdivision angle determination method to solve the problem of cumulative errors in the calculation of the subdivision angle using the current incremental calculation scheme. SUMMARY

[0006] The purpose of the present application is to provide a sine-cosine encoder subdivision angle determination method, device and medium to solve the problem of cumulative errors in the calculation of the subdivision angle using the current incremental calculation scheme.

[0007] To solve the above technical problems, the present application provides a sine-cosine encoder subdivision angle determination method, comprising:

[0008] Obtaining the sine-cosine signals output by the sine-cosine encoder;

[0009] Processing the sine-cosine signals to obtain corresponding pulse signals;

[0010] determining a start position and an end position corresponding to the subdivision angle, and determining a first part of the subdivision angle according to the pulse signal and a second part of the subdivision angle according to the cosine-sine signal; wherein the sum of the first part and the second part is equivalent to the subdivision angle between the start position and the end position;

[0011] obtaining the subdivision angle according to the first part and the second part.

[0012] Preferably, the processing of the cosine-sine signal to obtain the corresponding pulse signal comprises:

[0013] generating a pulse at a transition edge of the cosine-sine signal to obtain the pulse signal corresponding to the cosine-sine signal.

[0014] Preferably, the method further comprises:

[0015] if the start position / end position is not located at the beginning of any period of the cosine-sine signal, taking a pulse position adjacent to the start position / end position and corresponding to the beginning of a period of the cosine-sine signal as a reference position; wherein the reference position corresponding to the start position is a first reference position; and the reference position corresponding to the end position is a second reference position.

[0016] Correspondingly, the determining of the first part of the subdivision angle according to the pulse signal comprises:

[0017] determining the first part of the subdivision angle according to the number of pulses of the pulse signal between the first reference position and the second reference position.

[0018] Correspondingly, the determining of the second part of the subdivision angle according to the cosine-sine signal comprises:

[0019] determining a first compensation amount according to the start position and the first reference position, determining a second compensation amount according to the end position and the second reference position, and performing a positive-negative tangent calculation on the first compensation amount and the second compensation amount to determine the second part.

[0020] wherein if the position corresponding to the cosine-sine signal satisfies that the first reference position is before the start position, the first compensation amount is negative; if the first reference position is after the start position, the first compensation amount is positive; if the second reference position is before the end position, the second compensation amount is positive; and if the second reference position is after the end position, the second compensation amount is negative.

[0021] Preferably, the method further comprises:

[0022] if the start position / end position is not located at any pulse position of the pulse signal, taking any pulse position adjacent to the start position / end position as a reference position; wherein the reference position corresponding to the start position is a first reference position; and the reference position corresponding to the end position is a second reference position.

[0023] Accordingly, the first part of determining the subdivision angle based on the pulse signal includes:

[0024] The first part of the subdivision angle is determined based on the number of pulses of the pulse signal between the first reference position and the second reference position.

[0025] Accordingly, the second part of determining the subdivision angle based on the sine and cosine signals includes:

[0026] The first compensation amount is determined based on the starting position and the first reference position, and the second compensation amount is determined based on the ending position and the second reference position. The first compensation amount and the second compensation amount are calculated by tangent calculation to determine the second part.

[0027] Specifically, if the position corresponding to the sine and cosine signals satisfies the condition that the first reference position is before the starting position, then the first compensation amount is negative; if the first reference position is after the starting position, then the first compensation amount is positive; if the second reference position is before the ending position, then the second compensation amount is positive; if the second reference position is after the ending position, then the second compensation amount is negative.

[0028] Preferably, the first part of determining the subdivision angle based on the number of pulses of the pulse signal between the first reference position and the second reference position includes:

[0029] The first part of the subdivision angle is determined according to the first formula;

[0030] The first formula is:

[0031] Theta = Cnt ± [arctan(X)] 11 X 12 ) / 90°]±[arctan(X 21 X 22 ) / 90°]

[0032] Theta represents the number of complete pulse cycles contained in the first part; Cnt represents the sum of the pulse count values ​​of the pulse signal in this subdivision angle calculation; [] represents the rounding symbol; X 11 X 12 X represents the first compensation amount. 21 X 22 This indicates the second compensation amount.

[0033] Preferably, after determining the first part, it also includes:

[0034] Based on the current forward / reverse state of the sine and cosine encoders and the quadrant in which the reference position is located, the value of the first part is adjusted to obtain a new first part.

[0035] Preferably, the first part value is adjusted to obtain a new first part value according to the current forward-reverse state of the sine-cosine encoder and the quadrant in which the reference position is located, and the adjustment includes:

[0036] If the current forward-reverse state of the sine-cosine encoder is forward rotation, then:

[0037] If the quadrant in which the reference position is located is the first quadrant and the remainder of the pulse count value divided by 4 is 3, then the first part value is increased by 1.

[0038] The pulse count value is the sum of the pulse numbers of the pulse signal in the current subdivision angle calculation process.

[0039] If the current forward-reverse state of the sine-cosine encoder is reverse rotation, then:

[0040] If the quadrant in which the reference position is located is the fourth quadrant and the remainder of the pulse count value divided by 4 is 0, then the first part value is decreased by 1.

[0041] To solve the above technical problems, the present application also provides a sine-cosine encoder subdivision angle determination device, comprising:

[0042] A signal acquisition module is configured to acquire a sine-cosine signal output by the sine-cosine encoder.

[0043] A signal processing module is configured to process the sine-cosine signal to obtain a corresponding pulse signal.

[0044] A first calculation module is configured to determine a starting position and an ending position corresponding to a subdivision angle, and determine a first part of the subdivision angle according to the pulse signal and a second part of the subdivision angle according to the sine-cosine signal; wherein the sum of the first part and the second part is equivalent to the subdivision angle between the starting position and the ending position.

[0045] A second calculation module is configured to obtain the subdivision angle according to the first part and the second part.

[0046] To solve the above technical problems, the present application also provides a sine-cosine encoder subdivision angle determination device, comprising:

[0047] A memory is configured to store a computer program.

[0048] A processor is configured to execute the computer program to implement the steps of the above-mentioned sine-cosine encoder subdivision angle determination method.

[0049] To solve the above technical problems, the present application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the above-mentioned sine-cosine encoder subdivision angle determination method.

[0050] The application provides a sine-cosine encoder subdivision angle determination method. The starting position and the ending position of the subdivision angle calculation are determined to calculate each subdivision angle, so that the subdivision angle calculation process is changed from "incremental" to "position type". The calculation of each subdivision angle is irrelevant to the previous calculation result, so that the accumulation of interference or sampling error in the arctangent sine-cosine signal is avoided, and the problem of accumulated error is solved. In addition, the method further performs signal conditioning on the sine-cosine signal to obtain a corresponding pulse signal. Therefore, the sine-cosine period passed by the sine-cosine signal can be determined by counting the pulses of the pulse signal, and the main part of the subdivision angle can be determined. The remaining part can still be obtained by using the arctangent calculation method on the sine-cosine signal to obtain another part of the subdivision angle. The accurate subdivision angle can be obtained by combining the two. At the same time, since the calculation of multiple sine-cosine periods is completed in the main part, the arctangent calculation part is within one sine-cosine period, and there is no need to limit it. Therefore, the application range of the subdivision angle calculation method is widened, and the unit time and the arctangent error are not limited within one period of the A and B sine-cosine signals. When the subdivision speed is determined according to the subdivision angle, the speed range can be wider, and the driving control requirements of the actual elevator permanent magnet synchronous traction machine can be better met.

[0051] The application provides a sine-cosine encoder subdivision angle determination device and a computer readable storage medium, which correspond to the above method and have the same effect. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0053] Figure 1 A flowchart of a sine-cosine encoder subdivision angle determination method provided by the application;

[0054] Figure 2 An output signal schematic diagram of a subdivision angle determination method provided by the application;

[0055] Figure 3 A signal conditioning structure diagram provided by the application;

[0056] Figure 4 A calculation schematic diagram of a subdivision angle determination method provided by the application;

[0057] Figure 5 A pulse delay schematic diagram of a sine-cosine signal;

[0058] Figure 6 A structure diagram of a sine / cosine encoder subdivision angle determination device provided by the present application is shown in the figure;

[0059] Figure 7 A structure diagram of another sine / cosine encoder subdivision angle determination device provided by the present application is shown in the figure. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0061] The core of the present application is to provide a sine / cosine encoder subdivision angle determination method, device and medium.

[0062] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0063] At present, in the scene of elevator permanent magnet synchronous traction machine driving, a sine / cosine encoder is usually used for driving. The sine / cosine encoder has A and B sine / cosine analog signals which are orthogonal to each other. After processing, the output signal of the encoder can be converted into a "subdivision angle" calculation quantity with a resolution much higher than the actual pulse, so as to realize more accurate driving control of the elevator permanent magnet synchronous traction machine. Therefore, the resolution and accuracy of the subdivision angle calculation are the main factors affecting the driving effect of the elevator permanent magnet synchronous traction machine.

[0064] However, since the sine / cosine signal arctangent calculation cannot well distinguish how many sine / cosine periods are separated between the two calculation results, for example, it is calculated that the starting point is 100° and the ending point is 200°, it cannot be determined whether 100° and 200° are separated by a sine / cosine period or by several periods, that is, it cannot be determined that the subdivision angle calculation result is one of (100°+360°×n, n is a non-negative integer). Therefore, in the actual subdivision angle calculation process, an incremental calculation method is usually used, that is, either the A and B sine / cosine signals of the sine / cosine encoder are used to calculate the arctangent and then the subdivision angle is directly accumulated, or the change amount of the arctangent and the pulse count in each unit time is calculated, and the final subdivision angle is accumulated.

[0065] This incremental subdivision angle calculation method inevitably faces the following problems: interference in the forward and reverse tangent calculation process, the sampling process, and the signal will all introduce certain errors. Small errors are acceptable, but when the final subdivision angle is obtained by accumulating the results of multiple calculations using the incremental calculation method, the errors in the multiple calculation and sampling processes will also be superimposed, resulting in cumulative errors. Even if the error is small each time, the error will be relatively large after multiple accumulations, which will have an adverse effect on the accuracy of the subdivision precision calculation.

[0066] Therefore, this application provides a method for determining the subdivision angle of a sine / cosine encoder, such as... Figure 1 As shown, it includes:

[0067] S10: Obtain the sine and cosine signals output by the sine and cosine encoder.

[0068] Specifically, the sine and cosine signals obtained by the sine and cosine encoder are as follows: Figure 2 As shown, that is Figure 2 Signals A and B are orthogonal sine and cosine signals. The encoder outputs one sine and cosine cycle for each grid cell it passes through.

[0069] S20: Process the sine and cosine signals to obtain the corresponding pulse signals.

[0070] Processing of sine and cosine signals can be achieved through corresponding conditioning circuits, whose function is to condition the sine and cosine signals into pulse signals, specifically as follows: Figure 2 As shown, pulse signals PA and PB are pulse signals conditioned from sine and cosine signals A and B, respectively. Pulse signal PA corresponds to sine and cosine signal A, and pulse signal PB corresponds to sine and cosine signal B.

[0071] Generally, the conditioning process for sine and cosine signals involves taking values ​​(generating pulses) at the transition edges of the sine and cosine signals to obtain the corresponding pulse signals. Considering that there are already relatively mature technical solutions for signal conditioning circuits that generate pulses at the transition edges of sine and cosine signals, this embodiment will not elaborate on the specific composition and implementation principle of the signal conditioning circuit. Furthermore, the connection method between the signal conditioning circuit and the sine and cosine encoder is as follows... Figure 3 As shown, the sine / cosine encoder 11 and the signal conditioning circuit 12 are connected via signal lines to output the signal as shown in the figure. Figure 2 The sine and cosine signals A and B, and the pulse signals PA and PB are shown.

[0072] And from Figure 2As can be seen, the sine and cosine signals A and B generate two jump edges in one sine and cosine period, i.e. corresponding to two pulses in the pulse signal, and the sine and cosine signals orthogonal to each other are 90° apart in phase (when the encoder rotates forward, the sine and cosine signal A leads the signal B by 90°). Therefore, the reflection in the pulse signals PA and PB is that one sine and cosine period corresponds to four pulses (i.e. four times frequency), and the arctangent angle is in the range of 0-360°, and every 90° is equivalent to one four times frequency pulse. Therefore, the main part of the subdivision angle (i.e. the first part mentioned above) can be determined by counting the number of pulses in the pulse signal.

[0073] S30: determining the start position and the end position corresponding to the subdivision angle, and determining the first part of the subdivision angle according to the pulse signal and the second part of the subdivision angle according to the sine and cosine signal.

[0074] Wherein, the sum of the first part and the second part is equivalent to the subdivision angle between the start position and the end position.

[0075] As can be seen from this step, the method determines the range of the current subdivision angle calculation process by determining the start position and the end position of the subdivision angle, so as to obtain the subdivision angle result by one calculation process, which is a "position type" scheme without the aid of historical calculation results.

[0076] S40: obtaining the subdivision angle according to the first part and the second part.

[0077] For example, as shown in Figure 4 , the range of the subdivision angle to be calculated this time starts from the start position B and ends at the end position D, and the equivalent angle is as shown in Figure 4 .

[0078] Therefore, the number of complete sine and cosine periods contained in the equivalent angle can be quickly determined by the number of pulses between B and D, or further, the four times frequency pulse corresponds to 90° of the sine and cosine, so that the number of 90° contained in the equivalent angle can be determined according to the pulse signal, so as to determine the main part of the subdivision angle, i.e. the first part mentioned above.

[0079] Then, for the part of the equivalent angle other than the first part, the arctangent calculation is further performed according to the sine and cosine signal. Since the first part containing multiple sine and cosine periods has been determined by pulse counting, the remaining equivalent angle of the second part is within one sine and cosine period, without the need for additional restrictions, and the accurate result can be obtained by directly using the arctangent calculation, i.e. the second part.

[0080] And the calculation of the second part is performed at most twice, as shown in Figure 2As shown, the BD includes three complete cosine periods, i.e., the first part, and the equivalent angle of two ends less than one cosine period after removing the first part (may also be the equivalent angle of two ends remaining less than one pulse period, i.e., 90°, which is adaptively changed according to the selection range of the first part), i.e., two times of the arctangent calculation is required. It is easy to understand that when the starting position or the ending position is exactly at the beginning or the end of one cosine period, the number of arctangent calculations required is less.

[0081] As described above, the method for determining the subdivided angle of the cosine encoder provided by the present application does not rely on the historical calculation results for the calculation of the subdivided angle at any time, and determines the starting position and the ending position of the current calculation. The subdivided angle is divided into two parts for calculation, one is the first part (also referred to as the main part) including several complete cosine periods, and the other is the second part remaining after removing the first part. The first part can be simply obtained by counting the number of pulses of the pulse signal between the starting position and the ending position, and the second part can be determined by the traditional arctangent algorithm. As described above, the arctangent calculation of the second part needs at most two times, and the unit time of the calculation does not need to be limited within one cosine period. Compared with the existing incremental calculation method, the present application does not bring cumulative error, has better accuracy, and the unit time is not limited within one cosine signal period. The characteristics can also make the speed measurement range wider when determining the subdivided speed according to the subdivided angle, and better meet the actual driving control requirements of the elevator permanent magnet synchronous traction machine.

[0082] As described in the above embodiments, the method provided by the present application determines the subdivided angle by dividing it into two parts for calculation, specifically, the first part composed of complete cosine periods (or complete pulse periods, i.e., one quarter of a cosine period, i.e., 90°) and the second part remaining. Therefore, for the division of the first part, the starting point of the first complete cosine period contained between the current starting position and the ending position can be taken as the division point, i.e., the reference position, as described in the above embodiments. Alternatively, the starting point of one cosine period before the starting position or after the ending position can be taken as the reference position, i.e., not "dividing" the equivalent angle, but "filling" the equivalent angle, which will be subtracted in the subsequent calculation of the second part.

[0083] Based on the above division idea, step S30 in the present method is specifically:

[0084] A-S31: If the starting position / ending position is not located at the beginning of any period of the cosine signal, the pulse adjacent to the starting position / ending position and corresponding to the beginning of one cosine signal period is taken as the reference position.

[0085] The reference position corresponding to the start position is the first reference position; and the reference position corresponding to the end position is the second reference position.

[0086] It should be noted that the start of any period of the above sine signal refers to 90° in any period of the sine signal A, and such a value is selected based on the characteristics of the arctangent calculation. Because when the arctangent of the orthogonal sine signals A and B is calculated, the sine signal A leads the phase of B by 90° in the positive direction, the arctangent obtained is the vector angle of the sine signal, and the arctangent value starts from zero at the 90° position of the A signal, so the 90° position of the A signal is taken as the zero position of the arctangent vector angle, which is more convenient for subsequent calculation. It is easy to understand that if the sine encoder is in a reverse state, the addressing at the start of the sine signal should also be adaptively changed.

[0087] It should also be noted that if the start position / end position is exactly at the start of any period of the sine signal, the first reference position / second reference position can also be determined according to the above steps A-S31, and at this time the first reference position coincides with the start position and the second reference position coincides with the end position. For the convenience of subsequent description, the first reference position / second reference position mentioned later may coincide with the start position / end position.

[0088] S32: determining a first part of the subdivision angle according to the number of pulses of the pulse signal between the first reference position and the second reference position.

[0089] S33: determining a first compensation amount according to the start position and the first reference position, determining a second compensation amount according to the end position and the second reference position, and performing arctangent calculation on the first compensation amount and the second compensation amount to determine a second part.

[0090] If the position corresponding to the sine signal satisfies that the first reference position is before the start position, the first compensation amount is negative; if it satisfies that the first reference position is after the start position, the first compensation amount is positive; if it satisfies that the second reference position is before the end position, the second compensation amount is positive; and if it satisfies that the second reference position is after the end position, the second compensation amount is negative.

[0091] That is, in step S33, whether the first part is divided in step A-S31 is "splitting" or "filling", to determine whether the compensation of the second part is positive or negative; if step A-S31 is "splitting", step S33 should be "added back", that is, the compensation amount is positive; if step A-S31 is "filling", step S33 should be "subtracted", that is, the compensation amount is negative.

[0092] It should be noted that, considering the difficulty of actual calculation, the positive and negative tangent calculation is performed at the beginning of a positive sine period (i.e., 90° of the positive sine signal A described above), and the value is exactly counted from zero, so the positive and negative tangent calculation is easier to implement, and therefore the first reference position and the second reference position are preferably the beginning of the previous positive sine period of the starting position and the end position.

[0093] Also as shown in Figure 4 According to the division manner disclosed in the above embodiment, Figure 4 is to select the beginning of the previous positive sine period of the starting position as the first reference position A, that is, the "filling" manner, and the corresponding first compensation amount AB should be negative; the second reference position C is selected as the beginning of the previous positive sine period of the end position D, that is, the "splitting" manner, and the corresponding second compensation amount CD should be positive. Therefore, at this time, the first part is AC, and the second part is [- (AB) + CD].

[0094] For the equivalent angle between the first part AC, it can be known from Figure 4 that it corresponds to four complete positive sine periods, and the value of the subdivision angle can be determined as 16 (the unit in the value here is one pulse period of the four times frequency pulse signal, that is, 1 = 1 pulse period of the four times frequency pulse signal = 1 pulse count = 90° of the positive sine signal, and the unit can be freely converted according to actual application needs).

[0095] For the equivalent angle of the second part [- (AB) + CD], it is divided into AB and CD parts for convenience, and the AB part is negative; according to the positive and negative tangent calculation, the equivalent angle between AB is 1.7 (the unit is as described above, and will not be described hereinafter), and the equivalent angle between CD is 3.1; the positive and negative values are substituted, that is, the second part = -1.7 + 3.1 = 1.4.

[0096] Further, from the first part (the value is 16) and the second part (the value is 1.4), the subdivision angle 16 + 1.4 = 17.4 can be obtained, and the calculation of the subdivision angle is completed this time. The calculation of the subdivision angle of any subsequent time is a repetition of the above method, and does not need to rely on the calculation result of any previous time, and will not produce cumulative error; and only the second part involves at most two times of positive and negative tangent calculation, which can effectively control the calculation error and the difficulty of implementation.

[0097] In short, the above embodiment is an implementation scheme for subdividing the angle in units of one complete positive sine period, which is a preferred scheme considering the calculation difficulty and the implementation difficulty of the method, but it does not mean that the calculation method disclosed in the present application is limited to the above-mentioned one subdivision manner. In fact, according to different needs of different application scenarios, the technical personnel can select any subdivision manner to assist in calculation, and the present application does not make any limitation.

[0098] Further, the embodiment also provides another implementation of the splitting manner, i.e., the step S30 specifically comprises:

[0099] B-S31: if the start position / terminal position is not located at any one of the pulses in the pulse signal, taking any one of the pulses adjacent to the start position / terminal position as the reference position.

[0100] wherein the reference position corresponding to the start position is the first reference position; and the reference position corresponding to the terminal position is the second reference position.

[0101] It is easy to understand that the step B-S31 is different from the step A-S31 in the above embodiment only in that the unit for the angle division is different; the step A-S31 is to divide by one period of the cosine and sine (according to the unit of the angle division, i.e., the division is by "4"), while the step B-S31 is to divide by one pulse (i.e., the division is by "1"). Therefore, the subsequent steps S32 and S33 in the embodiment are the same as the step A-S31 in the above embodiment, and other specific embodiments are the same as or similar to the step A-S31 in the above embodiment, which will not be described herein again.

[0102] However, considering the calculation difficulty and other aspects, the implementation corresponding to the step A-S31 is preferred, and the calculation manner corresponding to the embodiment is to take the value from zero when calculating the arctangent, i.e., no zero position calibration is needed in the calculation process, which is easier to implement and easier for the operator to understand and simulate.

[0103] The embodiment specifically provides an implementation of dividing the angle into a first part and a second part for calculation, and the implementation of dividing by the period of the cosine and sine is preferred. According to the calculation characteristics of the arctangent, if the cosine and sine encoder is in the positive rotation state, the 90° position of the signal A in the two mutually orthogonal cosine and sine signals is the zero point position of the arctangent vector angle, which is counted from zero, is more in line with the reading habit of the technical personnel, avoids the subsequent zero adjustment, and is easier to implement.

[0104] For the determination of the first part of the angle value, it is determined by counting the pulse number according to the above embodiment, but it should be noted that in actual application, a pulse counter is generally used to count the pulses generated in the whole process, so the current pulse count value is easy to obtain, and the pulse count value of the last calculation process can be used to quickly determine the pulse number corresponding to the angle to be calculated.

[0105] Also Figure 4For example, the current pulse count value, i.e. the pulse count value corresponding to the end position D, and the last calculated pulse count value, i.e. the pulse count value at the start position B, are easily obtained, and thus the pulse number between B and D, i.e. the pulse count value of the pulse signal in the current angle subdivision calculation, can be easily obtained. The pulse count values at the first reference position A and the second reference position C are relatively difficult to obtain, and thus the present embodiment provides a preferred implementation for quickly and conveniently determining the pulse number between the first reference position and the second reference position for calculating the value of the first part:

[0106] determining the first part of the subdivided angle according to the first formula;

[0107] The first formula is as follows:

[0108] Theta = Cnt ± [arctan(X 11 X 12 ) / 90°] ± [arctan(X 21 X 22 ) / 90°]

[0109] Theta represents the number of complete pulse periods included in the first part; Cnt represents the sum of the pulse count values of the pulse signal in the current angle subdivision calculation; [] represents the rounding symbol; X 11 X 12 represents the first compensation amount, X 21 X 22 represents the second compensation amount.

[0110] It should be noted that arctan(X 11 X 12 ) represents the arctangent value corresponding to the first compensation amount, and the divisor is 90°, indicating that the first formula is a calculation formula for a four-fold pulse signal (one pulse period is equal to one quarter of a sine period, i.e. 90°). If other multiple frequency pulse signals are used, the divisor in the rounding symbol of the above first formula should be adaptively changed.

[0111] It should also be noted that the present embodiment is directed to an implementation in which one complete sine period is used as the division basis for the first part and the second part, and the role is to count how many complete sine periods are included in the first part.

[0112] For example, by Figure 4The example shown verifies the above method, the first part AC between the 16 pulse times; BD between the 18 pulse times, that is, Cnt = 18; the first compensation amount AB between the 1 pulse time (counted as once through a complete pulse period), the first compensation amount is negative here, then it should be positive; the second compensation amount CD between the 3 pulse times, negative.

[0113] Therefore, from the first formula:

[0114] Theta = 18 + 1 - 3 = 16

[0115] That is, the first part includes 16 complete pulse periods = 4 complete sine periods, which can be converted to units as needed after calculation.

[0116] For a specific application scenario, for example, the first reference position is always taken before the starting position, and the second reference position is also taken before the end position, that is, as shown in the scenario Figure 4 At this time, the method for obtaining the value of the first part Theta can be further simplified to:

[0117] Theta = [(Cnt ± [arctan(X 11 X 12 ) / 90°]) / 4]

[0118] That is:

[0119] Theta = [(18 + 1) / 4] = 16

[0120] A preferred scheme provided by the embodiment is based on the actual pulse count to implement the angle of ease of implementation, and the calculation method of the first part is proposed to simplify the calculation process, without additional pulse counting operation or improvement, in line with the actual application habit, and reduce the implementation difficulty.

[0121] It should be noted that the pulse signal is usually converted from the sine signal through the hardware signal conditioning circuit, and the pulse has a delay for the zero crossing point of the sine signal, as shown in Figure 5 If the current position is exactly in the hysteresis loop, the arctangent angle calculation shows that the first quadrant has been reached, and the four times counting pulse does not record the current pulse change because of the delay, which will cause errors in such subdivision angle. Each four times counting pulse has a delay, which will cause errors in counting.

[0122] The embodiment specifically provides a hysteresis effect processing method, after step S32, further comprising:

[0123] According to the current positive and negative rotation state of the sine-cosine encoder and the quadrant where the reference position is located, the value of the first part is adjusted to obtain a new first part.

[0124] More specifically, namely including:

[0125] S51: Determine the current positive and negative rotation state of the sine-cosine encoder, if it is positive rotation, go to step S52, if it is negative rotation, go to step S53.

[0126] S52: Determine whether the reference position is located in the first quadrant and the remainder of the pulse count value divided by 4 is 3, if both are satisfied, the first part value is increased by 1.

[0127] S53: Determine whether the reference position is located in the fourth quadrant and the remainder of the pulse count value divided by 4 is 0, if both are satisfied, the first part value is decreased by 1.

[0128] Wherein, the pulse count value is the sum of the pulse number of the pulse signal in the current subdivision angle calculation process;

[0129] It should be noted that based on the above definition of the reference position of the subdivided angle, after being divided by one sine-cosine period, the processing of the second part is within one sine-cosine period, and the arctangent value is used as the count. Therefore, in the above application scenario, only the delay of 90° of the A signal corresponding to the reference point of one pulse needs to be processed, that is, the delay of the first reference position needs to be processed, more specifically, in the scenario as shown in Figure 4 The first reference position A is processed.

[0130] It should be noted that the "1" in the value of the above step S52 and step S53 is "one pulse period" in the above embodiment unit interpretation, the meaning is referred to the above embodiment, and this embodiment will not be repeated. In addition, the reference position mentioned in this embodiment is also for the reference position at the beginning of any sine-cosine period.

[0131] The embodiment aims at providing a preferred solution for the problem that when a sine-cosine signal is processed by hardware to obtain a pulse signal, the pulse count may be wrong due to the lag of the pulse to the zero point of the sine-cosine signal, and the accuracy of the calculation of the subdivided angle is affected. According to the positive and negative rotation state of the current sine-cosine encoder and the quadrant where the reference position is located, it is determined whether the count is wrong and adjusted. Specifically, when the sine-cosine encoder rotates forward, starting from the reference position, if the current position is in the first quadrant and the pulse count is divided by 4 with a remainder of 3, it is determined that the count pulse does not make the incremental count this time, and the current position is in the hysteresis range, so one count pulse should be added. When the sine-cosine encoder rotates reversely, starting from the reference position, if the current position is in the fourth quadrant and the pulse count is divided by 4 with a remainder of 0, it is determined that the count pulse does not make the decremental count this time, and the current position is in the hysteresis range, so one count pulse should be reduced. The method can effectively solve the hysteresis influence in the hardware signal processing, thereby further improving the accuracy of the calculation of the subdivided angle.

[0132] In the above embodiment, a sine-cosine encoder subdivided angle determination method is described in detail, and the application also provides a corresponding embodiment of a sine-cosine encoder subdivided angle determination device. It should be noted that the embodiment of the device part is described from two angles, one is based on the functional module, and the other is based on the hardware.

[0133] Based on the functional module, as shown in Figure 6 The embodiment provides a sine-cosine encoder subdivided angle determination device, which comprises:

[0134] A signal acquisition module 21 is configured to acquire the mutually orthogonal sine and cosine signals output by the sine-cosine encoder.

[0135] A signal processing module 22 is configured to process the sine and cosine signals to obtain corresponding pulse signals.

[0136] A first calculation module 23 is configured to determine the start position and the end position of the current subdivided angle calculation, and determine a first part of the subdivided angle according to the pulse signals and a second part of the subdivided angle according to the sine and cosine signals.

[0137] A second calculation module 24 is configured to obtain the subdivided angle according to the first part and the second part.

[0138] Since the embodiment of the device part corresponds to the embodiment of the method part, the embodiment of the device part is described in the description of the embodiment of the method part, which is not described here.

[0139] The sine-cosine encoder subdivision angle determination device provided in the embodiment obtains the sine-cosine signals output by the sine-cosine encoder through the signal acquisition module; then the signal processing module processes the sine-cosine signals to obtain the pulse signals; thus, the first calculation module can divide the current subdivision angle calculation process into the first and second parts, wherein the first part is the complete pulse period or the sine-cosine period contained in the subdivision angle, and the value is determined by the pulse signal; the second part is the remaining part of less than one sine-cosine period, which can be obtained by the arctangent calculation, and at most two arctangent calculations are needed; finally, the second calculation module obtains the final subdivision angle result. The device does not need to use the historical calculation results for the calculation of the subdivision angle, which can eliminate the generation of the cumulative error from the root, in addition, at most two arctangent calculations are needed, which can effectively control the arctangent calculation error, thereby further ensuring the driving control precision of the elevator permanent magnet synchronous traction machine.

[0140] Figure 7 The structural diagram of a sine-cosine encoder subdivision angle determination device provided for another embodiment of the application is shown in Figure 7 The sine-cosine encoder subdivision angle determination device includes a memory 30 for storing a computer program.

[0141] The processor 31 is used to execute the computer program to realize the steps of the sine-cosine encoder subdivision angle determination method of the above-mentioned embodiment.

[0142] The sine-cosine encoder subdivision angle determination device provided in the embodiment can include but is not limited to a single-chip microcomputer, a notebook computer or a desktop computer, etc.

[0143] The processor 31 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 31 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 31 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 31 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0144] The memory 30 may include one or more computer-readable storage media, which may be non-transitory. The memory 30 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 30 is used to store at least the following computer program 301, which, after being loaded and executed by the processor 31, is capable of implementing the relevant steps of a sine / cosine encoder subdivision angle determination method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may also include an operating system 302 and data 303, and the storage method may be temporary or permanent storage. The operating system 302 may include Windows, Unix, Linux, etc. The data 303 may include, but is not limited to, a sine / cosine encoder subdivision angle determination method.

[0145] In some embodiments, a sine / cosine encoder subdivision angle determination device may further include a display screen 32, an input / output interface 33, a communication interface 34, a power supply 35, and a communication bus 36.

[0146] Those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on a sine / cosine encoder subdivision angle determination device and may include more or fewer components than shown.

[0147] The embodiment of the application provides a sine-cosine encoder subdivision angle determination device, which comprises a memory and a processor.

[0148] The sine-cosine encoder subdivision angle determination device provided by the embodiment can realize the transition from incremental calculation to position calculation, and does not need to depend on historical calculation results for calculation of any subdivision angle, so that the occurrence of cumulative error can be solved from the root, and at most twice of positive and inverse tangent calculation is involved in the whole calculation process, so that the calculation error can be effectively controlled, and the control accuracy is more guaranteed.

[0149] Finally, the application further provides an embodiment corresponding to a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps recorded in the above method embodiment.

[0150] It can be understood that if the method in the above embodiment is realized in the form of a software function unit and is sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and executes all or part of the steps of the method described in each embodiment of the application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and various program code storage media.

[0151] The computer readable storage medium provided by the embodiment can realize the transition from incremental calculation to position calculation, and does not need to depend on historical calculation results for calculation of any subdivision angle, so that the occurrence of cumulative error can be solved from the root, and at most twice of positive and inverse tangent calculation is involved in the whole calculation process, so that the calculation error can be effectively controlled, and the control accuracy is more guaranteed.

[0152] The above introduces in detail a sine-cosine encoder angle subdivision determination method and device and medium provided by the present application. The embodiments in the specification are described in a progressive manner, and each embodiment mainly explains the difference from other embodiments. The same or similar parts of each embodiment can be understood by referring to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be understood by referring to the method part. It should be pointed out that for ordinary skilled persons in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0153] It should also be noted that in the present specification, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for determining the subdivision angle of a sine / cosine encoder, characterized in that, The method comprises: obtaining a sine-cosine signal of a sine-cosine encoder output; generating a pulse at a transition edge of the sine-cosine signal to obtain a pulse signal corresponding to the sine-cosine signal; determining a start position and an end position corresponding to a subdivision angle, and determining a first part of the subdivision angle according to the pulse signal and a second part of the subdivision angle according to the sine-cosine signal; wherein the sum of the first part and the second part is equivalent to the subdivision angle between the start position and the end position; obtaining the subdivision angle according to the first part and the second part; wherein, if the start position / end position is not located at the beginning of any period of the sine-cosine signal, a reference position is taken at a pulse adjacent to the start position / end position and corresponding to the beginning of a period of the sine-cosine signal; or, if the start position / end position is not located at any pulse in the pulse signal, a reference position is taken at any pulse adjacent to the start position / end position; wherein the reference position corresponding to the start position is a first reference position; and the reference position corresponding to the end position is a second reference position; correspondingly, the determination of the first part of the subdivision angle according to the pulse signal comprises: determining the first part of the subdivision angle according to the number of pulses of the pulse signal between the first reference position and the second reference position; correspondingly, the determination of the second part of the subdivision angle according to the sine-cosine signal comprises: determining a first compensation according to the start position and the first reference position, determining a second compensation according to the end position and the second reference position, and performing an arctangent calculation on the first compensation and the second compensation to determine the second part; wherein, if the position corresponding to the sine-cosine signal satisfies that the first reference position is before the start position, the first compensation is a negative value; if the first reference position is after the start position, the first compensation is a positive value; if the second reference position is before the end position, the second compensation is a positive value; and if the second reference position is after the end position, the second compensation is a negative value.

2. The sine-cosine encoder sub-division angle determination method of claim 1, wherein, the determination of the first part of the subdivision angle according to the number of pulses of the pulse signal between the first reference position and the second reference position comprises: determining the first part of the subdivision angle according to a first formula; wherein the first formula is: Theta = Cnt ± [arctan(X 11 X 12 ) / 90°] ± [arctan(X 21 X 22 ) / 90°] Theta represents the number of complete pulse periods contained in the first part; Cnt represents the sum of the pulse count values of the pulse signal in this time subdivision angle calculation; [ ] represents the rounding symbol; X 11 X 12 represents the first compensation amount, X 21 X 22 represents the second compensation amount.

3. The sine-cosine encoder sub-division angle determination method of claim 1, wherein, after determining the first part, the method further comprises: adjusting the value of the first part according to the current forward / reverse state of the sine-cosine encoder and the quadrant in which the reference position is located to obtain a new first part.

4. The sine-cosine encoder sub-division angle determination method of claim 3, wherein, the adjustment of the value of the first part according to the current forward / reverse state of the sine-cosine encoder and the quadrant in which the reference position is located to obtain a new first part comprises: if the current forward / reverse state of the sine-cosine encoder is forward rotation, then determining whether the reference position is in the first quadrant and the pulse count value divided by 4 has a remainder of 3, and if both conditions are met, increasing the first part value by 1; wherein the pulse count value is the sum of the pulse numbers of the pulse signal in the current subdivision angle calculation process; if the current positive and negative rotation state of the positive and negative sine encoder is negative rotation, then: determining whether the reference position is in the fourth quadrant and the pulse count value divided by 4 has a remainder of 0, and if both conditions are met, decreasing the first part value by 1.

5. A sine-cosine encoder subdivision angle determination apparatus characterized by, comprising: a signal acquisition module configured to acquire a positive and negative sine signal output by a positive and negative sine encoder; a signal processing module configured to process the positive and negative sine signal to obtain a corresponding pulse signal; a first calculation module configured to determine a starting position and an ending position corresponding to a subdivision angle, and determine a first part of the subdivision angle according to the pulse signal and a second part of the subdivision angle according to the positive and negative sine signal; wherein the sum of the first part and the second part is equivalent to the subdivision angle between the starting position and the ending position; if the starting position / ending position is not located at the beginning of any cycle of the positive and negative sine signal, then taking a pulse adjacent to the starting position / ending position and corresponding to the beginning of a cycle of the positive and negative sine signal as a reference position; or, if the starting position / ending position is not located at any pulse in the pulse signal, then taking any pulse adjacent to the starting position / ending position as a reference position; wherein the reference position corresponding to the starting position is a first reference position; the reference position corresponding to the ending position is a second reference position; accordingly, the determination of the first part of the subdivision angle according to the pulse signal comprises determining the first part of the subdivision angle according to the number of pulses between the first reference position and the second reference position; accordingly, the determination of the second part of the subdivision angle according to the positive and negative sine signal comprises determining a first compensation quantity according to the starting position and the first reference position, determining a second compensation quantity according to the ending position and the second reference position, and performing an arctangent calculation on the first compensation quantity and the second compensation quantity to determine the second part; wherein if the position corresponding to the positive and negative sine signal satisfies that the first reference position is before the starting position, then the first compensation quantity is negative; if it satisfies that the first reference position is after the starting position, then the first compensation quantity is positive; if it satisfies that the second reference position is before the ending position, then the second compensation quantity is positive; if it satisfies that the second reference position is after the ending position, then the second compensation quantity is negative; a second calculation module configured to obtain the subdivision angle according to the first part and the second part.

6. A sine-cosine encoder subdivision angle determination apparatus characterized by, comprising: a memory configured to store a computer program; a processor configured to execute the computer program to implement the steps of the positive and negative sine encoder subdivision angle determination method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the sine-cosine encoder angle subdivision method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • High speed sine and cosine subdividing device

    CN101729071A