Method for on-line identification of encoder signal parameters based on least square method

The least squares method is used to identify the encoder signal parameters online, which solves the problem of limited encoder decoding accuracy, and realizes efficient and low resource consumption accurate signal parameter identification, improving the measurement accuracy and robustness of the encoder.

CN120407987AActive Publication Date: 2025-08-01WUXI WATER BEAR SENSING TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510496755.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-01
Estimated Expiration
2045-04-21

AI Technical Summary

Technical Problem

In the prior art, the encoder signal parameter decoding accuracy is limited, the offline calibration process is cumbersome and costly, and the real-time gradient descent method relies on a high computing power platform, and the parameters are poorly robust.

Method used

The least squares method is used to identify the encoder signal parameters online, and by constructing a matrix containing signal square terms and cross terms, the least squares method is used to solve the optimal intermediate variable, and inversely solve the signal amplitude, reference and phase difference to avoid offline calibration and gradient descent iterative search.

Benefits of technology

It improves the encoder decoding accuracy, reduces the consumption of computing resources, realizes online real-time calculation and dynamic adjustment, and improves parameter identification accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005367250780000027
    Figure BDA0005367250780000027
  • Figure BDA0005367250780000035
    Figure BDA0005367250780000035
  • Figure BDA0005367250780000037
    Figure BDA0005367250780000037
Patent Text Reader

Abstract

The invention relates to the technical field of encoder signal processing, and particularly provides a method for online identification of encoder signal parameters based on a least square method. Comprising the steps of obtaining two paths of orthogonal signals theoretically output by an encoder, solving a rotation angle of the encoder, obtaining two paths of orthogonal signals actually output by the encoder in real time, constructing a matrix, solving an optimal intermediate variable through a least square method, reversely solving a signal amplitude and a phase difference, solving a reference and rapidly identifying signal parameters of the encoder. According to the method, off-line calibration is not needed, online real-time calculation can be carried out, the amount of data participating in calculation can be dynamically adjusted, and different precision calculation requirements are met; iterative search is avoided through linear processing, only matrix operation and simple algebraic operation are needed, resource consumption is low, and calculation efficiency is high; in addition, the global optimality of the least square method is utilized, noise interference is reduced, the parameter identification precision is improved, and the robustness is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of encoder signal processing, and particularly relates to a method for online identifying encoder signal parameters based on the least squares method. Background Art

[0002] An encoder requires a set of orthogonal sine and cosine signals, and the angle value can be decoded by performing an arctangent transformation; generally, there will be deviations in the amplitudes, references, and phases of the two measured sine and cosine signals, which affect the encoder decoding accuracy. To address the above problems, the following two methods are usually used in the prior art to identify encoder signal parameters.

[0003] Method 1, offline calibration method: Calibration parameters are extracted through offline data, that is, by extracting the original measurement data, each signal is calculated offline. The amplitude and reference of the signal can be estimated through the maximum and minimum values in each signal period. By fitting a set of two signals, the phase deviation between the two signals can be obtained. After obtaining the data offline, these data are stored in the encoder chip and can be directly used during the encoder's angle calculation process. This method has the problems that the parameters need to be calculated offline based on the data, and the encoder requires a calibration process to extract the data; at the same time, the calculated amplitude, reference, and phase difference are approximate data of the original signal in one of its periods. Therefore, there are problems such as a cumbersome calibration process and only single-period approximate data can be obtained, resulting in limited accuracy.

[0004] Method 2, real-time gradient descent method: On a platform with sufficient computing power, two phase signals can be observed in real time through an OPD (Observer Phase Detector). In each sampling period, the approximate signal amplitude, reference, and phase are calculated through gradient descent iteration; this method relies on a high-computing-power platform, has poor parameter robustness, requires dynamic adjustment of the gradient descent parameters, and is difficult to control costs. Summary of the Invention

