Correction value calculation method, program, correction value calculation device, and encoder
Through polar coordinate calculation and least squares method, the correction residuals in the 2-phase sinusoidal signal are calculated, which solves the problem of low error calculation efficiency in the prior art, and achieves efficient and accurate calculation of correction value and improvement of accuracy.
Patent Information
- Application Number
- CN202410876260.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-03
- Filing Date
- 2024-07-02
- Publication Date
- 2025-01-03
AI Technical Summary
The prior art has problems such as large interpolation error, low sampling rate and low detection efficiency in the calculation of errors in correction of 2-phase sinusoidal signals. Especially in low-power encoders, it is difficult to fully sample around the desired point, resulting in the inability to error. Reduce sufficiently.
By calculating the offset error, amplitude ratio error and phase difference error of signals X and Y, the correction value is obtained based on each phase angle and the corresponding square radius, and the correction value is obtained based on the phase angle and the corresponding square radius. Correct the 2-phase sinusoidal signal.
The correction values are calculated efficiently and accurately, reducing interpolation errors, improving correction accuracy, and reducing the demand for computing resources, and obtaining correction values on fewer data points.
Smart Images

Figure CN119245699A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This nonprovisional application claims priority under 35 U.S.C. §119(a) to Japanese Patent Application No. 2023-109451, filed on July 3, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present invention relates to a correction value calculation method, a correction value calculation program, a correction value calculation device and an encoder for correcting a two-phase sinusoidal signal. Background Art
[0004] Conventionally, there is known a method for correcting errors such as an offset error, an amplitude ratio error, and a phase difference error in a 2-phase sinusoidal signal outputted from an encoder.
[0005] For example, JP 2006-112862A describes an invention that detects the third harmonic component of a 2-phase sinusoidal signal and calculates and corrects an offset error, an amplitude ratio error, and a phase difference error. In the invention described in JP 2006-112862A, the offset error and the amplitude ratio error are obtained from four zero-crossing points where the Lissajous waveform of the 2-phase sinusoidal signal intersects the X-axis or the Y-axis, so if the data used to calculate the correction coefficient does not include data sampled around the zero-crossing points, the error cannot be sufficiently reduced. The phase difference error is obtained by using four points where the Lissajous waveform of the 2-phase sinusoidal signal intersects the straight lines y=x and y=-x. In order to reduce the error, it is necessary to perform sampling near the points where the Lissajous waveform intersects the straight line.
[0006] Here, the electromagnetic induction encoder requires more sampling time than the photoelectric encoder because it detects displacement by applying an AC signal. In addition, in low-power encoders, the sampling rate may be suppressed. An encoder with such a low sampling rate may not be able to sample around the desired points (for example, the zero crossing point or the point where the Lissajous waveform intersects y=x or y=-x) and may not be able to sufficiently reduce the error.
[0007] In addition, JP 2006-112859A discloses a method for detecting a third harmonic component by Fourier analysis using data with a constant spacing. In this method, one rotation of the Lissajous signal is divided into uniform segments, and Fourier analysis is performed on all the segments. Using this method, if the sampling rate is low, it takes time to complete the sampling of all the segments, which reduces the update frequency of the Fourier analysis. This makes it difficult to use Fourier analysis to detect offset errors, amplitude ratio errors, and phase difference errors.
[0008] JP 2007-327770A discloses a method of approximating 2-phase sinusoidal signals X and Y as expressions of the sum of a sine wave and a cosine wave, respectively, by the least square method. In order to reduce the interpolation error associated with the amplitude, it is necessary to set the amplitude ratio between the 2-phase sinusoidal signals to 1. However, the method of JP 2007-327770A, which approximates the 2-phase sinusoidal signals, respectively, by the least square method without considering their relative relationship, has a problem of low detection efficiency of the interpolation error associated with the amplitude ratio. Summary of the invention
[0009] Problems to be solved by the present invention
[0010] In view of these circumstances, the object of the present invention is to provide a correction value calculation method, a correction value calculation program and a correction value calculation device, which are capable of efficiently and accurately calculating a correction coefficient for correcting an interpolation error in a 2-phase sinusoidal signal by a simple method, and to provide an encoder equipped with such a correction value calculation device.
[0011] Solutions to the problem
[0012] In order to solve the above problem, a correction value calculation method according to an embodiment of the present invention calculates a correction value to correct the 2-phase sinusoidal signal (X, Y) output by the encoder. The correction value calculation method includes: a polar coordinate calculation step for calculating the N phase angles θ in the Lissajous waveform drawn by the 2-phase sinusoidal signal. i and each phase angle θ i The corresponding Lissajous radius R i Calculate the square radius R i 2 , the square radius R i 2 is related to each phase angle θ i The corresponding Lissajous radius R i The square of; and the correction value calculation step for each phase angle θ i and the phase angle θ calculated in the polar coordinate calculation step i The corresponding square radius R i 2 , at least calculate the offset error C of signal X x The correction residual ΔC x , signal Y offset error C y The correction residual ΔC y , the amplitude ratio error K of signal X and Y a The correction residual ΔK a , and the phase difference error P between signal X and signal Y y The correction residual ΔP y, and then calculate the correction value based on the correction residual. Signals X and Y constitute a 2-phase sinusoidal signal. In the correction value calculation step, each phase angle θ is used i and each phase angle θ i The corresponding square radius R i 2 , the coefficients in the approximate expression model are obtained by the least squares method. In this approximate expression model, the square radius R 2 It is expressed by a trigonometric function including the phase angle θ as an independent variable, and a correction residual is obtained from the obtained coefficient.
[0013] A program according to an embodiment of the present invention causes a computer to execute the above-described correction value calculation method.
[0014] The correction value calculation device according to the embodiment of the present invention calculates the correction value to correct the 2-phase sinusoidal signal (X, Y) output by the encoder. The correction value calculation device includes: a polar coordinate conversion unit, which is for N phase angles θ in the Lissajous waveform drawn by the 2-phase sinusoidal signal i and each phase angle θ i The corresponding Lissajous radius R i Calculate the square radius R i 2 , the square radius R i 2 is related to each phase angle θ i The corresponding Lissajous radius R i The square of the square of the radius R i 2 , and an error detection unit, based on each phase angle θ i The phase angle θ calculated by the polar coordinate conversion unit i The corresponding square radius R i 2 , at least calculate the offset error C of signal X x The correction residual ΔC x , signal Y offset error C y The correction residual ΔC y , the amplitude ratio error K of signal X and Y a The correction residual ΔK a , and the phase difference error P between signal X and signal Y y The correction residual ΔP y , and then calculate the correction value based on the correction residual, where the signals X and Y constitute a 2-phase sinusoidal signal. The error detection unit uses each phase angle θ i and each phase angle θ i The corresponding square radius R i 2, the coefficients in the approximate expression model are obtained by the least square method, and the correction residual is obtained from the obtained coefficients. In the approximate expression model, the square radius R 2 It is expressed by a trigonometric function including the phase angle θ as an independent variable.
[0015] The encoder according to the embodiment of the present invention comprises the correction value calculation device and the encoder detection unit, the encoder detection unit outputs a 2-phase sinusoidal signal in response to the displacement in the measuring direction. The correction value calculation device performs a correction value calculation process, the correction value calculation process calculates the correction value based on the 2-phase sinusoidal signal output by the encoder detection unit, and the correction process applies the calculated correction value to the 2-phase sinusoidal signal output by the encoder detection unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 1 is a block diagram showing a basic configuration of the correction value calculation device 1 of the first embodiment, and an encoder detection unit 11 and a wide-range phase angle calculation unit 50 in the encoder 10 .
[0017] Figure 2 is a flowchart showing the procedure of correction value calculation processing in the first embodiment.
[0018] Figure 3 The correction value calculation device 1 of the first embodiment is used to calculate the two-phase sinusoidal signal X before and after correction. i and Y i Plotted as a Lissajous waveform.
[0019] Figure 4 The correction value calculation device 1 in the first embodiment is plotted by converting the two-phase sinusoidal signal X before and after correction. i and Y i The phase angle θ obtained i and square radius R 2 i A graph in which the horizontal axis represents θ and the vertical axis represents R 2 .
[0020] Figure 5 is a graph of the correction value calculation device 1 of the first embodiment. 2 The horizontal axis represents the cumulative number of times M the correction value is calculated.
[0021] Figure 6 is the plotting offset error C of the correction value calculation device 1 of the first embodiment. x and C y A curve graph in which the horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0022] Figure 7 is the plotted amplitude ratio error K for the correction value calculation device 1 of the first embodiment. a A curve graph in which the horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0023] Figure 8 is the plotted phase difference error P of the correction value calculation device 1 of the first embodiment. y A curve graph in which the horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0024] Fig. 9 The correction value calculation device 1 of the second embodiment is used to calculate the two-phase sinusoidal signal X before and after correction. i and Y i Plotted as a Lissajous waveform.
[0025] Fig.10 The correction value calculation device 1 in the second embodiment is plotted by converting the two-phase sinusoidal signal X before and after correction. i and Y i The phase angle θ obtained i and square radius R 2 i A graph in which the horizontal axis represents θ and the vertical axis represents R 2 .
[0026] Fig.11 is a plot R of the correction value calculation device 1 of the second embodiment. 2 The horizontal axis represents the cumulative number of times M the correction value is calculated.
[0027] Fig.12 is the plotting offset error C of the correction value calculation device 1 of the second embodiment. x and C y The horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0028] Fig.13 is the plotted amplitude ratio error K for the correction value calculation device 1 of the second embodiment. a The horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0029] Fig.14 is the plotted phase difference error P for the correction value calculation device 1 of the second embodiment. y A curve graph in which the horizontal axis represents the cumulative number of times M that the correction value is calculated.
[0030] Fig.15 Schematic illustration of a rotor tilted relative to a stator in a rotary encoder.
[0031] Fig.16The signal strength of the 2-phase sinusoidal signal relative to the rotational displacement when the rotor is tilted is shown. changes.
[0032] Fig.17 1 is a block diagram showing a basic configuration of a correction value calculation device 1 a and an encoder detection unit 11 in an encoder 10 of the third embodiment.
[0033] Fig.18 is a flowchart showing the procedure of correction value calculation processing in the second embodiment.
[0034] Fig.19 is the square radius R before the correction of the plotting signal strength of the correction value calculation device 1a in the third embodiment. i 2 The horizontal axis represents the rotor displacement.
[0035] Fig. 20 is the square radius R of the correction value calculation device 1a in the third embodiment after applying the signal strength correction. LCi 2 The horizontal axis represents the rotor displacement.
[0036] Fig.21 is the square radius R before the correction of the plotting signal strength of the correction value calculation device 1a in the third embodiment. i 2 In the graph of FIG. 1 , the horizontal axis represents the phase angle θ.
[0037] Fig. 22 is the square radius R after plotting the correction signal intensity for the correction value calculation device 1a in the third embodiment. LCi 2 In the graph of FIG. 1 , the horizontal axis represents the phase angle θ.
[0038] Fig.23 is the square radius R after drawing the correction signal strength to be used for the correction value calculation device 1a in the third embodiment. LCi 2 The calculated correction value is applied to the 2-phase sinusoidal signal X i and Y i The square radius R after correction i 2 , where the horizontal axis represents the phase angle θ. DETAILED DESCRIPTION
[0039] First embodiment
[0040] Next, we will base Figures 1 to 8 A first embodiment is described.
[0041] The correction value calculation device 1 calculates the correction value at the encoder 10 to correct the 2-phase sinusoidal signal. Figure 1 is a block diagram showing a basic configuration of the correction value calculation device 1 of the first embodiment, and the encoder detection unit 11 and the wide-range phase angle calculation unit 50 in the encoder 10 .
[0042] exist Figure 1 In the example shown, the correction value calculation device 1 is implemented in a form built into the encoder 10 together with the encoder detection unit 11 and the wide range phase angle calculation unit 50. In this embodiment, the encoder 10 includes the encoder detection unit 11, the correction value calculation device 1, and the wide range phase angle calculation unit 50, the encoder detection unit 11 outputs a 2-phase sinusoidal signal in response to the displacement in the measurement direction, and the wide range phase angle calculation unit 50 calculates the wide range phase angle according to the phase angle θ calculated by the correction value calculation device 1. Wide range phase angle is the final output of encoder 10. Wide range phase angle Corresponding to the rotational displacement of the rotary encoder, for example. The correction value calculation device 1 includes a correction unit 20, an error detection unit 40, and a polar coordinate conversion unit 30. The correction value calculation device 1 performs a correction value calculation process of calculating a correction value based on a 2-phase sinusoidal signal output by the encoder detection unit 11, and a correction process of applying a pre-calculated correction value to the 2-phase sinusoidal signal output by the encoder detection unit 11. In this embodiment built into the encoder 10, if the correction value can be calculated quickly enough, the correction value calculation device 1 can dynamically update the correction value while detecting the displacement.
[0043] As another embodiment of the correction value calculation device 1, the correction value calculation device 1 can be implemented as a unit separated from the encoder 10. For example, the correction value calculation device 1 can be implemented by a computer separated from the encoder detection unit 11. When the encoder detection unit 11 is installed at the displacement measurement point, the correction value calculation device 1 can obtain the data of the 2-phase sinusoidal signal obtained by the encoder detection unit 11 in the installed state via a communication device (means) or a storage medium, and calculate the correction value based on the obtained data. Then the calculated correction value can be provided to the encoder detection unit 11 via the communication device or the storage medium.
[0044] The encoder detection unit 11 may use any detection principle, but may be, for example, a photoelectric type, a magnetic type, an electromagnetic induction type, etc. Using the 2-phase sinusoidal signal output by the encoder detection unit 11 (for example, with X as the horizontal axis and Y as the vertical axis), a Lissajous waveform may be drawn. Ideally, the Lissajous waveform should have a constant Lissajous radius R regardless of the phase angle θ. However, the 2-phase sinusoidal signal output from the encoder detection unit 11 generally contains errors such as an amplitude error, a phase difference error, and an offset, so the Lissajous radius R is not constant regardless of the phase angle θ.
[0045] The analog 2-phase sinusoidal signal output by the encoder detection unit 11 is sampled and digitized at a predetermined frequency by an AD converter (not shown). In this specification, this set of digitized 2-phase sinusoidal signal data is simply referred to as "2-phase sinusoidal signals X and Y". The digitized 2-phase sinusoidal signals X and Y are referred to using a signal such as "2-phase sinusoidal signals X". i and Y i " is represented by a common subscript (index) of " to clearly indicate the respective data sampled simultaneously when necessary. In this specification, when calculating the correction value, the digital data of the 2-phase sinusoidal signals X and Y is described as a pair of N points. That is, in the 2-phase sinusoidal signal X used to calculate the correction value i and Y i In the data, i is an integer ranging from 0 to N-1. According to the 2-phase sinusoidal signal X i and Y i Other parameters calculated are also indicated by subscripts as needed, such as the square radius R i 2 and phase angle θ i .
[0046] The 2-phase sinusoidal signals X and Y are input to the correction unit 20. The correction unit 20 holds the correction value to be applied to the 2-phase sinusoidal signals. The error detection unit 40 calculates the correction value. The correction unit 20 corrects the 2-phase sinusoidal signals X and Y using the correction value and outputs output signals X' and Y'. The output signals X' and Y' of the correction unit 20 are input to the polar coordinate conversion unit 30.
[0047] The correction unit 20 uses the offset error in the orthogonal direction (ie, the offset error C x and Y offset error C y ), amplitude ratio error in orthogonal directions (K a =A y / A x ) and the phase difference error between X and Y (P y ) is used as a correction value to correct the 2-phase sinusoidal signals X and Y. The 2-phase sinusoidal signals X and Y with various errors are as shown in equation (1).
[0048] X=A x cosθ+C x
[0049] Y=A y sin(θ+P y )+C y …(1)
[0050] As a specific example of a method of applying the correction value, the correction unit 20 can apply the correction value to the 2-phase sinusoidal signal X according to equation (2): i and Y i To obtain the output signal (corrected 2-phase sinusoidal signal) X i ′ and Y i ′.
[0051] X i ′=K a (X i -C x )
[0052] Y i ′=Y i -C y -P y X i …(2)
[0053] In the initial state where the error detection section 40 does not calculate the correction value, the correction section 20 may output a 2-phase sinusoidal signal X i and Y i As the output signal X i ′ and Y i Alternatively, a predetermined initial correction value may be used to output the output signal X′ i and Y′ i For example, if the initial calibration value is C x =0, C y =0, K a =1 and P y = 0, then in the initial state where the error detection unit 40 does not calculate the correction value, basically no correction is performed, and the 2-phase sinusoidal signal X i and Y i is output unchanged as output signal X i ′ and Y i ′.
[0054] The polar coordinate conversion unit 30 converts the output signal X of the correction unit 20 into i ′ and Y i Calculate the phase angle θ in i and square radius R i2 , square radius R i 2 is the phase angle θ i The corresponding Lissajous radius R i The square of .
[0055]
[0056] The wide range phase angle calculation unit 50 calculates the phase angle θ for each phase angle θ. i Calculates phase angles over a wide range This wide range of phase angle Indicates a wide range of displacements exceeding the displacement corresponding to one cycle of a 2-phase sinusoidal signal. Wide range phase angle The number of cycles (Lissajous signal rotations) n of the two-phase sinusoidal signal from the reference displacement (origin) can be used to calculate the i and the phase angle θ calculated by the polar coordinate conversion unit 30 i Obtained by known methods. For example, over a wide range of phase angles In the case of an encoder having 100 2-phase sinusoidal signal cycles in one cycle (0 to 360 degrees), Through the relation With n i and θ i The number of revolutions of the Lissajous signal n i The wide range phase angle calculated by the wide range phase angle calculation unit 50 can be counted by a known incremental up-down counter (upper counter). is the final output of encoder 10.
[0057] The error detection unit 40 calculates the phase angle θ based on the phase angle θ calculated by the polar coordinate conversion unit 30. i and square radius R i 2 The error detection unit 40 calculates at least the offset error (C x and C y ), amplitude ratio error (K a ) and phase error (P y ) as correction values and provide them to the correction unit 20.
[0058] Specifically, the error detection unit 40 uses each phase angle θ and the corresponding square radius R 2 The least square method uses trigonometric functions including the phase angle θ as an independent variable to determine the square radius R 2The coefficient A in the approximate expression model (Equations (5) and (6)) is c1 , A s1 and R o1 .
[0059] R 2 =A c1 cosθ+A s1 sinθ+R o1 …(5)
[0060] R 2 =A c2 cos2θ+A s2 sin2θ+R o2 …(6)
[0061] For example, the error detection unit 40 may use equation (5) as an approximate expression model to create a i 2 and θ i The three-variable simultaneous linear equation of , and each coefficient in equation (5) can be expressed as C by equation (7) 1 The elements of the matrix are obtained.
[0062]
[0063] A 1 ·C 1 =B 1
[0064] C 1 =A 1 -1 ·B 1 …(7)
[0065] The error detection unit 40 can use equation (6) as an approximate expression model to create R i 2 and 2θ i The three-variable simultaneous linear equations are obtained, and each coefficient in equation (6) can be expressed as C by equation (8). 2 The elements of the matrix are obtained.
[0066]
[0067] A 2 ·C 2 =B 2
[0068] C 2 =A 2 -1 ·B 2 …(8)
[0069] The error detection unit 40 then calculates a correction value (ie, a correction residual remaining in the 2-phase sinusoidal signal) from the obtained coefficients using equations (9) to (12).
[0070] ΔC x =A c1 / 2…(9)
[0071] ΔC y =A s1 / 2…(10)
[0072]
[0073] ΔP y =A s2 …(12)
[0074] The offset error C of X is obtained in equation (9) x The reason can be explained as follows. That is, if only the offset error C of X in equation (1) x , then X and Y are expressed by equation (13).
[0075] X=Acosθ+Cx
[0076] Y=Asinθ…(13)
[0077] Therefore, the square radius R 2 It is expressed by equation (14).
[0078] R 2 =X 2 +Y 2
[0079] =(Acosθ+C x ) 2 +(Asinθ) 2
[0080] =2AC x cosθ+A 2 (cos 2 θ+sin 2 θ)
[0081] =2AC x cosθ+A 2 …(14)
[0082] By comparing the coefficients of cosθ in equations (5) and (14), the relationship in equation (9) is obtained. In the same way, it can be explained why the offset error C of Y obtained in equation (10) is y reason.
[0083] The amplitude ratio error K is obtained in equation (11): a The reason can be explained as follows. That is, if A in equation (1) x ≠A y True, K a Denoted as K a =A y / A x , and there are no other errors, then the square radius R 2 It is expressed as equation (15).
[0084]
[0085] By comparing the coefficients of cos2θ in equations (15) and (6), the relationship in equation (11) is obtained.
[0086] The phase difference error P is obtained in equation (12) y The reason can be explained as follows. If only the phase difference error P in equation (1) y , then equation (16) expresses the square radius R 2 .
[0087]
[0088] When P y ≈0, equation (16) can be approximated as equation (17), because cos2P y ≈1.
[0089]
[0090] In addition, due to sin2P y ≈2P y In P y =0, so the relationship in equation (18) can be derived.
[0091] R 2 ≈A 2 +A 2 P y sin2θ…(18)
[0092] By comparing the coefficients of sin2θ in equation (6) and equation (18) and the amplitude A=1 in equation (18), the relationship in equation (12) is obtained.
[0093] Next, a correction value calculation process will be described in which a correction value is calculated using the correction value calculation device 1 configured in the above-described manner. Figure 21 is a flowchart showing the procedure of the correction value calculation process in the first embodiment. The correction value calculation process is performed by the correction unit 20, the polar coordinate conversion unit 30, and the error detection unit 40. In the correction value calculation process, the offset error C of X is obtained from X and Y. x ,Y offset error C y , amplitude ratio error K a And the phase error P y These errors obtained are used as correction values and are used to remove the influence of errors from the 2-phase sinusoidal signals X and Y output from the encoder detection unit 11.
[0094] With offset error C x and C y , amplitude ratio error K a And the phase error P y The 2-phase sinusoidal signals X and Y can be expressed in the same way as in the above equation (1). In equation (1), C x =0, C y =0, K a =A y / A x =1,P y =0 is the state with the minimum error.
[0095] When the correction value calculation process starts, the correction unit 20 first obtains N pairs of digital data (X and Y) of the two-phase sinusoidal signals X and Y. i , Y i ; where i is 0 to N-1) as the output data of the encoder detection unit 11 for correction (step S01). The correction unit 20 can obtain the data from the encoder detection unit 11 in real time, or the encoder detection unit 11 can obtain and record the data in advance, and then the correction unit 20 obtains the data via a communication device or a storage medium.
[0096] Then, the polar coordinate conversion unit 30 calculates the phase angle θ for each of the N data pairs of the 2-phase sinusoidal signal. i and the corresponding square radius R i 2 (Step S02).
[0097] Then, based on each phase angle θ calculated in step S02 i and square radius R i 2 The error detection unit 40 calculates the correction residual (ΔC x and ΔC y ), calculate the correction residual (ΔK) of the residual amplitude ratio error in the two-phase sinusoidal signals X and Y input in step S01 a) and the correction residual of the phase difference error (ΔP y )(Step S03).
[0098] Then, the correction value held by the correction unit 20 is updated based on the correction residual calculated for each error (step S04). The error detection unit 40 can use a predetermined feedback gain G according to equation (19): f (where 0 <G f ≤1) to update the correction value. When using equation (19) to update the correction value, if the feedback gain G f Set to G f <1, the influence of the correction residual is prevented from being excessively reflected in the correction value, and the correction residual can easily converge to a value with a small error (for ΔC x , ΔC y and ΔP y is 0, for ΔK a is 1).
[0099] C x =C x +C f ΔC x
[0100]
[0101] Where 0 <G f ≤1
[0102] If step 03 is performed for the first time in the correction value calculation process, an update based on the calculated correction residual may be applied to a predetermined initial value of the correction value (e.g., C x =0, C y =0, K a =1 and P y =0).
[0103] Then, the correction unit 20 corrects the two-phase sinusoidal signal based on the correction value calculated by the error detection unit 40, and outputs a signal X i ′ and Y i ’(step S05).
[0104] If the calculation of the correction value is repeated (step S06; Yes), the two-phase sinusoidal signal X corrected in step S05 i ′ and Y i ′ is used as the new 2-phase sinusoidal signal X i and Y i(Step S07), and the process returns to step S02. Steps S02 to S05 are repeated as many times as necessary, and when repetition is no longer necessary (Step S06; No), the correction value calculation process ends. The correction value at the end of the correction value calculation process is the final correction value. The number of times the correction value is repeatedly calculated and updated may be a predetermined number of times. Alternatively, the process may be repeated until the correction residual is sufficiently small (for example, below a predetermined threshold). In this correction value calculation process, the correction value based on the initial 2-phase sinusoidal signal X is cumulatively applied. i and Y i The operation of calculating and updating the correction value, and the correction residual converges to a value with a small error (for ΔC x , ΔC y and ΔP y is 0, and for ΔK a is 1).
[0105] Next, a simulation performed to confirm the effectiveness of the correction value calculation process of the correction value calculation device 1 will be described.
[0106] When performing simulation, there is an error C x =0.1, C y =0.05, A x =0.95, A y =1.05 and P y = -0.04 2-phase sinusoidal signal X i and Y i 32 points (i.e., N=32) are randomly generated as data to which the correction value calculation process is applied. Then, the correction value calculation process of the first embodiment is applied to the 32 point data. The cumulative number of times the correction is applied (the number of repetitions of steps S02 to S05) M is set to 30.
[0107] Figure 3 The two-phase sinusoidal signal X before and after correction i and Y i Plotted as a Lissajous waveform. Figure 4 The 2-phase sinusoidal signal X is plotted before and after conversion correction. i and Y i The phase angle θ obtained i and square radius R 2 i A graph in which the horizontal axis represents θ and the vertical axis represents R 2 From these graphs, it can be seen that due to the correction, R 2 is constant, and a nearly ideal 2-phase sinusoidal signal X is obtained i and Y i .
[0108] Figure 5-Figure 8 Is to draw R2 The standard deviation and C x , C y , K a and P y The error curve of the correction is used to confirm the effect of the cumulative application of the correction, and the horizontal axis represents the cumulative number of times the correction value is calculated. As the cumulative number of times the correction value is calculated increases, Figure 5 R shown in 2 The standard deviation of 2 The changes in disappear as the correction value calculation is cumulatively applied. Figure 6-Figure 8 Each error shown in i and Y i When the data is used, how do they converge to the error value set? It can be seen that the cumulative number of applications M = 10 times is sufficient to converge.
[0109] According to the correction value calculation device 1 and the correction value calculation process of the first embodiment described above, the square radius R can be used. 2 Instead of the radius R to obtain the correction value. Therefore, there is no need for calculations for obtaining the square root, the correction value can be obtained with high accuracy and efficiency in a simple method, and the correction can be performed. In particular, by cumulatively applying the correction value calculation, a highly accurate correction value can be obtained. In addition, since a main encoder used as a correction reference is not required and the correction value can be obtained from unequally spaced data, there is no need to use a high-precision feeding mechanism or control to obtain 2-phase sinusoidal signal data for obtaining the correction value, thereby reducing costs. In addition, compared with conventional methods, correction values can be obtained from a smaller number of data points. Therefore, the calculation speed can be accelerated while suppressing computing resources.
[0110] Second embodiment
[0111] A second embodiment of the present invention will now be described below. This second embodiment performs correction value calculation processing at a higher speed with fewer operations than the first embodiment. Since the configuration of the correction value calculation device 1 is the same as that of the first embodiment, the operations in the correction value calculation processing of the second embodiment will be mainly described below.
[0112] In the first embodiment described above, equations (7) and (8) are used to obtain coefficients in an approximate expression model (equations (5) and (6)) that expresses the square radius R using a trigonometric function including the phase angle θ as an independent variable. 2These equations include sine and cosine operations. In embedded digital signal processing devices such as microcontrollers, DSPs, and FPGAs, sin and cos operations are implemented using high-order polynomials, and the accuracy of the operations depends on the order of the polynomial. For example, in a typical Q14 format fixed-point operation using the Maclaurin expansion polynomial of sinθ, an 11th-order polynomial operation is required to obtain an accuracy of less than 1 LSB. i Performing high-order polynomial operations increases the required computing resources and computation time, making it difficult to implement in small and lightweight digital signal processing devices, such as those embedded in encoders.
[0113] Therefore, in this embodiment, the sin and cos operations are replaced by operations that require fewer calculations. i and i (2-phase sinusoidal signal X i and Y i Divided by the amplitude A) can be approximated as equation (20). Even before correction, the high-precision encoder makes the amplitude A of the signal X x The amplitude A of the sum signal Y y They are also close to the design nominal value A of the amplitude. nom Therefore, when the common (average) amplitude of signals X and Y is set to A, by equation (20), cosθ i Approximately x i , and sinθ i Approximately y i .
[0114] X i / A=cosθ i ≡x i
[0115] Y i / A=sinθ i ≡y i …(20)
[0116] Therefore, under the constraint of using a high-precision encoder whose error is small enough to apply the approximation in equation (20) even before correction, by using x i and i The operation replaces the phase angle θ i To reduce the amount of calculation by using the trigonometric operation of x i and i Performing the operation, the polar coordinate conversion unit 30 of the second embodiment calculates x i and i , and input it to the error detection unit 40, x i and iBasically represents the phase angle θ i Instead of the phase angle θ i itself.
[0117] The error detection unit 40 of the second embodiment calculates each coefficient in equation (5) using equation (21), which is obtained by using x in equation (7). i and i Replace cosθ i and sinθ i And obtained.
[0118]
[0119] A 1 ·C 1 =B 1
[0120] C 1 =A 1 - 1.B 1 …(twenty one)
[0121] The error detection unit 40 can obtain each coefficient in equation (5) as C by equation (21) with less calculation amount than equation (7). 1 Elements of a matrix.
[0122] For equation (8), cos2θ i and sin2θ i You can use x separately i and i It is expressed as equation (22) through the double angle formula.
[0123]
[0124] sin2θ i =2sinθ i cosθ i =2x i y i …(twenty two)
[0125] The error detection unit 40 of the second embodiment calculates each coefficient in equation (6) using equation (23) obtained by substituting equation (22) into equation (8).
[0126]
[0127] A 2 ·C 2 =B 2
[0128] C 2 =A 2 -1 ·B 2 …(twenty three)
[0129] The error detection unit 40 can obtain each coefficient in equation (6) as C by equation (23) with fewer calculation times than equation (6). 2 Elements of a matrix.
[0130] In the same manner as in the first embodiment, the error detection unit 40 calculates each correction value (ie, the correction residual remaining in the 2-phase sinusoidal signal) based on the obtained coefficients. In the first embodiment, the correction values are obtained by equations (9) to (12).
[0131] Here, among equations (9) to (12) for obtaining the correction value, equation (11) includes a square root operation, which results in an increase in the amount of calculation. Therefore, in this embodiment, the calculation of equation (11) is simplified. That is, equation (24) gives the square root of The Maclaurin expansion of .
[0132]
[0133] If x in equation (24) = -2A c2 , then the operation involving square roots in equation (11) can be approximated by the polynomial in equation (25).
[0134]
[0135] When using a high-precision encoder with small error, it can be considered that ΔK a ≈1, that is, A c2 ≈0. Therefore, for the Q14 format, expansion to the second order is sufficient to obtain sufficient accuracy. Therefore, equation (11) can be simplified to equation (26) to suppress the amount of calculation.
[0136]
[0137] The correction value calculation process for calculating the correction value using the correction value calculation device 1 can be performed in the same manner as Figure 2 The correction value calculation process in the first embodiment shown is implemented by the same procedure, but equations (21), (23) and (26) are used instead of equations (7), (8) and (11), respectively.
[0138] Next, a simulation performed to confirm the effectiveness of the correction value calculation process of the correction value calculation device 1 will be described.
[0139] When performing simulation, the random error is C x =0.1, Cy =0.05, A x =0.95, A y =1.05 and P y = -0.04 2-phase sinusoidal signal X i and Y i 32 points (ie, N=32) are used as data to which the correction value calculation process is applied. The correction value calculation process of the second embodiment is then applied to the 32 point data. The cumulative number of times M (the number of repetitions of steps S02 to S04) to apply correction is set to 30.
[0140] Fig. 9 The two-phase sinusoidal signal X before and after correction i and Y i Plotted as a Lissajous waveform. Fig.10 The 2-phase sinusoidal signal X before and after conversion correction is i and Y i The phase angle θ obtained i and square radius R 2 i The horizontal axis represents θ and the vertical axis represents R 2 From these graphs, it can be seen that due to the correction, R 2 is constant, and a nearly ideal 2-phase sinusoidal signal X is obtained i and Y i .
[0141] Figure 11-Figure 14 Is to draw R 2 The standard deviation of C x , C y , K a and P y The error curve of the correction is used to confirm the effect of the cumulative application of the correction, and the horizontal axis represents the cumulative number of times the correction value is calculated. As the cumulative number of times the correction value is calculated increases, Fig.11 R shown in 2 The standard deviation of 2 The changes in disappear as the correction value calculation is cumulatively applied. Figure 12-14 Each error shown in the figure can be seen when generating a 2-phase sinusoidal signal X i and Y i How do they converge to a set of error values when the data is . It can be seen that the number of cumulative applications M = 10 is sufficient for convergence.
[0142] According to the correction value calculation device 1 and the correction value calculation process of the second embodiment described above, the calculation of the sin function, the cos function and the square root is not necessary, and the correction value can be obtained with high accuracy and high efficiency by a simple calculation using only four arithmetic operations, and correction can be performed. Therefore, the system can increase the calculation speed while reducing the calculation resources, and realize applications such as dynamically updating the correction value by performing the correction value calculation process in a small and light digital signal processing device (such as a device embedded in an encoder).
[0143] Third embodiment
[0144] Next, we will base Figures 15 to 23 A third embodiment of the present invention is described.
[0145] The correction value calculation method of the first embodiment described above is effective when the encoder detection unit 11 has a measurement range within one period of the 2-phase sinusoidal signal, or when the fluctuation of the signal strength output by the encoder detection unit 11 is small. However, if the fluctuation of the signal strength is large within the displacement measurement range exceeding one period of the 2-phase sinusoidal signal, the correction value calculation method of the first embodiment may not provide a sufficiently accurate correction value.
[0146] For example, it is assumed that the electromagnetic induction type rotary encoder detector 110 has a plurality of rotor scales 210 on the rotor 200, and a 2-phase sinusoidal signal is output by reading the relative rotor scales 210 by the stator detector 310 of the stator 300. In such a rotary encoder detection unit 110, a 2-phase sinusoidal signal having a period corresponding to the number of rotor scales 210 is output during one rotation of the rotor 200. For example, if the rotor 200 has 100 rotor scales 210, the 2-phase sinusoidal signal is output during one rotation of the rotor 200. A 2-phase sinusoidal signal with 100 cycles is output during one rotation from 0 to 360 degrees. In this case, the Lissajous waveform will rotate 100 times. Fig.15 As shown, when the rotor 200 is tilted relative to the stator 300, the distance between the stator detector 310 and the rotor scale 210 changes with the rotation displacement of the rotor 200. Therefore, the signal strength of the 2-phase sinusoidal signal also changes with the rotation displacement. And the fluctuation, and the square radius R 2 also fluctuates with a period longer than the signal spacing, e.g. Fig.16 That is, the signal strength (and R 2 The rotational displacement (square radius) between the stator detector 310 and the rotor scale 210 becomes shorter increases, and the signal strength (and R 2The rotational displacement (square radius) between the stator detector 310 and the rotor scale 210 becomes longer For example, similar signal strength fluctuations may occur in various encoders other than electromagnetic induction type rotary encoders due to misalignment caused by improper adjustment during the installation of the guide mechanism for mounting the encoder.
[0147] The square radius R obtained from the signal output by the actual encoder detection unit 11 2 In the case of a 2-phase sinusoidal signal, the fluctuation caused by the interpolation error and the fluctuation caused by the signal strength fluctuation are mixed together, making it difficult to separate them. As a result, it is difficult to obtain the correction value of the 2-phase sinusoidal signal with high accuracy.
[0148] In the correction value calculation device 1 according to the third embodiment, the square radius R is reduced by focusing on the fact that the fluctuation caused by the signal strength fluctuation has a long period exceeding the period of the 2-phase sinusoidal signal, while the fluctuation caused by the interpolation error has a short period less than the period of the 2-phase sinusoidal signal. 2 The impact of wide fluctuations in the
[0149] Fig.17 1 is a block diagram showing the basic configuration of the correction value calculation device 1a and the encoder detection unit 11 of the third embodiment. Fig.17 In the example shown, the correction value calculation device 1a is implemented in the form of being built into the encoder 10 together with the encoder detection unit 11, but the correction value calculation device 1a can be implemented as a unit separated from the encoder 10 as in the first embodiment. In this embodiment, the correction value calculation device 1a can correct the fluctuation of the signal strength within a wide displacement range exceeding the displacement corresponding to one cycle of the 2-phase sinusoidal signal, and a high-precision correction value can be obtained. To achieve this, the correction value calculation device 1a of the third embodiment is characterized in that, in addition to the configuration of the correction value calculation device 1 in the first embodiment, it is also equipped with a signal strength correction unit 60. Hereinafter, the configuration different from the correction value calculation device 1 in the first embodiment will be described in detail, and the configuration the same as the correction value calculation device 1 in the first embodiment will be omitted here with the same figure mark.
[0150] As in the first embodiment, the 2-phase sinusoidal signals X and Y are input to the correction unit 20. The correction unit 20 holds the correction value to be applied to the 2-phase sinusoidal signals. The correction unit 20 corrects the 2-phase sinusoidal signals X and Y using the correction value and outputs output signals X′ and Y′. The output signals X′ and Y′ of the correction unit 20 are input to the polar coordinate conversion unit 30. The polar coordinate conversion unit 30 converts the output signals X′ and Y′ of the correction unit 20 into the polar coordinate conversion unit 30 by the calculations in the equations (3) and (4) described in the first embodiment. i and Y′i Calculate the phase angle θ i and square radius R i 2 , square radius R i 2 is the phase angle θ i The corresponding Lissajous radius R i The square of .
[0151] As in the correction value calculation device 1 of the first embodiment, the phase angle θ calculated by the polar coordinate conversion unit 30 i is input to the error detection unit 40 and the wide range phase angle calculation unit 50. The square radius R calculated by the polar coordinate conversion unit 30 i 2 The signal strength is input to the signal strength correction unit 60 .
[0152] In the same manner as in the first embodiment, the wide range phase angle calculation unit 50 calculates the phase angle θ for each phase angle θ. i Calculates phase angles over a wide range This wide range of phase angle Indicates a wide range of displacements exceeding the displacement corresponding to one cycle of a 2-phase sinusoidal signal. Wide range phase angle The number of cycles (Lissajous signal rotations) n of the two-phase sinusoidal signal from the reference displacement (origin) can be used to calculate the i and the phase angle θ calculated by the polar coordinate conversion unit 30 i For example, in a wide range of phase angles In the case of an encoder having 100 2-phase sinusoidal signal cycles in one cycle (0 to 360 degrees), Through the relation With n i and θ i The number of revolutions of the Lissajous signal n i The counting can be performed by a known incremental up-down counter (upper counter). In the first embodiment, the wide range phase angle calculation unit 50 is not included in the correction value calculation device 1 and exists as a configuration of the encoder 10, but in the third embodiment, the wide range phase angle calculation unit 50 is a component of the correction value calculation device 1a.
[0153] As described in detail below, the signal strength correction unit 60 uses the square radius R input from the polar coordinate conversion unit 30. i 2 and the wide range phase angle input from the wide range phase angle calculation unit 50 The square radius R is obtained by the least squares method. 2 Expressed as a wide range phase angle The coefficients in the trigonometric function approximation model are obtained, and the coefficients obtained are related to each wide range phase angle The corresponding signal strength correction value R ci 2 Then based on the signal strength correction value R ci 2 Correction with each wide range of phase angles The corresponding square radius R i 2 .
[0154] Square radius R 2 The long-period fluctuations can be approximated as the sum of harmonics, with the fundamental frequency being a wide range of phase angles. Therefore, the signal strength corrector 60 can use equation (27) as an approximate expression model, which converts the square radius R 2 Expressed as a wide range phase angle The trigonometric functions of .
[0155]
[0156] In equation (27), k is a number from 1 to N. L integer, and N L is the order of the highest harmonic used in the approximation. Increase N L The accuracy of the approximation can be improved, but the gain coefficient a is increased k and b k And the signal strength correction value R ci 2 Therefore, N is determined by considering the trade-off between accuracy and computational effort. L For example, N L can be set to 3, and the approximate expression model can include up to the third harmonic.
[0157] For the range from 1 to N L For each k, the signal strength correction unit 60 can obtain the coefficient a in equation (27) by equation (28): k and b k As R k Elements of a matrix.
[0158]
[0159] P k ·R k =Q k
[0160] R k =P k -1 Q k …(28)
[0161] where k = 1, 2, 3, N L
[0162] The signal strength correction unit 60 uses equation (29) according to the obtained coefficient a k and b k Calculates the phase angle for each wide range The corresponding signal strength correction value R ci 2 ,
[0163]
[0164] In addition, the signal strength correction unit 60 uses the signal strength correction value R according to equation (30) ci 2 Correction square radius R i 2 , to calculate the phase angle with each wide range The corresponding corrected square radius R LCi 2 , which is input to the error detection unit 40,
[0165]
[0166] The error detection unit 40 uses the phase angle θ calculated by the polar coordinate conversion unit 30 i and the square radius R corrected by the signal strength correction unit 60 LCi 2 , the correction value is calculated using the same method as the signal strength correction unit 60 in the first embodiment.
[0167] Fig.18 1 is a flowchart showing the procedure of correction value calculation processing executed by the correction value calculation device 1 a in the third embodiment configured as described above.
[0168] When the correction value calculation process starts, the correction unit 20 first obtains N pairs of two-phase sinusoidal signals X and Y (X i , Y i ; where i is 0 to N-1) as the output data of the encoder detection unit 11 for correction (step S11). The correction unit 20 can obtain the data from the encoder detection unit 11 in real time, or the encoder detection unit 11 can obtain and record the data in advance, and then the correction unit 20 obtains the data via a communication device or a storage medium.
[0169] Then, the polar coordinate conversion unit 30 calculates the phase angle θ for each of the N data pairs of the 2-phase sinusoidal signal. i and the corresponding square radius R i2 (Step S12). Then, the wide range phase angle calculation unit 50 calculates the wide range phase angle This represents a wide range of displacement angles over one cycle of the 2-phase sinusoidal signal (step S13). The signal strength correction unit 60 calculates the phase angle corresponding to each wide range. The corresponding signal strength correction value R ci 2 To correct for wide range signal intensity fluctuations, the corresponding square radius R i 2 To calculate R LCi 2 (Step S14).
[0170] Then, based on each phase angle θ calculated in step S12 i and the square radius R corrected in step S14 i 2 The error detection unit 40 calculates the correction residual (ΔC x and ΔC y ), calculate the correction residual (ΔK) of the residual amplitude ratio error in the two-phase sinusoidal signals X and Y input in step S01 a ) and the correction residual of the phase difference error (ΔP y ) (step S15). Then, the correction value held by the correction unit 20 is updated based on the calculated correction residuals of the respective errors (step S16). The error detection unit 40 can update the correction value using equation (19) in the same manner as in the first embodiment.
[0171] Then, the correction unit 20 corrects the two-phase sinusoidal signal according to the correction value calculated by the error detection unit 40, and outputs a signal X′ i and Y′ i (Step S17).
[0172] If the calculation of the correction value is repeated (step S18; Yes), the 2-phase sinusoidal signal X′ corrected in step S05 i and Y′ i is used as the new 2-phase sinusoidal signal X i and Y i (Step S19), and the process returns to step S12. Steps S12 to S17 are repeated as many times as necessary, and when repetition is no longer necessary (Step S18; No), the correction value calculation process ends. The correction value at the end of the correction value calculation process is the final correction value. The number of times the correction value is repeatedly calculated and updated may be a predetermined number of times. Alternatively, the process may be repeated until the correction residuals are sufficiently small (e.g., until they are below a predetermined threshold). According to this correction value calculation process, after removing the square radius R2 In the same manner as in the first embodiment, the operation of calculating and updating the correction value based on the 2-phase sinusoidal signals X and Y is cumulatively applied, and the correction residual converges to a value with a small error (for ΔC x , ΔC y and ΔP y is 0, and for ΔK a is 1).
[0173] Next, an example of applying a correction value calculation process by the correction value calculation unit 1a of the present embodiment to the 2-phase sinusoidal signals X and Y output by an actual electromagnetic induction type rotary encoder will be described. When the angle changes by one cycle (i.e. from 0 degrees to 360 degrees), a 2-phase sinusoidal signal with 100 cycles is output.
[0174] Fig.19 The square radius R calculated from the 2-phase sinusoidal signal before correction of the signal strength is plotted. i 2 The horizontal axis represents the rotor displacement. (i.e., wide range of phase angles). The uncorrected square radius R when changing from 0 to 360 degrees 2 The large fluctuations are caused by long periods, and the short period fluctuations of the two-phase sinusoidal signal are superimposed on the large fluctuations.
[0175] Fig. 20 is Fig.19 The square radius R before correction i 2 The square radius R of the signal strength correction applied by the signal strength correction unit 60 LCi 2 A graph showing the rotor displacement on the horizontal axis. It can be seen that the correction has suppressed long-term fluctuations.
[0176] Fig.21 is the square radius R before drawing the signal strength correction i 2 The horizontal axis represents the phase angle θ. The signal strength fluctuates significantly within one rotation of the rotor, and this cannot be attributed to the square radius R due to interpolation error. 2 , and in this case the error detection unit 40 cannot calculate the correction value with high accuracy.
[0177] Fig. 22 The square radius R is drawn after correcting the signal strength LCi 2The horizontal axis represents the phase angle θ. It can be seen that the signal intensity fluctuation in a wide range is suppressed and the R caused by the interpolation error can be separated. 2 Fluctuation. Using R LCi 2 , the error detection unit 40 can calculate the correction value with high accuracy.
[0178] Fig.23 is the square radius R after the error detection unit 40 uses the corrected signal strength. LCi 2 The calculated correction value is applied to the corrected square radius R of the 2-phase sinusoidal signals Xi and Yi i 2 The horizontal axis represents the phase angle θ. The square radius R i 2 With phase angle θ i is irrelevant and the result is almost constant, which shows that the correction of the 2-phase sinusoidal signal is achieved with high accuracy to reduce the interpolation error.
[0179] According to the correction value calculation device 1a and correction value calculation process of the third embodiment described above, when the signal strength of the encoder output signal fluctuates in a wide range exceeding one cycle of the 2-phase sinusoidal signal, the correction value can be calculated while suppressing the influence of the signal strength fluctuation.
[0180] According to equation (28), simple matrix operations can be used to obtain the coefficients required to calculate the correction value.
[0181] Variations of the Embodiments
[0182] Although the embodiments are described above, the present invention is not limited to these examples. For example, in the above-mentioned third embodiment, the case where the correction value calculation device 1a is applied to the rotary encoder is described as an example, but the encoder may be a linear encoder. In the linear encoder, when there is a factor causing periodic fluctuations in the guide mechanism, the correction value calculation process in the third embodiment can be applied to reduce the periodic fluctuations and then calculate the correction value.
[0183] In each of the above-mentioned embodiments, the number of revolutions n of the Lissajous signal in the wide range phase angle calculation unit 50 is described as an example. i and the phase angle θ is obtained However, it can be obtained by other methods For example, in an absolute encoder, Can be obtained through absolute detection.
[0184] Any addition, deletion and design modification of the constituent elements in the embodiment and any combination of the features of the embodiment that can be imagined by those skilled in the art may also fall within the scope of the present invention as long as they include the spirit of the present invention.
Claims
1. A correction value calculation method for calculating a correction value to correct a two-phase sinusoidal signal (X, Y) output by an encoder, comprising: Polar coordinate calculation step for N phase angles θ in the Lissajous waveform drawn by the 2-phase sinusoidal signal i and each phase angle θ i The corresponding Lissajous radius R i , calculate the square radius R i 2 , the square radius R i 2 is related to each phase angle θ i The corresponding Lissajous radius R i The square of as well as Correction value calculation step for each phase angle θ i and the phase angle θ calculated in the polar coordinate calculation step i The corresponding square radius R i 2 , at least calculate the offset error C of signal X x The correction residual △C x , signal Y offset error C y The correction residual ΔC y , the amplitude ratio error K of signal X and Y a The correction residual △K a , and the phase difference error P between the signal X and the signal Y y The correction residual △P y , and then calculate the correction value based on the correction residual, wherein the signals X and Y constitute the 2-phase sinusoidal signals, and in the correction value calculation step, Using each phase angle θ i and each phase angle θ i The corresponding square radius R i 2 , the coefficients in the approximate expression model are obtained by the least squares method, in which the square radius R 2 is expressed by a trigonometric function including the phase angle θ as an independent variable, and the correction residual is obtained based on the obtained coefficient.
2. The correction value calculation method according to claim 1, wherein: In the correction value calculation step, equations (5) and (6) are used as the approximate expression model, R 2 =A c1 cosθ+A s1 sinθ+R o1 …(5) R 2 =A c2 cos2θ+A s2 sin2θ+R o2 …(6) The coefficient A in equation (5) c1 and A s1 As the elements of the C1 matrix are obtained by using equation (7), A1·C1=B1 C1=A1 -1 ·B1…(7) The coefficient A in equation (6) c2 and A s2 As the elements of the C2 matrix are obtained by using equation (8), A2·C2=B2 <h2 style=";text-align:left;direction:ltr">C2=A2<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> ·B2…(8) and The correction value is obtained by using equations (9) to (12) according to the coefficient A c1 , A s1 , A c2 and A s2 Calculated, △C x =A c1 / 2…(9) △C y =A s1 / 2…(10) △P y =A s2 …(12)。 3. The correction value calculation method according to claim 1, wherein: In the polar coordinate calculation step, sinθ is approximated by using equation (20) with A as the amplitude of the 2-phase sinusoidal signal. i and cosθ i The obtained x i and i is calculated to represent the phase angle θ i data, X i / A=cosθ i ≡x i AND i / A=sinθ i ≡y i …(20) In the correction value calculation step, equations (5) and (6) are used as the approximate expression model, R 2 =A c1 cosθ+A s1 sinθ+R o1 …(5) R 2 =A c2 cos2θ+A s2 sin2θ+R o2 …(6) The coefficient A in equation (5) c1 and A s1 As the elements of the C1 matrix are obtained by using equation (21), A1·C1=B1 C1=A1 -1 ·B1…(21) The coefficient A in equation (6) c2 and A s2 As the elements of the C2 matrix are obtained by using equation (23), A2·C2=B2 <h2 style=";text-align:left;direction:ltr">C2=A2<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> ·B2…(23) And the correction residual is obtained by using equations (9), (10), (26) and (12) according to the coefficient A c1 , A s1 , A c2 and A s2 Calculated, △C x =A c1 / 2…(9) △C y =A s1 / 2…(10) △P y =A s2 …(12)。 4. The correction value calculation method according to claim 1, further comprising a correction step for correcting the two-phase sinusoidal signal based on the correction value, The correction value calculation step is applied again to the 2-phase sinusoidal signal corrected by the correction step to update the correction value.
5. The correction value calculation method according to claim 4, wherein the correction value is updated using equation (19), Where 0 <G f ≤1.
6. The correction value calculation method according to claim 1, wherein the encoder is capable of detecting a wide range of displacement exceeding the displacement corresponding to one cycle of the 2-phase sinusoidal signal, and The correction value calculation method also includes: Wide range phase angle calculation steps, used to calculate a wide range of phase angles The wide range phase angle Represents the phase angle θ i The corresponding wide range displacement; as well as Signal strength correction step: Signal strength correction step, by least square method using the square radius R i 2 and the wide range phase angle To calculate the square radius R 2 The wide range phase angle is expressed as The coefficients in the trigonometric function approximation model are used to calculate the coefficients corresponding to each wide range phase angle. The signal strength correction value corresponding to each wide range phase angle is corrected based on the signal strength correction value. The corresponding square radius R i 2 ,and In the correction value calculation step, based on the corrected square radius R LCi 2 Calculate the correction value, the corrected square radius R LCi 2 is the square radius R corrected in the signal strength correction step i 2 .
7. The correction value calculation method according to claim 6, wherein: In the signal strength correction step calculation step, equation (27) is used as an approximate expression model, and the approximate expression model converts the square radius R 2 Expressed as the wide range phase angle The trigonometric functions of The coefficient a k and b k As R k The elements of the matrix are obtained by equation (28), where k is from 1 to N L integer, N L is the order of the highest harmonic used in the approximation, P k ·R k =Q k R k =P k -1 ·Q k …(28) where k = 1, 2, 3, N L With each of the wide range phase angles The corresponding signal strength correction value R ci 2 is obtained by using equation (29) according to the coefficient a k and b k Calculated, and with each of the wide range phase angles The corresponding corrected square radius R LCi 2 By using the signal strength correction value R according to equation (30) ci 2 Correction of the square radius R i 2 To calculate, 8 . A program for causing a computer to execute the correction value calculation method according to claim 1 .
9. A correction value calculation device for calculating a correction value to correct a 2-phase sinusoidal signal (X, Y) output by an encoder, comprising: Polar coordinate conversion unit, for N phase angles θ in the Lissajous waveform drawn from a 2-phase sinusoidal signal i and each phase angle θ i The corresponding Lissajous radius R i , calculate the square radius R i 2 , the square radius R i 2 is related to each phase angle θ i The corresponding Lissajous radius R i The square of as well as The error detection unit is based on each phase angle θ i and the phase angle θ calculated by the polar coordinate conversion unit i The corresponding square radius R i 2 , at least calculate the offset error C of signal X x The correction residual △C x , signal Y offset error C y The correction residual △C y , the amplitude ratio error K of signal X and Y a The correction residual △K a , and the phase difference error P between the signal X and the signal Y y The correction residual ΔP y , and then calculate the correction value based on the correction residual, wherein the signals X and Y constitute the 2-phase sinusoidal signals, and The error detection unit uses each phase angle θ i and each phase angle θ i The corresponding square radius R i 2 , the coefficients in the approximate expression model are obtained by the least squares method, in which the square radius R 2 is expressed by a trigonometric function including the phase angle θ as an independent variable, and a correction residual is obtained from the obtained coefficient.
10. The correction value calculation device according to claim 9, wherein the error detection unit uses equations (5) and (6) as approximate expression models, R 2 =A c1 cosθ+A s1 sinθ+R o1 …(5) R 2 =A c2 cos2θ+A s2 sin2θ+R o2 …(6) The coefficient A in equation (5) is obtained by using equation (7) c1 and A s1 As the elements of the C1 matrix, A1·C1=B1 C1=A1 -1 ·B1…(7) Using equation (8) we can obtain the coefficient A in equation (6): c2 and A s2 As the elements of the C2 matrix, A2·C2=B2 <h2 style=";text-align:left;direction:ltr">C2=A2<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> ·B2…(8) And using equations (9) to (12) according to the obtained coefficient A c1 , A s1 , A c2 and A s2 Calculating the correction value, △C x =A c1 / 2…(9) △C y =A s1 / 2…(10) △P y =A s2 …(12)。 11. The correction value calculation device according to claim 9, wherein the polar coordinate conversion unit approximates sinθ by using equation (20) with A as the amplitude of the 2-phase sinusoidal signal. i and cosθ i The obtained x i and i The phase angle θ is calculated to represent i data, X i / A=cosθ i ≡x i AND i / A=sinθ i ≡y i …(20) The error detection unit uses equations (5) and (6) as the approximate expression model, R 2 =A c1 cosθ+A s1 sinθ+R o1 …(5) R 2 =A c2 cos2θ+A s2 sin2θ+R o2 …(6) Using equation (21) we can obtain the coefficient A in equation (5): c1 and A s1 As the elements of the C1 matrix, A1·C1=B1 C1=A1 -1 ·B1…(21) Using equation (23) we obtain the coefficient A in equation (6): c2 and A s2 As the elements of the C2 matrix, A2·C2=B2 <h2 style=";text-align:left;direction:ltr">C2=A2<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> ·B2…(23) And using equations (9), (10), (26) and (12) according to the obtained coefficient A c1 , A s1 , A c2 and A s2 Calculate the correction residual, △C x =A c1 / 2…(9) △C y =A s1 / 2…(10) △P y =A s2 …(12)。 12. The correction value calculation device according to claim 9, further comprising a correction unit that corrects the two-phase sinusoidal signal based on the correction value, wherein the polar coordinate conversion unit calculates a square radius R for the two-phase sinusoidal signal corrected by the correction unit 2 , the square radius R 2 is the square of the Lissajous radius R corresponding to each phase angle θ, and The error detection unit calculates the square radius R based on each phase angle θ and the square radius R calculated by the polar coordinate conversion unit. 2 To calculate a new correction value and update the correction value.
13. The correction value calculation device according to claim 12, wherein the error detection unit updates the correction value using equation (19), Where 0 <G f ≤1.
14. The correction value calculation device according to claim 9, wherein the encoder is capable of detecting a wide range of displacements compared to a displacement corresponding to one cycle of the 2-phase sinusoidal signal, and The correction value calculation device also includes: The wide range phase angle calculation unit calculates and for each phase angle θ i A wide range of displacements corresponds to a wide range of phase angles as well as The signal strength correction unit uses the square radius R by the least squares method i 2 and the wide range phase angle To calculate the square radius R 2 The wide range phase angle is expressed as The coefficients in the trigonometric function approximation model are used to calculate the coefficients corresponding to each wide range phase angle. The signal strength correction value corresponding to each wide range phase angle is corrected based on the signal strength correction value. The corresponding square radius R i 2 ,and The error detection unit is based on the square radius R LCi 2 Calculate the correction value, the square radius R LCi 2 is the square radius R corrected in the signal strength correction unit i 2 .
15. The correction value calculation device according to claim 14, wherein the signal strength correction unit uses equation (27) as the approximate expression model, and the approximate expression model converts the square radius R 2 The wide range phase angle is expressed as The trigonometric functions of The coefficient a is obtained by equation (28): k and b k As R k The elements of the matrix, where k is from 1 to N L integer, and N L is the order of the highest harmonic used in the approximation, P k ·R k =Q k R k =P k -1 ·Q k …(28) where k = 1, 2, 3, N L By using equation (29) according to the obtained coefficient a k and b k Calculate the wide range of phase angles with each The corresponding signal strength correction value R ci 2 , And by using the signal strength correction value R according to equation (30) ci 2 Correction of the square radius R i 2 To calculate the wide range of phase angles with each The corresponding corrected square radius R LCi 2 , 16. An encoder comprising: The correction value calculation device according to claim 9; as well as The encoder detection unit outputs a 2-phase sinusoidal signal in response to the displacement along the measuring direction. The correction value calculation device performs: A correction value calculation process of calculating a correction value based on the two-phase sinusoidal signal output by the encoder detection unit; as well as The correction processing is to apply the calculated correction value to the two-phase sinusoidal signal output by the encoder detection unit.
