CN115930763A - Displacement measurement method and device based on magnetic grid ruler - Google Patents

Displacement measurement method and device based on magnetic grid ruler Download PDF

Info

Publication number
CN115930763A
CN115930763A CN202211575438.3A CN202211575438A CN115930763A CN 115930763 A CN115930763 A CN 115930763A CN 202211575438 A CN202211575438 A CN 202211575438A CN 115930763 A CN115930763 A CN 115930763A
Authority
CN
China
Prior art keywords
magnetic
magnetic poles
displacement
angle position
displacement measurement
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.)
Granted
Application number
CN202211575438.3A
Other languages
Chinese (zh)
Other versions
CN115930763B (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.)
Churui Intelligent Technology Suzhou Co ltd
Original Assignee
Churui Intelligent Technology Suzhou 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 Churui Intelligent Technology Suzhou Co ltd filed Critical Churui Intelligent Technology Suzhou Co ltd
Priority to CN202211575438.3A priority Critical patent/CN115930763B/en
Publication of CN115930763A publication Critical patent/CN115930763A/en
Application granted granted Critical
Publication of CN115930763B publication Critical patent/CN115930763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/30Assessment of water resources

Landscapes

  • Measurement Of Length, Angles, Or The Like Using Electric Or Magnetic Means (AREA)

Abstract

The invention discloses a displacement measuring method and a device based on a magnetic grid ruler, which can accurately determine the number of intervals of a reading head passing between magnetic poles through two acquired orthogonal sinusoidal signals; meanwhile, on the basis of the traditional angle position, the displacement is calculated by combining the number of the magnetic poles passed by the reading head at different moments, so that the problem that sinusoidal signals generated by the movement of the reading head between the magnetic poles cannot be completely collected when the reading head moves at a high speed due to the limitation of the calculation speed during measurement of the traditional magnetic grid ruler can be solved, and the number of the intervals passed by the reading head between the magnetic poles cannot be accurately obtained, therefore, the accuracy and precision of displacement measurement can be greatly improved; in addition, the device provided by the invention can realize the localization of the reading head of the magnetic grid ruler, thereby avoiding the problem that the displacement measurement of the magnetic grid ruler can be realized only by using a foreign special measuring chip in the traditional technology, and reducing the displacement measurement cost.

Description

