An angle resolving method and system with fast convergence, an electronic device and a storage medium

By performing special angle determination and quadrant classification on the input coordinate data, and using iterative formulas and dynamic sign parameter adjustments, the angle calculation with fast convergence is achieved, which solves the problem of low computational efficiency in traditional methods and improves the computational efficiency and accuracy of embedded systems.

CN119622181BActive Publication Date: 2026-01-09NORTH CHINA ELECTRIC POWER UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411591840.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2026-01-09
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

Traditional angle calculation methods are computationally inefficient in resource-constrained embedded systems, and the calculation of the arctangent function is complex, making it difficult to meet the needs of real-time systems.

Method used

By determining the special angles of the input coordinate data, extracting the non-special angle coordinate data, performing coordinate quadrant classification and normalization preprocessing, using iterative formulas and dynamic sign parameters to gradually approximate the normalized angle value, and performing quadrant compensation, the final angle value is finally converted.

Benefits of technology

It significantly reduces the number of iterations, improves computational efficiency and accuracy, and reduces computational resource consumption, making it suitable for resource-constrained systems and devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622181B_ABST
    Figure CN119622181B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer, specifically relates to a kind of fast convergence angle solution method, system, electronic equipment and storage medium, the method includes: according to input coordinate data output special angle determination result or extract non-special angle coordinate data;Non-special angle coordinate data is classified and is normalized pretreated to quadrant, and quadrant classification result and normalized non-special angle coordinate data are obtained;According to the normalized non-special angle coordinate data is iterated and is updated, and the normalized angle value is gradually approached by dynamic adjustment angle update direction;According to the quadrant classification result, the normalized angle value after iteration is updated is compensated and is converted into final angle value to quadrant.It is to realize the efficient, accurate solution of input signal, and significantly reduce the number of iterations, improve the calculation efficiency of angle solution.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer technology, and in particular to a fast-converging angle solving method and system, electronic equipment and storage medium. BACKGROUND

[0002] Angle solving plays a crucial role in many fields, including but not limited to robot control, autonomous driving systems, image processing and computer vision, aerospace engineering, etc. Accurate and efficient angle solving is essential to ensure the stable operation and performance of these systems.

[0003] Currently, traditional angle solving methods include lookup table method and arctangent function approximation method. The lookup table method relies on a pre-computed data table to find the corresponding angle value. This method has the advantage of fast query speed. Once the table is loaded into memory, the result can be quickly obtained through simple indexing operations. However, in order to improve the accuracy of angle solving, a very large storage space is needed 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 needed, which will increase the additional computational overhead. On the other hand, this method can usually provide high accuracy, especially when dealing with coordinate system conversion problems. However, the calculation of the arctangent function is usually achieved through Taylor series expansion or other numerical approximation methods, which often involve complex floating-point operations, thus increasing the computational cost and making it unsuitable for real-time systems. Therefore, in order to solve the technical problem of low computational efficiency of traditional angle solving methods, a fast-converging angle solving method, system, electronic equipment and storage medium are proposed. SUMMARY

[0004] In order to achieve efficient and accurate solving of input signals and significantly reduce the number of iterations, improve the computational efficiency of angle solving, the purpose of the present application is to provide a fast-converging angle solving method, system, electronic equipment and storage medium, the technical solution adopted is as follows:

[0005] The technical solution of the first aspect of the present application provides a fast-converging angle solving method, which comprises:

[0006] Outputting a special angle determination result or extracting non-special angle coordinate data according to the input coordinate data;

[0007] Performing coordinate quadrant classification and normalization preprocessing on the non-special angle coordinate data to obtain a quadrant classification result and normalized non-special angle coordinate data;

[0008] Performing iterative updating according to the normalized non-special angle coordinate data, and gradually approaching the normalized angle value by dynamically adjusting the angle updating direction;

[0009] According to the quadrant classification result, the normalized angle value after iterative update is compensated for quadrant and converted into a final angle value.

[0010] Further, the non-special angle coordinate data is classified and normalized for quadrant to obtain a quadrant classification result and normalized non-special angle coordinate data, including:

[0011] According to the positive and negative values of the non-special angle coordinate data, the quadrant classification result is obtained;

