CN115930763B - Displacement measurement method and device based on magnetic grating ruler - Google Patents

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

Info

Publication number
CN115930763B
CN115930763B CN202211575438.3A CN202211575438A CN115930763B CN 115930763 B CN115930763 B CN 115930763B CN 202211575438 A CN202211575438 A CN 202211575438A CN 115930763 B CN115930763 B CN 115930763B
Authority
CN
China
Prior art keywords
magnetic
angle position
displacement
displacement measurement
magnetic poles
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
CN202211575438.3A
Other languages
Chinese (zh)
Other versions
CN115930763A (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

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 measurement method and a device based on a magnetic grating ruler, which can accurately determine the number of intervals of a reading head passing between magnetic poles through two acquired orthogonal sinusoidal signals; meanwhile, the invention calculates the displacement by combining the number of the magnetic poles passed by the reading head at different moments on the basis of the traditional angle position, and based on the calculation, the problem that the sine signal generated by the movement of the reading head between the magnetic poles cannot be acquired completely when the reading head moves at high speed due to the limitation of the calculation speed during measurement can be avoided, so that the number of the intervals passed by the reading head between the magnetic poles cannot be obtained accurately, and the accuracy and precision of displacement measurement can be greatly improved; in addition, the device provided by the invention can realize localization of the magnetic grating ruler reading head, thereby avoiding the problem that the displacement measurement of the magnetic grating 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 grating 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 grating ruler.
Background
The magnetic ruler measuring system is specially designed for linear displacement measurement, has the advantages of good economy and high efficiency, and is particularly suitable for long-distance measurement and displacement measurement in severe environments such as greasy dirt, cutting scraps, vibration and the like; the working principle of the magnetic grating ruler is as follows: when the reading head passes through each magnetic pole on the scale, an orthogonal sinusoidal signal is generated on the magnetic sensor, and at the moment, the amplitude of the sinusoidal signal can be read through the AD converter to calculate the angle position based on the amplitude so as to obtain a displacement value; however, the foregoing displacement measurement based on the magnetic scale has the following disadvantages: due to the limitation of calculation speed, when the reading head moves at a high speed, sinusoidal signals generated by the movement of the reading head between magnetic poles cannot be acquired completely, so that the sinusoidal signals generated by the movement of the reading head between the magnetic poles can be lost, the number of intervals passed by the reading head between the magnetic poles can not be completely obtained, and finally, larger errors exist in the calculated displacement based on the sinusoidal signals; therefore, how to provide a displacement measurement method with high measurement accuracy in the field of magnetic grating ruler measurement has become a current research hotspot.
Disclosure of Invention
The invention aims to provide a displacement measurement method and device based on a magnetic grating ruler, which are used for solving the problems that in the prior art, due to the limitation of calculation speed, when a reading head moves at a high speed, sinusoidal signals generated by the movement of the reading head between magnetic poles cannot be acquired completely, so that the number of intervals passed by the reading head between the magnetic poles cannot be obtained completely, and further, the calculated displacement based on the sinusoidal signals has larger error.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
in a first aspect, a displacement measurement method based on a magnetic grating ruler is provided, including:
acquiring two paths of orthogonal sinusoidal signals generated by the 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 the 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 be respectively used 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 values of two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of two paths of orthogonal sinusoidal signals at the second moment;
And calculating to obtain a displacement measurement result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position.
Based on the above disclosure, the invention obtains two orthogonal square wave signals by performing waveform transformation on two paths of orthogonal sine signals generated on the magnetic grating ruler, 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 grating ruler is determined, therefore, when the number of magnetic poles passed by the reading head at a certain moment is determined, the number of intervals passed by the reading head between the two magnetic poles is equivalent to that of the reading head, for example, 10 intervals are arranged between the two magnetic poles, and the number of magnetic poles passed by the reading head at a first moment is 4, then the reading head moves twice completely between the two magnetic poles, and the number of intervals passed by the reading head is 20; finally, the displacement measurement result of the magnetic grating ruler can be calculated 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 passing 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 passing by the reading head between the magnetic poles can be accurately determined by the collected two paths of orthogonal sinusoidal signals; meanwhile, the invention calculates the displacement by combining the number of the magnetic poles passed by the reading head at different moments based on the traditional angle position, and based on the calculated displacement, the problem that the sine signal generated by the movement of the reading head between the magnetic poles cannot be acquired completely when the reading head moves at high speed due to the limitation of the calculation speed during measurement can be avoided, so that the number of the intervals passed by the reading head between the magnetic poles cannot be obtained accurately, and the accuracy and precision of displacement measurement can be greatly improved.
In one possible design, calculating the number of poles that the read head on the magnetic grid scale passes at a first time includes:
acquiring signal waveforms before a first moment in the two orthogonal square wave signals to obtain two sampling square wave signals;
taking the high level and the 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 in the two sampling square wave signals so as to obtain the counting times of the rising edge and the falling edge in the other sampling square wave signal after the counting;
and summing the count times of the rising edge and the falling edge 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.
Based on the above disclosure, the invention takes the number of magnetic poles passed by the reading head at the first moment as an example to describe a counting method of the number of magnetic poles passed by the reading head, namely, firstly, signals before the first moment are intercepted from two orthogonal square wave signals to be used as two sampling square wave signals, then, the high and low levels of one signal in the sampling square wave signals are used as counting references to count the times of rising edges and falling edges of the other signal, and finally, the total times of the rising edges and the falling edges are added to be used as the number of magnetic poles passed by the reading head at the first moment; in this embodiment, the high level and the low level are used as counting criteria, and when the number of rising edges and falling edges is counted each time, it is determined whether the number of rising edges is added or subtracted from the counted number, and the same is true for the falling edges; therefore, through the design, the number of the magnetic poles passing by the reading head at the first moment can be determined, and the number of the intervals passing between the two magnetic poles at the first moment can be accurately obtained.
In one possible design, calculating the displacement measurement result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle 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;
if yes, 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 a displacement measurement result of the magnetic grating ruler, otherwise, subtracting the second angle position from the first angle position to obtain a displacement measurement result of the magnetic grating ruler.
In one possible design, if the difference between the second number of magnetic poles and the first number of 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 yes, calculating according to the following formula (1) to obtain a displacement measurement result of the magnetic grating ruler, otherwise, calculating according to the following formula (2) to obtain a displacement measurement result of the magnetic grating ruler;
In the above formulas (1) and (2), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the second number of magnetic poles, CNT1 represents the first number of magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ (] represents the rounding operation).
In one possible design, if the difference between the second number of magnetic poles and the first number of 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 yes, calculating according to the following formula (3) to obtain a displacement measurement result of the magnetic grating ruler, otherwise, calculating according to the following formula (4) to obtain a displacement measurement result of the magnetic grating ruler;
in the above formulas (3 and (4), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the second number of magnetic poles, CNT1 represents the first number of 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 grid ruler, the method further includes:
obtaining a displacement direction based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle 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 measurement device based on a magnetic grating ruler, comprising:
the signal acquisition unit is used for acquiring two paths of orthogonal sine signals generated when the magnetic grating ruler performs displacement measurement;
the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals so as to obtain two orthogonal square wave signals;
the displacement measuring unit is used for calculating the number of magnetic poles passed by the 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 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 after 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 values of two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of the two paths of orthogonal sinusoidal signals at the second moment;
and the displacement measuring unit is also used for calculating and obtaining a displacement measuring result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position.
In one possible design, the signal acquisition unit comprises: a first operational amplifier circuit and a second operational amplifier circuit, wherein the first operational amplifier circuit and the second operational amplifier circuit each comprise an LTC6087 type operational amplifier;
for the first operational amplifier circuit, the normal phase input end and the reverse phase input end of the LTC6087 type operational amplifier are respectively and electrically connected with the first path of signal output end of the magnetic grating ruler through a first resistor, and are used for obtaining one path of orthogonal sine initial signals output by the magnetic grating ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for amplifying the signals of the one path of orthogonal sine initial signals to obtain one path of orthogonal sine signals, and outputting the one path of orthogonal sine signals to the displacement measuring unit;
for the second operational amplifier circuit, the normal phase input end and the reverse phase input end of the LTC6087 type operational amplifier are respectively and electrically connected with the second signal output end of the magnetic grating ruler through a second resistor, and are used for obtaining another path of orthogonal sine initial signals output by the magnetic grating ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for amplifying the signals of the other path of orthogonal sine initial signals to obtain another path of orthogonal sine signals, and outputting the other path of orthogonal sine signals to the displacement measuring unit.
In one possible design, the displacement measurement unit adopts a CW32F030F8 processing chip and a peripheral circuit thereof, wherein the CW32F030F8 processing chip is electrically connected with the output ends of two LTC6087 operational amplifiers and is used for performing waveform conversion on two paths of orthogonal sinusoidal signals so as to obtain two orthogonal square wave signals;
the CW32F030F8 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 to be respectively used as the first number of magnetic poles and the second number of magnetic poles;
the CW32F030F8 type processing chip is further configured to obtain the first angle position and the second angle position, and calculate a displacement measurement result of the magnetic grid ruler based on the first number of magnetic poles, the second number of magnetic poles, the first angle position and the second angle position.
In one possible design, the CW32F030F 8-type processing chip is further configured to obtain a displacement direction based on the first number of magnetic poles, the second number of 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 buck chip, wherein the input end of the MPM3506A synchronous rectification buck chip is electrically connected with a power supply, and the output end of the MPM3506A synchronous rectification buck 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 two LTC6087 type operational amplifiers respectively.
Based on the above disclosure, the displacement measuring device disclosed by the invention is composed of domestic chips, so that localization of the magnetic grating ruler reading head can be realized, and the problem that the displacement measurement of the magnetic grating ruler can be realized only by using a foreign special measuring chip (i.e. a hans chip) in the prior art is avoided.
In a third aspect, another displacement measurement device based on a magnetic grating ruler is provided, taking the device as an electronic device as an example, and the displacement measurement device comprises a memory, a processor and a transceiver which are sequentially and communicatively connected, wherein the memory is used for storing a computer program, the transceiver is used for receiving and transmitting messages, and the processor is used for reading the computer program and executing the displacement measurement method based on the magnetic grating ruler, which is possibly designed in the first aspect or any one of the first aspect.
In a fourth aspect, there is provided a storage medium having instructions stored thereon which, when executed on a computer, perform the magnetic scale-based displacement measurement method as set forth in the first aspect or any one of the possible designs of the first aspect.
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 in the first aspect or any one of the possible designs of the first aspect.
The beneficial effects are that:
(1) The invention utilizes two orthogonal sine signals on the magnetic grating ruler to determine the number of magnetic poles passed by the reading head at different moments, thus, the number of intervals passed by the reading head between the magnetic poles can be accurately determined through the collected two paths of orthogonal sine signals; meanwhile, the invention calculates the displacement by combining the number of the magnetic poles passed by the reading head at different moments based on the traditional angle position, and based on the calculated displacement, the problem that the sine signal generated by the movement of the reading head between the magnetic poles cannot be acquired completely when the reading head moves at high speed due to the limitation of the calculation speed during measurement can be avoided, so that the number of the intervals passed by the reading head between the magnetic poles cannot be obtained accurately, and the accuracy and precision of displacement measurement can be greatly improved.
(2) The displacement measuring device disclosed by the invention is composed of domestic chips, so that 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 (i.e. a Hans chip) in the traditional technology is avoided, 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 of the steps of a displacement measurement method based on a magnetic grating ruler according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of two orthogonal sinusoidal signals according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of two orthogonal square wave signals according to 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 a reverse pulse signal according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a displacement measuring device based on a magnetic grating ruler 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 CW32F030F 8-type processing chip according to an embodiment of the invention;
fig. 9 is a peripheral circuit diagram of a first portion of a CW32F030F 8-type processing chip according to an embodiment of the invention;
Fig. 10 is a peripheral circuit diagram of a second portion of the CW32F030F 8-type processing chip according to an embodiment of the invention;
FIG. 11 is a specific circuit diagram of an AM26C31 differential driving chip according to an embodiment of the present invention;
fig. 12 is a specific circuit diagram of an MPM3506A synchronous rectification buck chip provided by an embodiment of the 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 description of the embodiments or the prior art, and 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 according to these drawings without inventive effort to a person skilled in the art. It should be noted that the description of these examples is for aiding in understanding the present invention, but is not intended to limit the present invention.
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 element. 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" that may appear herein, it is merely one association relationship that describes an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a alone, B alone, and both a and B; for the term "/and" that may appear herein, which is descriptive of another associative object relationship, it means that there may be two relationships, e.g., a/and B, it may be expressed that: a alone, a alone and B alone; in addition, for the character "/" that may appear herein, it is generally indicated that the context associated object is an "or" relationship.
Examples:
referring to fig. 1 to 5, in the displacement measurement method based on the magnetic grating ruler provided by the embodiment, the number of magnetic poles passed by the reading head at different moments is counted by using two orthogonal sinusoidal signals generated by the magnetic grating ruler, and then, on the basis of the traditional angle position, the number of magnetic poles passed by the reading head at different moments is combined to calculate the displacement, so that the problem that the number of intervals passed by the reading head between the magnetic poles cannot be accurately obtained during measurement by the traditional magnetic grating ruler can be avoided, and the accuracy and precision of displacement measurement are improved; in this embodiment, the method may be, but not limited to, running on the displacement measuring end side of the magnetic scale, and it is to be understood that the foregoing execution subject does not limit the embodiment of the present application, and accordingly, the running steps of the method may be, but 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 when displacement measurement is carried out, and carrying out waveform conversion on the two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals; when the magnetic grating ruler is specifically applied, 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 in the magnetic grating ruler, at the moment, the two paths of orthogonal sine initial signals can be acquired, and after the signals are amplified, the two paths of orthogonal sine signals can be obtained; referring to fig. 2, vo1 in fig. 2 is a first path of orthogonal sinusoidal signal, vo2 is a second path of orthogonal sinusoidal signal, and as can be seen from fig. 2, the abscissa is time, and the ordinate is voltage value; then, calculating the angle position based on the two orthogonal sine signals and counting the number of the magnetic poles; in this embodiment, for example, but not limited to, a comparator is used to shape two orthogonal sinusoidal signals into orthogonal square wave signals, and the graph of the converted square wave signals can be shown in fig. 3 (Vo 11 represents the square wave signal after the conversion of the first orthogonal sinusoidal signal, and Vo12 represents the square wave signal after the conversion of the second orthogonal sinusoidal signal); of course, a processing chip having a comparator function may be used to implement the signal conversion, and the specific components thereof may be specifically set according to the actual use, and are not limited to the foregoing examples.
After the two orthogonal square wave signals are obtained, the number of the magnetic poles passing by the reading head at different moments can be counted based on the two orthogonal square wave signals, wherein the counting process of the number of the magnetic poles is shown in the following step S2.
S2, 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 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 after the first moment; in this embodiment, since the number of intervals between the two magnetic poles on the magnetic grid ruler is determined, when the number of magnetic poles that the reading head passes at a certain moment is determined, the number of intervals between the two magnetic poles is equal to the number of steps that the reading head passes at the moment; if 10 intervals are arranged between the two magnetic poles, and the number of the magnetic poles experienced by the reading head at the first moment is 2, the reading head moves completely once between the two magnetic poles, and the number of interval steps experienced by the reading head is 10; similarly, when the number of the magnetic poles experienced by the reading head at the first moment is 4, the reading head moves completely 2 times between the two magnetic poles, and at this time, the number of the interval steps passed by the reading head is 20, and of course, the meanings corresponding to the number of the other different magnetic poles are also the same, and are not described herein.
In this embodiment, since the principle of the method for calculating the number of magnetic poles passed by the head is the same at different times, the following description will be given of the number of magnetic poles counting in detail, taking the first time as an example, as shown in steps S21 to S23.
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 applications, the signal waveform before the first time is intercepted from the two orthogonal square wave signals, so that the two orthogonal square wave signals are taken as sampling square wave signals, and of course, the sampling time (i.e. the first time and the second time) can be specifically set according to actual use, and the method is not specifically limited.
After the signal waveform before the first time is captured, the number of magnetic poles passed by the reading head at the first time can be counted by using the captured signal, as shown in the following steps S22 and S23.
S22, counting rising edges and falling edges in one sampling square wave signal in the two sampling square wave signals by taking high level and low level in the other sampling square wave signal as counting standards, so as to obtain the counting times of the rising edges and the falling edges in the other sampling square wave signal after the counting process; in this embodiment, the principle of counting the number of rising edges and falling edges in one sampling square wave signal by using the high and low levels of the other sampling square wave signal as the counting standard is as follows: the high-low level is used for determining the counting signs of the rising edge and the falling edge times, namely when one sampling square wave signal is high level, if the other sampling square wave signal is the rising edge correspondingly, 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 corresponding to a rising edge, the number of rising edges is reduced by 1 on the total number counted before; similarly, the principle of the low level is also that, and will not be described here again.
After counting the total number of rising edges and falling edges of another sampled square wave signal based on the counting method provided in the step S22, the number of magnetic poles passed by the reading head at the first moment can be obtained by adding the counted total number of rising edges and falling edges, as shown in the following step S23.
S23, summing the count times of the rising edge and the falling edge to take the summation result as the number of magnetic poles passed by a reading head on the magnetic grid ruler at the first moment; in this embodiment, the principle of the counting method of the number of magnetic poles passed by the reading head at the second moment is the same as that of the counting method at the first moment, and will not be described again.
Therefore, through the design, the invention can determine the number of the intervals passed by the reading head by only counting the number of the magnetic poles passed by the reading head, thereby avoiding the problem that the number of the intervals passed by the reading head between the magnetic poles cannot be completely obtained because the sine 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 calculation speed in the traditional technology.
After the number of magnetic poles passed by the reading head at two different moments is obtained, the angular positions of the reading head at the two different moments can be combined to calculate and obtain the displacement measurement result of the magnetic grid ruler between the first moment and the second moment, wherein the calculation process is shown in the following step S3 and step S4.
S3, acquiring a first angle position and a second angle position, wherein the first angle position is obtained based on the amplitude values of two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of two paths of orthogonal sinusoidal signals at the second moment; in this embodiment, for different moments, the angular position of the reading head may be, but is not limited to, calculated according to the magnitudes of two orthogonal sinusoidal signals corresponding to the two different moments, where the specific calculation process is:
taking a first Angle position as an example, firstly, acquiring the amplitude values of two orthogonal sinusoidal signals at a first moment, and then calculating an Angle value Angle 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 the algorithm can calculate a common trigonometric function value by using only shift and add-subtract operations, so that the trigonometric function calculation can be easily implemented on a simple device (such as a single chip microcomputer or an FPGA without a floating point operation unit) without a hardware multiplier, which is a common algorithm for calculating an angle value in the field of magnetic grid ruler displacement measurement; after obtaining the corresponding angle value at the first moment, the first angle position can be obtained by calculating according to the following formula (5):
In the above equation (5), AP1 represents a first angular position, angle1 represents an angular value corresponding to a first time, scale represents a displacement coefficient, and the displacement coefficient is a preset value, and can be determined according to a magnetic pole pitch and a reading head accuracy.
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 moment may be obtained by substituting the value corresponding to the second moment into the above formula (5), and the calculation principle is the same as that of the above example, and will not be described again.
After the corresponding angular positions of the reading head at two different moments are obtained, the number of the magnetic poles passing through the reading head at two different moments can be combined to calculate and obtain a displacement measurement result of the magnetic grating ruler, as shown in the following step S4.
S4, calculating a displacement measurement result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position; in specific application, different displacement calculation formulas are determined according to the difference between the number of the second magnetic poles and the number of the first magnetic poles, and the displacement calculation formulas are shown in the following steps S41 to S47 respectively.
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 a specific application, it is determined whether CNT2-CNT1 is equal to 0, and if so, it is necessary to determine the two angular positions, as shown in step S42 below.
S42, if so, judging whether the second angle position is larger than the first angle position.
S43, if yes, subtracting the first angle position from the second angle position to obtain a displacement measurement result of the magnetic grating ruler, otherwise, subtracting the second angle position from the first angle position to obtain a displacement measurement result of the magnetic grating ruler; in this embodiment, if the second angular position is greater than the first angular position, it is indicated that the displacement direction is a forward direction, that is, forward movement, and at this time, the displacement measurement result is 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 indicated to be the reverse direction, namely the reverse movement is performed, and at the moment, the displacement measurement result can be obtained by subtracting the second angular position from the first angular position.
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 is indicated that the displacement direction is the forward direction, and at this time, the following steps S44 and S45 are adopted to calculate and obtain the displacement measurement result.
S44, judging whether the first angle position is larger than a preset threshold value or not, and judging whether the second angle position is smaller than the preset threshold value or not; in a specific application, the exemplary preset threshold may be, but is not limited to: In this way, based on the above-described judgment conditions, the present embodiment discloses a position calculation method that satisfies the above-described conditions and corresponds to each case when the above-described conditions are not satisfied, as shown in step S45 below.
S45, calculating to obtain a displacement measurement result of the magnetic grating ruler according to the following formula (1) if the displacement measurement result is positive, otherwise, calculating to obtain the displacement measurement result of the magnetic grating ruler according to the following formula (2).
In the above formulas (1) and (2), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the second number of magnetic poles, CNT1 represents the first number of magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ (] represents the rounding operation).
Similarly, if the difference between the number of the second magnetic poles and the number of the first magnetic poles is smaller than 0, it is indicated that the displacement direction is the opposite direction, and at this time, the following steps S46 and S47 are needed to calculate the displacement measurement result.
S46, judging whether the first angle position is smaller than a preset threshold value or not, and judging whether the second angle position is larger than the preset threshold value or not.
S47, calculating to obtain a displacement measurement result of the magnetic grating ruler according to the following formula (3) if yes, and otherwise, calculating to obtain a displacement measurement result of the magnetic grating ruler according to the following formula (4).
With the above-described design, the displacement measurement result of the magnetic scale can be calculated based on the steps S41 to S47.
In the present embodiment, after the displacement measurement result is calculated, a displacement pulse signal may be generated based on the displacement direction, as shown in steps S5 and S6 below.
S5, obtaining a displacement direction based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position; in specific applications, the determination process of the displacement direction can be referred to the steps S41 to S47, and will not be described herein.
S6, generating a displacement pulse signal according to the displacement direction and the displacement measurement result; in particular applications, the displacement measurement result and the displacement direction may be input to the quadrature encoder, so as to output corresponding data to the data register, so as to output corresponding pulse waveforms 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 displacement direction being the forward direction) and a reverse pulse (i.e., a pulse signal corresponding to the displacement direction being 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 measurement method based on the magnetic grating ruler, which is described in detail in the steps S1 to S6, the invention can accurately determine the number of intervals of the reading head passing between magnetic poles by the acquired two paths of orthogonal sinusoidal signals; meanwhile, on the basis of the traditional angle position, the number of magnetic poles passing by the reading head at different moments is combined to calculate displacement, and based on the calculated displacement, the problem that the number of intervals passing by the magnetic poles of the reading head cannot be accurately obtained when the traditional magnetic grating ruler is used for measuring can be avoided, so that the accuracy and precision of displacement measurement are greatly improved.
Referring to fig. 6 to 12, a second aspect of the present embodiment provides a hardware device for implementing the displacement measurement method based on a magnetic grating ruler according to the first aspect of the present embodiment, including:
and the signal acquisition unit is used for acquiring two paths of orthogonal sine signals generated when the magnetic grating ruler performs displacement measurement.
And the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals so as to obtain two orthogonal square wave signals.
The displacement measuring unit is used for calculating the number of magnetic poles passed by the 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 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 after 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 values of the two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of the two paths of orthogonal sinusoidal signals at the second moment.
And the displacement measuring unit is also used for calculating and obtaining a displacement measuring result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position.
In this embodiment, the example displacement measurement unit may, but is not limited to, include a comparator and a processor, where the comparator is configured to perform waveform conversion on two paths of orthogonal sinusoidal signals to obtain two orthogonal square wave signals, and the processing unit is configured to obtain, according to the two orthogonal square wave signals, the number of magnetic poles passed by the reading head on the magnetic grating ruler at the first moment and the second moment, and calculate the displacement value based on the angular positions and the number of magnetic poles at the two different moments.
When the magnetic grating ruler reading head is particularly applied, the displacement measurement can be realized by adopting a special chip basically, wherein the adopted chip is mainly a foreign Hans chip, so that the measurement cost is higher, the embodiment is improved on the hardware device, and the localization of the whole reading head is realized by adopting a localization chip and combining the measurement method provided by the first aspect of the embodiment, so that the technical limitation is broken, and the displacement measurement cost of the magnetic grating ruler is reduced.
Alternatively, example signal acquisition units may include, but are not limited to: the displacement measuring unit may be, but not limited to, a CW32F030F8 type processing chip and its peripheral circuit, wherein the CW32F030F8 type processing chip integrates the functions of a data processing and a comparator, so that the waveform conversion and displacement calculation functions can be realized at the same time; in this embodiment, input ends of the first operational amplifier circuit and the second operational amplifier circuit are electrically connected with the magnetic grating ruler, respectively obtain a path of orthogonal sinusoidal initial signals, and perform signal amplification processing on the obtained orthogonal sinusoidal signals to obtain orthogonal sinusoidal signals; the output ends of the first operational amplifier circuit and the second operational amplifier circuit are electrically connected with a CW32F030F8 type processing chip, and are used for inputting 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 so as to finally obtain a displacement measurement result.
As shown in fig. 7, the first operational amplifier circuit and the second operational amplifier circuit include LTC6087 type operational amplifiers, 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 operational amplifier U4A are electrically connected to the first signal output terminal of the magnetic grid ruler through a first resistor (i.e., the resistor R7 and the resistor R9 in fig. 7), respectively; in this embodiment, but not limited to, a VCP1615 type magnetic grating ruler may be adopted, so that a non-inverting input end of the LTC6087 type operational amplifier U4A is electrically connected to a 6 th pin of the VCP1615 type magnetic grating ruler through a first resistor R7, and an inverting input end of the LTC6087 type operational amplifier U4A is electrically connected to a 3 rd pin of the VCP1615 type magnetic grating ruler through a first resistor R9, so as to obtain one path of orthogonal sinusoidal initial signal output by the VCP1615 type magnetic grating ruler; then, the output end of the U4A of the LTC6087 operational amplifier is electrically connected with the displacement measuring unit and is used for amplifying the signal of the one-path orthogonal sine initial signal to obtain the one-path orthogonal sine signal and outputting the one-path orthogonal sine signal to the displacement measuring unit; specifically, the output end of the U4A of the LTC6087 operational amplifier is electrically connected to the 3 rd pin of the CW32F030F8 processing chip, as shown in FIG. 8.
Similarly, for the second operational amplifier circuit, the normal phase input end and the reverse phase input end of the LTC6087 type operational amplifier U4B are electrically connected to the second signal output end of the magnetic grating ruler through a second resistor (i.e., resistors R11 and R13 in fig. 7), and similarly, the normal phase input end of the LTC6087 type operational amplifier U4B is electrically connected to the 7 th pin of the VCP1615 type magnetic grating ruler, and the reverse phase input end is electrically connected to the 2 nd pin of the VCP1615 type magnetic grating ruler, so as to obtain another orthogonal sine initial signal output by the VCP1615 type magnetic grating ruler, while the output end of the LTC6087 type operational amplifier is electrically connected to the displacement measurement unit, for amplifying the signal of the other orthogonal sine initial signal to obtain another orthogonal sine signal, and outputting the other orthogonal sine signal to the displacement measurement unit; specifically, pin 4 of the CW32F030F8 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 ends thereof are further electrically connected to one end of the resistor R8 and one end of the capacitor C7, and the other ends of the resistor R8 and the capacitor C7 are electrically connected to the inverting input end of the first operational amplifier U4A, and meanwhile, the output end 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 peripheral circuit of the second operational amplifier U4B is also similar to that shown in fig. 7, and will not be described again.
In a 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 according to the method of the first aspect of the embodiment, obtain the number of magnetic poles passed by the reading head at different moments based on the two orthogonal square wave signals, and calculate the displacement measurement value by combining the angular positions of the reading head at different moments, where the calculation principle can refer to the first aspect of the embodiment and is not described herein.
Optionally, the CW32F030F8 type processing chip adopts an ARM Cortex-M0+ kernel, and has the highest main frequency of 64MHz, so that the computing performance is strong, and the computing performance requirement of displacement measurement can be met; in specific application, referring to fig. 8, pins 3 and 4 of the chip are configured as ADC input pins, the samples output amplified analog signals (i.e., quadrature sine signals) from the two operational amplifiers, after conversion, are used to calculate the angle position values, pins 5 and 11 are configured as input pins of the voltage comparator, receive quadrature sine signals, convert into quadrature square wave signals, and output the quadrature square wave signals from pins 14 and 15 to input pins 8 and 10 of the encoder counter, respectively, for recording the number of magnetic poles passing through; finally, the chip calculates the displacement measurement value based on the recorded number of magnetic poles and the angular position.
In the present embodiment, the peripheral circuits of the exemplary CW32F030F 8-type processing chip may include, but are not limited to, an MCU power supply circuit, a reset, a BOOT circuit, a debug interface SCLK, a SWDIO, and a work instruction circuit, as can be seen in fig. 9 and 10.
In addition, in this embodiment, the apparatus may further include, but not limited to, a differential output unit, alternatively, an exemplary differential output unit may further include, but 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; see fig. 11; in a specific implementation, the AM26C31 chip is a differential line driver with complementary outputs, and the three-phase output signal from the CW32F030F8 type processing chip is converted into three-way differential signal outputs (a+, a-, b+, B-, z+, Z-) to finally obtain a displacement pulse signal.
In this embodiment, the apparatus is further provided with a power supply unit, and optionally, for example, the power supply unit adopts an MPM3506A synchronous rectification buck chip, where 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, thereby ensuring normal operation of the apparatus.
Referring to fig. 12, the MPM3506A synchronous rectification buck converter operates within the normal operating range V in Between 4.5V and 36V, and output voltage V out The voltage divider is used for setting output voltage between 0.81V and 33V, and the feedback resistor R4 is also used for setting the bandwidth of a feedback loop through the internal compensation capacitor; the chip can adjust the output voltage by configuring the resistance value ratio of the feedback resistors R4 and R5, when the output voltage is larger than 1V, the resistance value of the feedback resistor is 75k, and the feedback resistor R5 is calculated by the following formula (6):
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 elaboration of the displacement measuring device based on the magnetic grating ruler, the device provided by the invention is composed of domestic chips, 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 in the traditional technology is avoided, the technical limit can be broken, the cost of the whole hardware device is greatly reduced, and the displacement measuring cost is reduced, thereby being suitable for large-scale application and popularization.
The working process, working details and technical effects of the device provided in this embodiment may refer to the first aspect of the embodiment, and are not described herein again.
As shown in fig. 13, a third aspect of the present embodiment provides another displacement measurement device based on a magnetic grating ruler, taking the device as an electronic device as an example, including: the device comprises a memory, a processor and a transceiver which are connected in sequence in communication, wherein the memory is used for storing a computer program, the transceiver is used for receiving and transmitting messages, and the processor is used for reading the computer program and executing the displacement measuring method based on the magnetic grid ruler according to the first aspect of the embodiment.
By way of specific example, the Memory may include, but is not limited to, random access Memory (random access Memory, RAM), read Only Memory (ROM), flash Memory (Flash Memory), first-in-first-out Memory (First Input First Output, FIFO) and/or first-in-last-out Memory (First In Last Out, FILO), etc.; in particular, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ), and 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 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, image processor) for taking charge of rendering and rendering of content required to be displayed by the display screen, for example, the processor may not be limited to a microprocessor employing a model number of STM32F105 family, a reduced instruction set computer (reduced instruction set computer, RISC) microprocessor, an X86 or other architecture processor, or a processor integrating an embedded neural network processor (neural-network processing units, 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 technology (General Packet Radio Service, GPRS) wireless transceiver, a ZigBee protocol (low power local area network protocol based on the ieee802.15.4 standard), a 3G transceiver, a 4G transceiver, and/or a 5G transceiver, etc. In addition, the device may include, but is not limited to, a power module, a display screen, and other necessary components.
The working process, working details and technical effects of the electronic device provided in this embodiment may refer to the first aspect of the embodiment, and are not described herein again.
A fourth aspect of the present embodiment provides a storage medium storing instructions containing the displacement measurement method based on a magnetic scale according to the first aspect of the present embodiment, that is, the storage medium storing instructions thereon, which when executed on a computer, perform the displacement measurement method based on a magnetic scale 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), where the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
The working process, working details and technical effects of the storage medium provided in this embodiment may refer to the first aspect of the embodiment, and are not described herein again.
A fifth aspect of the present embodiment provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the magnetic grid ruler based displacement measurement method of the first aspect of the embodiment, wherein the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
Finally, it should be noted that: the foregoing description is only of the preferred embodiments of the invention and is not intended to limit the scope of the invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. The displacement measurement method based on the magnetic grating ruler is characterized by comprising the following steps of:
Acquiring two paths of orthogonal sinusoidal signals generated by the 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 the 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 be respectively used 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 values of two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of two paths of orthogonal sinusoidal signals at the second moment;
calculating to obtain a displacement measurement result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position;
based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position, a displacement measurement result of the magnetic grid ruler is obtained through calculation, and the displacement measurement result comprises the following steps:
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;
if yes, 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 a displacement measurement result of the magnetic grating ruler, otherwise, subtracting the second angle position from the first angle position to obtain a displacement measurement result of the magnetic grating ruler.
2. The method of claim 1, wherein calculating the number of poles traversed by the read head on the magnetic scale at the first time based on the two orthogonal square wave signals comprises:
acquiring signal waveforms before a first moment in the two orthogonal square wave signals to obtain two sampling square wave signals;
taking the high level and the 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 in the two sampling square wave signals so as to obtain the counting times of the rising edge and the falling edge in the other sampling square wave signal after the counting;
and summing the count times of the rising edge and the falling edge 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.
3. The method of claim 1, wherein if the difference between the second number of poles and the first number of 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 yes, calculating according to the following formula (1) to obtain a displacement measurement result of the magnetic grating ruler, otherwise, calculating according to the following formula (2) to obtain a displacement measurement result of the magnetic grating ruler;
in the above formulas (1) and (2), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the second number of magnetic poles, CNT1 represents the first number of magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ (] represents the rounding operation).
4. The method of claim 1, wherein if the difference between the second number of poles and the first number of 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 yes, calculating according to the following formula (3) to obtain a displacement measurement result of the magnetic grating ruler, otherwise, calculating according to the following formula (4) to obtain a displacement measurement result of the magnetic grating ruler;
In the above formulas (3 and (4), pos represents the displacement measurement result of the magnetic Scale, scale represents the displacement coefficient, CNT2 represents the second number of magnetic poles, CNT1 represents the first number of magnetic poles, AP2 represents the second angular position, AP1 represents the first angular position, and [ (] represents the rounding operation).
5. The method of claim 1, wherein after obtaining the displacement measurement of the magnetic grid scale, the method further comprises:
obtaining a displacement direction based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position;
and generating a displacement pulse signal according to the displacement direction and the displacement measurement result.
6. A displacement measurement device based on a magnetic grating ruler, comprising:
the signal acquisition unit is used for acquiring two paths of orthogonal sine signals generated when the magnetic grating ruler performs displacement measurement;
the displacement measuring unit is used for carrying out waveform conversion on the two paths of orthogonal sinusoidal signals so as to obtain two orthogonal square wave signals;
the displacement measuring unit is used for calculating the number of magnetic poles passed by the 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 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 after 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 values of two paths of orthogonal sinusoidal signals at the first moment, and the second angle position is obtained based on the amplitude values of the two paths of orthogonal sinusoidal signals at the second moment;
the displacement measuring unit is also used for calculating a displacement measuring result of the magnetic grid ruler based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position;
based on the first magnetic pole number, the second magnetic pole number, the first angle position and the second angle position, a displacement measurement result of the magnetic grid ruler is obtained through calculation, and the displacement measurement result comprises the following steps:
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;
if yes, 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 a displacement measurement result of the magnetic grating ruler, otherwise, subtracting the second angle position from the first angle position to obtain a displacement measurement result of the magnetic grating ruler.
7. The apparatus of claim 6, wherein the signal acquisition unit comprises: a first operational amplifier circuit and a second operational amplifier circuit, wherein the first operational amplifier circuit and the second operational amplifier circuit each comprise an LTC6087 type operational amplifier;
for the first operational amplifier circuit, the normal phase input end and the reverse phase input end of the LTC6087 type operational amplifier are respectively and electrically connected with the first path of signal output end of the magnetic grating ruler through a first resistor, and are used for obtaining one path of orthogonal sine initial signals output by the magnetic grating ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for amplifying the signals of the one path of orthogonal sine initial signals to obtain one path of orthogonal sine signals, and outputting the one path of orthogonal sine signals to the displacement measuring unit;
for the second operational amplifier circuit, the normal phase input end and the reverse phase input end of the LTC6087 type operational amplifier are respectively and electrically connected with the second signal output end of the magnetic grating ruler through a second resistor, and are used for obtaining another path of orthogonal sine initial signals output by the magnetic grating ruler, and the output end of the LTC6087 type operational amplifier is electrically connected with the displacement measuring unit, and is used for amplifying the signals of the other path of orthogonal sine initial signals to obtain another path of orthogonal sine signals, and outputting the other path of orthogonal sine signals to the displacement measuring unit.
8. The device of claim 7, wherein the displacement measuring unit adopts a CW32F030F8 type processing chip and a peripheral circuit thereof, wherein the CW32F030F8 type processing chip is electrically connected to output ends of two LTC6087 type operational amplifiers and is used for performing waveform conversion on two orthogonal sinusoidal signals to obtain two orthogonal square wave signals;
the CW32F030F8 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 to be respectively used as the first number of magnetic poles and the second number of magnetic poles;
the CW32F030F8 type processing chip is further configured to obtain the first angle position and the second angle position, and calculate a displacement measurement result of the magnetic grid ruler based on the first number of magnetic poles, the second number of magnetic poles, the first angle position and the second angle position.
9. The apparatus of claim 7, wherein the CW32F030F 8-type processing chip is further configured to obtain a displacement direction based on the first number of poles, the second number of 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 buck chip, wherein the input end of the MPM3506A synchronous rectification buck chip is electrically connected with a power supply, and the output end of the MPM3506A synchronous rectification buck 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 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 CN115930763A (en) 2023-04-07
CN115930763B true 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 (11)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1471332A1 (en) * 2003-04-17 2004-10-27 Dialog Semiconductor GmbH Digital interface for an angular sensor

Patent Citations (11)

* 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
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高速光栅测距系统的实现;夏鸿晔;王君艳;;电子科技(11);31-3431-34 *
基于磁栅位移传感器的角度测量系统设计;金南 等;电子设计工程;第25卷(第8期);191-193 *
新型绝对式磁栅位移传感器的设计;郝双辉 等;高电压技术;35(9);2120-2124 *

Also Published As

Publication number Publication date
CN115930763A (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN102012209B (en) Digital transmission demodulating method of differential transformer displacement transducer
CN104808056B (en) A kind of frequency characteristic test method and apparatus based on comparator conversion
CN110836992B (en) Oscillography power meter acquisition system based on FPGA
CN103604373B (en) Optical grating Moire fringe small echo divided method and grating displacement measuring device
CN104614002A (en) Subdivided signal error compensation method of photoelectric encoder of tracking control platform
CN107238354A (en) A kind of Angle Measuring Equipment and its measuring method based on PSD position sensors
CN102809687B (en) Digital measurement method for alternating-current frequency
CN102095431A (en) Digital converter of magnetic encoder
CN102200544B (en) Total electricity accumulation method of the intelligent electric meter of bidirectional measuring can be realized
CN104914268A (en) Apparatus for detecting speed of motor
CN201637773U (en) Collecting circuit of true effective value of multi-path alternating current signals
CN104155521A (en) Method and apparatus for determining phase difference
CN106628006A (en) Intelligent mobile phone wave buoy
CN115930763B (en) Displacement measurement method and device based on magnetic grating ruler
CN104122439B (en) Electric energy meter capable of improving phase correction precision
CN104898521B (en) A kind of microcontroller for motor control
CN207832451U (en) A kind of cylinder pressure of engines signal acquisition and processing apparatus
CN103575979A (en) Method for digital measuring of alternating current frequency
CN205670191U (en) A kind of echo wave signal acquisition device of LDV technique
CN205388624U (en) Phase difference measurement circuit based on integrated phase detection discriminator
CN101515156B (en) Precise time measuring method
CN204904578U (en) Transportation vehicles detecting system based on magnetic sensor
CN207147415U (en) Signal subdividing device
CN114518782A (en) Micro control unit, motor rotating speed measuring method and system and storage medium
CN207132865U (en) A kind of Angle Measuring Equipment based on PSD position sensors

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