CN110296722B - Encoding method of magnetic encoder and magnetic encoder - Google Patents

Encoding method of magnetic encoder and magnetic encoder Download PDF

Info

Publication number
CN110296722B
CN110296722B CN201910573566.6A CN201910573566A CN110296722B CN 110296722 B CN110296722 B CN 110296722B CN 201910573566 A CN201910573566 A CN 201910573566A CN 110296722 B CN110296722 B CN 110296722B
Authority
CN
China
Prior art keywords
signal
sub
interval
quadrant
magnetic scale
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
CN201910573566.6A
Other languages
Chinese (zh)
Other versions
CN110296722A (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.)
Shanghai Kesi Automation Technology Co ltd
Original Assignee
Shanghai Kesi Automation 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 Shanghai Kesi Automation Technology Co ltd filed Critical Shanghai Kesi Automation Technology Co ltd
Priority to CN201910573566.6A priority Critical patent/CN110296722B/en
Publication of CN110296722A publication Critical patent/CN110296722A/en
Application granted granted Critical
Publication of CN110296722B publication Critical patent/CN110296722B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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
    • G01D5/249Mechanical 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 using pulse code

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)

Abstract

The embodiment of the invention discloses an encoding method of a magnetic encoder and the magnetic encoder, wherein the method comprises the following steps: determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision times of magnetic scales; and determining the encoding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating an encoding signal corresponding to the current magnetic scale. According to the embodiment of the invention, the high-precision interpolation algorithm is operated by the interpolation chip to read the recorded magnetic scale more finely, so that the displacement of the magnetic scale bar is divided more finely, and the resolution and the encoding precision of the encoder are improved.

Description