[0012] The absolute value of the non-special angle coordinate data is extracted and mapped to the target quadrant to obtain the non-special angle coordinate data under the target quadrant.

[0013] Further, the normalized non-special angle coordinate data is iteratively updated, including:

[0014] The non-special angle coordinate data after normalization preprocessing and the angle estimation value are initialized;

[0015] The non-special angle coordinate data and the angle estimation value are updated by an iterative formula, and the normalized angle value is gradually approximated until the preset iteration number is met, which can be represented 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 sign 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 X2 -i Xd i+1 X2 -(i-1) )X Y sin (i)

[0021] wherein 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 |; and

[0022] Z θ (i+2) = Z θ (i)-(d i X θ i +d i+1 X θ i+1

[0023] wherein 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; and Z θ (0) = 0.

[0024] Further, the step-by-step approximation of the normalized angle value by dynamically adjusting the angle updating direction comprises:

[0025] determining the value of the sign parameter of the next iteration according to the size relationship between the absolute value of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angle coordinate data.

[0026] Further, the determination of the value of the sign parameter of the next iteration according to the size relationship between the absolute value of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angle coordinate data comprises:

[0027] the iteration sign parameter is assigned by judging the positive or negative situation of the sine value of the non-special angle coordinate data, if the sine value of the non-special angle coordinate data is greater than 0, the sign parameter takes the value of -1, if the sine value of the non-special angle coordinate data is less than 0, the sign parameter takes the value of 1;

[0028] if the sign of the current iteration parameter is known, the value of the sign parameter of the next iteration is determined according to the size relationship between the absolute value Y sin (i) of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angle coordinate data.

[0029] Further, the value of the sign parameter of the next iteration is determined according to the size relationship between the absolute value Y​sin (i) the size relationship between the cosine value absolute value of the scaled non-special angle coordinate data The expression for determining the value of the next iteration sign parameter 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, the quadrant compensation and conversion of the normalized angle value after iteration update according to the quadrant classification result includes:

[0037] According to the quadrant classification result of the non-special angle coordinate data, the output range of the arctangent function is used to determine different angle compensation values based on the sign change of the non-special angle coordinate data in different quadrants, and the final angle value is extracted.

[0038] The technical solution of the second aspect of the application provides a fast-converging angle solving system, which comprises:

[0039] A special angle discrimination 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 configured to classify the non-special angle coordinate data according to coordinate quadrants to obtain a quadrant classification result;

[0041] A normalization module configured to perform normalization preprocessing on the non-special angle coordinate data to obtain normalized non-special angle coordinate data;

[0042] an angle iteration module configured to iteratively update according to the normalized non-special angle coordinate data;

[0043] a parameter control module configured to dynamically adjust the angle update direction to gradually approach the normalized angle value;

[0044] an angle expansion and result output module configured to perform quadrant compensation on the iteratively updated normalized angle value according to the quadrant classification result and convert the iteratively updated normalized angle value into a final angle value.

[0045] The technical solution of the third aspect of the present application provides an electronic device, which comprises a processor and a memory connected with the processor in communication; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to perform the steps of the fast-converging angle solution method provided by the technical solution of the first aspect of the present application.

[0046] The technical solution of the fourth aspect of the present application provides a computer-readable storage medium, which stores a program for implementing a fast-converging angle solution method, and the program is executed by a processor to implement the steps of the fast-converging angle solution method provided by the technical solution of the first aspect of the present application.

[0047] The present application has the following advantages:

[0048] The fast-converging angle solution method, system, electronic device and storage medium provided by the present application can avoid unnecessary iteration process by extracting non-special angle coordinate data through special angle determination and directly outputting special angle coordinate data; through coordinate quadrant classification and normalization preprocessing of the non-special angle coordinate data, not only can the coordinate data in any quadrant be processed, but also the non-special angle coordinate data can be normalized to the same quadrant, without additional quadrant judgment in each iteration, which simplifies the complexity of the iteration process and accelerates the convergence speed; on the other hand, by dynamically adjusting the angle update direction to gradually approach the normalized angle value in the iteration update process, the direction of each iteration can be more accurately controlled, so that each iteration can effectively approach the actual angle value, ensuring the accuracy of the solution result while reducing the number of iterations required to reach the required accuracy, improving the calculation efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0050] Figure 1 A method flow chart of a fast-converged angle resolving method provided by an embodiment of the present application;