Displacement measurement method and device based on magnetic grid ruler
Technical Field
The invention belongs to the technical field of displacement measurement, and particularly relates to a displacement measurement method and device based on a magnetic grid ruler.
Background
The magnetic ruler measurement system is specially designed for linear displacement measurement, has the advantages of good economy and high efficiency, is particularly suitable for long-distance measurement, and is suitable for displacement measurement in severe environments such as oil stain, cutting chips, vibration and the like; the working principle of the magnetic grid ruler is as follows: when the reading head passes through each magnetic pole on the ruler, orthogonal sinusoidal signals can be generated on the magnetic sensor, and at the moment, the amplitude of the sinusoidal signals can be read through the AD converter, so that the angular position can be calculated based on the amplitude, and a displacement value can be obtained; however, the aforementioned displacement measurement based on the magnetic scale has the following disadvantages: due to the limitation of the calculation speed, when the reading head moves at a high speed, sinusoidal signals generated by the movement of the reading head between the magnetic poles cannot be acquired completely, so that the sinusoidal signals generated by the movement of the reading head between the magnetic poles are lost, the number of intervals passed by the reading head between the magnetic poles cannot be obtained completely, and finally, a large error exists in the displacement calculated based on the sinusoidal signals; therefore, in the field of magnetic grid ruler measurement, how to provide a displacement measurement method with high measurement accuracy has become a current research hotspot.
Disclosure of Invention
The invention aims to provide a displacement measuring method and device based on a magnetic grid ruler, which are used for solving the problems that in the prior art, due to the limitation of calculation speed, sinusoidal signals generated by the movement of a reading head between magnetic poles cannot be completely acquired when the reading head moves at a high speed, so that the number of intervals passed by the reading head between the magnetic poles cannot be completely acquired, and further, the displacement calculated based on the sinusoidal signals has larger errors.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, a displacement measurement method based on a magnetic scale is provided, which includes:
acquiring two paths of orthogonal sinusoidal signals generated by a magnetic grating ruler during displacement measurement, and performing waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
based on two orthogonal square wave signals, calculating the number of magnetic poles passed by a reading head on a magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment as the number of the first magnetic poles and the number of the second magnetic poles respectively, wherein the second moment is behind the first moment;
acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the second moment;
and calculating to obtain a displacement measurement result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position.
Based on the disclosure, the invention carries out waveform transformation on two paths of orthogonal sinusoidal signals generated on the magnetic grid ruler to obtain two orthogonal square wave signals, then, the invention calculates the number of magnetic poles passed by the reading head at two different moments based on the two orthogonal square wave signals, wherein the number of intervals divided between the two magnetic poles on the magnetic grid ruler is determined, so that after the number of the magnetic poles passed by the reading head at a certain moment is determined, the number of the interval steps passed by the reading head between the two magnetic poles is determined, if 10 intervals are arranged between the two magnetic poles, the reading head completely moves twice between the two magnetic poles, and the number of the interval steps passed by the reading head is 20; finally, the invention can calculate the displacement measurement result of the magnetic grid ruler according to the number of the magnetic poles passed by the reading head at different moments and the angle positions at different moments.
Through the design, the number of the magnetic poles passed by the reading head at different moments is determined by utilizing the two orthogonal sinusoidal signals on the magnetic grid ruler, so that the number of the intervals passed by the reading head between the magnetic poles can be accurately determined through the two acquired orthogonal sinusoidal signals; meanwhile, on the basis of the traditional angle position, the displacement is calculated by combining the number of the magnetic poles passed by the reading head at different moments, so that the problem that sinusoidal signals generated by the movement of the reading head between the magnetic poles cannot be completely collected when the reading head moves at a high speed due to the limitation of the calculation speed during the measurement of the traditional magnetic grid ruler can be solved, and the number of the intervals passed by the reading head between the magnetic poles cannot be accurately obtained, and therefore, the accuracy and precision of the displacement measurement can be greatly improved.
In one possible design, calculating the number of magnetic poles passed by the reading head on the magnetic scale at the first time comprises:
acquiring a signal waveform before a first moment in two orthogonal square wave signals to obtain two sampling square wave signals;
taking a high level and a low level in one of the two sampling square wave signals as counting standards, and counting rising edges and falling edges in the other sampling square wave signal of the two sampling square wave signals so as to obtain the counting times of the rising edges and the falling edges in the other sampling square wave signal after counting;
and summing the counting times of the rising edge and the falling edge to obtain the summation result as the number of the magnetic poles passed by the reading head on the magnetic grid ruler at the first moment.
Based on the disclosure, the invention uses the number of magnetic poles passed by the reading head at the first time as an example to explain the statistical method of the number of magnetic poles passed by the reading head, namely, firstly, a signal before the first time is intercepted from two orthogonal square wave signals to be used as two sampling square wave signals, then, the number of times of rising edges and falling edges in the other signal is counted by using the high-low level of one signal in the sampling square wave signals as a counting reference, and finally, the total number of times of the rising edges and the falling edges is added to be used as the number of magnetic poles passed by the reading head at the first time; in this embodiment, the high level and the low level are used as the counting criteria, and it is determined whether the number of rising edges is added or subtracted on the counted number of times every time the number of rising edges and the number of falling edges are counted, and similarly, the same is true for the falling edges; therefore, through the design, the number of the magnetic poles passed by the reading head at the first moment can be determined, and the number of the intervals passed between the two magnetic poles at the first moment can be accurately obtained.
In one possible design, the calculating the displacement measurement result of the magnetic scale based on the number of the first magnetic poles, the number of the second magnetic poles, the first angular position, and the second angular position includes:
judging whether the difference value between the number of the second magnetic poles and the number of the first magnetic poles is equal to 0 or not;
if so, judging whether the second angle position is larger than the first angle position;
if so, subtracting the first angular position from the second angular position to obtain a displacement measurement result of the magnetic grid ruler, otherwise, subtracting the second angular position from the first angular position to obtain the displacement measurement result of the magnetic grid ruler.
In one possible design, if the difference between the number of the second magnetic poles and the number of the first magnetic poles is greater than 0, the method further includes:
judging whether the first angle position is larger than a preset threshold value or not and whether the second angle position is smaller than the preset threshold value or not;
if so, calculating according to the following formula (1) to obtain a displacement measurement result of the magnetic grid ruler, otherwise, calculating according to the following formula (2) to obtain a displacement measurement result of the magnetic grid ruler;
Figure BDA0003989259890000031
Figure BDA0003989259890000032
in the above equations (1) and (2), pos represents a displacement measurement result of the magnetic Scale, scale represents a displacement coefficient, CNT2 represents the number of second magnetic poles, CNT1 represents the number of first magnetic poles, AP2 represents a second angular position, AP1 represents a first angular position, and [ ] represents a rounding operation.
In one possible design, if the difference between the number of the second magnetic poles and the number of the first magnetic poles is less than 0, the method further includes:
judging whether the first angle position is smaller than a preset threshold value or not, and whether the second angle position is larger than the preset threshold value or not;
if so, calculating according to the following formula (3) to obtain a displacement measurement result of the magnetic grid ruler, otherwise, calculating according to the following formula (4) to obtain a displacement measurement result of the magnetic grid ruler;
Figure BDA0003989259890000041
Figure BDA0003989259890000042
in the above equations (3 and (4), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the number of second magnetic poles, CNT1 represents the number of first magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ ] represents the rounding operation.
In one possible design, after obtaining the displacement measurement result of the magnetic scale, the method further includes:
obtaining a displacement direction based on the number of the first magnetic poles, the number of the second magnetic poles, the first angular position and the second angular position;
and generating a displacement pulse signal according to the displacement direction and the displacement measurement result.
In a second aspect, there is provided a displacement measuring device based on a magnetic scale, comprising:
the signal acquisition unit is used for acquiring two paths of orthogonal sinusoidal signals generated by the magnetic grid ruler during displacement measurement;
the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
the displacement measuring unit is used for calculating the number of magnetic poles passed by a reading head on the magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment based on two orthogonal square wave signals to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles, wherein the second moment is behind the first moment;
the displacement measuring unit is used for acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the second moment;
and the displacement measuring unit is also used for calculating to obtain a displacement measuring result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position.
In one possible design, the signal acquisition unit includes: the operational amplifier comprises a first operational amplifier circuit and a second operational amplifier circuit, wherein the first operational amplifier circuit and the second operational amplifier circuit both comprise LTC6087 type operational amplifiers;
for the first operational amplifier circuit, the positive phase input end and the negative phase input end of the LTC6087 type operational amplifier are respectively electrically connected with the first path of signal output end of the magnetic grid ruler through a first resistor, and are used for acquiring a path of orthogonal sine initial signal output by the magnetic grid ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for performing signal amplification on the path of orthogonal sine initial signal to obtain a path of orthogonal sine signal, and outputting the path of orthogonal sine signal to the displacement measuring unit;
for the second operational amplifier circuit, the normal phase input end and the reverse phase input end of LTC6087 type operational amplifier are respectively connected through a second resistance electricity the second way signal output end of magnetic grid ruler for obtain another way quadrature sine initial signal of magnetic grid ruler output, LTC6087 type operational amplifier's output electricity is connected displacement measurement unit is used for with another way quadrature sine initial signal carries out signal amplification, obtains another way quadrature sine signal, and output extremely displacement measurement unit.
In one possible design, the displacement measurement unit adopts a CW32F030F8 type processing chip and a peripheral circuit thereof, wherein the CW32F030F8 type processing chip is electrically connected with output ends of two LTC6087 type operational amplifiers, and is used for performing waveform conversion on two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
the CW32F030F8 type processing chip is used for calculating the number of magnetic poles passed by a reading head on the magnetic grating ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment based on two orthogonal square wave signals, and the numbers are respectively used as the number of first magnetic poles and the number of second magnetic poles;
the CW32F030F8 type processing chip is further configured to acquire the first angular position and the second angular position, and calculate a displacement measurement result of the magnetic scale based on the number of the first magnetic poles, the number of the second magnetic poles, the first angular position, and the second angular position.
In one possible design, the CW32F030F8 processing chip is further configured to derive a displacement direction based on the number of first magnetic poles, the number of second magnetic poles, the first angular position, and the second angular position, and the apparatus further includes: a power supply unit and a differential output unit;
the differential output unit adopts an AM26C31 type differential driving chip, wherein the AM26C31 type differential driving chip is electrically connected with the CW32F030F8 type processing chip and is used for generating a displacement pulse signal according to a displacement measurement result and a displacement direction output by the CW32F030F8 type processing chip;
the power supply unit adopts an MPM3506A synchronous rectification step-down chip, wherein the input end of the MPM3506A synchronous rectification step-down chip is electrically connected with a power supply, and the output end of the MPM3506A synchronous rectification step-down chip is electrically connected with the power supply end of the CW32F030F8 type processing chip, the power supply end of the AM26C31 type differential driving chip and the power supply ends of the two LTC6087 type operational amplifiers respectively.
Based on the disclosure, the displacement measuring device disclosed by the invention is composed of chips made in China, so that the localization of the magnetic grating ruler reading head can be realized, the problem that the displacement measurement of the magnetic grating ruler can be realized only by using a foreign special measuring chip (namely a Hans chip) in the traditional technology is solved, and therefore, the cost of the whole hardware device can be greatly reduced, the displacement measurement cost is reduced, and the displacement measuring device is suitable for large-scale application and popularization.
In a third aspect, another displacement measuring apparatus based on a magnetic scale is provided, which takes an apparatus as an electronic device as an example, and includes a memory, a processor and a transceiver, which are sequentially connected in communication, where the memory is used to store a computer program, the transceiver is used to transmit and receive messages, and the processor is used to read the computer program and execute the displacement measuring method based on a magnetic scale as described in the first aspect or any one of the possible designs of the first aspect.
In a fourth aspect, there is provided a storage medium having stored thereon instructions for performing the magnetic scale-based displacement measurement method as described in the first aspect or any one of the possible designs of the first aspect when the instructions are run on a computer.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the magnetic scale-based displacement measurement method as described in the first aspect or any one of the possible designs of the first aspect.
Has the advantages that:
(1) The number of the magnetic poles passed by the reading head at different moments is determined by utilizing two orthogonal sinusoidal signals on the magnetic grid ruler, so that the number of the intervals passed by the reading head between the magnetic poles can be accurately determined by the two acquired orthogonal sinusoidal signals; meanwhile, on the basis of the traditional angle position, the displacement is calculated by combining the number of the magnetic poles passed by the reading head at different moments, so that the problem that sinusoidal signals generated by the movement of the reading head between the magnetic poles cannot be completely collected when the reading head moves at a high speed due to the limitation of the calculation speed during the measurement of the traditional magnetic grid ruler can be solved, and the number of the intervals passed by the reading head between the magnetic poles cannot be accurately obtained, and therefore, the accuracy and precision of the displacement measurement can be greatly improved.
(2) The displacement measuring device disclosed by the invention is completely composed of domestic chips, so that the localization of the magnetic grid ruler reading head can be realized, and the problem that the displacement measurement of the magnetic grid ruler can be realized only by using a foreign special measuring chip (namely a Hans chip) in the traditional technology is solved, so that the cost of the whole hardware device can be greatly reduced, the displacement measuring cost is reduced, and the displacement measuring device is suitable for large-scale application and popularization.
Drawings
Fig. 1 is a schematic flow chart illustrating steps of a displacement measurement method based on a magnetic scale according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of two orthogonal sinusoidal signals provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of two orthogonal square wave signals provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a forward pulse signal according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an inverted pulse signal according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a displacement measuring device based on a magnetic scale according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a specific circuit structure of a signal acquisition unit according to an embodiment of the present invention;
FIG. 8 is a specific circuit diagram of a CW32F030F8 type processing chip according to an embodiment of the present invention;
FIG. 9 is a circuit diagram of the periphery of a first portion of a CW32F030F8 type processing chip according to an embodiment of the present invention;
FIG. 10 is a peripheral circuit diagram of a second portion of a CW32F030F8 type processing chip according to an embodiment of the present invention;
fig. 11 is a specific circuit diagram of an AM26C31 type differential driver chip according to an embodiment of the present invention;
fig. 12 is a specific circuit diagram of an MPM3506A synchronous rectification buck chip according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly described below with reference to the accompanying drawings and the embodiments or the description in the prior art, it is obvious that the following description of the structure of the drawings is only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts. It should be noted that the description of the embodiments is provided to help understanding of the present invention, but the present invention is not limited thereto.
It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of example embodiments of the present invention.
It should be understood that, for the term "and/or" as may appear herein, it is merely an associative relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, B exists alone, and A and B exist at the same time; for the term "/and" as may appear herein, which describes another associative object relationship, it means that two relationships may exist, e.g., a/and B, may mean: a exists independently, and A and B exist independently; in addition, for the character "/" that may appear herein, it generally means that the former and latter associated objects are in an "or" relationship.
Example (b):
referring to fig. 1 to 5, in the displacement measurement method based on a magnetic grid ruler provided in this embodiment, two orthogonal sinusoidal signals generated by the magnetic grid ruler are used to count the number of magnetic poles passed by a reading head at different times, and then, on the basis of a conventional angular position, the number of magnetic poles passed by the reading head at different times is combined to calculate the displacement, so that the method can avoid the problem that the number of intervals passed by the reading head between the magnetic poles cannot be accurately obtained when the conventional magnetic grid ruler is used for measurement, thereby improving the accuracy and precision of displacement measurement; in the present embodiment, the method may be, but is not limited to, operated on the displacement measuring end side of the magnetic scale, and it is understood that the foregoing executing body does not constitute a limitation to the embodiments of the present application, and accordingly, the operation steps of the method may be, but are not limited to, as shown in the following steps S1 to S4.
S1, acquiring two paths of orthogonal sinusoidal signals generated by a magnetic grating ruler during displacement measurement, and performing waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals; when the magnetic grating ruler works, in the process that a reading head on the magnetic grating ruler moves between two magnetic poles, two paths of orthogonal sine initial signals are generated on a magnetic sensor inside the magnetic grating ruler, at the moment, the two paths of orthogonal sine initial signals can be collected, and after the signals are amplified, two paths of orthogonal sine signals can be obtained; referring to fig. 2, vo1 in fig. 2 is a first orthogonal sinusoidal signal, vo2 is a second orthogonal sinusoidal signal, and as can be seen from fig. 2, the abscissa of the first orthogonal sinusoidal signal is time, and the ordinate of the second orthogonal sinusoidal signal is a voltage value; then, the calculation of the angle position and the statistics of the number of magnetic poles can be carried out based on the two orthogonal sine signals; in this embodiment, for example, but not limited to, a comparator may be used to shape two paths of orthogonal sinusoidal signals into orthogonal square wave signals, and a graph of the converted square wave signals may be as shown in fig. 3 (Vo 11 represents a square wave signal converted from a first path of orthogonal sinusoidal signals, and Vo12 represents a square wave signal converted from a second path of orthogonal sinusoidal signals); of course, a processing chip with a comparator function may also be used to implement the signal conversion, and the specific components used may be specifically set according to actual use, which is not limited to the foregoing examples.
After the two orthogonal square wave signals are obtained, the number of magnetic poles passed by the reading head at different times can be counted based on the two orthogonal square wave signals, wherein the counting process of the number of magnetic poles is as shown in the following step S2.
S2, based on two orthogonal square wave signals, calculating the number of magnetic poles passed by a reading head on the magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles, wherein the second moment is after the first moment; in this embodiment, since the number of intervals divided between the two magnetic poles on the magnetic scale is determined, when the number of magnetic poles passed by the head at a certain time is determined, it corresponds to the number of intervals passed between the two magnetic poles when the head is determined at that time; if 10 intervals are arranged between the two magnetic poles, and the number of the magnetic poles passed by the reading head at the first moment is 2, the reading head moves once completely between the two magnetic poles, and the number of the passing interval steps is 10; similarly, when the number of the magnetic poles that the reading head experiences at the first moment is 4, the reading head moves between the two magnetic poles completely for 2 times, and at this time, the number of the passing interval steps is 20, and of course, the corresponding meanings of the number of the other different magnetic poles are also the same, and the description is omitted here.
In the present embodiment, since the principle of the calculation method of the number of magnetic poles passed by the head is the same at different times, the following description will be made in detail by taking the first time as an example, as shown in steps S21 to S23 below.
S21, acquiring a signal waveform before a first moment in the two orthogonal square wave signals to obtain two sampling square wave signals; in specific application, it is equivalent to intercept a signal waveform before the first time from the two orthogonal square wave signals, so as to serve as a sampling square wave signal, and of course, the sampling time (i.e. the first time and the second time) may be specifically set according to actual use, which is not specifically limited herein.
After the signal waveform before the first time is extracted, the number of magnetic poles passed by the head at the first time can be counted using the extracted signal, as shown in steps S22 and S23 below.
S22, taking a high level and a low level in one of the two sampling square wave signals as counting standards, and counting the rising edge and the falling edge in the other sampling square wave signal of the two sampling square wave signals to obtain the counting times of the rising edge and the falling edge in the other sampling square wave signal after counting; in this embodiment, the principle of counting the number of rising edges and falling edges in one sampled square wave signal by using the high and low levels of the other sampled square wave signal as the counting standard is as follows: the high and low levels are used for determining the counting signs of the rising edge times and the falling edge times, namely when one sampling square wave signal is at the high level, if the other sampling square wave signal corresponds to the rising edge, the rising edge times are added with 1 to the total times counted before; when one sampling square wave signal is at low level, if the other sampling square wave signal is correspondingly at rising edge, the rising edge frequency is reduced by 1 from the total frequency counted before; similarly, the principle of the low level is the same, and is not described herein again.
After the total number of rising edges and falling edges in another sampled square wave signal is counted based on the counting method provided in the foregoing step S22, the total number of times counted by the two is added, so that the number of magnetic poles passed by the reading head at the first time can be obtained, as shown in the following step S23.
S23, summing the counting times of the rising edge and the falling edge so as to take the summation result as the number of magnetic poles passed by the reading head on the magnetic grid ruler at the first moment; in this embodiment, the statistical method of the number of magnetic poles passed by the reading head at the second time is the same as the statistical method at the first time, and is not described herein again.
Therefore, through the design, the number of the magnetic poles passed by the reading head can be determined by counting the number of the magnetic poles passed by the reading head, so that the problem that the number of the intervals passed by the reading head between the magnetic poles cannot be completely obtained due to the fact that the sinusoidal signals generated by the movement of the reading head between the magnetic poles cannot be completely acquired when the reading head moves at a high speed due to the limitation of the traditional technology on the calculation speed can be solved.
After the number of the magnetic poles passed by the reading head at two different moments is obtained, the displacement measurement result of the magnetic grid ruler between the first moment and the second moment can be calculated by combining the angle positions of the reading head at the two different moments, wherein the calculation process is as shown in the following steps S3 and S4.
S3, acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the second moment; in this embodiment, for different time instants, the angular position of the reading head can be calculated according to, but not limited to, the amplitudes corresponding to the two orthogonal sinusoidal signals at two different time instants, and the specific calculation process is as follows:
taking a first Angle position as an example, firstly, obtaining the amplitude of two orthogonal sinusoidal signals at a first moment, and then calculating an Angle value by using a CORDIC (Coordinate Rotation Digital Computer) algorithm; in this embodiment, the CORDIC algorithm is a fast algorithm proposed by j.volder in 1959, and this algorithm can calculate a commonly used trigonometric function value only by using shift and addition and subtraction operations, and the calculation of the trigonometric function is easily realized on a simple device lacking a hardware multiplier (for example, a single chip microcomputer or an FPGA without a floating point arithmetic unit), which is a commonly used algorithm for calculating an angle value in the field of displacement measurement of a magnetic scale; after obtaining the corresponding angle value at the first time, the first angle position can be calculated according to the following formula (5):
Figure BDA0003989259890000111
in the above equation (5), AP1 represents the first angular position, angle1 represents the corresponding angular value at the first time, and Scale represents the displacement coefficient, which is a preset value and can be determined according to the magnetic pole pitch and the reading head precision.
Thus, the angular position of the reading head at the first moment can be calculated by the formula (5); of course, the angular position of the reading head at the second time may be obtained by substituting the value corresponding to the second time into the formula (5), and the calculation principle is the same as the example described above, which is not described herein again.
After the angular positions of the reading head at the two different moments are obtained, the number of the magnetic poles passed by the reading head at the two different moments can be combined to calculate the displacement measurement result of the magnetic grid ruler, as shown in the following step S4.
S4, calculating to obtain a displacement measurement result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position; in specific application, different displacement calculation formulas are determined according to the difference value between the number of the second magnetic poles and the number of the first magnetic poles, and the displacement calculation formulas are respectively shown in the following steps S41 to S47.
S41, judging whether the difference value between the number of the second magnetic poles and the number of the first magnetic poles is equal to 0; in the specific application, it is determined whether CNT2-CNT1 is equal to 0, and if yes, the two-angle position is determined, as shown in the following step S42.
And S42, if so, judging whether the second angle position is larger than the first angle position.
S43, if so, subtracting the first angle position from the second angle position to obtain a displacement measurement result of the magnetic grid ruler, otherwise, subtracting the second angle position from the first angle position to obtain a displacement measurement result of the magnetic grid ruler; in this embodiment, if the second angular position is greater than the first angular position, it indicates that the displacement direction is a forward direction, that is, forward movement, and at this time, the displacement measurement result can be obtained by subtracting the first angular position from the second angular position; otherwise, if the second angular position is smaller than the first angular position, the displacement direction is the reverse direction, that is, the displacement is in the reverse direction, and at this time, the second angular position is subtracted from the first angular position, so that the displacement measurement result can be obtained.
In this embodiment, if the difference between the number of the second magnetic poles and the number of the first magnetic poles is greater than 0, it indicates that the displacement direction is a forward direction, and at this time, the following steps S44 and S45 are adopted to calculate the displacement measurement result.
S44, judging whether the first angle position is larger than a preset threshold value or not, and whether the second angle position is smaller than the preset threshold value or not; in a specific application, the preset threshold may be, but is not limited to:
Figure BDA0003989259890000121
as such, based on the aforementioned determination conditions, the present embodiment discloses the position calculation methods corresponding to the cases where the aforementioned conditions are satisfied and the aforementioned conditions are not satisfied, as shown in step S45 below.
And S45, if so, calculating to obtain a displacement measurement result of the magnetic grid ruler according to the following formula (1), otherwise, calculating to obtain the displacement measurement result of the magnetic grid ruler according to the following formula (2).
Figure BDA0003989259890000122
Figure BDA0003989259890000123
/>
In the above equations (1) and (2), pos represents a displacement measurement result of the magnetic Scale, scale represents a displacement coefficient, CNT2 represents the number of second magnetic poles, CNT1 represents the number of first magnetic poles, AP2 represents a second angular position, AP1 represents a first angular position, and [ ] represents a rounding operation.
Similarly, if the difference between the number of the second magnetic poles and the number of the first magnetic poles is less than 0, it indicates that the displacement direction is the reverse direction, and at this time, the following steps S46 and S47 are required to calculate the displacement measurement result.
S46, judging whether the first angle position is smaller than a preset threshold value or not, and whether the second angle position is larger than the preset threshold value or not.
And S47, if so, calculating according to the following formula (3) to obtain a displacement measurement result of the magnetic grid ruler, otherwise, calculating according to the following formula (4) to obtain the displacement measurement result of the magnetic grid ruler.
Figure BDA0003989259890000124
Figure BDA0003989259890000131
With the above design, the displacement measurement result of the magnetic scale can be calculated based on the steps S41 to S47.
In addition, in the present embodiment, after the displacement measurement result is calculated, the displacement pulse signal may be generated based on the displacement direction, as shown in steps S5 and S6 described below.
S5, obtaining a displacement direction based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position; in specific applications, the process of determining the displacement direction may refer to the foregoing steps S41 to S47, which are not described herein again.
S6, generating a displacement pulse signal according to the displacement direction and the displacement measurement result; in a specific application, the displacement measurement result and the displacement direction can be input into the orthogonal encoder, so that corresponding data is output to the data register, and a corresponding pulse waveform is output based on the data register; in this embodiment, the output pulse waveform is divided into a forward pulse (i.e. a pulse signal corresponding to the case where the displacement direction is the forward direction) and a reverse pulse (i.e. a pulse signal corresponding to the case where the displacement direction is the reverse direction), and each pulse signal is divided into an a phase, a B phase and a Z phase, wherein the waveform diagrams of the two pulse signals can be seen in fig. 4 and 5.
Therefore, by the displacement measuring method based on the magnetic grid ruler, which is described in detail in the steps S1 to S6, the number of the passing intervals of the reading head between the magnetic poles can be accurately determined through the two acquired orthogonal sinusoidal signals; meanwhile, on the basis of the traditional angle position, the number of the magnetic poles passed by the reading head at different moments is combined to calculate the displacement, and therefore the problem that the number of the intervals passed by the reading head between the magnetic poles cannot be accurately obtained when the traditional magnetic grid ruler is used for measurement can be solved, and therefore the accuracy and the precision of displacement measurement are greatly improved.
Referring to fig. 6 to 12, a second aspect of the present embodiment provides a hardware apparatus for implementing the displacement measurement method based on a magnetic scale according to the first aspect of the present embodiment, including:
and the signal acquisition unit is used for acquiring two paths of orthogonal sinusoidal signals generated by the magnetic grid ruler during displacement measurement.
And the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals.
And the displacement measuring unit is used for calculating the number of magnetic poles passed by a reading head on the magnetic grating ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment based on the two orthogonal square wave signals to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles, wherein the second moment is behind the first moment.
And the displacement measuring unit is used for acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two paths of orthogonal sinusoidal signals at the second moment.
And the displacement measuring unit is also used for calculating to obtain a displacement measuring result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position.
In this embodiment, the displacement measuring unit may include, but is not limited to, a comparator and a processor, where the comparator is configured to perform waveform conversion on two orthogonal sinusoidal signals to obtain two orthogonal square wave signals, and the processing unit obtains, according to the two orthogonal square wave signals, the number of magnetic poles passed by the reading head on the magnetic scale at the first time and the second time, and calculates the displacement value based on the angular position and the number of magnetic poles at two different times.
In specific application, the displacement measurement of the existing magnetic grating ruler reading head can be realized by adopting a special chip basically, wherein the adopted chip is mainly a Chinese chip abroad, so that the measurement cost is higher.
Optionally, the exemplary signal acquisition unit may include, but is not limited to: the displacement measuring unit can adopt but not limited to a CW32F030F8 type processing chip and a peripheral circuit thereof, wherein the CW32F030F8 type processing chip integrates functions of data processing and a comparator, so that the functions of waveform conversion and displacement calculation can be realized at the same time; in this embodiment, the input ends of the first operational amplifier circuit and the second operational amplifier circuit are electrically connected to the magnetic scale, and are used for respectively acquiring a path of orthogonal sinusoidal initial signal, and performing signal amplification processing on the acquired orthogonal sinusoidal signal to obtain an orthogonal sinusoidal signal; the output ends of the first operational amplifier circuit and the second operational amplifier circuit are electrically connected to the CW32F030F8 type processing chip, and are used for inputting the respective corresponding orthogonal sinusoidal signals into the CW32F030F8 type processing chip, and performing data processing according to the method provided by the first aspect of the embodiment to finally obtain the displacement measurement result.
Referring to fig. 7, for example, the first operational amplifier circuit and the second operational amplifier circuit both include an LTC6087 operational amplifier, and further, the specific circuit structures of the two operational amplifiers are as follows:
as shown in fig. 7, for the first operational amplifier circuit, the non-inverting input terminal and the inverting input terminal of the LTC6087 type operational amplifier U4A are electrically connected to the first signal output terminal of the magnetic scale through a first resistor (i.e., the resistor R7 and the resistor R9 in fig. 7); in this embodiment, but not limited to, a VCP1615 type magnetic grid ruler may be adopted, so that the positive phase input terminal of the LTC6087 type operational amplifier U4A is electrically connected to the 6 th pin of the VCP1615 type magnetic grid ruler through the first resistor R7, and the negative phase input terminal of the LTC6087 type operational amplifier U4A is electrically connected to the 3 rd pin of the VCP1615 type magnetic grid ruler through the first resistor R9, so as to obtain one path of orthogonal sinusoidal initial signal output by the VCP1615 type magnetic grid ruler; then, the output end of the U4A of the LTC6087 type operational amplifier is electrically connected to the displacement measuring unit, and is configured to perform signal amplification on the one path of orthogonal sinusoidal initial signal to obtain one path of orthogonal sinusoidal signal, and output the one path of orthogonal sinusoidal signal to the displacement measuring unit; specifically, the output terminal of U4A of the LTC6087 type operational amplifier is electrically connected to pin 3 of the CW32F030F8 type processing chip, as shown in fig. 8.
Similarly, for the second operational amplifier circuit, the positive phase input terminal and the negative phase input terminal of the LTC6087 type operational amplifier U4B are electrically connected to the second signal output terminal of the magnetic grid ruler through a second resistor (i.e., resistors R11 and R13 in fig. 7), similarly, the positive phase input terminal of the LTC6087 type operational amplifier U4B is electrically connected to the 7 th pin of the VCP1615 type magnetic grid ruler, the negative phase input terminal is electrically connected to the 2 nd pin of the VCP1615 type magnetic grid ruler, so as to obtain another orthogonal sinusoidal initial signal output by the VCP1615 type magnetic grid ruler, and the output terminal of the LTC6087 type operational amplifier is electrically connected to the displacement measuring unit, and is configured to perform signal amplification on the another orthogonal sinusoidal initial signal, obtain another orthogonal sinusoidal signal, and output the another orthogonal sinusoidal signal to the displacement measuring unit; specifically, the 4 th pin of the CW32F030F8 type processing chip is electrically connected.
In this embodiment, the two operational amplifiers also have respective peripheral circuits, and the peripheral circuits are the same, taking the first operational amplifier U4A as an example, the output terminal thereof is further electrically connected to one end of the resistor R8 and one end of the capacitor C7, while the other end of the resistor R8 and the other end of the capacitor C7 are electrically connected to the inverting input terminal of the first operational amplifier U4A, and at the same time, the output terminal of the first operational amplifier U4A is further electrically connected to the voltage comparison pin of the CW32F030F8 type processing chip (i.e., the 5 th pin of the CW32F030F8 type processing chip) through the resistor R6; of course, the same is true for the peripheral circuits of the second operational amplifier U4B, which can be seen from fig. 7 and is not described herein again.
In specific implementation, the CW32F030F8 processing chip is configured to perform waveform conversion on orthogonal sinusoidal signals output by two LTC6087 operational amplifiers to obtain two orthogonal square wave signals, and obtain the number of magnetic poles passed by the reading head at different times based on the two orthogonal square wave signals according to the method described in the first aspect of the embodiment, and calculate a displacement measurement value by combining the angular positions of the reading head at different times, where a calculation principle may refer to the first aspect of the embodiment and is not described herein again.
Optionally, the CW32F030F8 type processing chip adopts an ARM Cortex-M0+ core, has the highest main frequency of 64MHz, has strong calculation performance, and can meet the calculation performance requirement of displacement measurement; in a specific application, referring to fig. 8, pins 3 and 4 of the chip are configured as ADC input pins, and sample the amplified analog signals (i.e. orthogonal sine signals) output from the two operational amplifiers, and the amplified analog signals are converted to calculate an angle position value, and pins 5 and 11 are configured as input pins of a voltage comparator, and the amplified analog signals are converted to orthogonal square signals after receiving the orthogonal sine signals, and the orthogonal square signals are output to input pins 8 and 10 of the encoder counter from pins 14 and 15, respectively, and used for recording the number of passing magnetic poles; and finally, calculating to obtain a displacement measurement value by the chip based on the recorded magnetic pole number and the angle position.
In this embodiment, the peripheral circuits of the CW32F030F8 type processing chip may include, but are not limited to, an MCU power circuit, a reset circuit, a BOOT circuit, a debug interface SCLK, a SWDIO, and an operation indication circuit, as shown in fig. 9 and 10.
In addition, in this embodiment, the apparatus may further include, but is not limited to, a differential output unit, and optionally, the differential output unit may also include, but is not limited to, an AM26C31 type differential driving chip, where the AM26C31 type differential driving chip is electrically connected to the CW32F030F8 type processing chip, and is configured to generate a displacement pulse signal according to a displacement measurement result and a displacement direction output by the CW32F030F8 type processing chip; as shown in fig. 11; in specific implementation, the AM26C31 chip is a differential line driver with complementary outputs, and converts the three-phase output signal from the CW32F030F8 type processing chip into three differential signal outputs (a +, a-, B +, B-, Z +, Z-) to finally obtain the displacement pulse signal.
In this embodiment, the apparatus is further provided with a power supply unit, optionally, for example, the power supply unit employs an MPM3506A synchronous rectification buck chip, wherein an input end of the MPM3506A synchronous rectification buck chip is electrically connected to a power supply, and an output end of the MPM3506A synchronous rectification buck chip is electrically connected to a power supply end of the CW32F030F8 type processing chip, a power supply end of the AM26C31 type differential driving chip, and power supply ends of two LTC6087 type operational amplifiers, so as to supply power to the foregoing devices, and ensure normal operation of the apparatus.
Referring to FIG. 12, MPM3506A synchronous rectification buck converter normal function operating range V in Between 4.5V and 36V, and output voltage V out Between 0.81V and 33V, an external resistor divider is used for setting output voltage, and a feedback resistor R4 is also arranged through an internal compensation capacitorSetting feedback loop bandwidth; the chip can adjust the output voltage by configuring the resistance ratio of the feedback resistors R4 and R5, when the output voltage is greater than 1V, the resistance of the feedback resistor is 75k, and the feedback resistor R5 is calculated by the following formula (6):
Figure BDA0003989259890000161
in the above formula (6), R5 'is the resistance of the feedback resistor R5, and R4' is the resistance of the feedback resistor R4.
Therefore, through the detailed explanation of the displacement measuring device based on the magnetic grid ruler, the device provided by the invention is completely composed of domestic chips, so that the localization of the reading head of the magnetic grid ruler can be realized, the problem that the displacement measurement of the magnetic grid ruler can be realized only by using a foreign special measuring chip in the traditional technology is avoided, the technical limit can be broken, the cost of the whole hardware device is greatly reduced, the displacement measuring cost is reduced, and the device is suitable for large-scale application and popularization.
For the working process, the working details, and the technical effects of the apparatus provided in this embodiment, reference may be made to the first aspect of the embodiment, which is not described herein again.
As shown in fig. 13, a third aspect of this embodiment provides another displacement measuring device based on a magnetic scale, taking the device as an electronic device as an example, including: the displacement measuring device comprises a memory, a processor and a transceiver which are sequentially connected in a communication manner, wherein the memory is used for storing a computer program, the transceiver is used for transmitting and receiving messages, and the processor is used for reading the computer program and executing the displacement measuring method based on the magnetic scale according to the first aspect of the embodiment.
For example, the Memory may include, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Flash Memory (Flash Memory), a First In First Out (FIFO), a First In Last Out (FILO), and/or the like; in particular, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array), and meanwhile, the processor may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a CPU (Central Processing Unit); a coprocessor is a low power processor for processing data in a standby state.
In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit) which is responsible for rendering and drawing contents required to be displayed on the display screen, for example, the processor may not be limited to a processor adopting a model STM32F105 series microprocessor, a Reduced Instruction Set Computer (RISC) microprocessor, an X86 or other architecture processor or an embedded neural Network Processor (NPU); the transceiver may be, but is not limited to, a wireless fidelity (WIFI) wireless transceiver, a bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee wireless transceiver (ieee802.15.4 standard-based low power local area network protocol), a 3G transceiver, a 4G transceiver, and/or a 5G transceiver, etc. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
For the working process, the working details, and the technical effects of the electronic device provided in this embodiment, reference may be made to the first aspect of the embodiment, which is not described herein again.
A fourth aspect of the present embodiment provides a storage medium storing instructions for implementing the magnetic scale-based displacement measurement method according to the first aspect of the present embodiment, that is, the storage medium stores instructions that, when executed on a computer, perform the magnetic scale-based displacement measurement method according to the first aspect.
The storage medium refers to a carrier for storing data, and may include, but is not limited to, a floppy disk, an optical disk, a hard disk, a flash Memory, a flash disk and/or a Memory stick (Memory stick), etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
For the working process, the working details, and the technical effects of the storage medium provided in this embodiment, reference may be made to the first aspect of the embodiment, which is not described herein again.
A fifth aspect of the present embodiments provides a computer program product comprising instructions which, when run on a computer, which may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus, cause the computer to perform the method for magnetic scale-based displacement measurement according to the first aspect of the embodiments.
Finally, it should be noted that: the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A displacement measurement method based on a magnetic grid ruler is characterized by comprising the following steps:
acquiring two paths of orthogonal sinusoidal signals generated by a magnetic grating ruler during displacement measurement, and performing waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
based on two orthogonal square wave signals, calculating the number of magnetic poles passed by a reading head on a magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles, wherein the second moment is after the first moment;
acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the second moment;
and calculating to obtain a displacement measurement result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position.
2. The method of claim 1, wherein calculating the number of magnetic poles passed by a read head on the magnetic scale at a first time based on the two orthogonal square wave signals comprises:
acquiring a signal waveform before a first moment in two orthogonal square wave signals to obtain two sampling square wave signals;
taking a high level and a low level in one of the two sampling square wave signals as counting standards, and counting rising edges and falling edges in the other sampling square wave signal of the two sampling square wave signals so as to obtain the counting times of the rising edges and the falling edges in the other sampling square wave signal after counting;
and summing the counting times of the rising edge and the falling edge to obtain the summation result as the number of the magnetic poles passed by the reading head on the magnetic grid ruler at the first moment.
3. The method of claim 1, wherein calculating a displacement measurement of the magnetic scale based on the first number of poles, the second number of poles, the first angular position, and the second angular position comprises:
judging whether the difference value between the number of the second magnetic poles and the number of the first magnetic poles is equal to 0 or not;
if so, judging whether the second angle position is larger than the first angle position;
and if so, subtracting the first angle position from the second angle position to obtain the displacement measurement result of the magnetic grid ruler, otherwise, subtracting the second angle position from the first angle position to obtain the displacement measurement result of the magnetic grid ruler.
4. The method of claim 3, wherein if the difference between the number of second poles and the number of first poles is greater than 0, the method further comprises:
judging whether the first angle position is larger than a preset threshold value or not and whether the second angle position is smaller than the preset threshold value or not;
if so, calculating according to the following formula (1) to obtain a displacement measurement result of the magnetic grid ruler, otherwise, calculating according to the following formula (2) to obtain a displacement measurement result of the magnetic grid ruler;
Figure FDA0003989259880000021
Figure FDA0003989259880000022
in the above equations (1) and (2), pos represents a displacement measurement result of the magnetic Scale, scale represents a displacement coefficient, CNT2 represents the number of second magnetic poles, CNT1 represents the number of first magnetic poles, AP2 represents a second angular position, AP1 represents a first angular position, and [ ] represents a rounding operation.
5. The method of claim 3, wherein if the difference between the number of second poles and the number of first poles is less than 0, the method further comprises:
judging whether the first angle position is smaller than a preset threshold value or not, and whether the second angle position is larger than the preset threshold value or not;
if so, calculating according to the following formula (3) to obtain a displacement measurement result of the magnetic grid ruler, otherwise, calculating according to the following formula (4) to obtain a displacement measurement result of the magnetic grid ruler;
Figure FDA0003989259880000023
Figure FDA0003989259880000024
in the above equations (3 and (4), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the number of second magnetic poles, CNT1 represents the number of first magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ ] represents the rounding operation.
6. The method of claim 1, wherein after obtaining the displacement measurement of the magnetic scale, the method further comprises:
obtaining a displacement direction based on the number of the first magnetic poles, the number of the second magnetic poles, the first angular position and the second angular position;
and generating a displacement pulse signal according to the displacement direction and the displacement measurement result.
7. A displacement measuring device based on a magnetic grid ruler is characterized by comprising:
the signal acquisition unit is used for acquiring two paths of orthogonal sinusoidal signals generated when the magnetic grid ruler carries out displacement measurement;
the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
the displacement measuring unit is used for calculating the number of magnetic poles passed by a reading head on the magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment based on two orthogonal square wave signals to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles, wherein the second moment is behind the first moment;
the displacement measuring unit is used for acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude of the two orthogonal sinusoidal signals at the second moment;
and the displacement measuring unit is also used for calculating to obtain a displacement measuring result of the magnetic grid ruler based on the number of the first magnetic poles, the number of the second magnetic poles, the first angle position and the second angle position.
8. The apparatus of claim 7, wherein the signal acquisition unit comprises: the operational amplifier comprises a first operational amplifier circuit and a second operational amplifier circuit, wherein the first operational amplifier circuit and the second operational amplifier circuit both comprise LTC6087 type operational amplifiers;
for the first operational amplifier circuit, the positive phase input end and the negative phase input end of the LTC6087 type operational amplifier are respectively electrically connected with the first path of signal output end of the magnetic grid ruler through a first resistor, and are used for acquiring a path of orthogonal sine initial signal output by the magnetic grid ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for performing signal amplification on the path of orthogonal sine initial signal to obtain a path of orthogonal sine signal, and outputting the path of orthogonal sine signal to the displacement measuring unit;
for the second operational amplifier circuit, the normal phase input end and the reverse phase input end of LTC6087 type operational amplifier are respectively connected through a second resistance electricity the second way signal output end of magnetic grid ruler for obtain another way quadrature sine initial signal of magnetic grid ruler output, LTC6087 type operational amplifier's output electricity is connected displacement measurement unit is used for with another way quadrature sine initial signal carries out signal amplification, obtains another way quadrature sine signal, and output extremely displacement measurement unit.
9. The device of claim 8, wherein the displacement measurement unit employs a CW32F030F8 type processing chip and a peripheral circuit thereof, wherein the CW32F030F8 type processing chip is electrically connected to output terminals of two LTC6087 type operational amplifiers, and is configured to perform waveform conversion on two paths of orthogonal sinusoidal signals to obtain two orthogonal square signals;
the CW32F030F8 type processing chip is used for calculating the number of magnetic poles passed by a reading head on the magnetic grid ruler at a first moment and the number of magnetic poles passed by the reading head at a second moment based on two orthogonal square wave signals so as to respectively serve as the number of the first magnetic poles and the number of the second magnetic poles;
the CW32F030F8 type processing chip is further configured to acquire the first angular position and the second angular position, and calculate a displacement measurement result of the magnetic scale based on the number of the first magnetic poles, the number of the second magnetic poles, the first angular position, and the second angular position.
10. The apparatus of claim 8, wherein the CW32F030F8 processing chip is further configured to derive a displacement direction based on the number of first magnetic poles, the number of second magnetic poles, the first angular position, and the second angular position, and the apparatus further comprises: a power supply unit and a differential output unit;
the differential output unit adopts an AM26C31 type differential driving chip, wherein the AM26C31 type differential driving chip is electrically connected with the CW32F030F8 type processing chip and is used for generating a displacement pulse signal according to a displacement measurement result and a displacement direction output by the CW32F030F8 type processing chip;
the power supply unit adopts an MPM3506A synchronous rectification step-down chip, wherein the input end of the MPM3506A synchronous rectification step-down chip is electrically connected with a power supply, and the output end of the MPM3506A synchronous rectification step-down chip is electrically connected with the power supply end of the CW32F030F8 type processing chip, the power supply end of the AM26C31 type differential driving chip and the power supply ends of the two LTC6087 type operational amplifiers respectively.
CN202211575438.3A 2022-12-08 2022-12-08 Displacement measurement method and device based on magnetic grating ruler Active CN115930763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211575438.3A CN115930763B (en) 2022-12-08 2022-12-08 Displacement measurement method and device based on magnetic grating ruler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211575438.3A CN115930763B (en) 2022-12-08 2022-12-08 Displacement measurement method and device based on magnetic grating ruler