[0005] In view of the above-mentioned disadvantages of the prior art, the purpose of the present invention is to provide a method for online identifying encoder signal parameters based on the least squares method, which obtains the optimal signal amplitude, reference, and phase difference in a section near the current measurement position through the least squares method; optimizes the encoder sampling signal, improves the encoder measurement accuracy, and can improve the encoder decoding accuracy after performing optimal calculations on the amplitudes, references, and phases of two signals; compared with the method 1 adopted in the prior art, the present invention does not require a special calibration process to obtain data, and can freely select the target area by the amount of data participating in the least squares calculation to select the fitting area of the signal amplitude, reference, and phase difference, improving the fitting accuracy; compared with the method 2 adopted in the prior art, the present invention packs the non-linear terms into intermediate values, first converts them into a linear least squares problem, and then reversely calculates the signal amplitude, reference, and phase difference through the calculated optimal intermediate values; it does not need to deal with the problems of gradient descent iterative search and adjusting gradient descent parameters, and is used to solve the problems of limited accuracy of the offline calibration method and high cost of the real-time gradient descent method in the prior art.

[0006] To achieve the above object and other related objects, the present invention provides a method for online identifying encoder signal parameters based on the least squares method, including the following steps:

[0007] S1. Obtain two orthogonal signals output by the encoder theoretically and

[0008] S2. Solve the rotation angle θ of the encoder through the arctangent operation of the two sets of data.

[0009] S3. Real-time obtain two orthogonal signals u sin and u cos ;

[0010] S4. Construct a matrix U containing the signal square terms and cross terms;

[0011] S5. Solve the optimal intermediate variable through the least squares method

[0012] S6. Reverse-solve the signal amplitudes A1, A2 and the phase difference φ according to the intermediate variable ;

[0013] S7. Construct a binary linear equation through the solved A1, A2, φ, solve the references B1 and B2, and quickly identify the signal parameters of the encoder by fitting A1, A2, B1, B2, φ.

[0014] In an embodiment of the present invention, in step S1, the calculation formulas for the two orthogonal signals and output by the encoder actually are:

[0015]

[0016] Wherein, θ is the rotation angle of the encoder, is the theoretical first path signal, is the theoretical second path signal, and has a phase difference of 90°.

[0017] In an embodiment of the present invention, in step S2, the solution formula for the rotation angle θ of the encoder is:

[0018]

[0019] In an embodiment of the present invention, in step S3, the calculation formulas for the two orthogonal signals u sin and u cos actually output by the encoder are:

[0020] u sin = A1sin(θ) + B1 + μ1

[0021]

[0022] Wherein, A1 is the actual amplitude of the first path signal, B1 is the actual reference of the first path signal, μ1 is the measurement noise of the first path signal; A2 is the actual amplitude of the second path signal, B2 is the actual reference of the second path signal, μ2 is the measurement noise of the second path signal; u sin is the actual measured signal of the first path, u cos is the actual measured signal of the second path.

[0023] In an embodiment of the present invention, in step S4, constructing the matrix U including the signal square term and the cross term includes combining trigonometric identities and deriving the ellipse equation after ignoring the noise:

[0024]

[0025] Wherein, k1 to k5 are intermediate variables, which are respectively associated with the parameters to be solved A1, B1, A2, B2 and φ.

[0026] In an embodiment of the present invention, the trigonometric identities include the trigonometric formula sin 2 θ + cos 2 θ = 1, the trigonometric sum-to-product formula cos(θ + φ) = cosθsinφ - sinθcosφ.

[0027] In an embodiment of the present invention, the calculation formulas for the intermediate vectors k1 to k5 are:

[0028]

[0029] The matrix U is in the form of:

[0030] U*K≈b

[0031] Among them, the matrix U is an n×5 matrix, n represents the number of signal groups involved in the least squares calculation, and the i-th row of the matrix U is the two signals sampled at the i-th moment and their quadratic terms:

[0032]

[0033] b=[1,1,…,1] T

[0034] K=[k1,k2,…,k5] T

[0035] In one embodiment of the present invention, in step S5, the least squares method is used to solve the optimal intermediate variable The formula is:

[0036]

[0037] Get the optimal vector That is, the optimal intermediate vectors k1, k2, k3, k4, and k5 are obtained.

[0038] In one embodiment of the present invention, in step S6, k1, k2, and k3 are substituted into the calculation formula of the intermediate vectors k1 to k5 and the optimal A1, A2, and φ are obtained by inversely solving:

[0039]