[0051] Figure 2 A structural schematic diagram of a fast-converged angle resolving system provided by an embodiment of the present application;

[0052] Figure 3 A system implementation schematic diagram of a fast-converged angle resolving system provided by an embodiment of the present application;

[0053] Figure 4 A structural schematic diagram of a magnetic encoder chip of an angle resolving method provided by an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to further illustrate the technical means and effects taken by the present application to achieve the predetermined purposes, the following describes the fast-converged angle resolving method, system, electronic device and storage medium according to the present application, the specific implementation, structure, features and effects thereof in detail in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.

[0056] The specific schemes of the fast-converged angle resolving method, system, electronic device and storage medium provided by the present application are described in detail below in combination with the accompanying drawings.

[0057] Please refer to Figure 1 which shows a method flow chart of a fast-converged angle resolving method provided by an embodiment of the present application. The technical scheme of the first aspect of the present application provides a fast-converged angle resolving method, which comprises:

[0058] Step S100: outputting a special angle determination result or extracting non-special angle coordinate data according to input coordinate data; and performing coordinate quadrant preprocessing on the coordinate data according to the non-special angle coordinate data; specifically, the coordinate data in the embodiment can be coordinate data from the fields of robot control, industrial control, autonomous driving, biomedical instruments, etc., such as sensor data of joint angles in robot control, position sensor data in an industrial control system, vehicle attitude data in an autonomous driving system, and motion capture data in biomedical instruments; after the signals from the sensors are subjected to analog-to-digital conversion, filtering, correction, etc., the coordinate signals are input, when the coordinate data is input to an angle calculation operation system, whether the angle calculation result is 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°, 360°, etc. or equivalent values thereof is determined by judging the positive and negative values of Y sin and X cos , whether they are equal, whether they are each other's opposite, and whether the data is on the coordinate axis; if it is determined that the angle value is 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 judging whether the input coordinate data is a special angle, effectively simplifying the subsequent processing flow, reducing unnecessary iterative calculation for special angle values, and thus significantly improving the calculation efficiency and accuracy.

[0059] Step S200: performing coordinate quadrant classification and normalization preprocessing on the non-special angle coordinate data to obtain a quadrant classification result and normalized non-special angle coordinate data.

[0060] Step S200 specifically includes:

[0061] Step S210: classifying the non-special angle coordinate data according to the positive and negative values of the non-special angle coordinate data to obtain a quadrant classification result; specifically, determining a quadrant flag according to the positive and negative values of the non-special angle coordinate data, receiving non-special angle value coordinate data (X cos , Y sin ), when X cos > 0 and Y sin > 0, recording a quadrant flag Qdt = 1 and classifying the coordinate data into a first quadrant; when X cos < 0 and Y sin > 0, recording a quadrant flag Qdt = 2 and classifying the coordinate data into a second quadrant; when X cos < 0 and Y sin < 0, recording a quadrant flag Qdt = 3 and classifying the coordinate data into a third quadrant; and when X cos > 0 and Y sinQdt=4, the coordinate data is classified into the fourth quadrant; the quadrant mark Qdt is finally transmitted to the angle expansion and result output module; in this embodiment, the classification is performed through the object limit and the quadrant mark is recorded, and step S210 ensures that the subsequent processing can accurately perform the 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: extracting the absolute value of the non-special angle coordinate data and mapping it to the target quadrant to obtain the non-special angle coordinate data under the target quadrant; specifically, taking the four quadrants in step S210 as an example, the absolute value of the non-special angle coordinate data can be uniformly mapped into the first quadrant to obtain the non-special angle coordinate data under the first quadrant, which can be represented as (|X cos |,|Y sin |).

[0063] Step S300: updating iteratively 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: initializing the non-special angle coordinate data after the normalization preprocessing and the angle estimation value;

