CN116358619B - Signal error correction method, magnetic encoder and optical encoder - Google Patents

Signal error correction method, magnetic encoder and optical encoder Download PDF

Info

Publication number
CN116358619B
CN116358619B CN202310642032.0A CN202310642032A CN116358619B CN 116358619 B CN116358619 B CN 116358619B CN 202310642032 A CN202310642032 A CN 202310642032A CN 116358619 B CN116358619 B CN 116358619B
Authority
CN
China
Prior art keywords
new
filter
signal
component signal
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310642032.0A
Other languages
Chinese (zh)
Other versions
CN116358619A (en
Inventor
王超
钱振煌
张开新
刘大权
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Quanzhou Kuntaixin Microelectronic Technology Co ltd
Original Assignee
Quanzhou Kuntaixin Microelectronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Quanzhou Kuntaixin Microelectronic Technology Co ltd filed Critical Quanzhou Kuntaixin Microelectronic Technology Co ltd
Priority to CN202310642032.0A priority Critical patent/CN116358619B/en
Publication of CN116358619A publication Critical patent/CN116358619A/en
Application granted granted Critical
Publication of CN116358619B publication Critical patent/CN116358619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
    • G01D18/001Calibrating encoders
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • G01D5/12Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means
    • G01D5/244Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means influencing characteristics of pulses or pulse trains; generating pulses or pulse trains
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • G01D5/26Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light
    • G01D5/32Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light
    • G01D5/34Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light the beams of light being detected by photocells
    • G01D5/347Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light the beams of light being detected by photocells using displacement encoding scales
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations

Abstract

The application belongs to the technical field of detection processing of magnetic field signals or optical signals, and provides a signal error trimming method, a magnetic encoder and an optical encoder, wherein the signal error trimming method comprises the following steps: x to output the sensor in And y in Inputting the four-point correction module to perform the following processing: let x new =(x in1 +x in2 )/2,y new =(y in1 +y in2 ) 2; if y in1 ≤y 0 ≤y in2 Or y in2 ≤y 0 ≤y in1 Then consider y in Traversing y 0 The method comprises the steps of carrying out a first treatment on the surface of the If x new ≤x 0 Then use x new Updating x n If x new >x 0 Then use x new Updating x p Then x is 0 The updating is as follows: x is x 0 =(x n +x p ) 2; if x in1 ≤x 0 ≤x in2 Or x in2 ≤x 0 ≤x in1 Then consider x in Pass through x 0 The method comprises the steps of carrying out a first treatment on the surface of the If y new ≤y 0 Then utilize y new Updating y n If y new >y 0 Then utilize y new Updating y p And then y 0 The updating is as follows: y is 0 =(y n +y p ) 2; continuous acquisition of x in And y in And input four-point correction module to update x n 、x p 、x 0 、y n 、y p 、y 0 、K x 、K y And to x in And y in Performing first four-point correction: x is x out =K y ·(x in ‑x 0 ),y out =K x ·(y in ‑y 0 ). The application can overcome the quadrature error of the sensing signalAnd a high angle detection accuracy can be obtained.

Description

Signal error correction method, magnetic encoder and optical encoder
Technical Field
The application belongs to the technical field of detection processing of magnetic field signals or optical signals, and particularly relates to a signal error correction method, a magnetic encoder and an optical encoder.
Background
Patent document CN114910112B discloses a signal error correction method that improves the detection accuracy of the rotation angle θ by correcting the zero point error and the amplitude deviation in order. According to the technical proposal disclosed in the patent document, four key values x are required to be acquired first det,p 、x det,n 、y det,p And y det,n Then zero point error correction is carried out, and new four key values x are obtained cor,p 、x cor,n 、y cor,p And y cor,n Then, the amplitude deviation is corrected. These two sets of key values are very important for correction of zero-point errors and amplitude deviations. The patent document further discloses the acquisition of these two sets of key values in a "zero crossing peaking" method. However, the solution disclosed in this patent document requires that the first component signal and the second component signal output by the sensor have good orthogonality if high detection accuracy is to be obtained.
In many cases, the trace plot formed by the first component signal and the second component signal output by the sensor is generally in an elliptical shape, if the orthogonality of the two is good, the major axis of the ellipse tends to be horizontal (see fig. 1 of patent document CN 114910112B), and if the orthogonality of the two is poor, the major axis of the ellipse forms a certain angle with the x-axis.
In a high noise environment or because of a problem of a manufacturing process, signals output by the sensor often have quadrature errors, that is, orthogonality of the first component signal and the second component signal is poor, a long axis of an elliptical trajectory formed by the two forms a certain included angle with an x axis, and in this case, detection accuracy obtained by the technical scheme disclosed in patent document CN114910112B is poor.
Therefore, it is necessary to provide a new signal error correction method to solve the problem of error correction of sensor signals with larger quadrature errors.
Disclosure of Invention
The purpose of the present application is to provide a signal error trimming method, a magnetic encoder and an optical encoder, so as to solve the technical problem that the error correction effect of a sensor signal is poor due to the orthogonal error in the prior art.
In order to achieve the above purpose, the technical scheme adopted in the application is as follows: the signal error trimming method is applied to detecting the rotation angle theta of the rotating member relative to the sensor, and comprises the following steps:
initializing a first register, a second register, a third register and a fourth register, wherein the first register is used for registering x n The second register is used for registering x p A third register for registering y n A fourth register for registering y p
Collecting a first component signal and a second component signal output by a sensor, wherein the sampling value of the first component signal is x in The sampled value of the second component signal is y in Will x in And y in Inputting the four-point correction module to perform the following processing:
x in is x in1 And x in2 ,y in Is y in1 And y in2 ,x in1 And y is in1 For simultaneous sampling, x in2 And y is in2 For simultaneous sampling, let the intermediate variable x new =(x in1 +x in2 )/2,y new =(y in1 +y in2 )/2;
Calculating intermediate variable x 0 =(x n +x p )/2,y 0 =(y n +y p )/2;
If y in1 ≤y 0 ≤y in2 Or y in2 ≤y 0 ≤y in1 Then consider y in Traversing y 0
In y in Traversing y 0 In the case of (1), if x new ≤x 0 Then use x new Updating x n If x new >x 0 Then use x new Updating x p Then utilize the latest x n And x p Updating x 0
If x in1 ≤x 0 ≤x in2 Or x in2 ≤x 0 ≤x in1 Then consider x in Pass through x 0
At x in Pass through x 0 In the case of (1), if y new ≤y 0 Then utilize y new Updating y n If y new >y 0 Then utilize y new Updating y p Then utilize the latest y n And y p Updating y 0
Calculating intermediate variable K x =(x p -x n )/2,K y =(y p -y n )/2;
Continuous acquisition of x in And y in And inputting the four-point correction module to update x n 、x p 、x 0 、y n 、y p 、y 0 、K x 、K y And to x in And y in Performing first four-point correction:
x out = K y ·(x in -x 0 ),
y out = K x ·(y in -y 0 ),
wherein x is out For correction value of the first component signal, y out Is the correction value of the second component signal.
Optionally, at initialization, let x n =x p =y n =y p =0; alternatively, let x p Let x be the amplitude of the first component signal n Let y be the negative of the amplitude of the first component signal p Let y be the amplitude of the second component signal n Is the negative of the amplitude of the second component signal.
Optionally, for x in And y in When the first four-point correction is performed, the following steps are performed:
x out = K y ·(x in -x 0 )·K amp
y out = K x ·(y in -y 0 ) ·K amp
wherein K is amp Is a signal amplitude control coefficient and is used for preventing data from exceeding the maximum value which can be recorded by a storage unit in the calculation process to cause data overflow.
Alternatively, K amp The value of (2) and 2/(K) x + K y ) The proportion of the change is varied and, or alternatively, the process may be performed,
K amp =A max /(K x ·K y ),A max =2 (M-1) m is x in Or y in Is a binary number of bits containing sign bits.
Alternatively, K amp =K·2/(K x + K y ),0.5≤K≤1.5。
Optionally, the utilizing x new Updating x p By combining x new And x p Inputting a first filter for filtering; and/or the number of the groups of groups,
the utilization x new Updating x n By combining x new And x n Inputting a second filter for filtering; and/or the number of the groups of groups,
the utilization of y new Updating y p By combining y new And y p Inputting a third filter for filtering; and/or the number of the groups of groups,
the utilization of y new Updating y n By combining y new And y n And inputting the filtered signal to a fourth filter.
Optionally, the filtering algorithm of the first filter is: x is x p(i+1) = x p(i) +(x new -x p(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the second filter is as follows: x is x n(i+1) = x n(i) +(x new -x n(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the third filter is as follows: y is p(i+1) = y p(i) +(y new -y p(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the fourth filter is as follows: y is n(i+1) = y n(i) +(y new -y n(i) )/D;
Wherein i is a natural number, D is a parameter showing the filtering depth, and D is more than or equal to 1.
Alternatively, d=2 FN FN is the filter depth coefficient of the corresponding filter.
Alternatively, x new Is input to the first filter and the second filter, y new Is input to the third filter and the fourth filter;
if x new ≤x 0 Enabling the second filter while the first filter is not active if x new >x 0 Enabling the first filter and disabling the second filter;
if y new ≤y 0 Enabling the fourth filter while the third filter is not active if y new >y 0 The third filter is enabled and the fourth filter is disabled.
Optionally, at pair x in And y in After the first four-point correction, the trajectory graph formed by the first component signal and the second component signal is rotated 45 degrees clockwise or counterclockwise around the origin of coordinates.
Optionally, after rotating the trace pattern formed by the first component signal and the second component signal by 45 degrees, taking the data of the first component signal and the second component signal as new x in And y in And inputting the four-point correction module to perform secondary four-point correction.
The application also provides a magnetic encoder, which comprises a magnetic sensor and a signal processing circuit, wherein the signal processing circuit calculates the rotation angle of a rotating piece capable of generating a magnetic field relative to the magnetic sensor according to any one of the signal error trimming methods.
The application also provides an optical encoder, which comprises an optical sensor and a signal processing circuit, wherein the signal processing circuit calculates the rotation angle of the rotating piece relative to the optical sensor according to any one of the signal error trimming methods.
The signal error trimming method has the beneficial effects that: compared with the prior art, the four-point correction method adopted by the signal error correction method can overcome the quadrature error of two component signals of the sensor, gradually approaches the center of a track diagram formed by the two component signals, and obtains four reliable key values, so that the accurate zero point error correction is performed, and the higher angle detection precision is facilitated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 (a) shows a state one of a trace diagram formed by a first component signal and a second component signal provided in an embodiment of the present application.
Fig. 1 (b) shows a second state of a trace diagram formed by the first component signal and the second component signal provided in the embodiment of the present application.
Fig. 1 (c) shows a third state of a trace diagram formed by the first component signal and the second component signal provided in the embodiment of the present application.
Fig. 1 (d) shows a state four of a trace diagram formed by the first component signal and the second component signal provided in the embodiment of the present application.
Fig. 1 (e) shows a state five of a trace diagram formed by a first component signal and a second component signal provided in an embodiment of the present application.
Fig. 2 (a) shows a first process state of finding the center of an elliptical trajectory graph according to the "four-point correction method" provided in the embodiment of the present application.
Fig. 2 (b) shows a second process state of finding the center of the elliptical trajectory graph according to the "four-point correction method" provided in the embodiment of the present application.
Fig. 2 (c) shows a third process state of finding the center of the elliptical trajectory graph according to the "four-point correction method" provided in the embodiment of the present application.
Fig. 2 (d) shows a process state four of finding the center of an elliptical trajectory graph according to the "four-point correction method" provided in the embodiment of the present application.
Fig. 3 is a digital circuit schematic diagram of a four-point correction module according to an embodiment of the present application.
Fig. 4 is a flowchart of a signal error correction method according to an embodiment of the present application.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved by the present application more clear, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It will be understood that when an element is referred to as being "mounted" or "disposed" on another element, it can be directly on the other element or be indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or be indirectly connected to the other element.
It is to be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like indicate or are based on the orientation or positional relationship shown in the drawings, merely to facilitate description of the present application and simplify description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be configured and operated in a particular orientation, and therefore should not be construed as limiting the present application.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The application proposes a magnetic encoder comprising a magnetic sensor detecting a varying magnetic field generated at the magnetic sensor by a relative movement between the magnetic sensor and a magnetic medium and outputting a first component signal and a second component signal representing the magnetic field, and a signal processing circuit calculating an angle θ of rotation of the magnetic medium relative to the magnetic sensor according to a signal error trimming method. In some examples, the first and second component signals are a sine signal and a cosine signal, respectively, or the first and second component signals are a cosine signal and a sine signal, respectively. As an example, the structure and basic principle of the magnetic encoder of the present application can also be referred to the magnetic encoder disclosed in patent document CN114216486 a.
The magnetic medium may be any magnetic material that can generate a magnetic field, such as a magnet. A magnetic medium may be used as an example of a rotating member.
The magnetic encoder detects the changed magnetic signal by the magnetic sensor and supplies the detected magnetic signal to the signal processing circuit. The magnetic sensor may be a magnetic encoder capable of detecting a changing magnetic signal, such as a magneto-resistive effect sensor, a hall effect sensor, or the like. The magnetic sensor can be in the form of a packaged chip or in the form of a structure inside the chip. In some examples, the magnetic sensor and the signal processing circuit may be integrated together on the same chip, which may be referred to as a magnetic encoder, for short, a magnetic encoder. In other examples, the magnetic encoder may be present as a PCBA, and the magnetic sensor and signal processing circuitry are circuit devices on the PCBA.
The magnetic sensor provided in the present application can refer to the circuit structure disclosed in fig. 4 of patent document CN114459511a, which outputs a first component signal and a second component signal through two wheatstone bridges, respectively.
The magnetic sensor and the magnetic encoder provided in the present application can also be understood with reference to fig. 1, 2 and 3 of patent document CN114216486a and the corresponding description.
The application provides an optical encoder, which comprises an optical sensor and a signal processing circuit, wherein the signal processing circuit calculates the rotation angle of a rotating piece relative to the optical sensor according to a signal error trimming method. The structure and arrangement mode of the optical encoder can refer to the scheme of the magnetic encoder provided by the application, and also refer to the scheme of the existing optical encoder which is usually matched with a servo motor for use.
As for the signal error correction method proposed in the present application, the following description is mainly made by comparison with patent document CN 114910112B.
It is noted that the signal error correction method is applicable not only to magnetic encoders and optical encoders, but also to any other encoder that can detect the rotation angle of a rotating member, such as an angle sensor based on a change in capacitance, inductance or resistance.
The signal error correction method disclosed in patent document CN114910112B assumes that the first component signal and the second component signal output by the sensor are orthogonal to each other, i.e. the orthogonal errors of the two component signals are ignored, which is also feasible for application environments with less noise, and compared with the present application, the signal error correction method has relatively simple data calculation, high overall operation speed, and good market application prospects.
For an application scene with larger environmental noise and higher detection precision or reliability requirement, the quadrature error of the two component signals cannot be ignored, and the signal error trimming method provided by the application is necessary.
In order to obtain excellent operation speed, one embodiment of the application applies a hardware description language, and the signal error trimming method can realize operation of data through the hardware description language. It is understood that the signal error correction method may also implement the data operation in other manners. The hardware description language applied in the application can be VHDL (Very-High-Speed Integrated Circuit Hardware Description Language), and can also be other Hardware Description Languages (HDL) such as Verilog HDL and SystemVerilog, systemC. Compared with a microprocessor MCU, the hardware description language has the remarkable advantage of high operation speed. In terms of mathematical calculations, the hardware description language is very fast to implement additions and subtractions, but is slow to implement complex multiplications or divisions, which are slower to multiply, so the present application avoids complex division calculations as much as possible. It is also noted that the hardware description language is calculated by using shift operation to implement the division and multiplication of the exponent of 2, so the calculation speed of the division and multiplication of the exponent of 2 is also relatively fast.
The signal error trimming method provided by the application comprises the following steps:
initializing a first register, a second register, a third register and a fourth register, wherein the first register is used for registering x n The second register is used for registering x p A third register for registering y n A fourth register for registering y p
Collecting a first component signal and a second component signal output by a sensor, wherein the sampling value of the first component signal is x in The sampled value of the second component signal is y in Will x in And y in Inputting the four-point correction module to perform the following processing:
x in is x in1 And x in2 ,y in Is y in1 And y in2 ,x in1 And y is in1 For simultaneous sampling, x in2 And y is in2 For simultaneous sampling, let the intermediate variable x new =(x in1 +x in2 )/2,y new =(y in1 +y in2 )/2;
Calculating intermediate variable x 0 =(x n +x p )/2,y 0 =(y n +y p )/2;
If y in1 ≤y 0 ≤y in2 Or y in2 ≤y 0 ≤y in1 Then consider y in Traversing y 0
In y in Traversing y 0 In the case of (1), if x new ≤x 0 Then use x new Updating x n If x new >x 0 Then use x new Updating x p Then utilize the latest x n And x p Updating x 0
If x in1 ≤x 0 ≤x in2 Or x in2 ≤x 0 ≤x in1 Then consider x in Pass through x 0
At x in Pass through x 0 In the case of (1), if y new ≤y 0 Then utilize y new Updating y n If y new >y 0 Then utilize y new Updating y p Then utilize the latest y n And y p Updating y 0
Calculating intermediate variable K x =(x p -x n )/2,K y =(y p -y n )/2;
Continuous acquisition of x in And y in And inputting the four-point correction module to update x n 、x p 、x 0 、y n 、y p 、y 0 、K x 、K y And to x in And y in Performing first four-point correction:
x out = K y ·(x in -x 0 ),
y out = K x ·(y in -y 0 ),
wherein x is out For correction value of the first component signal, y out Is the correction value of the second component signal.
Referring to fig. 1, fig. 1 shows five different states of a trace plot formed by a first component signal and a second component signal.
Fig. 1 (a) shows a trace diagram with zero point error, amplitude error and orthogonal error, wherein the trace diagram is in an ellipse, the center of the ellipse deviates from the origin of coordinates, and the long axis of the ellipse forms a certain included angle with the x axis.
Fig. 1 (b) shows a trace diagram without zero error, with amplitude error, with quadrature error, the trace diagram presenting an ellipse centered at the origin of coordinates, the major axis of the ellipse forming an angle with the x-axis.
Fig. 1 (c) shows a trace with no zero error, no amplitude error, no quadrature error, the trace presenting an ellipse centered at the origin of coordinates with the major axis of the ellipse parallel to the x-axis.
Fig. 1 (d) shows a trace with zero error, no amplitude error, no quadrature error, the trace assuming a perfect circle with the center offset from the origin of coordinates.
Fig. 1 (e) shows a trace diagram without zero point error, amplitude error and quadrature error in an ideal state, the trace diagram is presented as a perfect circle, and the center is located at the origin of coordinates.
In a high noise environment, the trace diagram formed by the first component signal and the second component signal is shown in fig. 1 (a) before correction. In correcting the signal error using the signal error correction method provided in the present application, the trajectory graph generally follows the paths (a) - (b) - (c)/(d) - (e) shown in fig. 1.
For ease of description, x will be referred to herein in And y in The process of inputting the four-point correction module is called four-point correction, and the corresponding method is called four-point correction method.
After the first four-point correction, the zero point error is reduced, the trace is changed from fig. 1 (a) to fig. 1 (b), and the trace may still be substantially elliptical, but the center is relatively close to the origin of coordinates.
The signal error trimming method has the beneficial effects that: compared with the prior art, the four-point correction method adopted by the signal error correction method can overcome the quadrature error of two component signals of the sensor, gradually approaches the center of a track diagram formed by the two component signals, and obtains four reliable key values, so that the accurate zero point error correction is performed, and the higher angle detection precision is facilitated.
Referring to fig. 2, fig. 2 shows a process of finding the center of an elliptical trajectory graph according to the "four-point correction method".
Referring to fig. 2 (a), in the initial state, let x n =x p =x 0 ,y n =y p =y 0 . Initialized (x 0 ,y 0 ) May be any point within the ellipse. For example, when initializing each register, let x n =x p =y n =y p =0, i.e. x 0 =y 0 =0,(x 0 ,y 0 ) Is the origin of coordinates. At initialization, x can also be set to p About the amplitude of the first component signal, let x n About the negative of the amplitude of the first component signal, let y p About the amplitude of the second component signal, let y n About the negative of the amplitude of the second component signal, i.e. x 0 About the amplitude of the first component signal, y 0 About the amplitude of the second component signal, then (x 0 ,y 0 ) Near or coincident with the locus of the ellipse. Thereby, it is advantageous to let (x 0 ,y 0 ) Rapidly approaching the center of the ellipse. (x) new ,y new ) The points on the trace plot (assuming a clockwise movement) may be considered as a function of the sampling progress.
Referring to fig. 2 (b), y appears as the sampling progresses in1 ≤y 0 ≤y in2 Or y in2 ≤y 0 ≤y in1 At this time consider y in Traversing y 0 ,(x new ,y new ) For straight line y=y 0 Intersecting the left side of the ellipse. X is x p Unchanged by x new Updating x n . Ideally, x can be made to be n =x new The calculation is the simplest. Preferably, x is used new Updating x n By combining x new And x n And inputting the second filter for filtering. For noisy application environments, x in And y in Is very large, (x) new ,y new ) The jitter of (2) is also relatively large if x is directly set n =x new Unreliable detection results may be obtained. It is necessary to let x n Gently varying to obtain a more reliable detection result by combining x new And x n Input to a second filter for proceedingFiltering is implemented. Preferably, the filtering algorithm of the second filter is: x is x n(i+1) = x n(i) +(x new -x n(i) ) D; wherein i is a natural number, D is a parameter showing the filtering depth, and D is more than or equal to 1. Preferably, d=2 FN FN is the filter depth coefficient of the corresponding filter, so that the calculation of a digital circuit can be facilitated, and the data processing efficiency is improved. According to x p And new x n Calculate a new x 0 :x 0 =(x n +x p )/2. At this time, the straight line x=x 0 Closer to the centre of the ellipse.
Referring to fig. 2 (c), x appears as the sampling progresses in1 ≤x 0 ≤x in2 Or x in2 ≤x 0 ≤x in1 At this time consider x in Pass through x 0 ,(x new ,y new ) For straight line x=x 0 Intersecting the upper side of the ellipse. y is n Unchanged, by y new Updating y p . Ideally, y can be made to p =y new The calculation is the simplest. Preferably, y is used new Updating y p By combining y new And y p And inputting the third filter for filtering. For noisy application environments, x in And y in Is very large, (x) new ,y new ) The jitter of (2) is also relatively large if y is directly given p =y new Unreliable detection results may be obtained. It is necessary to let y p Gently varying to obtain a more reliable detection result by combining y new And y p And inputting the third filter for filtering. Preferably, the filtering algorithm of the third filter is: y is p(i+1) = y p(i) +(y new -y p(i) ) and/D. Preferably, d=2 FN . According to y n And new y p Calculate a new y 0 :y 0 =(y n +y p )/2. At this time, the straight line y=y 0 Closer to the centre of the ellipse.
Y will reappear with the sampling progress in Traversing y 0 ,(x new ,y new ) Is a straight line y=y 0 Intersecting the right side of the ellipse. X is x n Unchanged by x new Updating x p . Preferably, x is used new Updating x p By combining x new And x p The first filter is input for filtering. Preferably, the filtering algorithm of the first filter is: x is x p(i+1) = x p(i) +(x new -x p(i) ) and/D. Preferably, d=2 FN . According to x n And new x p Calculate a new x 0 :x 0 =(x n +x p )/2. At this time, the straight line x=x 0 Closer to the centre of the ellipse.
X will reappear with the sampling progress in Traversing x 0 ,(x new ,y new ) For straight line x=x 0 Intersecting the underside of the ellipse. y is p Unchanged, by y new Updating y n . Preferably, y is used new Updating y n By combining y new And y n And inputting the filtered signal to a fourth filter. Preferably, the filtering algorithm of the fourth filter is: y is n(i+1) = y n(i) +(y new -y n(i) ) and/D. Preferably, d=2 FN . According to y p And new y n Calculate a new y 0 :y 0 =(y n +y p )/2. At this time, the straight line y=y 0 Closer to the centre of the ellipse.
Please refer to fig. 2 (d), (x) 0 ,y 0 ) Gradually approaching the center of the trace plot.
Updating K x :K x =(x p -x n )/2;
Updating K y :K y =(y p -y n )/2。
For x in And y in Four-point correction is carried out:
x out = K y ·(x in -x 0 ),
y out = K x ·(y in -y 0 ),
thereby, the zero point error can be reduced.
Circularly calculating for several times (x) 0 ,y 0 ) The zero point error is smaller and smaller when the zero point error is closer to the center of the track diagram and closer to the origin of coordinates, so that the zero point error is corrected under the condition of orthogonal error, and higher detection precision is obtained.
In addition, for x in And y in When the first four-point correction is performed, the following steps can be further performed:
x out = K y ·(x in -x 0 )·K amp
y out = K x ·(y in -y 0 ) ·K amp
wherein K is amp Is a signal amplitude control coefficient and is used for preventing data from exceeding the maximum value which can be recorded by a storage unit in the calculation process to cause data overflow.
Further, K amp The value of (2) and 2/(K) x + K y ) The proportion of the change is varied and, or alternatively, the process may be performed,
K amp =A max /(K x ·K y ),A max =2 (M-1) m is x in Or y in Is a binary number of bits containing sign bits.
K amp May be used to control the strength of the signal. K (K) amp Varying within a certain range, e.g. 0.0001.ltoreq.K amp And less than or equal to 1, wherein the variation range is related to the intensity of the signal.
In some examples, K amp The value of (2) and 2/(K) x + K y ) Proportionally varying so that x when digitally stored out And y out No overflow occurs and the amplitude of the change is not too small. For example K amp =K·2/(K x + K y ) K is an adjustment coefficient. Preferably, 0.5.ltoreq.K.ltoreq.1.5.
In other examples, K amp =A max /(K x ·K y ),A max =2 (M-1) M is x in Or y in Is a binary number of bits containing sign bits. A is that max The maximum allowable overflow value of the input signal can be characterized. For example, x is represented by an 8-bit binary signed number in 、y in 、x out And y out I.e. m=8, the value range is-128 to 127, beyond which the number has no way of indicating (overflows).
Referring to fig. 3, the digital circuit shown in fig. 3 may be used to implement a "four-point correction method".
Will x in And y in Input crossing detection module, crossing detection module judges x in Whether or not to cross x 0 ,y in Whether or not to pass through y 0 . The crossing detection module may output enable signals ena_xp, ena_xn, ena_yp, ena_yn to control whether the first filter, the second filter, the third filter, and the fourth filter are enabled, respectively. The crossing detection module can also output x new To the first filter and the second filter, output y new To the third filter and the fourth filter.
If x new ≤x 0 Enabling the second filter while the first filter is not active if x new >x 0 Enabling the first filter and disabling the second filter;
if y new ≤y 0 Enabling the fourth filter while the third filter is not active if y new >y 0 The third filter is enabled and the fourth filter is disabled.
The first filter outputs a new x in the enabled state p To the second register to update x p
The second filter outputs a new x in the enabled state n To the first register to update x n
The third filter outputs a new y in the enabled state p To fourth register to update y p
The fourth filter outputs a new y in the enabled state n To the third register to update y n
New x n And x p Is used to calculate x 0 And k x
Novel y n And y p Is used to calculate y 0 And k y
New x 0 And y 0 And then is transmitted to a crossing detection module for judging x in Whether or not to cross x 0 ,y in Whether or not to pass through y 0
New x 0 、y 0 、k x 、k y And also is used to correct x in And y in Thereby obtaining x out And y out 。x out And y out And can also be used as new x in And y in Input to the crossing detection module to circularly calculate.
The four filters may be identical filters, for example, each may be a simplest first-order IIR filter that facilitates hardware implementation. The filter depth factor FN is generally an integer, the larger the value, the more stable the filter.
Referring to fig. 4, taking a magnetic encoder as an example, the magnetic sensor outputs two component signals x a And y a ,x a And y a Converted into x by ADC b And y b ,x b And y b Respectively correspond to the above x in And y in ,x b And y b Becomes x after the first four-point correction c And y c Will x c And y c The formed trace pattern is rotated 45 degrees to become x d And y d ,x d And y d And can also be used as x in And y in Inputting the four-point correction module to perform the second four-point correction, and finally outputting x e And y e 。x e And y e The angle θ can be obtained by the existing angle extraction method as an error correction result for the two component signals. The angle extraction method may be a CORDIC algorithm, or may be an angle extraction circuit disclosed in patent document CN114370814a, by which the angle θ is obtained.
I.e. at pair x in And y in After the first four-point correction, the trajectory graph formed by the first component signal and the second component signal is rotated 45 degrees clockwise or counterclockwise around the origin of coordinates. In forming the first component signal and the second component signalAfter the trace diagram rotates 45 degrees, the data of the first component signal and the second component signal are taken as new x in And y in And inputting the four-point correction module to perform the second four-point correction.
The trajectory graph is rotated 45 degrees, which is equivalent to the transformation of the trajectory graph from fig. 1 (b) to fig. 1 (c), and the quadrature error can be converted into the amplitude error, so that the zero point error and the amplitude error can be better removed by performing four-point correction, and the more accurate angle theta can be obtained.
Rotating the trajectory graph 45 degrees can be achieved by the following calculation.
The signal expressions containing various errors are:
where Δθ is half of the quadrature error, Δy and Δx are zero point errors of the two component signals, n y And n x Is a random variable that is mathematically expected to be 0, representing noise on both component signals.
The first four-point correction is carried out to obtain:
wherein K is c =k x · k y Or K c =k amp · k x · k y
Will x c 、y c The trajectory graph rotates 45 degrees anticlockwise around the origin of coordinates on the x/y graph, and the linear change is performed to obtain:
i.e.
Wherein, the liquid crystal display device comprises a liquid crystal display device,
mathematical calculations that rotate the trajectory graph by 45 degrees can also be considered as existing mathematical methods.
The magnetic encoder and the optical encoder provided by the application can overcome the signal error trimming method of the quadrature error, so that the magnetic encoder and the optical encoder can be applied to a high-noise environment and have higher angle detection precision.
The foregoing description of the preferred embodiments of the present application is not intended to be limiting, but is intended to cover any and all modifications, equivalents, and alternatives falling within the spirit and principles of the present application.