[0040] In one embodiment of the present invention, in step S7, the solved A1, A2, and φ are substituted into k4 and k5 to construct a two-variable linear equation, and the references B1 and B2 are obtained by solving the equation. The signal parameters of the encoder are quickly identified through the references B1 and B2.

[0041] As described above, the method for online identification of encoder signal parameters based on the least squares method of the present invention has the following beneficial effects:

[0042] The present invention can perform real-time calculations at the sensor chip end, and obtain the optimal signal amplitude, reference, and phase difference in a section near the current measurement position through least squares. Compared with Method 1 adopted in the prior art, the present invention does not require a dedicated calibration process to obtain data. The signal amplitude, reference, and phase difference fitting region can be selected by the amount of data participating in the least squares calculation, and the target region can be freely selected to improve the fitting accuracy. Compared with Method 2 adopted in the prior art, the present invention packs the non-linear terms into intermediate values, first converts them into a linear least squares problem, and then inversely calculates the signal amplitude, reference, and phase difference through the calculated optimal intermediate values. There is no need to deal with the problems of gradient descent iterative search and adjusting gradient descent parameters. At the same time, the present invention only uses the measured signal and its quadratic term as inputs during the calculation process, and the solution process only uses a small amount of square sum and square root operations and the solution of a univariate quadratic equation system, so the consumption of computing resources is also smaller.

[0043] The present invention does not require offline calibration, can perform online real-time calculations and dynamically adjust the amount of data participating in the calculations. For example, when calculating a set of 100 data covering the entire area D or half of the area of the encoder, the number of signal groups n can be adjusted to 50 groups or 100 groups to meet different precision calculation requirements. By linearization processing, iterative search is avoided, only matrix operations and simple algebraic operations are required, the resource consumption is low, and the calculation efficiency is high. The present invention also utilizes the global optimality of the least squares method to reduce noise interference, improve the parameter identification accuracy, and has strong robustness. The present invention can optimize the encoder sampling signal, improve the encoder measurement accuracy, and improve the encoder decoding accuracy after performing optimal calculations on the amplitudes, references, and phases of the two signals. Detailed implementation manners

[0044] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification.

[0045] The present invention provides a method for online identifying encoder signal parameters based on the least squares method, including the following steps:

[0046] S1. Obtain two orthogonal signals output theoretically by the encoder and In this step, and The calculation formulas are:

[0047]

[0048] where θ is the rotation angle of the encoder, is the theoretical first signal, is the theoretical second signal, and The phase difference is 90°.

[0049] S2. By performing the arctangent operation on the two-channel data, the rotation angle θ of the encoder is solved. In this step, the formula for solving the rotation angle θ of the encoder is:

[0050]

[0051] S3. The two orthogonal signals u sin and u cos actually output by the encoder are obtained in real time. u sin and u cos are the two orthogonal signals actually output by the encoder under the condition of ignoring the secondary influence of higher harmonics. In this step, the calculation formulas for the two orthogonal signals u sin and u cos are:

[0052] u sin = A1sin(θ) + B1 + μ1

[0053]

[0054] In the formula, A1 is the actual amplitude of the first signal, B1 is the actual reference of the first signal, and μ1 is the measurement noise of the first signal; A2 is the actual amplitude of the second signal, B2 is the actual reference of the second signal, and μ2 is the measurement noise of the second signal; u sin is the actual measurement signal of the first channel, and u cos is the actual measurement signal of the second channel. The measurement noise μ1 of the first signal and the measurement noise μ2 of the first signal are generally considered to be Gaussian distributions with an expectation of 0, and are mostly white noise that can be ignored during normal measurement, that is, both μ1 and μ2 are 0.

[0055] S4. A matrix U containing the signal square terms and cross terms is constructed. In this step, constructing the matrix U containing the signal square terms and cross terms includes combining trigonometric identities and deriving an ellipse equation after ignoring the noise:

[0056]

[0057] In the formula, k1 to k5 are intermediate variables, which are respectively associated with the parameters to be solved A1, B1, A2, B2, and φ.

[0058] The trigonometric identities include the trigonometric formula sin 2 θ + cos 2 θ = 1, and the trigonometric sum-to-product formula cos(θ + φ) = cosθsinφ - sinθcosφ.