[0066] Step S320: updating the non-special angle coordinate data and the angle estimation value through the iterative formula, and gradually approaching the normalized angle value until the preset number of iterations is met; specifically, in the iterative updating process, the value of the next iteration symbol parameter is determined according to the size relationship between the absolute value of the sine value of the current iteration non-special angle coordinate data and the absolute value of the cosine value of the scaled non-special angle coordinate data; the expression of the 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] wherein X cos (i+2) represents the cosine value of the non-special angle coordinate data after the i+2th iteration; d i represents the sign 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] wherein 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 |; and

[0073] Z θ (i+2) = Z θ (i) - (d i ×θ i + d i+1 ×θ i+1 )

[0074] wherein 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: a pre-stored iteration angle parameter table θ i = arctan(2 -i ), i ∈ (0, 32), and the iteration angle θ i = d i+1 is calculated according to the sign parameter d i+2 input by the parameter control module.i x θ i + d i+1 x θ i+1 , thus updating Z θ (i+2) = Z θ (i) - θ i+2 , by increasing the iteration angle selection decision each time, the number of iterations is compressed by half, thereby reducing the calculation time, while not increasing the circuit complexity;

[0075] Specifically, by judging the positive and negative of the sine value of the non-special angle coordinate data, the iteration sign parameter is assigned a value, if the sine value of the non-special angle coordinate data is greater than 0, the sign parameter takes the value of -1, if the sine value of the non-special angle coordinate data is less than 0, the sign parameter takes the value of 1.

[0076] If the current iteration parameter sign is known, according to the size relationship between the absolute value Y sin (i) of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the scaled non-special angle coordinate data , the value of the next iteration sign parameter can be determined, 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 iteration formula is updated, which can be expressed as:

[0084] When d i = -1, d i+1 = -1.

[0085] X cos (i+2) = X cos (i) - X cos (i) x 2 -(2i+1) + 3 x 2 -(i+1) x Y sin (i);

[0086] Y sin (i+2) = -3 x 2 -(i+1) x X cos (i) + Y sin (i) - Y sin (i) x 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) x 2 -(2i+1) + 2 -(i+1) x Y sin (i);

[0090] Y sin (i+2) = -2 -(i+1) x X cos (i) + Y sin (i) + Y sin (i) x 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) x 2 -(2i+1) - 2 -(i+1) x Y sin (i);

[0094] Ysin (i+2) = 2 -(i+1) × X cos (i) + Y sin (i) + Y sin (i) x 2 -(2i+1) ;

[0095] Z θ (i+2) = Z θ (i) - (θ i + θ i+1 );

[0096] When d i = 1, d i+1 = 1:

[0097] X cos (i+2) = X cos (i) - X cos (i) x 2 -(2i+1) - 3 x 2 -(i+1) x Y sin (i);

[0098] Y sin (i+2) = 3 x 2 -(i+1) x X cos (i) + Y sin (i) - Y sin (i) x 2 -(2i+1) ;

[0099] Z θ (i+2) = Z θ (i) - (θ i + θ i+1 );

[0100] In step S300, the normalized non-special angle coordinate data and the angle estimation value are initialized, and the actual angle value is gradually approached by dynamically adjusting the direction and step size of each iteration; this method not only ensures the consistency and standardization of the data, but also reduces the number of iterations required and improves the calculation efficiency and accuracy through an efficient iteration strategy; compared with the traditional iteration algorithm, the method optimizes the angle iteration process to achieve the target accuracy in half the number of iterations by pre-judging the sign parameters d i , d i+1 , thereby significantly improving the calculation efficiency; thus providing better speed and accuracy as a whole; the angle solving operation error of the system is about 1.392e-07 in 11 system clock cycles, compared with the calculation accuracy of 22 clock cycles of the general angle solving method, reducing the average number of calculation clock cycles by about 50%.

[0101] Step S400: quadrant compensation and conversion to final angle value according to the quadrant classification result of the normalized angle value updated iteratively;

[0102] Step S400 specifically includes:

[0103] Step S410: according to the quadrant classification result of the non-special angle coordinate data, determine different angle compensation values by using the output range of the arctangent function and based on the sign change of the non-special angle coordinate data in different quadrants, and extract the final angle value; specifically, determine the angle compensation value according to the quadrant flag in step S210, compensate the normalized angle mapped into the first quadrant to the quadrant where the original coordinate is located through an angle compensation formula, the final angle value falls within the interval (0, 2π), and the angle compensation formula can be expressed as:

[0104] When the quadrant flag Qdt = 1, θ' = Z θ (i);

[0105] When the quadrant flag Qdt = 1, θ' = π - Z θ (i);

[0106] When the quadrant flag Qdt = 1, θ' = π + Z θ (i);

[0107] When the quadrant flag Qdt = 1, θ' = 2 x π - Z θ (i);

[0108] Wherein, θ' represents the final angle value; finally, the principle of quadrant compensation for the normalized angle value is to determine different angle compensation values by using the output range of the arctangent function and based on the sign change of the coordinate data in different quadrants according to the quadrant classification result of the non-special angle coordinate data, so as to extract the final angle value, which ensures that the final output angle value not only accurately reflects the quadrant where the original coordinate is located, but also meets the angle representation requirement in actual application; through the accurate compensation of the quadrant, the angle error caused by the output range limitation of the arctangent function is avoided, and the accuracy and reliability of the angle solution are improved;

[0109] The fast convergence algorithm expands the angle calculation range from the traditional (-99.7°, 99.7°) to (0°, 360°), has a wider application range, improves the measurement precision and accuracy, enables the system to more efficiently process the full-rotation requirement, and thus enhances the stability and flexibility of the system, and is suitable for diversified application scenarios such as robot navigation and automatic driving; due to the fast convergence speed and high calculation efficiency, the fast convergence algorithm consumes relatively less calculation resources (such as CPU time and memory) during execution, and all multiplications are replaced by shift operations and addition and subtraction operations after optimization, which reduces the hardware area overhead and timing overhead, which 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 convergence angle calculation method provided by the application can extract non-special angle coordinate data or directly output special angle coordinate data for the determination of special angles, thereby avoiding unnecessary iteration processes; by performing coordinate quadrant classification and normalization preprocessing on the non-special angle coordinate data, the coordinate data in any quadrant can be processed, the non-special angle coordinate data is normalized to the same quadrant, no additional quadrant judgment is needed in each iteration, the complexity of the iteration process is simplified, and the convergence speed is accelerated; on the other hand, by dynamically adjusting the angle update direction in the iteration 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, the accuracy of the calculation result is ensured, the number of iterations required to reach the required accuracy is reduced, and the calculation efficiency is improved.

[0111] Please refer to Figure 2 and Figure 3 , the technical scheme of the second aspect of the application provides a fast convergence angle calculation system, the system comprises:

[0112] a special angle discrimination module configured to output a special angle determination result or extract non-special angle coordinate data according to input coordinate data; specifically, the special angle discrimination module will determine whether the input value is a special angle according to the input data (X cos ,Y sin ), if it is a special angle, the coordinate information (X cos ,Y sin ) will be directly output to the angle expansion and result output module at the next clock rising edge, if it is not a special angle, the coordinate information (X cos ,Y sin ) will be output to the coordinate quadrant judgment module at the next clock rising edge;

[0113] The coordinate quadrant classification module is configured to classify the non-special angle coordinate data according to the coordinate quadrant, and 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 ) from the special angle judgment module, the quadrant of the coordinate plane is determined through the combination logic about (X cos ,Y sin ), and the quadrant flag signal Qdt is output to the angle expansion and result output module, and the coordinate value (X cos ,Y sin ) is output to the angle normalization module.

[0114] The normalization module is configured to perform normalization preprocessing on the non-special angle coordinate data, and obtain normalized non-special angle coordinate data. Specifically, the input signal of the angle normalization module is the coordinate value (X cos ,Y sin ) from the coordinate quadrant classification module, the coordinate value is mapped to the first quadrant through the combination logic about (X cos ,Y sin ), the angle solving range is limited to (0°, 90°) and its equivalent value, and the normalized 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 form to eliminate the sign difference. During the iteration calculation process, the angle parameter is pre-stored as a lookup table, and the iteration is updated in an integer form. The final output angle solving result can be converted into different data formats such as angle system, radian system, etc. according to the application scene requirement.