Encoding method of magnetic encoder and magnetic encoder
Technical Field
The embodiment of the invention relates to a signal processing technology, in particular to an encoding method of a magnetic encoder and the magnetic encoder.
Background
The encoder is an instrument for converting angular displacement or linear displacement into an electric signal or a digital signal, and is applied to various fields of automatic control. The magnetic encoder is one type of encoder, has the advantages of low price and low use environment requirement, can be used in the environments of dirt, dust, oil stain, condensation and other pollutants, but has the problem of low resolution in the existing magnetic encoders.
Disclosure of Invention
The invention provides an encoding method of a magnetic encoder and the magnetic encoder, which can effectively improve the stability of analog quantity waveforms, thereby improving the resolution and the data output speed of the encoder by utilizing a software and hardware interpolation algorithm.
In a first aspect, an embodiment of the present invention provides an encoding method of a magnetic encoder, which is performed by a magnetoresistive conversion chip in the magnetic encoder, and the method includes:
determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip;
determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision times of magnetic scales;
determining the coding interval of the target sub-quadrant interval according to the subdivision value of the magnetic scale bar of the target sub-quadrant interval;
and coding by adopting the coding interval of the target sub-quadrant interval, and outputting a coded signal.
In a second aspect, an embodiment of the present invention further provides a magnetic encoder, including a magnetic resistance conversion chip, where the magnetic resistance conversion chip includes:
the target sub-quadrant interval determining module is used for determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip;
the target sub-quadrant interval subdivision value determining module is used for determining a magnetic scale bar subdivision value of the target sub-quadrant interval according to a mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and a magnetic scale subdivision value of the first sub-quadrant interval or the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of magnetic scales;
the coding interval determining module is used for determining the coding interval of the target sub-quadrant interval according to the subdivision value of the magnetic scale bar of the target sub-quadrant interval;
and the coding module is used for coding by adopting the coding interval of the target sub-quadrant interval.
The embodiment of the invention subdivides the magnetic scale of the magnetic scale strip by using a tangent function method, divides a 2 pi signal period into 8 sub-quadrant intervals, and can determine the subdivision algorithm of other sub-quadrant intervals on the magnetic scale based on the determined subdivision algorithm of the first sub-quadrant interval and the second sub-quadrant interval on the magnetic scale and the corresponding relation of other sub-quadrant intervals and the first sub-quadrant interval and the second sub-quadrant interval, so as to obtain the subdivision value of the magnetic scale of the target sub-quadrant interval, and take the subdivision value of the magnetic scale of each sub-quadrant interval as the sampling rate for encoding the current magnetic scale, so as to finally obtain the encoding signal of the magnetic encoder and output the encoding signal. According to the embodiment of the invention, the written magnetic scale is read in a more detailed manner by running a high-precision interpolation algorithm through the interpolation chip, so that the MR magnetoresistive chip reads the magnetic scale according to a higher detailed value, namely, the displacement of the magnetic scale strip is divided in a more detailed manner, and the resolution and the encoding precision of the encoder are improved.
Drawings
FIG. 1 is a flow chart of an encoding method of a magnetic encoder according to a first embodiment of the present invention;
FIG. 2 is a flow chart of an encoding method of a magnetic encoder according to a second embodiment of the present invention;
FIG. 3 is a flow chart of an encoding method of a magnetic encoder according to a third embodiment of the present invention;
FIG. 4 is a flow chart of an encoding method of a magnetic encoder according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a magnetic encoder according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an encoding method of a magnetic encoder according to an embodiment of the present invention, where the method may be executed by the magnetic encoder, and specifically, may be executed by a magnetic resistance conversion chip in the magnetic encoder, as shown in fig. 1, where the method specifically includes the following steps:
s110, determining a target sub-quadrant interval to which the rotation angle belongs according to a sine signal and a cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip.
The sine signal and the cosine signal of the rotation angle of the magnetic scale bar are obtained through an MR magnetic induction chip. The target sub-quadrant interval refers to a quadrant interval to which the rotation angle of the magnetic scale bar belongs in the current signal period. When the magnetic scale strip is a linear magnetic strip, the rotation angle refers to the relative displacement between the magnetic strip and the central point of the MR magnetic induction chip; when the magnetic scale bar is a magnetic rotor, the rotation angle refers to the relative angle between the magnetic rotor (magnetic ring) and the central point of the MR magnetic induction chip. When the magnetic scale bar is displaced relative to the magnetic induction chip, a periodically changed rotation angle is generated.
And S120, determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval, and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of the magnetic scale.
The embodiment of the invention subdivides the displacement of the magnetic scale bar by a method for constructing a tangent function, wherein the tangent function is determined by the acquired sine signal and cosine signal.
The core of subdividing the displacement of the magnetic scale bar by constructing a tangent function method is to realize subdivision by utilizing a discrimination quadrant and table lookup. When the rotation angle is denoted by θ, the θ angle is a periodically changing angle regardless of the magnetic rotor type or linear magnetic stripe type encoder. Since the tangent function tan θ is a multi-valued function and the subdivision is performed for one signal period, it is necessary to process the subdivided value into a single-valued function in the phase angle range of 0 to 2 π. And because theta is at
Figure BDA0002111477520000041
Where tan θ is Asin θ/Acos θ greatly varies, when
Figure BDA0002111477520000042
In time, tan θ approaches infinity and cannot be calculated, so the first quadrant is subdivided into two parts:
Figure BDA0002111477520000043
and
Figure BDA0002111477520000044
thereby the period of 2 pi is arranged according to
Figure BDA0002111477520000045
The phase interval of the phase is divided into 8 sub-quadrant intervals, and the cycle period of each sub-quadrant interval is
Figure BDA0002111477520000051
Thus, a signal period is equally divided into 8 sub-quadrant intervals, because the cycle period is
Figure BDA0002111477520000052
Thus, the mapping relationship between the target sub-quadrant interval and the first and second sub-quadrant intervals is as follows:
carrying out amplitude subdivision on the third sub-quadrant interval, the fifth sub-quadrant interval and the seventh sub-quadrant interval according to a subdivision algorithm of the first sub-quadrant interval;
and the fourth sub-quadrant interval, the sixth sub-quadrant interval and the eighth sub-quadrant interval are subjected to amplitude subdivision according to a subdivision algorithm of the second sub-quadrant interval.
Through the corresponding relation, the algorithm of the subdivision values of the magnetic scale bar of other sub-quadrant intervals can be mapped to the first sub-quadrant interval or the second sub-quadrant interval, the subdivision values of the first sub-quadrant interval and the second sub-quadrant interval are determined according to the set subdivision formula, so that the subdivision algorithm of the magnetic scale bar of the target sub-quadrant interval can be obtained according to the algorithm of the subdivision values of the magnetic scale bar of the first sub-quadrant interval and the second sub-quadrant interval, and the subdivision value of the magnetic scale bar of the target sub-quadrant interval is further determined.
The fine value isThe magnetic scale is divided into a plurality of times, and the magnetic scale is recorded on the magnetic scale strip in advance by a magnet burning method according to a certain interval. Subdivision is the reading of pre-recorded magnetic scales at finer intervals. For example, the pre-recorded magnetic scale on the magnetic scale strip is 2mm, and the total amount of the magnetic scale is 28256, namely the interval between two adjacent magnetic scales is 2mm, and the magnetic scale strip has 256 magnetic scales in total, and the resolution of the magnetic encoder is 256 at this moment; the subdivision is to read the magnetic scale interval of 2mm more finely, for example, in the embodiment, since the signal period of 2 pi is divided into 8 sub-quadrant intervals, the signal period of 2 pi can be realized according to 210Is read, then the subdivision value is 2101024. Correspondingly, after subdivision, the resolution of the encoder is 28*210=218When 262144 is read, it is clear that the resolution of the magnetic encoder is greatly improved.
S130, determining the encoding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating an encoding signal corresponding to the current magnetic scale.
The encoding interval refers to a time interval for encoding by an encoder. For example, the encoder performs encoding according to a high-low level manner, where 1 represents a high level and 0 represents a low level, and the encoding interval is a time interval between the high level and the low level, i.e. a time interval between adjacent signals 1 and 0. After the subdivision value of the target sub-quadrant interval is obtained, the subdivision value of the current magnetic scale is determined, that is, the encoded signal of the current magnetic scale is determined. And then, combining the burning interval of the magnetic scale, the resolution of the magnetic encoder can be obtained.
The subdivision value of the magnetic scale bar of the target sub-quadrant interval is used as the coding interval of the current magnetic scale, so that the coding precision of each sub-quadrant interval is consistent with the subdivision precision of the magnetic scale bar of each sub-quadrant interval, and coding with higher resolution is realized.
In this embodiment, the encoded signal includes at least a two-channel signal, and an identification pulse signal,and the two-channel signal is an orthogonal pulse signal. Optionally, the encoded signal is a standard ABZ signal, wherein the phase difference between the a-phase signal and the B-phase signal is
Figure BDA0002111477520000061
Namely, the A-phase signal and the B-phase signal are orthogonal signals, and the Z signal is an identification signal and is used for determining the identification position.
Since the encoded signal is determined from the subdivision values of the target sub-quadrant interval with respect to the magnetic scale, the accuracy of the encoded signal is matched to the subdivision values of the magnetic scale bar. For example, in the above example, the subdivision value for the magnetic scale bar is 210The resolution ratio of hardware recording before combination subdivision is 28Obtaining a resolution of 2 after subdivision18262144, i.e., 262144 discrete code samples are output within one signal period.
According to the technical scheme, the magnetic scales of the magnetic scale strip are subdivided by using a tangent function method, a 2 pi signal period is divided into 8 sub-quadrant intervals, based on the determined subdivision algorithm of the first sub-quadrant interval and the second sub-quadrant interval on the magnetic scale strip and the corresponding relation between each other sub-quadrant interval and the first sub-quadrant interval and the second sub-quadrant interval, the subdivision algorithm of each other sub-quadrant interval on the magnetic scale strip can be determined, further, the subdivision value of the magnetic scales of the target sub-quadrant interval is obtained, each magnetic scale is encoded and output according to the obtained subdivision value, and finally, the encoding signal of the magnetic encoder is obtained. In the embodiment, the recorded magnetic scale is read in a more detailed manner by running a higher-precision algorithm through the interpolation chip, so that the MR magnetoresistive chip reads the magnetic scale according to a higher detailed value, namely, the displacement of the magnetic scale strip is divided more finely, and the resolution and the encoding precision of the encoder are improved.
Example two
Fig. 2 is a flowchart of an encoding method of a magnetic encoder according to a second embodiment of the present invention, which is optimized based on the above embodiments, and the method may be executed by the magnetic encoder, as shown in fig. 2, where the method specifically includes the following steps:
s210, taking one of the sine signal and the cosine signal as a reference signal, and performing amplitude compensation on the other one of the sine signal and the cosine signal by using an amplifying circuit to enable amplitude peak values of the sine signal and the cosine signal to be the same.
Because the sine signal and the cosine signal are basic signals for magnetic scale subdivision, if the two signals are irregular (the sine is not good) and the orthogonality between the two signals is not good, the subdivision precision of the magnetic scale is inevitably influenced. After the sine signal and the cosine signal are acquired, the two signals are shaped, specifically, in the embodiment, one signal is used as a reference signal through an amplifying circuit, and amplitude compensation is performed on the other signal, so that amplitude peak values of the two signals are the same, and the two signals have good sine properties.
S220, performing phase shift processing on the sine signal or the cosine signal after amplification processing through a resistance-capacitance comparison circuit to enable the phase difference between the sine signal and the cosine signal to be
Figure BDA0002111477520000071
Wherein, in order to obtain a sine signal and a cosine signal with strict orthogonality, namely, the phase difference is
Figure BDA0002111477520000081
The phase of the two signals needs to be determined by a phase-sensitive detection circuit, and if the phases of the two signals are not orthogonal, the phase shifting process is further performed, for example, a resistance-capacitance circuit is used to perform phase delay on one signal with a leading phase, so as to achieve the purpose of phase shifting.
And S230, performing anti-interference processing on the sine signal and/or the cosine signal after phase shifting processing to obtain a shaped sine signal and a shaped cosine signal.
The level fluctuation can cause subdivision errors of the magnetic scale, so that anti-interference processing needs to be performed on the signal, the anti-interference processing means that the processed level signal has anti-interference performance, and optionally, the level under a certain amplitude value can be selected as an effective signal from the amplitude angle of the signal, so that the fluctuation influence of the effective signal is reduced, and the anti-interference performance of the signal is realized.
S240, determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip.
The sine signal and the cosine signal are shaped signals, and the shaped sine signal and the shaped cosine signal have better sine property and phase orthogonality, so that the shaped sine signal and the shaped cosine signal are used as basic signals for magnetic scale subdivision, and subdivision errors of the magnetic scale can be reduced.
And S250, determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval, and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of the magnetic scale.
S260, determining the encoding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating an encoding signal corresponding to the current magnetic scale.
According to the technical scheme, before the sine signal and the cosine signal are used for determining the target sub-quadrant interval of the rotation angle, the obtained sine signal and the obtained cosine signal are shaped, so that the two signals have good signal sine performance and phase orthogonality, accurate basic signals are provided for subsequent calculation of fine values, fine errors of magnetic scale bars are reduced, and fine precision of the magnetic scale bars is accurate.
EXAMPLE III
Fig. 3 is a flowchart of an encoding method of a magnetic encoder according to a third embodiment of the present invention, which is optimized based on the foregoing embodiments, and the method may be executed by the magnetic encoder, as shown in fig. 3, where the method specifically includes the following steps:
and S310, obtaining the polarities of the shaped sine signal and the shaped cosine signal through a phase judging circuit.
The polarity of the sine signal or the cosine signal refers to the corresponding instantaneous polarity of the signal at a determined phase angle. The phase decision circuit can be a circuit with an exclusive-or function.
S320, obtaining the amplitude relation between the amplitude of the shaped sine signal and the amplitude relation between the shaped cosine signal through a comparison circuit.
The amplitude relationship refers to the magnitude relationship between the amplitudes of the two signals at the same phase angle, where the amplitude is an unsigned value.
S330, determining a target sub-quadrant interval to which the rotation angle belongs according to the polarity of the shaped sine signal, the polarity of the shaped cosine signal and the amplitude relation between the shaped sine signal and the shaped cosine signal.
It is known from the above embodiments that a 2 pi signal period is divided into 8 sub-quadrant intervals, and each sub-quadrant interval corresponds to a set of the polarity of a sine signal, the polarity of a cosine signal, and the magnitude relationship between the amplitudes of the sine signal and the cosine signal, so that the sub-quadrant interval to which the rotation angle belongs can be uniquely determined by the acquired relationship between the polarity of the sine signal, the polarity of the cosine signal, and the magnitudes of the amplitudes of the two signals. Specifically, see table one for the correspondence between the sub-quadrant intervals and the signal polarities.
Watch 1
sign(u1) sign(u2) |u1|-|u2| section
+ + <0 1
+ + >0 1
+ - >0 1
+ - <0 1
- - <0 1
- - >0 1
- + >0 1
- + <0 1
S340, determining a third signal according to the amplitude of the shaped sine signal and the amplitude of the shaped cosine signal, wherein if the amplitude of the shaped sine signal is greater than the amplitude of the shaped cosine signal, the third signal is an absolute value of a ratio of the shaped cosine signal to the shaped sine signal; otherwise, the third signal is an absolute value of a ratio of the shaped sine signal to the shaped cosine signal.
The amplitude of the sine signal or the cosine signal refers to the instantaneous amplitude of the signal, which is an unsigned value. By comparing the amplitudes of the two signals, the relative magnitude between the instantaneous amplitudes of the two signals can be determined.
The third signal refers to a signal constructed by a sine signal and a cosine signal, and specifically, the third signal is a tangent signal or a cotangent signal constructed by a sine signal and a cosine signal, wherein the tangent signal is considered to be at a phase angle
Figure BDA0002111477520000101
The phase angle of the quadrature and cotangent signals cannot be calculated at 0, so that at each phase
Figure BDA0002111477520000102
Within a phase angle range of
Figure BDA0002111477520000103
Is divided, wherein
Figure BDA0002111477520000104
In the phase interval of (3), the third signal being a cotangent signalAbsolute value, after
Figure BDA0002111477520000105
The third signal is the absolute value of the tangent signal in the phase interval (c).
And S350, if the third signal monotonically rises in the current sub-quadrant interval, summing the subdivision value of the magnetic scale bar in the target sub-quadrant interval with the subdivision constant corresponding to the target sub-quadrant interval to obtain the subdivision value of the magnetic scale bar in the target sub-quadrant interval.
And S360, if the third signal monotonically decreases in the current sub-quadrant interval, summing the subdivision value of the magnetic scale bar in the target sub-quadrant interval with the subdivision constant corresponding to the target sub-quadrant interval to obtain the subdivision value of the magnetic scale bar in the target sub-quadrant interval.
If the third signal monotonically rises in the current sub-quadrant interval, it indicates that the third signal is obtained from the constructed tangent signal, and the sub-quadrant interval to which the rotation angle belongs is an odd number, and at this time, the subdivision value of the first sub-quadrant interval and the subdivision constant of the target sub-quadrant interval are summed to obtain the subdivision value of the target sub-quadrant interval.
Correspondingly, if the third signal monotonically decreases in the current sub-quadrant interval, it indicates that the third signal is obtained from the constructed cotangent signal, and the sub-quadrant interval to which the rotation angle belongs is an even number at this time, and at this time, the subdivision value of the second sub-quadrant interval and the subdivision constant of the target sub-quadrant interval are summed to obtain the subdivision value of the target sub-quadrant interval.
The subdivision constant of the target sub-quadrant interval is determined according to the following formula:
Figure BDA0002111477520000111
wherein D iskAnd k is the subdivision constant of the target sub-quadrant, k is the serial number of the target sub-quadrant, and N is the number of scales contained in the magnetic scale bar.
The subdivision values of the magnetic scale bars of the first sub-quadrant interval and the second sub-quadrant interval are determined according to the following formula:
Figure BDA0002111477520000121
wherein, T is the subdivision value of the magnetic scale bar, and N is the number of the scales contained in the magnetic scale bar.
For example, when the target sub-quadrant interval is the fifth sub-quadrant interval, the sub-division value of the magnetic scale bar is determined by the following method:
T5=T1+D5wherein, T1Is a subdivision of the first sub-quadrant interval, D5Is a subdivision constant of the fifth sub-quadrant interval, which can be obtained according to equation (2),
Figure BDA0002111477520000122
as can be obtained from the equation (1),
Figure BDA0002111477520000123
accordingly, the number of the first and second electrodes,
Figure BDA0002111477520000124
namely the subdivision value of the fifth sub-quadrant interval to the magnetic scale.
And S370, determining the encoding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating an encoding signal corresponding to the current magnetic scale.
According to the technical scheme of the embodiment, the polarities of the sine signal and the cosine signal are judged through the phase judgment circuit, the amplitudes of the sine signal and the cosine signal are judged through the comparison circuit, a target sub-quadrant interval to which the rotation angle belongs is obtained, and then the subdivision value of the magnetic scale bar of the target sub-quadrant interval for the magnetic scale bar is calculated and obtained based on the subdivision value of the magnetic scale bar of the first sub-quadrant interval or the subdivision value of the magnetic scale bar of the second sub-quadrant interval through the corresponding relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval, so that the magnetic scale is accurately subdivided.
Example four
Fig. 4 is a flowchart of an encoding method of a magnetic encoder according to a fourth embodiment of the present invention, which is optimized based on the foregoing embodiments, and the method can be executed by the magnetic encoder, as shown in fig. 4, where the method specifically includes the following steps:
s410, determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip.
And S420, determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval, and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of the magnetic scale.
And S430, determining the encoding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating an encoding signal corresponding to the current magnetic scale.
S440, filtering and frequency-matching the coded signals, and outputting parallel signals meeting the bit width requirement.
Here, the parallel signal is an ABZ signal. The filtering process is to filter the noise signal according to the frequency requirement of the encoded signal to reduce the jitter of the output signal. The frequency-pair processing is to resample the output encoded signal at a finer encoding interval and output a finer encoded signal. For example, the interpolation chip has a subdivision value of 2 for the magnetic scale18262144, that is, for the number of the fine parts of the magnetic scale being 262144, the frequency processing is resampled at a sampling frequency of 4 times, which is equivalent to performing one-time upsampling on the basis of the original sampling interval, and at this time, the precision of the resampled code signal is 2201048576, i.e. 1048576 as the number of the magnetic scale subdivisions, it can be seen that the precision of the encoded signal is further improved after the frequency matching processing.
In this embodiment, the interpolation chip encodes the sine signal and the cosine signal at the same time, that is, the a-phase signal and the B-phase signal because the phase difference between the a-phase signal and the B-phase signal is
Figure BDA0002111477520000141
Therefore, when the frequency matching processing is carried out, the rising edge of the A-phase signal and the falling edge of the B-phase signal are respectively set as external interrupt trigger signals, namely quadruple frequency is operated, so that the frequency matching processing of the ABZ digital signal is completed.
S450, converting the parallel signals into serial signals, and outputting the serial signals as magnetic coding signals, wherein the output rate of the serial signals is set according to the receiving capacity of the lower computer.
The parallel coded signals are converted into serial signals to be output, so that the occupied bandwidth of the transmission signals is reduced, and the output rate and the anti-interference capability of the coded signals are improved. And the parallel signals are converted into serial signals, so that the number of lines for transmitting signals can be reduced, and the stability of the system can be improved. The converted digital signal is output to the upper-order using unit according to a set rate. In this embodiment, it is preferable to convert the parallel ABZ signal into an RS485 signal, and transmit the RS485 signal to the upper usage unit at a speed of 2.5 Mbps.
According to the technical scheme of the embodiment, the precision of the coded signal is improved by carrying out frequency-matching processing on the coded output signal, and the jitter of the output coded signal can be reduced by carrying out filtering processing on the coded signal; by converting the parallel coded signals into serial signals for output, the output rate of the signals can be improved, the bandwidth occupation of the signals can be reduced, and meanwhile, the stability of the system can be improved by outputting the serial coded signals.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a magnetic encoder according to a fifth embodiment of the present invention, as shown in fig. 5, the encoder includes a magnetic resistance conversion chip 520, an interpolation chip is disposed in the magnetic resistance conversion chip 520, and the interpolation chip includes:
the target sub-quadrant interval determining module is used for determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip;
the target sub-quadrant interval subdivision value determining module is used for determining a magnetic scale bar subdivision value of the target sub-quadrant interval according to a mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and a magnetic scale subdivision value of the first sub-quadrant interval or the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of magnetic scales;
the coding interval determining module is used for determining the coding interval of the target sub-quadrant interval according to the subdivision value of the magnetic scale bar of the target sub-quadrant interval;
and the coding module is used for coding by adopting the coding interval of the target sub-quadrant interval.
Optionally, the target sub-quadrant interval refinement value determining module specifically includes:
a third signal determining unit, configured to determine a third signal according to the amplitude of the shaped sine signal and the amplitude of the shaped cosine signal, where the third signal is an absolute value of a ratio of the shaped cosine signal to the shaped sine signal if the amplitude of the shaped sine signal is greater than the amplitude of the shaped cosine signal; otherwise, the third signal is the absolute value of the ratio of the shaped sine signal to the shaped cosine signal;
the first target sub-quadrant interval subdivision value determining unit is used for summing the subdivision value of the first sub-quadrant interval and the subdivision constant corresponding to the target sub-quadrant interval to obtain the subdivision value of the magnetic scale bar of the target sub-quadrant interval if the third signal monotonically rises in the current sub-quadrant interval;
and the second target sub-quadrant interval subdivision value determining unit is used for summing the subdivision value of the second sub-quadrant interval and the subdivision constant corresponding to the target sub-quadrant interval to obtain the magnetic scale bar subdivision value of the target sub-quadrant interval if the third signal monotonically decreases in the current sub-quadrant interval.
The encoder further comprises peripheral circuitry 530, the peripheral circuitry 530 comprising at least: an amplifying circuit, a comparing circuit, a phase judging circuit, a counting circuit and an A/D converting circuit, wherein,
the amplifying circuit is used for carrying out amplitude compensation on the sine signal or the cosine signal, so that the amplitude peak values of the sine signal and the cosine signal are the same.
The comparison circuit is used for determining the amplitude relation between the sine signal and the cosine signal processed by the amplification circuit.
The phase judging circuit is used for determining the polarity of the sine signal and the cosine signal.
The counting circuit is used for calculating the number of periods of the sine signal or the cosine signal.
The A/D conversion circuit is used for converting the shaped sine signal and the shaped cosine signal into a pulse signal of digital quantity according to the determined subdivision value of the magnetic scale.
The encoder further comprises: null sensor 510, filter 540, ABZ signal generator 550, and parallel-to-serial converter 560, wherein,
the null sensor 510 is used to acquire an origin signal or an identification signal of the sine signal and the cosine signal.
The filter 540 is used for filtering the encoded signal to eliminate or reduce jitter of the output signal.
The ABZ signal generator 550 is configured to perform frequency-matching processing on the filtered digital signal according to a set frequency-doubling relationship, and output a parallel signal with a bit width meeting a requirement.
Preferably, the parallel-serial converter 560 may select an FPGA (Field-Programmable Gate Array), sample and count the parallel ABZ signals in real time through the FPGA, convert the parallel ABZ signals into protocol digital signals, for example, RS485 signals, store the digital signals in a register, and output the serial signals to the upper-level using unit according to a set period.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (7)