Publications (2)

Publication Number Publication Date
CN115930763A true CN115930763A (en) 2023-04-07
CN115930763B CN115930763B (en) 2023-12-05

Family

ID=86700380

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211575438.3A Active CN115930763B (en) 2022-12-08 2022-12-08 Displacement measurement method and device based on magnetic grating ruler

Country Status (1)

Country Link
CN (1) CN115930763B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0138306A1 (en) * 1983-07-25 1985-04-24 Cain Encoder Company Angular position detector
US5241173A (en) * 1991-05-16 1993-08-31 Renishaw Transducer Systems Limited Readhead for producing signals when travelling along a scale having a set-up detector for detecting alignment of quadrature signals
JPH06307889A (en) * 1993-04-20 1994-11-04 Kayaba Ind Co Ltd Position detecting device
US20040207392A1 (en) * 2003-04-17 2004-10-21 Dialog Semiconductor Gmbh Magnetic senor digital processing interface for electrical motor application
WO2010124580A1 (en) * 2009-04-30 2010-11-04 浙江关西电机有限公司 Position detecting device and signal processing device and method thereof
CN102589405A (en) * 2012-02-17 2012-07-18 清华大学 Motor rotor displacement measurement method
CN107152904A (en) * 2016-03-02 2017-09-12 深圳市祈飞科技有限公司 A kind of magnetic railings ruler digital readout system
CN108885125A (en) * 2016-03-30 2018-11-23 日本电产株式会社 Electric system
CN109510430A (en) * 2018-11-27 2019-03-22 西安工业大学 A kind of Precision Linear Moving platform
CN111814650A (en) * 2020-07-02 2020-10-23 珠海市迈卡威超声波技术有限公司 Magnetic grid ruler reading receiving method, device and electronic equipment
CN112243563A (en) * 2018-06-26 2021-01-19 三美电机株式会社 Rotary reciprocating drive actuator
CN214223976U (en) * 2020-12-21 2021-09-17 南京安麦森电子科技有限公司 Device based on magnetic grid chi pulse data acquisition

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0138306A1 (en) * 1983-07-25 1985-04-24 Cain Encoder Company Angular position detector
US5241173A (en) * 1991-05-16 1993-08-31 Renishaw Transducer Systems Limited Readhead for producing signals when travelling along a scale having a set-up detector for detecting alignment of quadrature signals
JPH06307889A (en) * 1993-04-20 1994-11-04 Kayaba Ind Co Ltd Position detecting device
US20040207392A1 (en) * 2003-04-17 2004-10-21 Dialog Semiconductor Gmbh Magnetic senor digital processing interface for electrical motor application
WO2010124580A1 (en) * 2009-04-30 2010-11-04 浙江关西电机有限公司 Position detecting device and signal processing device and method thereof
CN102589405A (en) * 2012-02-17 2012-07-18 清华大学 Motor rotor displacement measurement method
CN107152904A (en) * 2016-03-02 2017-09-12 深圳市祈飞科技有限公司 A kind of magnetic railings ruler digital readout system
CN108885125A (en) * 2016-03-30 2018-11-23 日本电产株式会社 Electric system
CN112243563A (en) * 2018-06-26 2021-01-19 三美电机株式会社 Rotary reciprocating drive actuator
CN109510430A (en) * 2018-11-27 2019-03-22 西安工业大学 A kind of Precision Linear Moving platform
CN111814650A (en) * 2020-07-02 2020-10-23 珠海市迈卡威超声波技术有限公司 Magnetic grid ruler reading receiving method, device and electronic equipment
CN214223976U (en) * 2020-12-21 2021-09-17 南京安麦森电子科技有限公司 Device based on magnetic grid chi pulse data acquisition

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
夏鸿晔;王君艳;: "基于FPGA高速光栅测距系统的实现", 电子科技, no. 11, pages 31 - 34 *
郝双辉 等: "新型绝对式磁栅位移传感器的设计", 高电压技术, vol. 35, no. 9, pages 2120 - 2124 *
金南 等: "基于磁栅位移传感器的角度测量系统设计", 电子设计工程, vol. 25, no. 8, pages 191 - 193 *