Claims (13)

1. The signal error trimming method is applied to detecting the rotation angle theta of the rotating member relative to the sensor and is characterized by comprising the following steps:
initializing a first register, a second register, a third register and a fourth register, wherein the first register is used for registering x n The second register is used for registering x p A third register for registering y n A fourth register for registering y p Wherein "x n ”、“x p "is two values on the first component signal that constitute the intermediate variable, and" y n ”、“y p "are two values on the second component signal that constitute the intermediate variable;
collecting a first component signal and a second component signal output by a sensor, wherein the sampling value of the first component signal is x in The sampled value of the second component signal is y in Will x in And y in Inputting the four-point correction module to perform the following processing:
x in is x in1 And x in2 ,y in Is y in1 And y in2 ,x in1 And y is in1 For simultaneous sampling, x in2 And y is in2 For simultaneous sampling, let the intermediate variable x new =(x in1 +x in2 )/2,y new =(y in1 +y in2 )/2;
Calculating intermediate variable x 0 =(x n +x p )/2,y 0 =(y n +y p )/2;
If y in1 ≤y 0 ≤y in2 Or y in2 ≤y 0 ≤y in1 Then consider y in Traversing y 0
In y in Traversing y 0 In the case of (1), if x new ≤x 0 Then use x new Updating x n If x new >x 0 Then use x new Updating x p Then utilize the latest x n And x p Updating x 0
If x in1 ≤x 0 ≤x in2 Or x in2 ≤x 0 ≤x in1 Then consider x in Pass through x 0
At x in Pass through x 0 In the case of (1), if y new ≤y 0 Then utilize y new Updating y n If y new >y 0 Then utilize y new Updating y p Then utilize the latest y n And y p Updating y 0
Calculating intermediate variable K x =(x p -x n )/2,K y =(y p -y n )/2;
Continuous acquisition of x in And y in And inputting the four-point correction module to update x n 、x p 、x 0 、y n 、y p 、y 0 、K x 、K y And to x in And y in Performing first four-point correction:
x out = K y ·(x in -x 0 ),
y out = K x ·(y in -y 0 ),
wherein x is out For correction value of the first component signal, y out Is the correction value of the second component signal.
2. The signal error correction method of claim 1, wherein:
at the time of initialization, let x n =x p =y n =y p =0; alternatively, let x p Let x be the amplitude of the first component signal n Let y be the negative of the amplitude of the first component signal p Let y be the amplitude of the second component signal n Is the negative of the amplitude of the second component signal.
3. The signal error correction method of claim 1, wherein:
for x in And y in When the first four-point correction is performed, the following steps are performed:
x out = K y ·(x in -x 0 )·K amp
y out = K x ·(y in -y 0 ) ·K amp
wherein K is amp Is a signal amplitude control coefficient and is used for preventing data from exceeding the maximum value which can be recorded by a storage unit in the calculation process to cause data overflow.
4. The signal error correction method of claim 3, wherein:
K amp the value of (2) and 2/(K) x + K y ) The proportion of the change is varied and, or alternatively, the process may be performed,
K amp =A max /(K x ·K y ),A max =2 (M-1) m is x in Or y in Is a binary number of bits containing sign bits.
5. The signal error correction method of claim 4, wherein:
K amp =K·2/(K x + K y ) K is more than or equal to 0.5 and less than or equal to 1.5, and K is an adjustment coefficient.
6. The signal error correction method of claim 1, wherein:
the utilization x new Updating x p By combining x new And x p Inputting a first filter for filtering; and/or the number of the groups of groups,
the utilization x new Updating x n By combining x new And x n Inputting a second filter for filtering; and/or the number of the groups of groups,
the utilization of y new Updating y p By combining y new And y p Inputting a third filter for filtering; and/or the number of the groups of groups,
the utilization of y new Updating y n By combining y new And y n And inputting the filtered signal to a fourth filter.
7. The signal error correction method of claim 6, wherein:
the filtering algorithm of the first filter is as follows: x is x p(i+1) = x p(i) +(x new -x p(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the second filter is as follows: x is x n(i+1) = x n(i) +(x new -x n(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the third filter is as follows: y is p(i+1) = y p(i) +(y new -y p(i) ) D; and/or the number of the groups of groups,
the filtering algorithm of the fourth filter is as follows: y is n(i+1) = y n(i) +(y new -y n(i) )/D;
Wherein i is a natural number, D is a parameter showing the filtering depth, and D is more than or equal to 1.
8. The signal error correction method of claim 7, wherein:
D=2 FN FN isThe filter depth coefficients of the corresponding filters.
9. The signal error correction method of claim 6, wherein:
x new is input to the first filter and the second filter, y new Is input to the third filter and the fourth filter;
if x new ≤x 0 Enabling the second filter while the first filter is not active if x new >x 0 Enabling the first filter and disabling the second filter;
if y new ≤y 0 Enabling the fourth filter while the third filter is not active if y new >y 0 The third filter is enabled and the fourth filter is disabled.
10. The signal error correction method according to any one of claims 1 to 9, characterized in that:
at the para-x in And y in After the first four-point correction, the trajectory graph formed by the first component signal and the second component signal is rotated 45 degrees clockwise or counterclockwise around the origin of coordinates.
11. The signal error correction method of claim 10, wherein:
after the trace graph formed by the first component signal and the second component signal is rotated by 45 degrees, the data of the first component signal and the second component signal are taken as new x in And y in And inputting the four-point correction module to perform secondary four-point correction.
12. A magnetic encoder, characterized by:
the magnetic encoder comprises a magnetic sensor and a signal processing circuit, wherein the signal processing circuit calculates the rotation angle of a rotating member capable of generating a magnetic field relative to the magnetic sensor according to the signal error trimming method of any one of claims 1 to 11.
13. An optical encoder, characterized by:
the optical encoder includes an optical sensor and a signal processing circuit that calculates an angle by which the rotary member rotates relative to the optical sensor according to the signal error correction method according to any one of claims 1 to 11.
CN202310642032.0A 2023-06-01 2023-06-01 Signal error correction method, magnetic encoder and optical encoder Active CN116358619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310642032.0A CN116358619B (en) 2023-06-01 2023-06-01 Signal error correction method, magnetic encoder and optical encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310642032.0A CN116358619B (en) 2023-06-01 2023-06-01 Signal error correction method, magnetic encoder and optical encoder

Publications (2)

Publication Number Publication Date
CN116358619A CN116358619A (en) 2023-06-30
CN116358619B true CN116358619B (en) 2023-08-08

Family

ID=86924014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310642032.0A Active CN116358619B (en) 2023-06-01 2023-06-01 Signal error correction method, magnetic encoder and optical encoder

Country Status (1)

Country Link
CN (1) CN116358619B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116892970B (en) * 2023-09-11 2023-11-14 泉州昆泰芯微电子科技有限公司 Method for judging stability of magnetic encoder based on timestamp register and motor

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852028A (en) * 2005-04-22 2006-10-25 三洋电机株式会社 Multibit delta sigma modulation da converter
CN102095552A (en) * 2010-12-03 2011-06-15 西安交通大学 Method for eliminating random error of signal phase
CN102252689A (en) * 2010-05-19 2011-11-23 北京国浩传感器技术研究院(普通合伙) Electronic compass calibration method based on magnetic sensor
CN104819716A (en) * 2015-04-21 2015-08-05 北京工业大学 Indoor and outdoor personal navigation algorithm based on INS/GPS (inertial navigation system/global position system) integration of MEMS (micro-electromechanical system)
CN110266232A (en) * 2019-06-20 2019-09-20 哈尔滨工业大学 Method and apparatus, motor servo system for the identification of motor servo system dynamic rotation inertia
DE102019214757A1 (en) * 2019-09-26 2021-04-01 Infineon Technologies Ag Device and method for determining whether an update of an offset register of a rotation angle sensor is to be carried out
CN112788984A (en) * 2018-05-03 2021-05-11 德克斯康公司 Automated analyte sensor calibration and error detection
CN114910112A (en) * 2022-07-15 2022-08-16 泉州昆泰芯微电子科技有限公司 Signal error correction method, magnetic encoder, and optical encoder
CN115090917A (en) * 2022-08-25 2022-09-23 成都飞机工业(集团)有限责任公司 Hole making method and device, storage medium and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10245686B3 (en) * 2002-09-30 2004-06-03 Advanced Micro Devices, Inc., Sunnyvale Phase error corrector and method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852028A (en) * 2005-04-22 2006-10-25 三洋电机株式会社 Multibit delta sigma modulation da converter
CN102252689A (en) * 2010-05-19 2011-11-23 北京国浩传感器技术研究院(普通合伙) Electronic compass calibration method based on magnetic sensor
CN102095552A (en) * 2010-12-03 2011-06-15 西安交通大学 Method for eliminating random error of signal phase
CN104819716A (en) * 2015-04-21 2015-08-05 北京工业大学 Indoor and outdoor personal navigation algorithm based on INS/GPS (inertial navigation system/global position system) integration of MEMS (micro-electromechanical system)
CN112788984A (en) * 2018-05-03 2021-05-11 德克斯康公司 Automated analyte sensor calibration and error detection
CN110266232A (en) * 2019-06-20 2019-09-20 哈尔滨工业大学 Method and apparatus, motor servo system for the identification of motor servo system dynamic rotation inertia
DE102019214757A1 (en) * 2019-09-26 2021-04-01 Infineon Technologies Ag Device and method for determining whether an update of an offset register of a rotation angle sensor is to be carried out
CN114910112A (en) * 2022-07-15 2022-08-16 泉州昆泰芯微电子科技有限公司 Signal error correction method, magnetic encoder, and optical encoder
CN115090917A (en) * 2022-08-25 2022-09-23 成都飞机工业(集团)有限责任公司 Hole making method and device, storage medium and equipment

Also Published As

Publication number Publication date
CN116358619A (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN116358619B (en) Signal error correction method, magnetic encoder and optical encoder
US10794752B2 (en) Direct-read meter capable of eliminating magnetic interference of adjacent rotating wheels
CN101836085B (en) Method and device for contactless sensing rotation and angular position using orientation tracking
US6943544B2 (en) Adjustment of a magneto-resistive angle sensor
JP6319601B1 (en) Angle sensor correction device and angle sensor
CN108627082B (en) Angle sensor system
CN114910112B (en) Signal error correction method, magnetic encoder, and optical encoder
CN105978570B (en) High-precision signal processing system of sine and cosine encoder
CN115290125B (en) Method for signal trimming by injecting random noise and magnetic encoder
CN112985325B (en) Position decoding method and device of sine and cosine encoder and computer readable medium
CN114216486A (en) Magnetic encoder and detection method thereof
CN107449355A (en) Angular transducer and its modification method and angular transducer system
TW201122974A (en) Touch detection device and method thereof.
CN106989762B (en) Encoder
CN101738495B (en) CORDIC algorithm-based capacitive micro-accelerometer signal detection device
CN105526954B (en) A kind of signal processing method of magnetoresistance transformer
CN105680858B (en) A method of estimation TIADC parallel acquisition system time offset errors
JP4340467B2 (en) Rotation angle sensor
CN106053884A (en) Double-shaft resonant accelerometer digital control circuit device based on coordinate rotation method
CN207543088U (en) Shaft angle signal conversion circuit and device
CN115355937A (en) Self-calibration method of magnetic encoder and motor
CN111368584A (en) Self-correcting high-resolution position information splicing method for sine and cosine encoder
CN109708664A (en) A kind of solid oscillation gyro frequency difference and dissipation angle detection circuit and its detection method
US5886520A (en) Position sensor having magnetic resistance effect devices for detecting a position of an object
JPS585610A (en) Detecting device for travelling direction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant