A method and circuit for realizing axis angle conversion based on forward and reverse tangent function
Patent Information
- Application Number
- CN202310234057.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-03-07
AI Technical Summary
现有使用直接角度比较方法进行轴角信号转换时,每一级电路都需要针对tan45°/2i-1搭建薄膜电阻网络,虽然能够直接进行二进制角度值的运算,但对薄膜电阻比例值的要求较高,导致产品研制成本高,且超高精密阻值也阻碍了集成电路小型化的发展
[0034] The advantages of the axis-angle conversion method and circuit based on the tangent and inverse tangent functions provided by this invention are as follows: The method and circuit based on the tangent and inverse tangent functions provided in this invention have low requirements for the ratio of thin-film resistors, promoting the miniaturization of integrated circuits; ultimately, a string of digital values is directly output, requiring only interpretation of the digital values according to the needs, and the corresponding angle can be obtained using simple addition and subtraction. Furthermore, with the improvement of process capabilities, series expansion can be performed to increase the accuracy of angle interpretation; simultaneously, all coefficients in the algorithm process of the implementation method are ignored, realizing the limit idea while amplifying the signal, reducing the requirements for the signal, i.e., reducing process requirements; in addition, the direct arctangent function lookup table method simplifies the circuit structure, using circuits with the same structure and parameters to assemble the solution method for the axis-angle signal. The direct angle comparison scheme has the same processing flow for all input angle voltages, so the processing time is the same. Moreover, the main circuit structure and parameters of the direct arctangent function lookup table method are all consistent, making it more suitable for the implementation of large-scale integrated circuit design, and the computing speed can be increased with the improvement of IC design and process capabilities.
Smart Images