Also Published As

Publication number Publication date
CN115930763B (en) 2023-12-05

Similar Documents

Publication Publication Date Title
CN102012209B (en) Digital transmission demodulating method of differential transformer displacement transducer
CN202255263U (en) Visual calibration device for displacement sensor
CN104808056B (en) A kind of frequency characteristic test method and apparatus based on comparator conversion
CN102288821B (en) Measuring method, measuring device, measuring procedure and carrier for phase difference of three-phase circuit
CN102116798A (en) Power grid frequency measurement method and device
CN110836992B (en) Oscillography power meter acquisition system based on FPGA
CN102809687B (en) Digital measurement method for alternating-current frequency
CN103872851A (en) Rotating speed and displacement measuring system for rotation motor
CN108982940A (en) A kind of external trigger device and external trigger method, oscillograph based on serial receiver
CN102200544B (en) Total electricity accumulation method of the intelligent electric meter of bidirectional measuring can be realized
CN101556325B (en) Method for quickly verifying electric energy error
CN115930763B (en) Displacement measurement method and device based on magnetic grating ruler
CN104898521B (en) A kind of microcontroller for motor control
CN103575979A (en) Method for digital measuring of alternating current frequency
CN203433041U (en) An electric energy meter provided with a communication function
CN203191708U (en) Precise time-interval measuring instrument
CN205388624U (en) Phase difference measurement circuit based on integrated phase detection discriminator
CN204904578U (en) Transportation vehicles detecting system based on magnetic sensor
CN101515156B (en) Precise time measuring method
CN104748687B (en) A kind of method and adapter for improving grating sensor measurement accuracy
CN208171165U (en) Displacement measurement system for sensor device
CN102998651A (en) Error calibration device and system and error transfer system and method of full digital electric energy meter
CN202939966U (en) Device for measuring indexing, revolution and rotation speed of turntable
CN201555591U (en) Direct-current sine-cosine azimuth indicator
CN207529214U (en) A kind of rotation speed measuring module for DCS system

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