A direct angle comparison based method for converting between shaft angles
By converting the input signal of the axis-angle converter into binary code through a direct angle comparison method, the problem of inconsistent computation time caused by different angle step sizes in traditional servo systems is solved, achieving fast and stable axis-angle conversion, which is suitable for large-scale integrated circuit design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional axis-angle converters use a Type II servo system, which results in different computation times for different angle step sizes. This limits the tracking rate of the axis-angle converter, makes it unable to effectively respond to sudden speed changes, and causes system instability.
The direct angle comparison method is adopted to convert the input voltage signals sinθ and cosθ of the axis-angle converter into binary codes, and the angle is implemented in the form of binary weighted coefficients through an angle latch. The circuit design enables fast processing of arbitrary angles with consistent circuit topology.
It achieves a unified processing time for all input angles, improves computing speed, is suitable for large-scale integrated circuit design, and enhances system stability and responsiveness.
Smart Images

Figure CN115900531B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of servo control, specifically to a method for shaft-angle conversion based on direct angle comparison. Background Technology
[0002] Traditional axis-angle converters primarily employ a Type II servo system solution. This solution is essentially a follow-up system, with varying computation times for different angular step sizes. This necessitates re-accessing the system based on the maximum adjustment time, thus limiting the improvement of the axis-angle converter's tracking speed. In applications with sudden speed changes, the long adjustment time and smooth data processing of Type II servo systems fail to accurately reflect actual speed fluctuations. Furthermore, due to the dispersion of components, system instability can sometimes occur in practical applications.
[0003] The direct angle comparison method involves more circuit components than the Type II servo system, but the circuit topology of each component is almost identical, which facilitates the design and implementation of large-scale integrated circuits. The direct angle comparison scheme overcomes the weaknesses in the dynamic response of the Type II servo system, maintaining consistent processing time for any angle and providing linear feedback for sudden speed changes. Summary of the Invention
[0004] The purpose of this invention is to provide an axis-angle conversion method based on direct angle comparison in order to solve the above-mentioned problems.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: a shaft-angle conversion method based on direct angle comparison, used to convert the analog voltage signals sinθ and cosθ of the input voltage converter of the shaft-angle converter into binary codes and output them to the angle latch in parallel. The method uses a circuit design to convert the angle θ / π into a binary angle weighting coefficient form, where the angle θ is the shaft angle converted into radians, and the shaft angle is determined by the input voltage signals sinθ and cosθ of the shaft-angle converter.
[0006] The voltage signals sinθ and cosθ are analog voltage inputs to the axis-angle converter, used to detect the axis angle. The output is mostly in binary code, and the precise axis angle value is obtained by decoding the binary code. When the angle latch resolution is n, the angle θ / π converted to binary angle weighting values are shown in the table below:
[0007]
[0008] The angle latch stores the value of the corresponding bit of the angle. This value is 1 or 0. When it is 1, the angle weight value corresponding to this bit is accumulated during decoding. When it is 0, the angle weight value corresponding to this bit is not accumulated during decoding.
[0009] Based on the direct angle comparison method and binary decoding rules, the following method is proposed to convert axis angle values into binary angle weighting coefficients, specifically including the following steps:
[0010] S100, Phase Detection: Phase detection is performed on the axis angle θ in the input voltage signals sinθ and cosθ. This phase detection determines whether the axis angle θ is located in one of the four quadrants. Two zero-bit comparators are designed to determine the position of sinθ.
[0011] The sign of cosθ is determined, and the result is input into bits 0 and 1 in the angle latch.
[0012] S200, taking absolute values: taking the absolute values of the phase-detected analog voltages sinθ and cosθ; by designing a reverse follower and a two-to-one circuit for direct circuit, the shaft angle θ is replaced with the first quadrant angle θ1, and then the analog voltages sinθ and cosθ are converted into analog voltages sinθ1 and cosθ1. When the values of the analog voltages sinθ and cosθ are greater than 0, they are used directly; when the values of the analog voltages sinθ and cosθ are less than 0, the analog switch is controlled to run through the reverse follower and then used, thus realizing the taking of absolute values of analog voltages;
[0013] S300, with angle θ1 and Direct comparison: Determine if θ2 is greater than 0, where By designing adder and subtractor circuits, the absolute values of the analog voltages sinθ1 and cosθ1 are converted into analog voltages sinθ2 and cosθ2. Then, by comparing the magnitudes of the analog voltages sinθ2 and 0, θ1 is determined. The value of θ1 is determined by the following conditions: when sinθ2≥0, θ1≥π / 4, the second bit in the angle latch is set to 1, and the process proceeds to step S400; when sinθ2<0, θ1<π / 4, the second bit in the angle latch is set to 0, and the process proceeds to step S500.
[0014] S400, with angle θ2 and Direct comparison: Determine if θ3 is greater than 0, where By designing adder and subtractor circuits, the analog voltages sinθ2 and cosθ2 are converted into analog voltages sinθ3 and cosθ3, respectively. Then, by comparing the magnitudes of the analog voltages sinθ3 and 0, θ2 and θ3 are determined. The size, when
[0015] When sinθ3≥0, θ2≥π / 8, set bit 3 in the angle latch to 1, and proceed to step S600; when sinθ3<0, θ2<π / 8, set bit 3 in the angle latch to 0, and proceed to step S700.
[0016] S500, with angle θ2 and Accumulation: By designing adder and subtractor circuits, the analog voltages sinθ2 and cosθ2 are converted into analog voltages sinθ3 and cosθ3, where... Then, the angle weighting coefficient of bit 3 in the angle latch is determined by comparing the magnitudes of the simulated voltages sinθ3 and 0. When sinθ3≥0, bit 3 in the angle latch is set to 1, and the process proceeds to step S600; when sinθ3<0, bit 3 in the angle latch is set to 0, and the process proceeds to step S700.
[0017] S600, angle θ i With π / 2 i+1 Direct comparison: Determine θ i+1 Is it greater than 0, where
[0018] θ i+1 =θ i -π / 2 i+1 By designing adder and subtractor circuits, the analog voltage sinθ is converted. i With cosθ i Convert to analog voltage sinθ i+1 cosθ i+1 Furthermore, by simulating voltage sinθ i+1 The magnitude of θ is determined by comparing it with 0. i With π / 2 i+1 The size of sinθ i+1 When ≥0, θ i ≥π / 2 i+1 Set the bit (i+1) in the angle latch to 1, and repeat step S600; when sinθ i+1 When θ < 0, i <π / 2 i+2 Set the number of bits (i+1) in the angle latch to 0, and proceed to step S700; where the analog voltage sinθ i With cosθ i This is the analog voltage converted in the previous step;
[0019] S700, angle θ i With π / 2 i+1 Accumulation: By designing adder and subtractor circuits, the analog voltage sinθ is... i With cOsθ i Convert to analog voltage sinθ i+1 cosθ i+1 , where θ i+1 =θ i +π / 2 i+1 Furthermore, by simulating voltage sinθ i+1 The magnitude of 0 is compared to determine the angle weighting coefficient of the number of bits (i+1) in the angle latch, when sinθi+1 When sinθ is ≥0, set the number of bits (i+1) in the angle latch to 1 and proceed to step S600; when sinθ i+1 When <0, the bit (i+1) in the angle latch is set to 0, and step S700 is repeated; where the analog voltage sinθ i With cosθ i This is the analog voltage converted in the previous step;
[0020] S800, iterate to obtain the value of all digits: repeat steps 600 and 700 until i = n - 2, then determine sinθ. n-1 The sign of the value is determined and the result is output to the angle latch, completing the n-bit resolution axis-angle conversion. The value stored in the angle latch is the binary encoding of angle θ / π.
[0021] Compared with existing technologies, the advantages of this invention are reflected in the following: the direct angle comparison scheme of this invention has the same processing flow for all input angle voltages, so the processing time is the same. In addition, the main circuit topology of this method is basically the same, which is very suitable for the implementation of large-scale integrated circuit design. The computing speed can be improved with the improvement of IC design and process capabilities. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the phase detection circuit design of the present invention;
[0023] Figure 2 This is a schematic diagram of the absolute value taking circuit of the present invention;
[0024] Figure 3 For the present invention, angle θ0 and Directly compare the circuit schematics;
[0025] Figure 4 This is a circuit diagram of the adder and subtractor of the present invention. Detailed Implementation
[0026] The present invention will be further described in detail below with reference to the embodiments shown in the accompanying drawings, but this does not constitute any limitation on the present invention.
[0027] This invention aims to improve upon the traditional type II servo system scheme for axis-angle converters, which is based on a follower system. The improved type II servo system scheme has different computation times for different angle step sizes, which inevitably limits the improvement of the axis-angle converter's tracking speed. The direct angle comparison scheme, however, uses a circuit to approximate the angle step size, achieving the same computation time for different angle step sizes. Furthermore, its circuit topology is almost identical, and improvements in current IC design and manufacturing processes significantly increase the computation speed. Based on the direct angle comparison scheme and the decoding and encoding rules of binary code, this invention proposes an axis-angle conversion method based on direct angle comparison. First, the axis angle is converted to radians. After fixing the radian system, the angle θ / π can be directly implemented according to the decoding and encoding rules of binary code. The implementation principle is as follows:
[0028] (1) Physiological identification
[0029] For the input sinθ and cosθ, quadrant determination must be performed first. Quadrant determination is used to group the axis angles. Based on the grouping, the axis angles greater than π / 2 are all in the first quadrant. At the same time, the actual value can be restored through decoding rules.
[0030] The quadrant determination principle is as follows: when sinθ is positive and cosθ is positive, θ is located in the first quadrant; when sinθ is positive and cosθ is negative, θ is located in the second quadrant; when sinθ is negative and cosθ is negative, θ is located in the third quadrant; and when sinθ is negative and cosθ is positive, θ is located in the fourth quadrant.
[0031] The circuit diagram for quadrant determination is as follows: Figure 1 As shown: Two zero-bit comparators are used to determine the signs of sinθ and cosθ. The comparison result is used as an address signal and input to a ROM. The ROM is pre-stored with data. When the address is 11 (meaning Add0 is set to 1 and Add1 is set to 1; its meaning is equivalent to sinθ≥0, cosθ≥0), it outputs 00 and stores it in the angle latch (meaning that the 180-degree and 90-degree bits are weighted as 0). When the address is 10, it outputs 01 and stores it in the angle latch (meaning that the 180-degree bits are weighted as 0 and the 90-degree bits are weighted as 1). When the address is 00, it outputs 10 and stores it in the angle latch (meaning that the 180-degree bits are weighted as 1 and the 90-degree bits are weighted as 0). When the address is 01, it outputs 11 and stores it in the angle latch (meaning that the 180-degree and 90-degree bits are weighted as 1). The above process completes the determination of the θ quadrant, that is, completes the assignment of the high two bits of the θ binary angle code.
[0032] (2) Take the absolute values of sinθ and cosθ
[0033] The purpose of taking the absolute value of sinθ and cosθ is to place the axis angles in the first quadrant. When the values of sinθ and cosθ of the analog voltage are greater than 0, they are used directly. When the values of sinθ and cosθ of the analog voltage are less than 0, the analog switch is controlled to run the reverse follower and then used, thereby realizing the absolute value of the analog voltage.
[0034] The circuit schematic for taking the absolute value is as follows: Figure 2 As shown: Using the comparator data of the phase detection circuit, the absolute values of sinθ and cosθ are taken. That is, when the value is greater than 0, it is directly used; when the value is less than 0, the analog switch is controlled to run in reverse and then used. The output sinθ1 and cosθ1 are the corresponding sine and cosine analog voltages of the first quadrant.
[0035] Since it is a follower, the resistor values are R1=R2=R3=R4, and a thin film resistor network is selected to control the proportional error to less than 0.01%.
[0036] (3) Interchange angle θ1 with direct comparison
[0037] The first quadrant θ1 is processed and the operation is performed. First, the third bit of the binary angle code of θ1 (i.e. 45°) is judged.
[0038] Interchange angle θ1 with The principle of direct comparison is as follows: Let θ2 = θ1 - 45°, then we have
[0039] sinθ2=sin(θ1-45°)=cos45°(sinθ1-cosθ1tan45°)
[0040] =cos45°(sinθ1-cosθ1)
[0041] cosθ2=cos(θ1-45°)=cos45°(sinθ1tan45°+cosθ1)
[0042] =cos45°(sinθ1+cosθ1)
[0043] Since both sinθ2 and cosθ2 contain a cos45° factor, and this calculation only concerns whether the sine value of θ2 is greater than 0, this factor is directly removed to simplify the circuit, resulting in...
[0044] sinθ2=sinθ1-cosθ1tan45°=sinθ1-cosθ1
[0045] cosθ2=sinθ1tan45°+cosθ1=sinθ1+cosθ1
[0046] When sinθ2≥0, it means that θ1≥45°, so the third bit (i.e., the 45° weighted value) in the angle latch is set to 1; conversely, when sinθ2<0, it means that θ2<45°, so the third bit (i.e., the 45° weighted value) in the angle latch is set to 0.
[0047] Interchange angle θ1 with The circuit schematic for direct comparison is as follows: Figure 3 As shown: The upper part of the diagram is a subtractor. The subtractor circuit consists of analog voltages sinθ1 and cosθ1 as input signals, an operational amplifier, and a thin-film resistor. The inverting input of the operational amplifier is connected to the thin-film resistor R. 11 Connect the analog voltage cosθ1, with the non-inverting input terminal connected to a thin-film resistor R. 12 The analog voltage sinθ1 is connected, and a thin-film resistor R is connected to ground at the non-inverting input of the operational amplifier. 13 A feedback thin-film resistor R is also provided. 14 According to the principle of the subtractor circuit, it can be known that
[0048]
[0049] In order to satisfy
[0050] sinθ2=sinθ1-cosθ1tan45°=sinθ1-cosθ1
[0051] Take R 11 =R 14 R 12 =R 13 , where R 11 R 14 Select thin film resistor pair, R 12 R 13 Thin-film resistor pairs are selected, and the proportional error is controlled to be less than 0.01%.
[0052] The lower part of the diagram shows an adder. The adder circuit consists of analog voltages sinθ1 and cosθ1 as input signals, an operational amplifier, and a thin-film resistor. The analog voltages sinθ1 and cosθ1 are respectively connected through the thin-film resistor R. 15 R 16 Connect the non-inverting input of the operational amplifier, and connect the inverting input of the operational amplifier through a thin-film resistor R. 18 The operational amplifier's non-inverting input is connected to ground via a thin-film resistor R. 17 A feedback thin-film resistor R is also provided. 19 The resistors across the negative terminal of the operational amplifier are valued as R. 19 =2R 18 According to the principle of adder circuit, it can be known that
[0053]
[0054] To satisfy the above equation, let R be... 15 =R 16 =R 17 , where R 15 R 16 R 17 Thin-film resistor network is selected, R 18 R 19 Thin-film resistor pairs are selected, and the proportional error is controlled to be less than 0.01%.
[0055] (4) General weighted bits direct comparison
[0056] After judging the third bit (i.e., 45°) of the binary angle code θ1, the subsequent judgments are set according to a pattern, the principle of which is as follows:
[0057] set up
[0058]
[0059] When sinθ i When ≥0,
[0060]
[0061]
[0062] When sinθ i When <0,
[0063]
[0064]
[0065] When sinθ i+1 When sinθ is ≥0, set the number of bits (i+1) in the angle latch to 1; when sinθ is ≥0, set the number of bits (i+1) in the angle latch to 1. i+1 When <0, set the number of bits (i+1) in the angle latch to 0;
[0066] Its circuit schematic is as follows Figure 4 As shown: The upper part of the diagram is the subtractor circuit, which consists of analog voltages Ui1 and Ui2 as input signals, an operational amplifier, and a thin-film resistor. The inverting input of the operational amplifier is connected to the thin-film resistor R. i1 Connect analog voltage Ui1, with the non-inverting input terminal connected to a thin-film resistor R. i2 The analog voltage Ui2 is connected, and a thin-film resistor R is connected to ground at the non-inverting input of the operational amplifier. i3 A feedback thin-film resistor R is also provided. i4 ;
[0067] The lower half of the diagram shows the adder circuit, which consists of analog voltages Ui1 and Ui2 as input signals, an operational amplifier, and thin-film resistors. The analog voltages Ui1 and Ui2 are respectively connected through thin-film resistors R. i6 R i5 Connect the non-inverting input of the operational amplifier, and connect the inverting input of the operational amplifier through a thin-film resistor R. i8 The operational amplifier's non-inverting input is connected to ground via a thin-film resistor R. i7 A feedback thin-film resistor R is also provided. i9 ;
[0068] When sinθ i When ≥0, sinθ i Take U i1 cosθ i Take U i2 U oi1 sinθ i+1 ;
[0069] When sinθ i When <0, sinθ i Take U i2 cosθ i Take U i1 U oi2 sinθ i+1 ;
[0070] Based on the principle of subtractor circuit:
[0071]
[0072] In order to correspond one-to-one with general rules,
[0073]
[0074] Where R i1 R i4 Select a thin-film resistor pair network, R i2 R i3 Thin-film resistors are selected for the network, and the proportional error is controlled to be less than 0.01%.
[0075] The resistor across the negative terminal of the op-amp is R. i9 =2R i8 According to the principle of adder circuit:
[0076]
[0077] In order to correspond one-to-one with general rules,
[0078]
[0079] Among them, Ri8 R i9 Select a thin-film resistor pair network, R i5 R i6 R i7 Thin-film resistor networks are selected, and the proportional error is controlled to be less than 0.01%.
[0080] (5) Iterate through the data to obtain the values of all digits.
[0081] Using the circuit design above, repeat step (4) until i = n - 2, at which point determine sinθ. n-1 The sign of the value is determined and the result is output to the angle latch, completing the n-bit resolution axis-angle conversion. The value stored in the angle latch is the axis-angle θ / π binary code.
[0082] The direct angle comparison scheme of this invention uses the same processing flow for all input angle voltages, so the processing time is the same. Furthermore, the main circuit topology of this method is basically the same, making it very suitable for the implementation of large-scale integrated circuit design. The computing speed can be increased with the improvement of IC design and process capabilities.
[0083] The above-described embodiments are preferred embodiments of the present invention and are only used to facilitate the illustration of the present invention. They are not intended to limit the present invention in any way. Any person skilled in the art who makes local modifications or alterations to the technical content disclosed in the present invention without departing from the scope of the technical features of the present invention shall still fall within the scope of the technical features of the present invention.
Claims
1. A shaft-angle conversion method based on direct angle comparison, used to convert the input voltage signal of the shaft-angle converter into an input voltage signal. and The analog voltage is converted into binary code and output to the angle latch in parallel. Its characteristic is: by designing a circuit to convert the angle into a binary angle-weighted coefficient form, where the angle is converted into a radian system, and the axis angle is determined by an input voltage signal of an axis angle converter ; By designing a circuit to control the angle The method for converting π to binary angle weighted coefficient form includes the following steps: S100, Phase Detector: Detects the input voltage signal. and The axis angle in Phase detection is performed, wherein the phase detection is performed on the axis angle. Determining its location in the four quadrants; using two zero-bit comparators for determination. , The sign of the value is determined, and the result is input into bits 0 and 1 in the angle latch. S200, take the absolute value: the analog voltage after phase detection. and Take the absolute value; use a two-way selector circuit consisting of an inverting follower and a through circuit to determine the shaft angle. Change to first quadrant angle Therefore, when the simulated voltage , Convert to analog voltage , When the analog voltage , When the value is greater than 0, it is used directly; when further simulating voltage... , When the value is less than 0, the analog switch is controlled to follow the reverse follower, thereby realizing the absolute value of the analog voltage; S300, angle and Direct comparison: judgment Is it greater than 0, where By designing adder and subtractor circuits, the absolute value of the analog voltage is obtained. and Convert to analog voltage , And then through simulated voltage The size of 0 is determined by comparison. and The size, when hour, Set bit 2 in the angle latch to 1 and proceed to step S400; when hour, Set bit 2 in the angle latch to 0 and proceed to step S500; S400, angle and Direct comparison: judgment Is it greater than 0, where By designing adder and subtractor circuits, analog voltages are converted... and Convert to analog voltage , And then through simulated voltage The size of 0 is determined by comparison. and The size, when hour, Set bit 3 in the angle latch to 1 and proceed to step S600; when hour, Set bit 3 in the angle latch to 0 and proceed to step S700; S500, angle and Accumulation: By designing adder circuits and subtractor circuits, analog voltages are... and Convert to analog voltage , ,in And then through simulated voltage The comparison with 0 determines the angle weighting coefficient of bit 3 in the angle latch. When, set bit 3 in the angle latch to 1, proceed to step S600; when When the time is right, set bit 3 in the angle latch to 0 and proceed to step S700; S600, angle and Direct comparison: judgment Is it greater than 0, where By designing adder and subtractor circuits, analog voltages are converted... and Convert to analog voltage , And then through simulated voltage The size of 0 is determined by comparison. and The size, when hour, The number of bits in the angle latch ( i+ 1) Set to 1, repeat step S600; when hour, The number of bits in the angle latch ( i+ 1) Set to 0, proceed to step S700; where the analog voltage and This is the analog voltage converted in the previous step; S700, angle and Accumulation: By designing adder circuits and subtractor circuits, analog voltages are... and Convert to analog voltage , ,in And then through simulated voltage The value of 0 is compared to determine the number of bits in the angle latch. i+ 1) Angle weighting coefficients, when At that time, the number of bits in the angle latch ( i+ 1) Set to 1, proceed to step S600; when At that time, the number of bits in the angle latch ( i+ 1) Set to 0, repeat step S700; where the analog voltage and This is the analog voltage converted in the previous step; S800, iterate to obtain the value of all bits: repeat steps 600 and 700 until... i = n -2, at this point, we determine... The sign of the value is determined, and the result is output to the angle latch, completing the process. n Bit resolution axis-angle conversion, the value stored in the angle latch is the angle. / π is a binary encoding system.
2. The axis-angle conversion method based on direct angle comparison according to claim 1, characterized in that: When the angle latch resolution is n At time, angle The angle weights converted from / π to binary are shown in the table below: 。 3. The axis-angle conversion method based on direct angle comparison according to claim 1, characterized in that: The subtractor circuit is based on analog voltage. and It consists of an input signal, an operational amplifier, and a thin-film resistor, wherein the inverting input terminal of the operational amplifier is connected to a thin-film resistor R. i1 Connect analog voltage The non-inverting input terminal is connected to a thin-film resistor R. i2 Connect analog voltage The non-inverting input of the operational amplifier is connected to ground by a thin-film resistor R. i3 A feedback thin-film resistor R is also provided. i4 .
4. The axis-angle conversion method based on direct angle comparison according to claim 3, characterized in that: in, The bits of the angle latch correspond one-to-one. .
5. The axis-angle conversion method based on direct angle comparison according to claim 1, characterized in that: The adder circuit is based on analog voltage. and As an input signal, operational amplifier, and thin-film resistor, analog voltage... and Through thin film resistor R respectively i6 R i5 Connect the non-inverting input of the operational amplifier, and connect the inverting input of the operational amplifier through a thin-film resistor R. i8 The operational amplifier's non-inverting input is connected to ground via a thin-film resistor R. i7 A feedback thin-film resistor R is also provided. i9 .
6. The axis-angle conversion method based on direct angle comparison according to claim 5, characterized in that: in, The bits of the angle latch correspond one-to-one. .
Citation Information
Patent Citations
360-degree modulus binary-decimal converter
CN101882413A