CN113358140B - Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method - Google Patents

Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method Download PDF

Info

Publication number
CN113358140B
CN113358140B CN202110614603.0A CN202110614603A CN113358140B CN 113358140 B CN113358140 B CN 113358140B CN 202110614603 A CN202110614603 A CN 202110614603A CN 113358140 B CN113358140 B CN 113358140B
Authority
CN
China
Prior art keywords
phase
encoder
output
zero
incremental rotary
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
CN202110614603.0A
Other languages
Chinese (zh)
Other versions
CN113358140A (en
Inventor
袁毅
陈银晖
王海彦
侯丽伟
周德亮
谢巍
俞旭辉
潘鸣
孙义兴
侯树海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Henglin Photoelectric Technology Co ltd
Jiangsu Hengtong Terahertz Technology Co Ltd
Original Assignee
Shanghai Henglin Photoelectric Technology Co ltd
Jiangsu Hengtong Terahertz Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Henglin Photoelectric Technology Co ltd, Jiangsu Hengtong Terahertz Technology Co Ltd filed Critical Shanghai Henglin Photoelectric Technology Co ltd
Priority to CN202110614603.0A priority Critical patent/CN113358140B/en
Publication of CN113358140A publication Critical patent/CN113358140A/en
Application granted granted Critical
Publication of CN113358140B publication Critical patent/CN113358140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • G01D5/12Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means
    • G01D5/244Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means influencing characteristics of pulses or pulse trains; generating pulses or pulse trains
    • G01D5/249Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means influencing characteristics of pulses or pulse trains; generating pulses or pulse trains using pulse code
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P70/00Climate change mitigation technologies in the production process for final industrial or consumer products
    • Y02P70/10Greenhouse gas [GHG] capture, material saving, heat recovery or other energy efficient measures, e.g. motor control, characterised by manufacturing processes, e.g. for rolling metal or metal working

Abstract

The invention provides a method and a system for eliminating positive and negative zero setting deviation of an incremental rotary encoder, a counting method of the incremental rotary encoder and a computer readable storage medium, which can eliminate zero setting deviation of the incremental rotary encoder during positive and negative rotation, output accurate zero position, and can be widely applied to occasions of high-precision control of the incremental rotary encoder.

Description

Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method
Technical Field
The invention relates to the technical field of incremental rotary encoders, in particular to a method and a system for eliminating positive and negative zero-setting deviation of an incremental rotary encoder, a counting method of the incremental rotary encoder and a computer readable storage medium.
Background
The incremental rotary encoder comprises a stationary housing and a shaft rotatable relative to the housing, and three output signals of phase a, phase B and phase Z, as shown in fig. 1.
When the housing 1 of the encoder is fixed, the rotary shaft 2 rotates from the position 1 in fig. 1 to the position 2 through the position 0 (zero position) clockwise, or from the position 2 to the position 1 through the position 0 (zero position) anticlockwise, the output signals of the phase A, the phase B and the phase Z are as shown in fig. 2.
The current reading principle of the angle counter matched with the encoder in the market is to count the number of rising edges or falling edges output by the phase A or the phase B to obtain the rotation angle of the rotating shaft; judging the level of the phase A or the phase B at each edge moment of the phase A or the phase B to acquire the rotation direction of the rotating shaft to be clockwise or anticlockwise; and judging the level of the Z phase at each edge time of the A phase or the B phase to acquire the zero position of the encoder. Referring to fig. 2, taking the example of the rising edge of the phase a of the count, the clockwise rotation angle is defined as positive, the anticlockwise rotation angle is defined as negative, the counting judgment flow is as shown in fig. 3, +..
Phase A Phase B Z phase Counter result
H or L H Setting zero
L L +1
H L -1
TABLE 1
As shown in fig. 2, 3 and table 1, taking the rising edge of phase a as an example, when the rotation shaft of the encoder rotates unidirectionally, the zero output of the encoder is accurate; when the rotating shaft passes through the zero position of the encoder in a clockwise (forward direction) or a counterclockwise (reverse direction), the zero positions output by the encoder and the encoder are not coincident, and a positive and negative zero setting deviation exists, as shown in fig. 4.
This deviation is a systematic error because the high level of the Z-phase output of the encoder also has a width that is not an exact stable value for different brands and models of encoders and the exact value of this width is not normally indicated in the product manual.
When the width of the Z phase does not exceed a period of high level + low level of the a phase or the B phase, the positive and negative zero offset value is equivalent to the high level width of the a phase or the B phase as shown in fig. 4, but when the width of the Z phase exceeds a period, larger and larger offset is brought, and the direction of the offset can be positive or negative according to the difference of the width of the Z phase, which is difficult to eliminate by a unified method, as shown in fig. 5.
For unidirectional rotation encoders, or where the zero bit precision requirement is not high, the deviation is negligible. However, if there are cases where the encoder is rotated forward and backward and the zero precision is required to be high, the deviation must be eliminated. Therefore, it is necessary to specially design an angle counting mode capable of eliminating the error, so as to meet the application situations of the incremental rotary encoder in forward and reverse rotation and high precision.
Disclosure of Invention
The invention provides a method for eliminating the positive and negative zero setting deviation of an incremental rotary encoder and a counting method thereof, which can eliminate the zero setting deviation of the incremental rotary encoder during positive and negative rotation, output accurate zero position and can be widely applied to occasions where the incremental rotary encoder is applied to high-precision control.
The technical scheme is as follows: a method for eliminating positive and negative zero-setting deviation of an incremental rotary encoder comprises the following steps: and setting a Z 'phase opposite to the Z phase, and judging the zero position output by the counter through the rising edge of the output of the Z phase or the Z' phase for eliminating the positive and negative zero setting deviation.
Further, the Z-phase inverter in the output phase of the encoder forms the Z' phase.
A rotation angle counting method of an incremental rotary encoder, comprising the steps of:
setting a Z' phase opposite to the Z phase;
waiting for an output of the encoder;
when the rising edge of the Z phase or Z' phase output is received, setting a counter to zero;
when receiving the rising edge of the output of the phase A, judging the level of the output of the phase B;
when the B phase outputs high level, the rotation angle calculated by the counter is reduced by one, the Z phase is selected to judge that the counter is set to zero, the Z' phase is closed, and when the Z phase outputs rising edge, the counter is set to zero;
when the output of the phase B is low, the rotation angle calculated by the counter is increased by one, the phase Z is selected to judge the zero setting of the counter, the phase Z is closed, and when the output of the phase Z is rising, the counter is zero setting.
Further, the Z-phase inverter in the output phase of the encoder forms the Z' phase.
A positive and negative zero bias cancellation system for an incremental rotary encoder, comprising:
the encoder is used for detecting the rotation angle;
an inverter, an input of which is connected to the Z-phase of the encoder, and an output of which is connected to a processor;
the processor is also connected with A, B, Z of the encoder and is used for receiving the electric signal output by the encoder and outputting a counting result of the rotation angle;
the power supply module is respectively connected with the encoder, the inverter and the processor and is used for supplying power to the encoder, the inverter and the processor;
the system for eliminating the forward and reverse zero setting deviation of the incremental rotary encoder adopts the rotary angle counting method of the incremental rotary encoder to count the rotary angle and output zero positions.
A computer readable storage medium having a program stored thereon, which when executed by a processor implements a method for canceling a positive and negative zero bias of an incremental rotary encoder as described above.
A computer readable storage medium having a program stored thereon, which when executed by a processor implements a method of counting a rotation angle of an incremental rotary encoder as described above.
The method for eliminating the forward and reverse zero setting deviation of the incremental rotary encoder and the counting method are different from the principle of the existing angle counter, innovatively judge zero signals preferentially, read information of an output angle, eliminate the zero setting deviation of the incremental rotary encoder during forward and reverse rotation, and output accurate zero positions.
Drawings
FIG. 1 is a schematic diagram of a prior art incremental rotary encoder;
FIG. 2 is a phase diagram of the output of an incremental rotary encoder of the prior art;
FIG. 3 is a flow chart of the counting and judging of the incremental rotary encoder in the prior art;
FIG. 4 is a schematic diagram of a positive and negative zero bias of an encoder;
FIG. 5 is a schematic diagram of a positive and negative zero bias when the width of the Z phase of the encoder exceeds one period;
FIG. 6 is a phase diagram of the output of an incremental rotary encoder in a method of counting the rotational angle of the incremental rotary encoder according to one embodiment;
FIG. 7 is a flow chart of counting and judging in a method for counting the rotation angle of an incremental rotary encoder according to an embodiment;
FIG. 8 is a schematic diagram of a positive and negative zero bias generated by the method of the embodiment;
FIG. 9 is a schematic diagram of a positive and negative zero offset cancellation system of an incremental rotary encoder according to an embodiment.
Detailed Description
The invention relates to a method for eliminating positive and negative zero-setting deviation of an incremental rotary encoder, which comprises the following steps: and setting a Z 'phase opposite to the Z phase, and judging the zero position output by the counter through the rising edge of the output of the Z phase or the Z' phase for eliminating the positive and negative zero setting deviation.
Specifically, in this embodiment, the Z 'phase is formed by a Z phase inverter in the output phase of the encoder, a new output signal Z' phase complementary to Z is obtained as a new output signal, the rising edge of the Z 'phase corresponds to the falling edge of the Z phase, the falling edge of the Z' phase corresponds to the rising edge of the Z phase, the high level of the Z 'phase corresponds to the low level of the Z phase, and the low level of the Z' phase corresponds to the high level of the Z phase, while retaining the original Z phase output. At this time, the incremental rotary encoder has four output signals, which are a phase, B phase, Z phase, and Z' phase, respectively. In actual counting use, only one of the Z phase and the Z' phase is read.
In particular, the encoder may be various types of three-phase output or three-phase complementary output incremental rotary encoders.
Specifically, the inverter may be a TTL inverter or a CMOS inverter.
In particular, the processor may be any of a variety of general purpose and special purpose processors that are capable of reading and processing the output signals of the incremental encoder.
As shown in fig. 6 and 7, there is provided a rotation angle counting method of an incremental rotary encoder, comprising the steps of:
setting a Z' phase opposite to the Z phase;
waiting for an output of the encoder;
when the rising edge of the Z phase or Z' phase output is received, setting a counter to zero;
when receiving the rising edge of the output of the phase A, judging the level of the output of the phase B;
when the B phase outputs high level, the rotation angle calculated by the counter is reduced by one, the Z phase is selected to judge that the counter is set to zero, the Z' phase is closed, and when the Z phase outputs rising edge, the counter is set to zero;
when the output of the phase B is low, the rotation angle calculated by the counter is increased by one, the phase Z is selected to judge the zero setting of the counter, the phase Z is closed, and when the output of the phase Z is rising, the counter is zero setting.
In particular, in this embodiment, the Z phase inverter in the output phase of the encoder forms a Z 'phase, and as can be seen from fig. 7, the encoder is set to zero, which is determined by combining the rising edge of the a phase with the high-low level of the Z phase in fig. 3, and the Z phase or the rising edge of the Z' phase of the inverted signal is dedicated to the output zero. As the zero position is judged from the original rising edge depending on the A phase, the rising edges of the Z phase and the Z' phase are adopted directly for judgment, and the positive and negative zero setting deviation is eliminated, as shown in figure 8.
Table 2 shows a logical truth table of a rotation angle counting method of an incremental rotary encoder according to an embodiment, in table 2, a rising edge is represented by ∈, H represents a high level, L represents a low level, and x represents any of the states.
Figure BDA0003096867420000051
TABLE 2
In an embodiment of the present invention, there is also provided a positive and negative zero bias elimination system for an incremental rotary encoder, comprising:
an encoder 100 for detecting a rotation angle;
an inverter 200, an input terminal of the inverter 200 being connected to the Z-phase of the encoder 100, and an output terminal of the inverter 200 being connected to the processor 300;
the processor 300 is also connected with the A, B, Z of the encoder 100 and is used for receiving the electric signal output by the encoder 100 and outputting the counting result of the rotation angle;
the power supply module 400 is respectively connected with the encoder 100, the inverter 200 and the processor 300, and is used for supplying power to the encoder 100, the inverter 200 and the processor 300;
in the system for eliminating the forward and reverse zero offset of the incremental rotary encoder in the embodiment, the counting method of the rotation angle of the incremental rotary encoder is adopted to count the rotation angle and output zero.
In the system of the embodiment, the power supply module adopts a DC power supply, an ohm dragon E6B2 series incremental rotary encoder is used as an encoder, a 74HC04 chip is used as an inverter, an STC12 series singlechip is used as an angle counter, and the flow of FIG. 7 is written into the singlechip as a program.
A computer-readable storage medium having a program stored thereon, characterized in that: the program is executed by the processor to implement a method for eliminating the positive and negative zero bias of the incremental rotary encoder.
A computer-readable storage medium having a program stored thereon, characterized in that: the program is executed by the processor to implement a method for counting the rotation angle of the incremental rotary encoder.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the system is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (3)

1. A rotation angle counting method of an incremental rotary encoder, characterized by: the method is based on a positive and negative zero-setting deviation elimination system of an incremental rotary encoder, and the system comprises the following connected components:
the encoder is used for detecting the rotation angle;
an inverter, an input of which is connected to the Z-phase of the encoder, and an output of which is connected to a processor;
the processor is also connected with A, B, Z of the encoder and is used for receiving the electric signal output by the encoder and outputting a counting result of the rotation angle;
the power supply module is respectively connected with the encoder, the inverter and the processor and is used for supplying power to the encoder, the inverter and the processor;
the method comprises the following steps:
setting a Z' phase opposite to the Z phase;
waiting for an output of the encoder;
when the rising edge of the Z phase or Z' phase output is received, setting a counter to zero;
when receiving the rising edge of the output of the phase A, judging the level of the output of the phase B;
when the B phase outputs high level, the rotation angle calculated by the counter is reduced by one, the Z phase is selected to judge that the counter is set to zero, the Z' phase is closed, and when the Z phase outputs rising edge, the counter is set to zero;
when the output of the phase B is low, the rotation angle calculated by the counter is increased by one, the phase Z is selected to judge the zero setting of the counter, the phase Z is closed, and when the output of the phase Z is rising, the counter is zero setting.
2. The method of counting the rotation angle of an incremental rotary encoder according to claim 1, wherein: the Z-phase inverter in the output phase of the encoder constitutes the Z' phase.
3. A computer-readable storage medium having a program stored thereon, characterized in that: the method for counting the rotation angle of an incremental rotary encoder according to claim 1, when the program is executed by the processor.
CN202110614603.0A 2021-06-02 2021-06-02 Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method Active CN113358140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110614603.0A CN113358140B (en) 2021-06-02 2021-06-02 Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110614603.0A CN113358140B (en) 2021-06-02 2021-06-02 Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method

Publications (2)

Publication Number Publication Date
CN113358140A CN113358140A (en) 2021-09-07
CN113358140B true CN113358140B (en) 2023-07-14

Family

ID=77531294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110614603.0A Active CN113358140B (en) 2021-06-02 2021-06-02 Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method

Country Status (1)

Country Link
CN (1) CN113358140B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296393B (en) * 2021-12-29 2024-01-16 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Motion table zeroing method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005207985A (en) * 2004-01-26 2005-08-04 Toyo Electric Mfg Co Ltd Position detector
CN102778251A (en) * 2012-07-18 2012-11-14 宁波海得工业控制系统有限公司 Zero position correction method for permanent magnet alternating current servo motor incremental encoder
CN103575312A (en) * 2013-11-25 2014-02-12 济南飞越机电科技有限公司 Jitter elimination method of incremental photoelectric encoder for photoelectric rotating table
CN104147711A (en) * 2014-08-28 2014-11-19 山东交通学院 Method for improving leaf position detection accuracy of multi-leaf collimator
CN104482885A (en) * 2014-12-04 2015-04-01 哈尔滨工业大学 Four-reading-head incremental circular grating coupler
CN107449376A (en) * 2017-09-15 2017-12-08 深圳大学 A kind of steering wheel angle acquisition system in real time
CN111174819A (en) * 2019-12-27 2020-05-19 深圳市越疆科技有限公司 Zero calibration method, device, product and medium for motor incremental encoder

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005207985A (en) * 2004-01-26 2005-08-04 Toyo Electric Mfg Co Ltd Position detector
CN102778251A (en) * 2012-07-18 2012-11-14 宁波海得工业控制系统有限公司 Zero position correction method for permanent magnet alternating current servo motor incremental encoder
CN103575312A (en) * 2013-11-25 2014-02-12 济南飞越机电科技有限公司 Jitter elimination method of incremental photoelectric encoder for photoelectric rotating table
CN104147711A (en) * 2014-08-28 2014-11-19 山东交通学院 Method for improving leaf position detection accuracy of multi-leaf collimator
CN104482885A (en) * 2014-12-04 2015-04-01 哈尔滨工业大学 Four-reading-head incremental circular grating coupler
CN107449376A (en) * 2017-09-15 2017-12-08 深圳大学 A kind of steering wheel angle acquisition system in real time
CN111174819A (en) * 2019-12-27 2020-05-19 深圳市越疆科技有限公司 Zero calibration method, device, product and medium for motor incremental encoder

Also Published As

Publication number Publication date
CN113358140A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN113358140B (en) Method for eliminating positive and negative zero-setting deviation of incremental rotary encoder and counting method
US20200104209A1 (en) Hard and soft bit data from single read
US20200348150A1 (en) Magnetic field angle sensor having a low power mode and associated methods
US10823582B2 (en) Angle detection device and method of multi-turn servo, and multi-turn servo
US20190372488A1 (en) Correcting offset and gain drift related angle errors with motor position detectors
DE102018120315A1 (en) Non-volatile memory device and method of operation thereof
JP4509995B2 (en) Memory with spatially encoded data storage
CN116569264A (en) Modifying parity data using toxic data units
CN111380499A (en) Method and device for detecting rotation angle
CN113494910A (en) Vehicle positioning method and device based on UWB positioning and storage medium
CN101916213A (en) Space protection device and method based on ARM processor
CN108927533B (en) The angle correction method and computer readable storage medium of rotary shaft
US10613918B2 (en) Data register monitoring
US3674999A (en) Numerical function generator
CN114157102B (en) Motor angle measurement method, system, device and computer readable storage medium
CN115950469A (en) Method and device for correcting power failure of single-turn absolute value encoder
CN114446340A (en) Data bus duty cycle distortion compensation
US10789116B2 (en) Method for determining location where memory error occurs
CN208171299U (en) Encoder code disc, absolute value encoder and position acquisition system
CN102736549A (en) 24-Bit acquisition module
CN111323149A (en) Temperature sensor device with function of correcting OTP (one time programmable) errors and OTP error correcting method
CN116633376A (en) Method and system for quickly acquiring phase shift value of single pulse tracking receiver
CN111796569A (en) Method and device for communication between machine tool and external equipment and industrial personal computer
CN204044551U (en) A kind of AC servo motor intelligent control management system
CN116564380B (en) Correction method and device for gate pulse signals in DRAM (dynamic random Access memory)

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