[0115] The angle iteration module is configured to perform iterative update according to the normalized non-special angle coordinate data. The angle iteration module receives (|X cos |,|Y sin |) as the initial value, X cos (0)=|X cos |、Y sin (0)=|Y sin |、Z θ (0)=0, according to the positive and negative relationship of the current Y sin (i), the current X cos (i)、Y sin (i)、Z θ (i) is increased or decreased by the change amount determined by the iteration angle selection module, X cos (i+2)、Y sin (i+2)、Z θ (i+2) is obtained, which is written into the iteration register at the rising edge of the clock, and the iteration identifier is increased by two.

[0116] A 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), the iteration parameter d is dynamically adjusted according to the iteration state and the preset condition i , d i+1 , the iteration angle parameter θ i , the updated iteration parameter is fed back to the angle iteration module

[0117] An angle expansion and result output module is configured to perform quadrant compensation on the normalized angle value updated by iteration according to the quadrant classification result and convert the normalized angle value into a final angle value; when the maximum iteration number is reached, the angle expansion and result output module receives the following signals: the special angle value (if any) from the special angle discrimination module, the normalized angle value from the angle iteration module , and the quadrant flag signal Qdt from the coordinate quadrant judgment module; the normalized angle value is expanded to a complete angle range according to the quadrant flag signal Qdt, and a final calculation result is output

[0118] Secondly, the hardware platform for running the angle calculation algorithm with low iteration number and high precision includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc.; the input signal containing orthogonal signal information includes but is not limited to an ADC input signal, a signal directly output by a sensor, and an input signal after signal processing such as filtering, which is first sent to the special angle discrimination module for processing; in the fast-converging angle calculation system, the complete calculation system can be integrated in a special hardware circuit such as an FPGA or an ASIC, so as to realize high-speed and low-power angle calculation; the hardware circuit can include the special angle discrimination module, the coordinate quadrant classification module, the angle normalization module, the angle iteration module, the parameter control module, and the angle expansion and result output module; the hardware circuit can be applied to scenarios with high requirements for calculation speed and power consumption, such as embedded systems, mobile devices, robot control, etc.

[0119] As shown in Figure 4 , for a fast-converging angle calculation system, a magnetic encoder chip based on the fast-converging angle calculation method can also be provided, which is designed by a full-custom ASIC chip or a semi-custom programmable device; the chip structure includes an analog front-end circuit structure, a magnetic sensor, an ADC, a filter, a circuit structure of a fast-converging angle calculation 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, providing a basis for subsequent digital processing and filtering, amplifying, filtering, and shaping the signals;

[0121] Magnetic sensor: used to convert magnetic field information into an electrical signal;

[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] Fast-converging angle solution module circuit structure: used to calculate the rotation angle based on the input signal;

[0125] Output interface circuit: used to convert the digital signal into a signal format that can be recognized by external devices, and perform signal amplification, filtering, shaping, and matching to ensure smooth transmission and processing of the signal;

[0126] Function control logic: responsible for managing the various modules of the chip, controlling its workflow, and implementing various functions;

[0127] Non-volatile memory structure: used to store important configuration parameters and calibration data.

[0128] For a fast-converging angle solution system, a magnetic encoding system based on a fast-converging angle solution method can also be provided, including: a rotation measurement unit including a rotation shaft, a magnetic steel fixed on the rotation shaft, and a dynamic magnetic induction Hall element; a signal processing unit that converts the magnetic field signal collected by the magnetic induction element into an electrical signal and performs amplification, processing, and angle solution, the angle solution uses a low-iteration high-precision angle solution method and hardware structure, receives coordinate values (X cos ,Y sin ) output by the magnetic induction element or after filtering correction and other processing operations, and performs angle solution; calculates the angle solution result feedback to the host computer, which is the absolute angle of the rotation shaft and the magnetic steel fixed on the rotation shaft in the rotation measurement.

[0129] The third aspect of the technical solution of the present application provides an electronic device, which comprises a processor and a memory connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to perform the steps of the fast-converging angle solution method provided by the first aspect of the technical solution of the present application.

[0130] The technical scheme of the fourth aspect of the present application provides a computer readable storage medium, and the computer readable storage medium stores a program for implementing the angle solution method with fast convergence.

[0131] It should be noted that the above-mentioned embodiment sequence is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.

[0132] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments.

Claims