1. An encoding method of a magnetic encoder, performed by a magneto-resistive switching chip in the magnetic encoder, the method comprising:
determining a sine signal and a cosine signal of a rotation angle of a magnetic scale bar, taking one of the sine signal and the cosine signal as a reference signal, and enabling amplitude peak values of the sine signal and the cosine signal to be the same through amplitude compensation;
amplifying the sine signal and the cosine signal, and enabling the phase difference between the sine signal and the cosine signal to be pi/2 through phase shifting;
determining a target sub-quadrant interval to which the rotation angle of the magnetic scale bar belongs, wherein the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip;
determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval, wherein the subdivision value is the subdivision times of magnetic scales;
determining the coding interval of the current magnetic scale according to the magnetic scale bar subdivision value of the target sub-quadrant interval, and generating a coding signal corresponding to the current magnetic scale;
and filtering and frequency-matching the coded signals, outputting parallel signals meeting the bit width requirement, converting the parallel signals into serial signals, and outputting the serial signals as magnetic coded signals.
2. The method according to claim 1, wherein the anti-interference level suppression is performed on the phase-shifted sine signal and/or cosine signal to obtain a shaped sine signal and a shaped cosine signal.
3. The method according to claim 2, wherein the determining the target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar comprises:
obtaining the polarity of the shaped sine signal and the shaped cosine signal through a phase judging circuit;
obtaining the amplitude relation between the amplitude of the shaped sine signal and the amplitude relation between the shaped cosine signal through a comparison circuit;
and determining a target sub-quadrant interval to which the rotation angle belongs according to the polarity of the shaped sine signal, the polarity of the shaped cosine signal and the amplitude relation between the shaped sine signal and the shaped cosine signal.
4. The method of claim 2, wherein determining the magnetic scale bar subdivision value of the target sub-quadrant interval according to the mapping relationship between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval, and the magnetic scale subdivision value of the first sub-quadrant interval or the magnetic scale subdivision value of the second sub-quadrant interval comprises:
determining a third signal according to the amplitude of the shaped sine signal and the amplitude of the shaped cosine signal, wherein if the amplitude of the shaped sine signal is greater than the amplitude of the shaped cosine signal, the third signal is an absolute value of a ratio of the shaped cosine signal to the shaped sine signal; otherwise, the third signal is the absolute value of the ratio of the shaped sine signal to the shaped cosine signal;
if the third signal monotonically rises in the current sub-quadrant interval, the subdivision value of the magnetic scale bar in the target sub-quadrant interval is obtained by summing the subdivision value of the first sub-quadrant interval and a subdivision constant corresponding to the target sub-quadrant interval;
and if the third signal monotonically decreases in the current sub-quadrant interval, summing the subdivision value of the second sub-quadrant interval and the subdivision constant corresponding to the target sub-quadrant interval to obtain the subdivision value of the magnetic scale bar of the target sub-quadrant interval.
5. The method of claim 4, wherein the subdivision constant corresponding to the target sub-quadrant interval is determined according to the following formula,
Figure FDA0003242091900000031
wherein D iskAnd k is the subdivision constant of the target sub-quadrant, k is the serial number of the target sub-quadrant interval, and N is the number of scales contained in the magnetic scale bar.
6. The method of claim 1, wherein the subdivision values of the magnetic scale bars of the first sub-quadrant interval and the second sub-quadrant interval are determined according to the following formula,
Figure FDA0003242091900000032
wherein, T is the subdivision value of the magnetic scale bar, and N is the number of the scales contained in the magnetic scale bar.
7. A magnetic encoder comprising a magnetoresistive conversion chip, the magnetoresistive conversion chip comprising:
the target sub-quadrant interval determining module is used for determining a target sub-quadrant interval to which the rotation angle belongs according to the sine signal and the cosine signal of the rotation angle of the magnetic scale bar; the rotation angle of the magnetic scale bar is the rotation angle of the magnetic scale bar relative to the magnetic induction chip;
the amplifying circuit is used for performing amplitude compensation on one signal of the sine signal and the cosine signal by taking the other signal as a reference signal so as to enable amplitude peak values of the sine signal and the cosine signal to be the same;
the resistance-capacitance comparison circuit is used for shifting the phase of the sine signal or the cosine signal to ensure that the phase difference between the sine signal and the cosine signal is pi/2;
the target sub-quadrant interval subdivision value determining module is used for determining a magnetic scale bar subdivision value of the target sub-quadrant interval according to a mapping relation between the target sub-quadrant interval and the first sub-quadrant interval or the second sub-quadrant interval and a magnetic scale subdivision value of the first sub-quadrant interval or the second sub-quadrant interval, wherein the subdivision value is the subdivision frequency of magnetic scales;
the coding interval determining module is used for determining the coding interval of the target sub-quadrant interval according to the subdivision value of the magnetic scale bar of the target sub-quadrant interval;
the coding module is used for coding by adopting the coding interval of the target sub-quadrant interval;
the ABZ signal generator is used for carrying out frequency-matching processing on the filtered digital signals according to a set frequency-doubling relation and outputting parallel signals conforming to bit width;
and the parallel-serial converter is used for converting the parallel signals into serial signals and outputting the serial signals as magnetic coding signals of the encoder.
CN201910573566.6A 2019-06-28 2019-06-28 Encoding method of magnetic encoder and magnetic encoder Active CN110296722B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910573566.6A CN110296722B (en) 2019-06-28 2019-06-28 Encoding method of magnetic encoder and magnetic encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910573566.6A CN110296722B (en) 2019-06-28 2019-06-28 Encoding method of magnetic encoder and magnetic encoder