[0059] The calculation formulas for the intermediate vectors k1 to k5 are as follows:

[0060]

[0061]

[0062] The form of the matrix U is:

[0063] U*K≈b

[0064] Among them, the matrix U is an n×5 matrix, where n represents the number of signal groups participating in the least squares calculation. The number of signal groups n can also be dynamically adjusted as needed. For example, if 100 groups of data cover a region D of the encoder, and if online measurement of A1, B1, A2, B2, and φ for the entire region D is to be achieved, 100 groups of signals can be used for least squares; if online measurement of the parameters for half of the region is desired, only 50 groups of data are needed, and the dimension of the matrix U can be directly adjusted. The i-th row of the matrix U is the two sampled signals and their quadratic terms at the i-th moment:

[0065]

[0066] b = [1, 1, …, 1] T

[0067] K = [k1, k2, …, k5] T

[0068] S5. Solve for the optimal intermediate variables by the least squares method In this step, the least squares method is used to solve for the optimal intermediate variables The formula is:

[0069]

[0070] Obtain the optimal vector That is, the optimal intermediate vectors k1, k2, k3, k4, and k5 are obtained.

[0071] S6. Inverse-solve the signal amplitudes A1, A2, and the phase difference φ according to the intermediate variables In this step, k1, k2, and k3 are substituted into the calculation formulas for the intermediate vectors k1 to k5 to inverse-solve the optimal A1, A2, and φ:

[0072]

[0073]

[0074] S7. Construct a linear equation of two variables using the solved A1, A2, and φ to solve for the reference values B1 and B2. Rapidly identify the signal parameters of the encoder by fitting A1, A2, B1, B2, and φ. Specifically, substitute the A1, A2, and φ solved in step 6 into k4 and k5 to construct a linear equation of two variables, and solve for the reference values B1 and B2. As can be seen from step 3, A1 is the actual amplitude of the first signal, B1 is the actual reference of the first signal, A2 is the actual amplitude of the second signal, and B2 is the actual reference of the second signal. By fitting the two orthogonal signals u sin and u cos with the optimal amplitudes A1, A2, references B1, B2, and phase difference φ, the signal parameters of the encoder can be rapidly identified, improving the decoding accuracy of the encoder.

[0075] The present invention can perform real-time calculations at the sensor chip end, and obtain the optimal signal amplitude, reference, and phase difference in a section near the current measurement position through least squares. Compared with method one adopted in the prior art, the present invention does not require a special calibration process to obtain data, and can freely select the target area by determining the signal amplitude, reference, and phase difference fitting area according to the data volume participating in the least squares calculation, improving the fitting accuracy. Compared with method two adopted in the prior art, the present invention packs the non-linear terms into intermediate values, first transforms it into a linear least squares problem, and then inversely calculates the signal amplitude, reference, and phase difference through the calculated optimal intermediate values. There is no need to deal with the problems of gradient descent iterative search and adjusting gradient descent parameters. At the same time, only the measured signal and its quadratic term are used as inputs in the calculation process of the present invention, and only a small number of square sum and square root operations and the solution of a quadratic equation of one variable are used in the solution process, consuming less computing resources.

[0076] In summary, the present invention does not require offline calibration, can perform online real-time calculations and dynamically adjust the data volume participating in the calculation. For example, when calculating a section covering the entire area D or half of the area of the encoder with 100 groups of data, the number of signal groups n can be adjusted to 50 groups or 100 groups to meet different precision calculation requirements. By linearization processing, iterative search is avoided, and only matrix operations and simple algebraic operations are required, with low resource consumption and high calculation efficiency. The present invention also utilizes the global optimality of the least squares method to reduce noise interference, improve parameter identification accuracy, and has strong robustness. The present invention can optimize the encoder sampling signal, improve the encoder measurement accuracy, and improve the encoder decoding accuracy after performing optimal calculations on the amplitudes, references, and phases of the two signals. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has high industrial utilization value.

[0077] The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed by the present invention should still be covered by the claims of the present invention.

Claims

1. A method for online identifying encoder signal parameters based on the least squares method, characterized in that, It includes the following steps: S1. Obtain two orthogonal signals output by the encoder theoretically and S2. Solve the rotation angle θ of the encoder through arctangent operations on two channels of data; S3. Obtain two orthogonal signals u sin and u cos ; S4. Construct a matrix U containing signal square terms and cross terms; S5. Solve for the optimal intermediate variable by the least squares method S6. According to the intermediate variable Inverse-solve the signal amplitudes A1, A2 and the phase difference φ; S7. Construct a binary linear equation with the solved A1, A2, and φ, solve for the reference values B1 and B2, and quickly identify the signal parameters of the encoder by fitting A1, A2, B1, B2, and φ.

2. The method for online identifying encoder signal parameters based on the least squares method according to claim 1, characterized in that In step S1, the two orthogonal signals actually output by the encoder and are calculated by the following formula: where θ is the rotation angle of the encoder, is the theoretical first path signal, is the theoretical second path signal, and have a phase difference of 90°.

3. The method for online identifying encoder signal parameters based on the least squares method according to claim 2, characterized in that In step S2, the formula for solving the rotation angle θ of the encoder is:

4. The method for online identifying encoder signal parameters based on the least squares method according to claim 3, characterized in that In step S3, the two orthogonal signals u sin and u cos are calculated by the following formula: u sin = A1sin(θ) + B1 + μ1 u cos = A2cos(θ + φ) + B2 + μ2 Wherein, A1 is the actual amplitude of the first signal, B1 is the actual reference of the first signal, and μ1 is the measurement noise of the first signal; A2 is the actual amplitude of the second signal, B2 is the actual reference of the second signal, and μ2 is the measurement noise of the second signal; u sin is the actual measured signal of the first path, u cos is the actual measured signal of the second path.

5. The method for online identifying encoder signal parameters based on the least squares method according to claim 4, characterized in that In step S4, constructing the matrix U containing signal square terms and cross terms includes deriving an ellipse equation by combining trigonometric identities and ignoring noise: In the formula, k1 to k5 are intermediate variables, which are respectively associated with the parameters to be solved, A1, B1, A2, B2, and φ.

6. The method for online identifying encoder signal parameters based on the least squares method according to claim 5, characterized in that: The trigonometric identities include the trigonometric formula sin 2 θ + cos 2 θ = 1, the trigonometric sum-to-product formula cos(θ + φ) = cosθsinφ - sinθcosφ.

7. The method for online identifying encoder signal parameters based on the least squares method according to claim 6, characterized in that The calculation formulas for the intermediate vectors k1 to k5 are: The form of the matrix U is: U*K≈b Among them, the matrix U is an n×5 matrix, n represents the number of signal groups participating in the least squares calculation, and the i-th row of the matrix U is the two channels of signals sampled at the i-th moment and their quadratic terms: b=[1,1,…,1] T K = [k1, k2, …, k5] T 8. The method for online identifying encoder signal parameters based on the least squares method according to claim 7, wherein In step S5, the least squares method is used to solve for the optimal intermediate variable The formula for which is: Obtain the optimal vector That is, the optimal intermediate vectors k1, k2, k3, k4, and k5 are obtained.

9. The method for online identifying encoder signal parameters based on the least squares method according to claim 8, characterized in that In step S6, substitute k1, k2, and k3 into the calculation formulas for the intermediate vectors k1 to k5 to inversely solve for the optimal A1, A2, and φ:

10. The method for online identifying encoder signal parameters based on the least squares method according to claim 9, characterized in that, In step S7, substitute the solved A1, A2, and φ into k4 and k5 to construct a binary linear equation, solve for the reference values B1 and B2, and quickly identify the signal parameters of the encoder through the reference values B1 and B2.

Citation Information

Patent Citations

  • Error processing method for single pole magnetic encoder

    CN103115641A

  • High-precision rotary transformer decoding method based on parameter identification

    CN111045323A

  • Local abnormal factor optimization ellipse fitting method for optical fiber vibration sensing phase demodulation

    CN114812636A

  • Incremental optical encoder scribing and subdivision error compensation method

    CN116295118A

  • Complex electromagnetic environment signal sorting method and system based on deep learning and time-frequency transformation

    CN118606796A