Fast convergence angle resolving method and system, electronic equipment and storage medium
Through the fast convergence angle solution method, through special angle judgment, quadrant classification and dynamic iterative update, the problem of low computational efficiency of traditional angle solution methods is solved, efficient and accurate angle solution is achieved, and resource consumption is reduced.
Patent Information
- Application Number
- CN202411591840.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-08
AI Technical Summary
Traditional angle solution methods are inefficient in calculations, especially in real-time systems, and embedded systems with limited resources are difficult to process detailed data tables.
A fast convergence angle solution method is proposed. By judging special angles, non-special angle coordinate data are extracted, coordinate quadrant classification and normalization preprocessing are performed, angle update direction is dynamically adjusted and iterative update is updated, and quadrant compensation is finally performed to obtain the final angle value.
It significantly reduces the number of iterations, improves the calculation efficiency of angle calculation, ensures the accuracy of the calculation results, and reduces resource consumption.
Smart Images

Figure CN119622181A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a fast-converging angle solving method, system, electronic equipment and storage medium. Background Art
[0002] Angle calculation plays a vital role in many fields, including but not limited to robotic control, autonomous driving systems, image processing and computer vision, aerospace engineering, etc. Accurate and efficient angle calculation is essential to ensure the stable operation and performance of these systems.
[0003] At present, the traditional angle solution methods include table lookup method and inverse tangent function approximation method. The table lookup method relies on a pre-calculated data table to find the corresponding angle value. The advantage of this method is that the query speed is fast. Once the table is loaded into the memory, the result can be quickly obtained through a simple index operation. However, in order to improve the accuracy of angle solution, a very large storage space is required to store detailed data tables, which is a challenge for resource-constrained embedded systems. In addition, when the input data is not in the table, interpolation operations are required, which will increase additional computational overhead. On the other hand, this method can usually provide higher accuracy, especially when dealing with coordinate system transformation problems; however, the calculation of the inverse tangent function is usually implemented through Taylor series expansion or other numerical approximation methods, which often involve complex floating-point operations, so the computational cost is high and is not conducive to the application of real-time systems. Therefore, in order to solve the technical problem of low computational efficiency of traditional angle solution methods, a fast-converging angle solution method, system, electronic device and storage medium are proposed. Summary of the invention
[0004] In order to achieve efficient and accurate solution of input signals, significantly reduce the number of iterations, and improve the calculation efficiency of angle solution, the purpose of the present invention is to provide a fast-converging angle solution method, system, electronic device and storage medium. The technical solutions adopted are as follows:
[0005] The technical solution of the first aspect of the present invention provides a fast-converging angle solution method, the method comprising:
[0006] Output special angle determination results or extract non-special angle coordinate data according to input coordinate data;
[0007] Performing coordinate quadrant classification and normalization preprocessing on the non-special angular coordinate data to obtain quadrant classification results and normalized non-special angular coordinate data;
[0008] Iteratively update the normalized non-special angle coordinate data, and gradually approach the normalized angle value by dynamically adjusting the angle update direction;
[0009] The normalized angle value after iterative update is quadrant compensated according to the quadrant classification result and converted into the final angle value.
[0010] Furthermore, the non-special angular coordinate data is subjected to coordinate quadrant classification and normalization preprocessing, and the quadrant classification results and the normalized non-special angular coordinate data are obtained, including:
[0011] Classify the quadrants according to the positive and negative values of the non-special angular coordinate data to obtain the quadrant classification results;
[0012] The absolute value of the non-special angular coordinate data is extracted and mapped to the target quadrant to obtain the non-special angular coordinate data in the target quadrant.
[0013] Further, performing iterative updating according to the normalized non-special angular coordinate data includes:
[0014] Initialize the normalized preprocessed non-special angular coordinate data and angle estimation values;
[0015] The non-special angle coordinate data and angle estimation value are updated through the iterative formula, gradually approaching the normalized angle value until the preset number of iterations is met, which can be expressed as:
[0016] X cos (i+2)=(1-d i ×2 -i ×d i+1 ×2 -(i-1) )
[0017] ×X cos (i)-(d i ×2 -i ×d i+1 ×2 -(i-1) )×Y sin (i)
[0018] In the formula, X cos (i+2) represents the cosine value of the non-special angle coordinate data after the i+2th iteration; d i represents the symbolic parameter of the i-th iteration; X cos (i) represents the cosine value of the non-special angle coordinate data after the i-th iteration, X cos (0) = |X cos |;Y sin (i) represents the sine value of the non-special angle coordinate data after the i-th iteration;
[0019] Y sin (i+2)=(d i ×2 -i ×d i+1 ×2 -(i-1) )
[0020] ×X cos (i)-(1-d i ×2 -i ×d i+1 ×2 -(i-1) )×Y sin (i)
[0021] Where Y sin (i+2) represents the sine value of the non-special angle coordinate data after the i+2th iteration; Y sin (0)=|Y sin |;
[0022] Z θ (i+2)=Z θ (i)-(d i ×θ i +d i+1 ×θ i+1 )
[0023] In the formula, Z θ (i+2) represents the angle estimation value of the non-special angle coordinate data after the i+2th iteration; θ i represents the angle parameter of the i-th iteration; Z θ (0)=0.
[0024] Further, gradually approaching the normalized angle value by dynamically adjusting the angle update direction includes:
[0025] The value of the symbol parameter of the next iteration is determined according to the magnitude relationship between the absolute value of the sine value of the non-special angular coordinate data of the current iteration and the absolute value of the cosine value of the non-special angular coordinate data after scaling.
[0026] Further, judging the value of the symbol parameter of the next iteration according to the magnitude relationship between the absolute value of the sine value of the non-special angular coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angular coordinate data includes:
[0027] The iteration sign parameter is assigned by judging the positive or negative condition of the sine value of the non-special angular coordinate data. If the sine value of the non-special angular coordinate data is greater than 0, the sign parameter takes the value of -1. If the sine value of the non-special angular coordinate data is less than 0, the sign parameter takes the value of 1.
[0028] If the parameter sign of the current iteration is known, the absolute value Y of the sine value of the non-special angle coordinate data of the current iteration is calculated. sin (i) The absolute value of the cosine value of the non-special angle coordinate data after scaling The size relationship between them determines the value of the symbol parameter for the next iteration.
[0029] Further, according to the absolute value of the sine value Y of the non-special angle coordinate data of the current iterationsin (i) The absolute value of the cosine value of the non-special angle coordinate data after scaling The expression for determining the value of the symbolic parameter of the next iteration is:
[0030] when And d i = -1, d i+1 = -1;
[0031] when And d i =1, d i+1 =1;
[0032] when And d i = -1, d i+1 =1;
[0033] when And d i = -1, d i+1 = -1;
[0034] when And d i =1, d i+1 = -1;
[0035] when And d i =1, d i+1 =1.
[0036] Further, performing quadrant compensation on the normalized angle value after iterative update according to the quadrant classification result and converting it into a final angle value includes:
[0037] According to the quadrant classification results of the non-special angular coordinate data, the output range of the inverse tangent function is used to determine different angle compensation values based on the sign changes of the non-special angular coordinate data in different quadrants, and the final angle value is extracted.
[0038] The technical solution of the second aspect of the present invention provides a fast-converging angle solving system, the system comprising:
[0039] A special angle determination module, configured to output a special angle determination result or extract non-special angle coordinate data according to input coordinate data;
[0040] A coordinate quadrant classification module is configured to perform coordinate quadrant classification on non-special angle coordinate data to obtain a quadrant classification result;
[0041] A normalization module is configured to perform normalization preprocessing on the non-special angular coordinate data to obtain normalized non-special angular coordinate data;
[0042] An angle iteration module, configured to perform iterative updates based on normalized non-special angle coordinate data;
[0043] A parameter control module is configured to dynamically adjust the angle update direction to gradually approach the normalized angle value;
[0044] The angle expansion and result output module is configured to perform quadrant compensation on the iteratively updated normalized angle value according to the quadrant classification result and convert it into a final angle value.
[0045] The technical solution of the third aspect of the present invention provides an electronic device, comprising: a processor and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the steps of the fast convergence angle solution method provided by the technical solution of the first aspect of the present invention.
[0046] The technical solution of the fourth aspect of the present invention provides a computer-readable storage medium, on which is stored a program for implementing a fast-convergence angle solution method, and the program for implementing a fast-convergence angle solution method is executed by a processor to implement the steps of the fast-convergence angle solution method provided by the technical solution of the first aspect of the present invention.
[0047] The present invention has the following beneficial effects:
[0048] The present invention provides a fast-converging angle solution method, system, electronic device and storage medium. By determining the special angle, non-special angle coordinate data is extracted, and the special angle coordinate data is directly output, thereby avoiding unnecessary iteration processes. By performing coordinate quadrant classification and normalization preprocessing on the non-special angle coordinate data, not only can the coordinate data of any quadrant be processed, but the non-special angle coordinate data can also be normalized to the same quadrant, and no additional quadrant judgment is required in each iteration, thereby simplifying the complexity of the iteration process and accelerating the convergence speed. On the other hand, by dynamically adjusting the angle update direction during the iterative update process to gradually approach the normalized angle value, the direction of each iteration can be more accurately controlled, so that each iteration can effectively approach the actual angle value, thereby ensuring the accuracy of the solution result while reducing the number of iterations required to achieve the required accuracy, thereby improving the calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A method flow chart of a fast-converging angle solution method provided by one embodiment of the present invention;
[0051] Figure 2 A schematic diagram of the structure of a fast-converging angle solving system provided by one embodiment of the present invention;
[0052] Figure 3 A schematic diagram of a system implementation of a fast-converging angle solving system provided by an embodiment of the present invention;
[0053] Figure 4 A schematic diagram of the structure of a magnetic encoder chip for an angle resolution method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a fast-converging angle solution method, system, electronic device and storage medium proposed by the present invention, its specific implementation method, structure, features and effects in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0055] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0056] The specific scheme of a fast-converging angle solving method, system, electronic device and storage medium provided by the present invention is described in detail below with reference to the accompanying drawings.
[0057] See also Figure 1 , which shows a method flow chart of a fast-converging angle solution method provided by an embodiment of the present invention. The technical solution of the first aspect of the present invention provides a fast-converging angle solution method, the method comprising:
[0058] Step S100: Output the special angle determination result or extract the non-special angle coordinate data according to the input coordinate data; perform coordinate quadrant preprocessing on the coordinate data according to the coordinate data of the non-special angle, including: Specifically, the coordinate data in this embodiment can be coordinate data from the fields of robot control, industrial control, automatic driving, biomedical equipment, etc., such as sensor data of joint angles in robot control, position sensor data in industrial control systems, vehicle posture data in automatic driving systems, and motion capture data in biomedical equipment; the signal from the sensor is input as a coordinate signal after analog-to-digital conversion, filtering, correction, etc., and when the coordinate data is input into the angle solving operation system, by judging Y sin and X cos The positive and negative values of the angles, whether they are equal, whether they are opposite to each other, and whether the data is on the coordinate axis determine whether the angle solution result is a special angle value such as 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°, 360°, or its equivalent value; if it is determined to be a special angle value, the corresponding angle value is directly output; if it is a non-special angle value, the non-special angle coordinate data is transmitted to a subsequent preprocessing module; step S100 directly outputs the special angle value or extracts the non-special angle coordinate data by determining whether the input coordinate data is a special angle, thereby effectively simplifying the subsequent processing flow and reducing unnecessary iterative calculations for special angle values, thereby significantly improving the calculation efficiency and accuracy.
[0059] Step S200: performing coordinate quadrant classification and normalization preprocessing on the non-special angular coordinate data to obtain quadrant classification results and normalized non-special angular coordinate data;
[0060] Step S200 specifically includes:
[0061] Step S210: Classify the quadrants according to the positive and negative values of the non-special angular coordinate data to obtain the quadrant classification result; specifically, determine the quadrant mark according to the positive and negative values of the non-special angular coordinate data, receive the non-special angle value coordinate data (X cos ,Y sin ), when X cos >0,Y sin >0, record the quadrant flag Qdt = 1, and classify the coordinate data into the first quadrant; when X cos <0, Y sin >0, record the quadrant flag Qdt = 2, and classify the coordinate data into the second quadrant; when X cos <0, Y sin <0, record the quadrant flag Qdt = 3, and classify the coordinate data into the third quadrant; when X cos >0,Y sin>0, record the quadrant flag Qdt=4, and classify the coordinate data into the fourth quadrant; the quadrant flag Qdt is finally transmitted to the angle expansion and result output module; in this embodiment, by classifying the quadrants and recording the quadrant flags, step S210 ensures that subsequent processing can accurately perform quadrant compensation on the normalized angle value, which not only simplifies the subsequent angle compensation process, but also ensures the accuracy of the final angle value.
[0062] Step S220: extract the absolute value of the non-special angular coordinate data and map it to the target quadrant to obtain the non-special angular coordinate data in the target quadrant; specifically, taking the four quadrants in step S210 as an example, the absolute value of the extracted non-special angular coordinate data can be uniformly mapped to the first quadrant to obtain the non-special angular coordinate data in the first quadrant, which can be expressed as (|X cos |,|Y sin |); By extracting the absolute value of the non-special angular coordinate data and mapping it to the first quadrant, the coordinate value can be normalized to the first quadrant to limit the angle solution range to (0, 90°); Step S220 ensures that all data are processed in the same quadrant. Since all data are in the first quadrant, there is no need to perform additional quadrant judgment in each iteration, which reduces logical branches and improves calculation efficiency; at the same time, the normalized data has a standardized form, which is convenient for the application of subsequent iterative formulas and can reduce error accumulation in calculations.
[0063] Step S300: performing iterative update according to the normalized non-special angle coordinate data, and gradually approaching the normalized angle value by dynamically adjusting the angle update direction;
[0064] Step S300 specifically includes:
[0065] Step S310: Initialize the normalized preprocessed non-special angle coordinate data and angle estimation value;
[0066] Step S320: Update the non-special angular coordinate data and the angle estimation value through an iterative formula, and gradually approach the normalized angle value until the preset number of iterations is met; specifically, during the iterative update process, the value of the next iteration symbol parameter is determined according to the relationship between the absolute value of the sine value of the non-special angular coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angular coordinate data; the expression for iterative update is:
[0067] X cos (i+2)=(1-d i ×2 -i ×d i+1 ×2 -(i-1) )
[0068] ×X cos (i)-(d i ×2-i ×d i+1 ×2 -(i-1) )×Y sin (i)
[0069] In the formula, X cos (i+2) represents the cosine value of the non-special angle coordinate data after the i+2th iteration; d i represents the symbolic parameter of the i-th iteration; X cos (i) represents the cosine value of the non-special angle coordinate data after the i-th iteration, X cos (0) = |X cos |;Y sin (i) represents the sine value of the non-special angle coordinate data after the i-th iteration;
[0070] Y sin (i+2)=(d i ×2 -i ×d i+1 ×2 -(i-1) )
[0071] ×X cos (i)-(1-d i ×2 -i ×d i+1 ×2 -(i-1) )×Y sin (i)
[0072] Where Y sin (i+2) represents the sine value of the non-special angle coordinate data after the i+2th iteration; Y sin (0)=|Y sin |;
[0073] Z θ (i+2)=Z θ (i)-(d i ×θ i +d i+1 ×θ i+1 )
[0074] In the formula, Z θ (i+2) represents the angle estimation value of the non-special angle coordinate data after the i+2th iteration; θ i represents the angle parameter of the i-th iteration; Z θ (0) = 0; Optionally, the iteration angle parameter θ in the angle iteration module is selected as follows: Pre-stored iteration angle parameter table θ i =arctan(2 -i ),i∈(0,32), according to the symbolic parameter d input by the parameter control module i d i+1 Calculate the iteration angle θ i+2 =di ×θ i +d i+1 ×θ i+1 , thereby updating Z θ (i+2)=Z θ (i)-θ i+2 , by increasing the number of iteration angle selection decisions each time, the number of iterations is compressed by half, thereby reducing the calculation time without increasing the circuit complexity;
[0075] Specifically, the iteration sign parameter is assigned by judging the positive or negative condition of the sine value of the non-special angular coordinate data. If the sine value of the non-special angular coordinate data is greater than 0, the sign parameter takes a value of -1; if the sine value of the non-special angular coordinate data is less than 0, the sign parameter takes a value of 1.
[0076] If the parameter sign of the current iteration is known, the absolute value Y of the sine value of the non-special angle coordinate data of the current iteration is calculated. sin (i) The absolute value of the cosine value of the non-special angle coordinate data after scaling The size relationship between them determines the value of the symbol parameter of the next iteration, which can be expressed as:
[0077] when And d i = -1, d i+1 = -1;
[0078] when And d i =1, d i+1 =1;
[0079] when And d i = -1, d i+1 =1;
[0080] when And d i = -1, d i+1 = -1;
[0081] when And d i =1, d i+1 = -1;
[0082] when And d i =1, d i+1 =1;
[0083] Finally, these parameters are output to the angle iteration module, and the updated iteration formula can be expressed as:
[0084] When i =-1, d i+1 = -1:
[0085] X cos (i + 2)=X cos (i)-X cos (i)×2 -(2i+1) +3×2 -(i+1) ×Y sin (i);
[0086] Y sin (i + 2)=-3×2 -(i+1) ×X cos (i)+Y sin (i)-Y sin (i)×2 -(2i+1) ;
[0087] Z θ (i + 2)=Z θ (i)-(-θ i -θ i+1 )
[0088] When d i =-1, d i+1 =1:
[0089] X cos (i + 2)=X cos (i)+X cos (i)×2 -(2i+1) +2 -(i+1) ×Y sin (i);
[0090] Y sin (i + 2)=-2 -(i+1) ×X cos (i)+Y sin (i)+Y sin (i)×2 -(2i+1) ;
[0091] Z θ (i + 2)=Z θ (i)-(-θ i +θ i+1 )
[0092] When d i =1, d i+1 =-1:
[0093] X cos (i + 2)=X cos (i)+X cos (i)×2 -(2i+1) -2 -(i+1) ×Y sin (i);
[0094] Ysin (i+2)=2 -(i+1) ×X cos (i)+Y sin (i)+Y sin (i)×2 -(2i+1) ;
[0095] Z θ (i+2)=Z θ (i)-(θ i -θ i+1 );
[0096] When i =1,d i+1 =1:
[0097] X cos (i+2)=X cos (i)-X cos (i)×2 -(2i+1) -3×2 -(i+1) ×Y sin (i);
[0098] Y sin (i+2)=3×2 -(i+1) ×X cos (i)+Y sin (i)-Y sin (i)×2 -(2i+1) ;
[0099] Z θ (i+2)=Z θ (i)-(θ i +θ i+1 );
[0100] In step S300, the normalized non-special angle coordinate data and angle estimation values are initialized, and the direction and step size of each iteration are dynamically adjusted to gradually approach the actual angle value; this method not only ensures the consistency and standardization of the data, but also reduces the number of required iterations through an efficient iteration strategy, thereby improving the computational efficiency and accuracy; compared with the traditional iterative algorithm, this method predicts the symbol parameter d i d i+1 , the angle iteration process is optimized to achieve the target accuracy within half the number of iterations, thereby significantly improving the computational efficiency; thus providing better speed and accuracy overall; the system completes the angle solution operation error of about 1.392e-07 within 11 system clock cycles, which reduces the average number of calculation clock cycles by about 50% compared to the calculation accuracy of 22 clock cycles of the general angle solution method.
[0101] Step S400: performing quadrant compensation on the normalized angle value after iterative update according to the quadrant classification result and converting it into a final angle value;
[0102] Step S400 specifically includes:
[0103] Step S410: According to the quadrant classification result of the non-special angular coordinate data, different angle compensation values are determined based on the output range of the inverse tangent function and the sign change of the non-special angular coordinate data in different quadrants, and the final angle value is extracted; specifically, the angle compensation value is determined according to the quadrant mark in step S210, and the normalized angle mapped to the first quadrant is compensated to the quadrant where the original coordinate is located through the angle compensation formula. The final angle value falls within the interval of (0,2π), and the angle compensation formula can be expressed as:
[0104] When the quadrant flag Qdt = 1, θ′ = Z θ (i);
[0105] When the quadrant mark Qdt = 1, θ′ = π-Z θ (i);
[0106] When the quadrant mark Qdt = 1, θ′ = π + Z θ (i);
[0107] When the quadrant mark Qdt = 1, θ′ = 2×π-Z θ (i);
[0108] Among them, θ′ represents the final angle value; finally, the principle of quadrant compensation for the normalized angle value is to determine different angle compensation values based on the quadrant classification results of the non-special angular coordinate data, using the output range of the inverse tangent function and the sign change of the coordinate data in different quadrants, so as to extract the final angle value, ensuring that the final output angle value not only accurately reflects the quadrant of the original coordinate, but also meets the angle representation requirements in practical applications; through precise compensation of the quadrant, the angle error caused by the output range limitation of the inverse tangent function is avoided, and the accuracy and reliability of the angle solution are improved;
[0109] The fast convergence algorithm expands the angle solution range from the traditional (-99.7°, 99.7°) to (0°, 360°), which has a wider application range. It expands the scope of application of the algorithm, improves the precision and accuracy of measurement, and enables the system to more efficiently handle all-round rotation requirements, thereby enhancing the stability and flexibility of the system. It is suitable for diversified application scenarios such as robot navigation and autonomous driving. Due to its fast convergence speed and high computational efficiency, the fast convergence algorithm consumes relatively few computing resources (such as CPU time, memory, etc.) during execution, and after optimization of the calculation, all multiplications are replaced by shift operations and addition and subtraction operations to reduce hardware area overhead and timing overhead. This is particularly important for resource-constrained systems and devices, and can reduce the overall power consumption and cost of the system.
[0110] In summary, the fast-converging angle solution method provided by the present invention can extract non-special angle coordinate data for the determination of special angles or directly output special angle coordinate data, thereby avoiding unnecessary iterative processes; by performing coordinate quadrant classification and normalization preprocessing on non-special angle coordinate data, it is not only possible to process coordinate data of any quadrant, but also normalize the non-special angle coordinate data to the same quadrant, without the need for additional quadrant judgment in each iteration, thereby simplifying the complexity of the iterative process and accelerating the convergence speed; on the other hand, by dynamically adjusting the angle update direction during the iterative update process to gradually approach the normalized angle value, the direction of each iteration can be more accurately controlled, so that each iteration can effectively approach the actual angle value, thereby ensuring the accuracy of the solution result while reducing the number of iterations required to achieve the required accuracy, thereby improving computational efficiency.
[0111] See also Figure 2 and Figure 3 The technical solution of the second aspect of the present invention provides a fast-converging angle solving system, the system comprising:
[0112] The special angle determination module is configured to output a special angle determination result or extract non-special angle coordinate data according to the input coordinate data; specifically, the special angle determination module will output a special angle determination result or extract non-special angle coordinate data according to the input coordinate data (X cos ,Y sin ) determines whether the input value is a special angle. If it is a special angle, the coordinate information (X cos ,Y sin ) to the angle expansion and result output module. If it is not a special angle, the coordinate information (X cos ,Y sin ) to the coordinate quadrant judgment module;
[0113] The coordinate quadrant classification module is configured to perform coordinate quadrant classification on the non-special angle coordinate data to obtain a quadrant classification result; specifically, the input signal of the coordinate quadrant classification module is the non-special angle value (X cos ,Y sin ), through about (X cos ,Y sin ) combination logic determines its quadrant on the coordinate plane, and at the same time outputs the quadrant mark signal Qdt to the angle expansion and result output module, and the coordinate value (X cos ,Y sin ) output to the angle normalization module;
[0114] The normalization module is configured to perform normalization preprocessing on the non-special angular coordinate data to obtain normalized non-special angular coordinate data; specifically, the input signal of the angle normalization module comes from the coordinate value (X cos ,Y sin ), through about (X cos ,Y sin ) maps the coordinate value to the first quadrant, limits the angle solution range to (0°, 90°) and its equivalent value, and normalizes the coordinate value (|X cos |,|Y sin |) is output to the angle iteration module; during the angle normalization process, the coordinate value is converted into an absolute value to eliminate the sign difference. During the iterative calculation process, the angle parameter is pre-stored as a lookup table and iteratively updated in the form of integers. The final output angle solution result can be converted into different data formats such as angle system, radian system, etc. according to the application scenario requirements;
[0115] Angle iteration module, configured to perform iterative updates based on normalized non-special angle coordinate data; the angle iteration module receives (|X cos |,|Y sin |) is the initial value, X cos (0) = |X cos |、Y sin (0)=|Y sin |、Z θ (0) = 0, according to the current Y sin (i) The positive and negative relationship of the current X cos (i) Y sin (i) Z θ (i) Increase or decrease the change determined by the iterative angle selection module to obtain X cos (i+2), Y sin (i+2), Z θ (i+2), which is written into the iteration register on the rising edge of the clock, and the iteration flag is incremented by two;
[0116] The parameter control module is configured to dynamically adjust the angle update direction to gradually approach the normalized angle value; the parameter control module receives the intermediate iteration state X from the iteration register in the angle iteration module cos (i) Y sin (i) Z θ (i) Dynamically adjust the iteration parameters including the symbolic parameter d according to the iteration status and preset conditions i d i+1 , iterative angle parameter θ i , the updated iteration parameters are fed back to the angle iteration module;
[0117] The angle expansion and result output module is configured to perform quadrant compensation on the normalized angle value after iterative update according to the quadrant classification result and convert it into a final angle value; when the maximum number of iterations is reached, the angle expansion and result output module receives the following signals: the special angle value from the special angle discrimination module (if any), the normalized angle value from the angle iteration module The quadrant mark signal Qdt from the coordinate quadrant judgment module; according to the quadrant mark signal Qdt, the normalized angle value is expanded to the full angle range, and the final solution result is output
[0118] Secondly, the hardware platform for running the angle solution algorithm with low iteration times and high precision includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), etc.; orthogonal signal information, including but not limited to ADC input signals, signals directly output by sensors, and input signals after signal processing such as filtering, are first sent to a special angle discrimination module for processing; in a fast-converging angle solution system, the complete operation system can be integrated into a dedicated hardware circuit, such as FPGA or ASIC, so as to achieve high-speed, low-power angle solution; the hardware circuit can include a special angle discrimination module, a coordinate quadrant classification module, an angle normalization module, an angle iteration module, a parameter control module, an angle expansion and result output module; the hardware circuit can be applied to scenarios with high requirements for computing speed and power consumption, such as embedded systems, mobile devices, robot control, etc.;
[0119] like Figure 4 As shown, for a fast-converging angle solution system, a magnetic encoder chip based on a fast-converging angle solution method can also be provided, and the chip structure is designed by a fully customized ASIC chip or a semi-custom programmable device; the chip includes: an analog front-end circuit structure, a magnetic sensor, an ADC, a filter, a circuit structure of a fast-converging angle solution module, an output interface circuit, a function control logic, and a non-volatile memory structure:
[0120] Analog front-end circuit structure: used to convert weak analog signals into high-quality digital signals, provide a basis for subsequent digital processing and filtering, and amplify, filter and shape the signals;
[0121] Magnetic sensor: used to convert magnetic field information into electrical signals;
[0122] ADC: used to convert the analog signal output by the magnetic sensor into a digital signal, providing a basis for subsequent digital processing and calculation;
[0123] Filter: used to improve signal quality, increase measurement accuracy, and suppress noise and interference;
[0124] The circuit structure of the fast-converging angle calculation module is used to calculate the rotation angle according to the input signal;
[0125] Output interface circuit: used to convert digital signals into a signal format that can be recognized by external devices, and perform signal amplification, filtering, shaping and matching to ensure that the signal can be transmitted and processed smoothly;
[0126] Function control logic: responsible for managing the various modules of the chip, controlling its workflow, and realizing various functions;
[0127] Non-volatile memory structure: used to store important configuration parameters and calibration data.
[0128] For a fast convergence angle solution system, a magnetic encoding system based on a fast convergence angle solution method can also be provided, including: a rotation measurement unit, including a rotating shaft, a magnetic steel fixed on the rotating shaft, and a dynamic magnetic induction Hall element; a signal processing unit, the magnetic field signal collected by the magnetic induction element is converted into an electrical signal, and amplified, processed and angle solved, the angle solution adopts a low iteration number and high precision angle solution method and hardware structure, receives the coordinate value (X) output by the magnetic induction element or output by filtering correction and other processing operations cos ,Y sin ) and perform angle calculation; calculate the angle calculation result The result is fed back to the host computer and is the absolute angle of the rotating shaft and the magnetic steel fixed on the rotating shaft in the rotation measurement.
[0129] The technical solution of the third aspect of the present invention provides an electronic device, comprising: a processor and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the steps of the fast convergence angle solution method provided by the technical solution of the first aspect of the present invention.
[0130] The technical solution of the fourth aspect of the present invention provides a computer-readable storage medium, on which is stored a program for implementing a fast-convergence angle solution method, and the program for implementing a fast-convergence angle solution method is executed by a processor to implement the steps of the fast-convergence angle solution method provided by the technical solution of the first aspect of the present invention.
[0131] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0132] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A fast-converging angle solution method, characterized in that: The method comprises: Output special angle determination results or extract non-special angle coordinate data according to input coordinate data; Performing coordinate quadrant classification and normalization preprocessing on the non-special angular coordinate data to obtain quadrant classification results and normalized non-special angular coordinate data; Iteratively update the normalized non-special angle coordinate data, and gradually approach the normalized angle value by dynamically adjusting the angle update direction; The normalized angle value after iterative update is quadrant compensated according to the quadrant classification result and converted into the final angle value.
2. The fast-converging angle solving method according to claim 1, characterized in that: The coordinate quadrant classification and normalization preprocessing are performed on the non-special angular coordinate data, and the quadrant classification results and the normalized non-special angular coordinate data include: Classify the quadrants according to the positive and negative values of the non-special angular coordinate data to obtain the quadrant classification results; The absolute value of the non-special angular coordinate data is extracted and mapped to the target quadrant to obtain the non-special angular coordinate data in the target quadrant.
3. The fast-converging angle solving method according to claim 1, characterized in that: Iterative updates based on normalized non-special angular coordinate data include: Initialize the normalized preprocessed non-special angular coordinate data and angle estimation values; The non-special angle coordinate data and angle estimation value are updated through the iterative formula, gradually approaching the normalized angle value until the preset number of iterations is met, which can be expressed as: X cos (i+2)=(1-d i ×2 -i ×d i+1 ×2 -(i-1) ) ×X cos (i)-(d i ×2 -i ×d i+1 ×2 -(i-1) )×Y sin (i) In the formula, X cos (i+2) represents the cosine value of the non-special angle coordinate data after the i+2th iteration; d i represents the symbolic parameter of the i-th iteration; X cos (i) represents the cosine value of the non-special angle coordinate data after the i-th iteration, X cos (0) = |X cos |;Y sin (i) represents the sine value of the non-special angle coordinate data after the i-th iteration; Y sin (i+2)=(d i ×2 -i ×d i+1 ×2 -(i-1) ) ×X cos (i)-(1-d i ×2 -i ×d i+1 ×2 -(i-1) )×Y sin (i) Where Y sin (i+2) represents the sine value of the non-special angle coordinate data after the i+2th iteration; Y sin (0)=|Y sin |; Z θ (i+2)=z θ (i)-(d i ×θ i +d i+1 ×θ i+1 ) In the formula, Z θ (i+2) represents the angle estimation value of the non-special angle coordinate data after the i+2th iteration; θ i represents the angle parameter of the i-th iteration; Z θ (0)=0.
4. The fast-converging angle solving method according to claim 3, characterized in that: The normalized angle value is gradually approached by dynamically adjusting the angle update direction, including: The value of the symbol parameter of the next iteration is determined according to the magnitude relationship between the absolute value of the sine value of the non-special angular coordinate data of the current iteration and the absolute value of the cosine value of the non-special angular coordinate data after scaling.
5. The fast-converging angle solving method according to claim 4, characterized in that: The value of the symbol parameter for the next iteration is determined based on the relationship between the absolute value of the sine value of the non-special angular coordinate data of the current iteration and the absolute value of the cosine value of the non-special angular coordinate data after scaling, including: The iteration sign parameter is assigned by judging the positive or negative condition of the sine value of the non-special angular coordinate data. If the sine value of the non-special angular coordinate data is greater than 0, the sign parameter takes the value of -1. If the sine value of the non-special angular coordinate data is less than 0, the sign parameter takes the value of 1. If the parameter sign of the current iteration is known, the absolute value Y of the sine value of the non-special angle coordinate data of the current iteration is calculated. sin (i) The absolute value of the cosine value of the non-special angle coordinate data after scaling The size relationship between them determines the value of the symbol parameter for the next iteration.
6. The fast-converging angle solving method according to claim 4, characterized in that: According to the absolute value Y of the sine value of the non-special angle coordinate data of the current iteration sin (i) The absolute value of the cosine value of the non-special angle coordinate data after scaling The expression for determining the value of the symbolic parameter of the next iteration is: when And d i = -1, d i+1 = -1; when And d i =1, d i+1 =1; when And d i = -1, d i+1 =1; when And d i = -1, d i+1 = -1; when And d i =1, d i+1 = -1; when And d i =1, d i+1 =1.
7. The fast-converging angle solving method according to any one of claims 1 to 6, characterized in that: According to the quadrant classification result, quadrant compensation is performed on the normalized angle value after iterative update and converted into the final angle value, including: According to the quadrant classification results of the non-special angular coordinate data, the output range of the inverse tangent function is used to determine different angle compensation values based on the sign changes of the non-special angular coordinate data in different quadrants, and the final angle value is extracted.
8. A fast-converging angle solving system, characterized in that: The system comprises: A special angle determination module, configured to output a special angle determination result or extract non-special angle coordinate data according to input coordinate data; A coordinate quadrant classification module is configured to perform coordinate quadrant classification on non-special angle coordinate data to obtain a quadrant classification result; A normalization module is configured to perform normalization preprocessing on the non-special angular coordinate data to obtain normalized non-special angular coordinate data; An angle iteration module, configured to perform iterative updates based on normalized non-special angle coordinate data; A parameter control module is configured to dynamically adjust the angle update direction to gradually approach the normalized angle value; The angle expansion and result output module is configured to perform quadrant compensation on the iteratively updated normalized angle value according to the quadrant classification result and convert it into a final angle value.
9. An electronic device, characterized in that: The electronic device includes: a processor and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the steps of the fast-converging angle solution method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing a fast-converging angle solution method, and the program for implementing a fast-converging angle solution method is executed by a processor to implement the steps of the fast-converging angle solution method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Transform operation method, transform operation device, coordinate rotation digital computation method and coordinate rotation digital computation device
CN101930351A
FPGA and coordinate rotation based azimuth obtaining method
CN108416311A
Video monitoring target real-time positioning method
CN111126220A
Trigonometric function calculation device and method based on CORDIC algorithm
CN113138749A
Apparatus and method for cordic processing
KR1020130093409A