Publications (2)

Publication Number Publication Date
CN110296722A CN110296722A (en) 2019-10-01
CN110296722B true CN110296722B (en) 2021-12-07

Family

ID=68029262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910573566.6A Active CN110296722B (en) 2019-06-28 2019-06-28 Encoding method of magnetic encoder and magnetic encoder

Country Status (1)

Country Link
CN (1) CN110296722B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109238688B (en) * 2018-08-31 2020-12-25 武汉船用机械有限责任公司 Rotation detection device and detection method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1092159A (en) * 1993-12-18 1994-09-14 常州第二电子仪器厂 The electronic fine-grained disposal route and the circuit thereof of grating signal in angle or the linear measure longimetry
WO2008015229A1 (en) * 2006-08-01 2008-02-07 Continental Teves Ag & Co. Ohg Sensor arrangement for the precise detection of relative movements between an encoder and a sensor
CN102111158A (en) * 2010-11-23 2011-06-29 广州数控设备有限公司 Device for subdividing sine signal and cosine signal of position sensor and coding data, and implementation method thereof
CN202041221U (en) * 2011-03-02 2011-11-16 西安交通大学 Subdividing device of sine/cosine encoder
CN102636127A (en) * 2012-04-26 2012-08-15 中国计量科学研究院 Trajectory tracking type interference signal counting and subdividing device and method
CN108375391A (en) * 2018-05-04 2018-08-07 苏州汇川技术有限公司 Cosine and sine signal processing method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1092159A (en) * 1993-12-18 1994-09-14 常州第二电子仪器厂 The electronic fine-grained disposal route and the circuit thereof of grating signal in angle or the linear measure longimetry
WO2008015229A1 (en) * 2006-08-01 2008-02-07 Continental Teves Ag & Co. Ohg Sensor arrangement for the precise detection of relative movements between an encoder and a sensor
CN102111158A (en) * 2010-11-23 2011-06-29 广州数控设备有限公司 Device for subdividing sine signal and cosine signal of position sensor and coding data, and implementation method thereof
CN202041221U (en) * 2011-03-02 2011-11-16 西安交通大学 Subdividing device of sine/cosine encoder
CN102636127A (en) * 2012-04-26 2012-08-15 中国计量科学研究院 Trajectory tracking type interference signal counting and subdividing device and method
CN108375391A (en) * 2018-05-04 2018-08-07 苏州汇川技术有限公司 Cosine and sine signal processing method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
莫尔条纹信号的1024细分;王作斌;《量子电子学》;19910331(第01期);第23-24页 *
莫尔条纹计算细分法的研究;纪刚等;《青岛大学学报(自然科学版)》;19950630(第02期);正文第1页第21行至第4页第4行以及附图1-3 *
高精度磁电编码器及其细分算法的研究;徐春明;《中国优秀硕士学位论文全文数据库 信息科技辑》;20140315(第03期);I135-279 *