Figure CN116449910B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of axis-angle conversion technology, and in particular to an axis-angle conversion method and implementation circuit based on tangent and inverse tangent functions. Background Technology
[0002] Traditional axis-angle converters mainly adopt the Type II servo system solution. This solution is essentially a follow-up system, which has different calculation times for different angle step amounts. As a result, the system generally needs to be re-accessed according to the maximum adjustment time, which restricts the improvement of the tracking rate of the axis-angle converter. When facing application scenarios with sudden speed changes, the Type II servo system has a long adjustment time and smooth data processing, which makes it unable to truly reflect the actual speed changes. Moreover, due to the dispersion of components, the system may sometimes become unstable in actual use.
[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.
[0004] Traditional shaft-angle converters use a parallel transmission method for binary angle values, where the weight of each higher bit is twice that of the first bit, and the weight of the most significant bit is 180°. Current methods using direct angle comparison for shaft-angle signal conversion require each circuit stage to be compatible with tan45° / 2. i-1 While building a thin-film resistor network can directly perform binary angle calculations, it requires high-precision ratios of the thin-film resistors, resulting in high product development costs. Furthermore, ultra-high precision resistance values also hinder the miniaturization of integrated circuits. Summary of the Invention
[0005] Based on the technical problems existing in the background technology, this invention proposes an axis-angle conversion method and implementation circuit based on the positive and negative tangent functions. It does not have high requirements for the ratio of thin film resistors, promotes the development of miniaturization of integrated circuits, and finally directly outputs a string of digital values. The corresponding angle can be obtained by simply adding or subtracting the digital values according to the requirements.
[0006] This invention proposes a method for axis-angle transformation based on tangent and inverse tangent functions, comprising:
[0007] Obtain the sine and cosine feedback signals sinθ and cosθ, and shift the quadrant in which the sine and cosine feedback signals are located to the first quadrant sinθ0 and cosθ0;
[0008] Take the angle in the first quadrant Determined based on tangent and inverse functions The general weighted transfer function yields [sinθ] n cosθ n ], output the decoded angle value θ.
[0009] Further, in obtaining the sine and cosine feedback signals sinθ and cosθ, shifting the quadrant containing the sine and cosine feedback signals to the first quadrant sinθ0 and cosθ0 specifically includes:
[0010] A zero-bit comparator is used to determine the sign of sinθ and cosθ. The decision bit corresponding to sinθ is set as A0 and the decision bit corresponding to cosθ is set as A1. When the decision value is greater than 0, the corresponding decision bit is 0, and when the decision value is less than 0, the corresponding decision bit is 1. The decision values are sinθ and cosθ.
[0011] When (A0, A1) = (0, 0), then sinθ = sinθ0, cosθ = cosθ0;
[0012] When (A0, A1) = (0, 1), then sinθ = cosθ0, cosθ = -sinθ0;
[0013] When (A0, A1) = (1, 1), then sinθ = -sinθ0, cosθ = -cosθ0;
[0014] When (A0, A1) = (1, 0), then sinθ = -cosθ0, cosθ = sinθ0.
[0015] Furthermore, taking the angle in the first quadrant... Determined based on tangent and inverse functions The general weighted bits of the transfer function are obtained as [sinθ] n cosθ n The decoded angle value θ output specifically includes:
[0016] Take the angle in the first quadrant Calculated
[0017] The value is set to the tangent function. Where n is the number of bits in the decoder, and the output features B0, B1, ..., B1 corresponding to the value of n. n-1 ;
[0018] Based on A0, A1, B0, B1, ... B n-1 Decode the angle value θ and output the decoded angle value.
[0019] Furthermore, in The value is set to the tangent function. Where n is the number of bits in the decoder, and the output features B0, B1, ..., B1 corresponding to the value of n. n-1 Specifically, this includes:
[0020] The value is set to the tangent function.
[0021] When n = 1, since sinθ0 > 0, the corresponding characteristic bit B0 = 0 is taken. but
[0022]
[0023]
[0024] When n = 2, if sinθ1 > 0, take the corresponding characteristic bit B1 = 0. but
[0025]
[0026] When n = 2, if sinθ1 < 0, take the corresponding characteristic bit B1 = 1. but
[0027]
[0028] The calculations are performed iteratively to obtain B0, B1, ... B. n-1 The corresponding transfer function is:
[0029]
[0030] A circuit for axis-angle conversion based on tangent and inverse tangent functions includes a phase-shifting circuit, a first-stage transfer circuit, and an nth-stage transfer circuit. The input terminals of the phase-shifting circuit are sine and cosine feedback signals sinθ and cosθ, and its output terminal is connected to the input terminal of the first-stage transfer circuit. The input terminal of the nth-stage transfer circuit is connected to the output terminal of the first-stage transfer circuit, and its output terminal outputs a signal sinθ. n and cosθ n .
[0031] Furthermore, the phase-shifting circuit includes a through circuit and an inverting follower, which are connected in parallel. The through circuit receives signals sinθ and cosθ at its input terminals and outputs signals sinθ0 and cosθ0 at its output terminals. The inverting follower receives signals sinθ and cosθ at its input terminals and outputs signals sinθ0 and cosθ0 at its output terminals.
[0032] Furthermore, the first-stage transmission circuit includes a first-stage adder and a first-stage subtractor, and the nth-stage transmission circuit includes an nth-stage adder and an nth-stage subtractor. The input terminals of the first-stage adder and the first-stage subtractor are respectively connected to the output terminals of the phase-shifting circuit, and the output terminals of the first-stage adder and the first-stage subtractor are respectively connected to the input terminals of the nth-stage adder and the nth-stage subtractor.
[0033] Furthermore, the (n-1)th stage transmission circuit is connected to the nth stage transmission circuit via a first transmission analog switch group, and the nth stage transmission circuit is connected to a second transmission analog switch group before its output.
[0034] The advantages of the axis-angle conversion method and circuit based on the tangent and inverse tangent functions provided by this invention are as follows: The method and circuit based on the tangent and inverse tangent functions provided in this invention have low requirements for the ratio of thin-film resistors, promoting the miniaturization of integrated circuits; ultimately, a string of digital values is directly output, requiring only interpretation of the digital values according to the needs, and the corresponding angle can be obtained using simple addition and subtraction. Furthermore, with the improvement of process capabilities, series expansion can be performed to increase the accuracy of angle interpretation; simultaneously, all coefficients in the algorithm process of the implementation method are ignored, realizing the limit idea while amplifying the signal, reducing the requirements for the signal, i.e., reducing process requirements; in addition, the direct arctangent function lookup table method simplifies the circuit structure, using circuits with the same structure and parameters to assemble the solution method for the axis-angle signal. The direct angle comparison scheme has the same processing flow for all input angle voltages, so the processing time is the same. Moreover, the main circuit structure and parameters of the direct arctangent function lookup table method are all consistent, making it more suitable for the implementation of large-scale integrated circuit design, and the computing speed can be increased with the improvement of IC design and process capabilities. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the process of the present invention;
[0036] Figure 2 A flowchart illustrating the method for implementing axis-angle conversion;
[0037] Figure 3 A schematic diagram illustrating the steps of the axis-angle conversion method;
[0038] Figure 4 This is the circuit diagram for the phase-reversing circuit;
[0039] Figure 5 This is the circuit diagram for the first-stage transmission circuit.
[0040] Figure 6 This is the circuit diagram for the nth stage transmission circuit. Detailed Implementation
[0041] The technical solution of the present invention will now be described in detail through specific embodiments. Many specific details are set forth in the following description to provide a thorough understanding of the invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0042] like Figures 1 to 6 As shown, this invention proposes a circuit for axis-angle conversion based on tangent and inverse tangent functions, including a phase-shifting circuit, a first-stage transfer circuit, and an nth-stage transfer circuit. The input terminal of the phase-shifting circuit receives sine and cosine feedback signals sinθ and cosθ, and its output terminal is connected to the input terminal of the first-stage transfer circuit. The input terminal of the nth-stage transfer circuit is connected to the output terminal of the first-stage transfer circuit, and its output terminal outputs a signal sinθ. n and cosθ n .
[0043] The phase-shifting circuit includes a through circuit and an inverting follower, which are connected in parallel. The through circuit receives signals sinθ and cosθ at its input terminals and outputs signals sinθ0 and cosθ0 at its output terminals. The inverting follower receives signals sinθ and cosθ at its input terminals and outputs signals sinθ0 and cosθ0 at its output terminals.
[0044] The first-stage transmission circuit includes a first-stage adder and a first-stage subtractor. The nth-stage transmission circuit includes an nth-stage adder and an nth-stage subtractor. The input terminals of the first-stage adder and the first-stage subtractor are respectively connected to the output terminals of the phase-inverting circuit, and the output terminals of the first-stage adder and the first-stage subtractor are respectively connected to the input terminals of the nth-stage adder and the nth-stage subtractor.
[0045] The (n-1)th stage transmission circuit is connected to the nth stage transmission circuit via a first transmission analog switch group, and the nth stage transmission circuit is connected to the output via a second transmission analog switch group.
[0046] This circuit is used to implement shaft-angle conversion, as detailed below:
[0047] like Figures 1 to 6 As shown, the present invention proposes an axis-angle transformation method based on tangent and inverse tangent functions, which includes the following steps:
[0048] S100: Obtain sine and cosine feedback signals sinθ and cosθ, and phase-shift the quadrant where the sine and cosine feedback signals are located to the first quadrant sinθ0 and cosθ0;
[0049] A zero-bit comparator is used to determine the signs of sinθ and cosθ. To convert θ into a first-quadrant angle θ0, as follows: Figure 4 As shown, a phase-switching circuit is used to set up a two-way selector circuit for sinθ and cosθ, consisting of an inverting follower and a direct circuit. When sinθ is positive, closing switch K1 or K2 in the direct circuit outputs sinθ0 or cosθ0 through the direct circuit. When sinθ is negative, closing switch K5 or K6 connected to inverting follower U9 outputs -sinθ0 or -cosθ0 through the direct circuit. Similarly, when cosθ is positive, closing switch K3 or K4 in the direct circuit outputs cosθ0 or sinθ0 through the inverting follower. When cosθ is negative, closing switch K7 or K8 connected to inverting follower U10 outputs -sinθ0 or -cosθ0 through the inverting follower. The resistor values in the figure are the same, which does not require high requirements for the ratio of thin-film resistors, thus promoting the miniaturization of integrated circuits.
[0050] Let A0 be the decision bit corresponding to sinθ and A1 be the decision bit corresponding to cosθ. Set the decision bit to 0 when the decision value is greater than 0 and 1 when the decision value is less than 0. The decision value is sinθ and cosθ. Specifically, when sinθ > 0, A0 = 0; when sinθ < 0, A0 = 1; when cosθ > 0, A1 = 0; when cosθ < 0, A0 = 1.
[0051] When (A0, A1) = (0, 0), then θ is in the first quadrant, so sinθ = sinθ0, cosθ = cosθ0;
[0052] When (A0, A1) = (0, 1), then θ is in the second quadrant, so sinθ = sin(θ0 + 90°) = cosθ0, cosθ = cos(θ0 + 90°) = -sinθ0;
[0053] When (A0, A1) = (1, 1), then θ is in the third quadrant, so sinθ = sin(θ0 + 180°) = -sinθ0, cosθ = cos(θ0 + 180°) = -cosθ0;
[0054] When (A0, A1) = (1, 0), then θ is in the fourth quadrant, so sinθ = sin(θ0 + 270°) = -cosθ0, cosθ = cos(θ0 + 270°) = sinθ0.
[0055] The goal is to shift θ to the first quadrant to obtain θ0. In the final conversion, the calculated θ0 should also be converted to θ based on these two decision bits.
[0056] S200: Take the angle in the first quadrant. Determined based on tangent and inverse functions The general weighted transfer function yields [sinθ] n cosθ n ], output the decoded angle value θ.
[0057] when hour, Therefore, when the above expression equals 0, the value of θ can be obtained, and the approximation method can be used to approximate it. make Then it can be passed θ can be calculated directly.
[0058]
[0059]
[0060] Expressed in matrix form as follows
[0061]
[0062] Here It is a constant, therefore we need to make To approach 0, that is, to make For the sake of circuit and manufacturing convenience, 0 can be used here. If ignored, the above formula can be simplified to:
[0063]
[0064] Again, for the sake of convenient circuit and manufacturing process implementation, The value is set to the tangent function. Where n is the number of bits in the decoder, here They are respectively correspond For 45°, 26.56505°, 14.03624°,...
[0065] This embodiment uses the direct arctangent function lookup table method, which simplifies the circuit structure. The direct angle comparison scheme has the same processing flow for all input angle voltages, so the processing time is the same. Furthermore, the main circuit structure and parameters of the direct arctangent function lookup table method are all consistent, making it more 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.
[0066] When n = 1, since sinθ0 > 0, the corresponding characteristic bit B0 = 0 is taken. but
[0067]
[0068] Where θ1 = θ0 - arctan1;
[0069] When n = 2, if sinθ1 > 0, take the corresponding characteristic bit B1 = 0. but
[0070]
[0071] in
[0072] When n = 2, if sinθ1 < 0, take the corresponding characteristic bit B1 = 1. but
[0073]
[0074] in
[0075] That is, when sinθ n When ≥0, directly take the corresponding value. The value proceeds to the next step of the calculation, when sinθ n When <0, directly take the corresponding value. The value proceeds to the next step of the calculation; thus, all variables in the subsequent matrix of the construction function are... The circuit design is simplified.
[0076] Due to the hysteresis mechanism of the comparator, sinθ n When = 0, the output is uncertain; it may output as > 0 or as < 0.
[0077] The above feature bits B0, B1, ... B n-1 The phase shift of θ yields θ0, θ1, ..., θ n The corresponding sine and cosine values, i.e., when sinθ0, sinθ1, ..., sinθ... n When it is greater than 0, the corresponding feature bits B0, B1, ... B n-1 The value is 0 when sinθ0, sinθ1, ..., sinθ n When less than 0, the corresponding feature bits B0, B1, ... B n-1 The value is 1, when cosθ0, cosθ1, ..., cosθ n When it is greater than 0, the corresponding feature bits B0, B1, ... B n-1 The value is 0 when cosθ0, cosθ1, ..., cosθ n When less than 0, the corresponding feature bits B0, B1, ... B n-1 The value is 1.
[0078] And so on.
[0079] For an n-bit decoder, the calculation continues up to B.n-1
[0080] The circuit implementation scheme for the first stage (θ0->θ1) of this part is attached. Figure 5 In the first-stage transfer circuit, since θ0 is already the angle in the first quadrant after phase shift, sinθ0 must be greater than 0, and B0 must be equal to 0. This part of the circuit can be fixed. Circuit 1 is the first-stage subtractor with output AB, and circuit 2 is the first-stage adder with output A+B. Their transfer functions are summarized as follows:
[0081]
[0082] This part is the subsequent stage (θ1->θ2->…->θ) n-1 (n>1) General architecture for each stage of the circuit Figure 6 The nth stage transmission circuit consists of a comparator, an analog switch, an nth stage adder, and an nth stage subtractor. Circuit 1 is the nth stage subtractor, and its output is A - (1 / 2 n Circuit B, Circuit 2 is the nth stage adder, and its output is A - (1 / 2) n B, Select the corresponding analog switch based on the sin value of the preceding stage. The specific correspondence is shown in the appendix. Figure 4 As shown, its transfer function is synthesized as follows:
[0083]
[0084] Then, calculate B0, B1, ... B in sequence using a loop. n-1 ;
[0085] Based on A0, A1, B0, B1, ... B n-1 Decode the angle value θ and output the decoded angle value;
[0086] The final decoded angle value is
[0087] When (A0, A1) = (0, 0):
[0088]
[0089] When (A0, A1) = (0, 1):
[0090]
[0091] When (A0,A1)=(1,1),
[0092]
[0093] When (A0,A1)=(1,0),
[0094]
[0095] In steps S100 to S200, this embodiment ultimately outputs a string of digital values. The angle can be obtained simply by interpreting the digital values according to requirements and using basic addition and subtraction. The entire system contains no complex chips, making it easy to achieve independent control. A detailed flowchart of the overall concept, calculations, and circuit implementation is attached. Figure 5 As shown, the application is simple and reliable, and with the improvement of process capabilities, it can be extended in stages to increase the accuracy of angle interpretation.
[0096] Furthermore, the axis-angle conversion implementation method in this embodiment ignores all coefficients in the algorithm process, achieving the limit concept while amplifying the signal and reducing the requirements for the signal, i.e., reducing process requirements. The overall idea is that the resistance matching only exists as an integer multiple, which also greatly reduces the requirements for the process.
[0097] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for implementing axis-angle transformation based on tangent and inverse tangent functions, characterized in that, include: Obtaining sine and cosine feedback signals and The quadrant containing the sine and cosine feedback signals is shifted to the first quadrant. and Specifically, this includes: using a zero-bit comparator to... and Perform a positive / negative judgment and take... The corresponding decision bit is , The corresponding decision bit is When the judgment value is greater than 0, the corresponding judgment bit is 0; when the judgment value is less than 0, the corresponding judgment bit is 1. and ;when( If )=(0,0), then = , = ;when( If ) = (0, 1), then = , = ;when( If )=(1,1), then = , = ;when( If )=(1,0), then = , = ; Take the angle in the first quadrant Determined based on the tangent and inverse tangent functions [ , The general weighted bits of the transfer function are then used to obtain [ , Output the decoded angle value. Specifically, it means taking the angle located in the first quadrant. Calculation yields [ , ]=[ , ][ ]; The value is set to the tangent function. Where n is the number of bits in the decoder, and the output corresponds to the feature bits with the value of n. , ... ;according to , , , ... For angle values Perform decoding and output the decoded angle value; exist The value is set to the tangent function. Where n is the number of bits in the decoder, and the output corresponds to the feature bits with the value of n. , ... Specifically, this includes: The value is set to the tangent function. , = ; when n When =1, because Take the corresponding feature bits =0, =45°, then when n When =2, if Take the corresponding feature bits =0, =26.56505°, then when n When =2, if Take the corresponding feature bits =1, =26.56505°, then Calculate in sequence to obtain , ... The corresponding transfer function is: 。 2. The axis-angle conversion implementation circuit of the axis-angle conversion implementation method according to claim 1, characterized in that, It includes a phase-shifting circuit, a first-stage transmission circuit, and an nth-stage transmission circuit. The input terminal of the phase-shifting circuit receives sine and cosine feedback signals. and The output terminal is connected to the input terminal of the first-stage transmission circuit, and the input terminal of the nth-stage transmission circuit is connected to the output terminal of the first-stage transmission circuit. The output terminal outputs a signal. and .
3. The axis-angle conversion circuit according to claim 2, characterized in that, The phase-shifting circuit includes a through circuit and an inverting follower, which are connected in parallel. The input terminals of the through circuit receive signals respectively. ,Signal The output terminals are respectively connected to the output signal. and signal The input terminals of the reverse follower are respectively input signals ,Signal The output terminals are respectively connected to the output signal. and signal .
4. The shaft-angle conversion circuit according to claim 3, characterized in that, The first-stage transmission circuit includes a first-stage adder and a first-stage subtractor, and the nth-stage transmission circuit includes an nth-stage adder and an nth-stage subtractor. The input terminals of the first-stage adder and the first-stage subtractor are respectively connected to the output terminals of the phase-inverting circuit, and the output terminals of the first-stage adder and the first-stage subtractor are respectively connected to the input terminals of the nth-stage adder and the nth-stage subtractor.
5. The shaft-angle conversion circuit according to claim 4, characterized in that, The (n-1)th stage transmission circuit is connected to the nth stage transmission circuit via a first transmission analog switch group, and the nth stage transmission circuit is connected to the output via a second transmission analog switch group.
Citation Information
Patent Citations
Generating method of sine and cosine signals based on probability calculation
CN102541815A
Single-chip digital-rotary transformer signal conversion method
CN105180973A