1. A fast converging angle resolution method, characterized in that, The method comprises: outputting a special angle determination result or extracting non-special angle coordinate data according to input coordinate data; performing coordinate quadrant classification and normalization preprocessing on the non-special angle coordinate data to obtain a quadrant classification result and normalized non-special angle coordinate data; iteratively updating according to the normalized non-special angle coordinate data, gradually approaching a normalized angle value by dynamically adjusting an angle update direction, comprising: initializing the non-special angle coordinate data after normalization preprocessing and an angle estimation value; updating the non-special angle coordinate data and the angle estimation value through an iterative formula, gradually approaching the normalized angle value until a preset number of iterations is satisfied, which can be expressed as: In the formula, Indicates the first Cosine value of non-special angular coordinate data after the next iteration; Indicates the first The sign parameter of the next iteration; Indicates the first The cosine value of the non-special angular coordinate data after iteration. ; Indicates the first The sine value of the non-special angular coordinate data after iteration; wherein represents the sine of the non-special angular coordinate data after the ; ) wherein denotes the angle estimate of the non-special angular coordinate data after the denotes the angle estimate of the non-special angular coordinate data after the ;​​ determining a value of a next iteration sign parameter according to a size relationship between an absolute value of a sine value of the current iteration non-special angle coordinate data and an absolute value of a cosine value of the scaled non-special angle coordinate data; performing quadrant compensation on the normalized angle value after iteration updating according to the quadrant classification result and converting the normalized angle value into a final angle value.

2. The fast converging angle resolution method of claim 1, wherein, The method comprises: classifying according to a positive and negative value object limit of the non-special angle coordinate data to obtain a quadrant classification result; extracting an absolute value of the non-special angle coordinate data and mapping to a target quadrant to obtain non-special angle coordinate data under the target quadrant.

3. The fast converging angle resolution method of claim 1, wherein, The method comprises: assigning a value to the iteration sign parameter by judging a positive and negative situation of the sine value of the non-special angle coordinate data, if the sine value of the non-special angle coordinate data is greater than 0, the value of the sign parameter is -1, if the sine value of the non-special angle coordinate data is less than 0, the value of the sign parameter is 1; If the current iteration parameter symbol is known, the next iteration symbol parameter is determined according to the size relationship between the absolute value of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the non-special angle coordinate data after scaling .

4. The fast converging angle resolution method of claim 1, wherein, The expression for determining the value of the next iteration sign parameter based on the size relationship between the absolute value of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the non-special angle coordinate data of the current iteration is: The expression for determining the value of the next iteration sign parameter based on the size relationship between the absolute value of the sine value of the non-special angle coordinate data of the current iteration and the absolute value of the cosine value of the non-special angle coordinate data of the current iteration is: The expression for determining the value of the next iteration sign parameter based on the size relationship between the absolute value of When and , ; When and , ; When and , ; When and , ; When and , ; When and , .

5. The fast converging angle resolution method according to any one of claims 1 to 4, wherein, The method comprises: determining different angle compensation values according to an output range of an inverse tangent function and a sign change of the non-special angle coordinate data in different quadrants according to the quadrant classification result of the non-special angle coordinate data, and extracting a final angle value.

6. A fast converging angle resolving system characterized in that, The system for performing the fast-converging angle solving method of any one of claims 1 to 5 comprises: a special angle discrimination 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 configured to perform coordinate quadrant classification on the non-special angle coordinate data to obtain a quadrant classification result; a normalization module configured to perform normalization preprocessing on the non-special angle coordinate data to obtain normalized non-special angle coordinate data; an angle iteration module configured to iteratively update according to the normalized non-special angle coordinate data; a parameter control module configured to dynamically adjust an angle update direction to gradually approach a normalized angle value; an angle expansion and result output module configured to perform quadrant compensation on the normalized angle value after iteration updating according to the quadrant classification result and convert the normalized angle value into a final angle value.

7. An electronic device, comprising: The electronic device comprises a processor and a memory connected with the processor in communication; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to perform the steps of the fast-converging angle solution method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a program for implementing the fast-converging angle solution method, and the program is executed by the processor to implement the steps of the fast-converging angle solution method according to any one of claims 1 to 5.

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