Also Published As

Publication number Publication date
CN110296722A (en) 2019-10-01

Similar Documents

Publication Publication Date Title
JP5571700B2 (en) Position encoder device
US8179129B2 (en) Position/displacement measuring system with an encoded scale body
US6018318A (en) Method and apparatus for determining the phase angle in position transmitters with sinusoidal output signals
CN109696112B (en) Compact pseudo-random scale and readhead for inductive absolute position encoder
CN112117079B (en) Encoder magnet structure, encoder, motor, electrical equipment and vehicle
CN110296722B (en) Encoding method of magnetic encoder and magnetic encoder
US7352304B2 (en) Interpolation apparatus in encoder
KR20190033035A (en) Method and system for linear position sensing using magnetic sensors
US8271221B2 (en) Phase detection device and position detection device
CN111982164B (en) Multi-track sector positioning off-axis absolute value encoder
CN102636127A (en) Trajectory tracking type interference signal counting and subdividing device and method
CN111750906A (en) Magnetoelectric encoder
CN100535604C (en) Electronic fine-grained segmentation device and its method
EP0711974B1 (en) Interpolation pulse generating device
KR102589472B1 (en) Angle measurement system based on magnetic method measurement method therefor and the magnet for the measurement
CN114279472A (en) Signal processing method and circuit for incremental magnetoelectric encoder
CN212340274U (en) Magnetoelectric encoder
CN113447051B (en) Single code channel absolute position measuring device
CN114688978B (en) Sine wave subdivision method
WO2023028967A1 (en) Absolute position measurement device
JPH04136715A (en) Encoder
WO2023028966A1 (en) Single-code channel absolute position measurement apparatus
JP2008261786A (en) Absolute angle detector
KR20230065138A (en) Angle measurement system based on magnetic method and measurement method therefor
JP3047946B2 (en) Angular position signal generator for sine and cosine signals

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