Method for collecting and processing encoder signals

文档序号:1660204 发布日期:2019-12-27 浏览:15次 中文

阅读说明:本技术 一种采集处理编码器信号的方法 (Method for collecting and processing encoder signals ) 是由 李华文 倪骏 郑启旺 徐邓 詹祥超 刘睿 崔宇翔 程倩 赵宇 施中海 严涛 李 于 2019-05-10 设计创作,主要内容包括:本发明公开了一种采集处理编码器信号的方法,属于烟草加工设备技术领域,本发明通过对原机MICROII绝对值编码器信号进行处理,在不改变原机各编码信号使用需求的条件下,实现新系统编码信号采集、处理和使用功能;硬件电路需要隔离放大电流;软件上需要实现格雷码转换成自然二进制码,即将原机的编码器的高九位一一对应所需的自然二进制码。本发明成功解决了外接系统需要使用MICROII系统原绝对值编码器信号的需求,保障原系统和新系统的连续稳定运行。(The invention discloses a method for collecting and processing encoder signals, which belongs to the technical field of tobacco processing equipment and realizes the functions of collecting, processing and using new system encoding signals by processing MICROII absolute value encoder signals of an original machine under the condition of not changing the use requirements of each encoding signal of the original machine; the hardware circuit needs to isolate and amplify current; the software needs to convert the gray code into a natural binary code, that is, the high nine bits of the encoder of the original machine correspond to the required natural binary code one by one. The invention successfully solves the requirement that an external system needs to use the original absolute value encoder signal of the MICROII system, and ensures the continuous and stable operation of the original system and the new system.)

1. A method of acquiring and processing an encoder signal, comprising: the method for collecting and processing the encoder signals comprises a software implementation method (1) and a hardware implementation method (2).

2. The method of claim 1, wherein the method further comprises: the software implementation method (1) is specifically to interchange binary gray codes and natural binary codes.

3. The method of claim 1, wherein the method further comprises: the hardware implementation method (2) comprises a circuit for converting natural binary system into Gray code; the binary gray code is converted into a natural binary code circuit; and isolating the hardware amplifying circuit.

4. A method of acquiring a processed encoder signal according to claim 3, characterized by: the circuit for converting the natural binary system into the Gray code comprises three exclusive-OR gates, and the three exclusive-OR gates are connected in parallel to output.

5. A method of acquiring a processed encoder signal according to claim 3, characterized by: the circuit for converting the binary gray code into the natural binary code comprises four exclusive-OR gates, and one end of the output of each exclusive-OR gate is used as the input of the next exclusive-OR gate.

Technical Field

The invention belongs to the field of tobacco equipment processing, and particularly relates to a method for collecting and processing encoder signals.

Background

In a precise positioning control system, it is important to accurately measure the position of a control object in order to improve the control accuracy. Currently, there are two methods for detecting position: one is to use a position sensor, and the measured displacement is converted into digital quantity by a transducer through A/D and sent to the system for further processing. The method has high precision, but is not practical in a multipath and long-distance position monitoring system due to high cost and difficult installation; and the other is to adopt a photoelectric shaft encoder to carry out accurate position control. The photoelectric shaft-position encoder can be divided into an incremental type, an absolute type and a mixed type according to a calibration method and a signal output form. The absolute encoder is a sensor that directly outputs digital quantity, and it performs photoelectric conversion by using a natural binary or cyclic binary (gray code) mode, and the encoding design generally adopts natural binary code, cyclic binary code, binary complement code, and the like. It is characterized in that a fixed digital code corresponding to the position can be read at any position of the rotating shaft without a counter; the anti-interference capability is strong, and no accumulated error is used; the position information is not lost after the power supply is cut off, but the resolution is determined by the binary digit, and different resolutions, namely the digits can be selected according to different precision requirements. There are currently many kinds of 10 bits, 11 bits, 12 bits, 13 bits, 14 bits or higher.

The output signal of the absolute encoder adopting the cyclic binary coding is a digital sequence which is not a weight code, each bit has no definite size, can not directly carry out comparison size and arithmetic operation, can not be directly converted into other signals, is changed into a natural binary code through one-time code conversion, is read by an upper computer to realize corresponding control, and has different processing modes in code system conversion.

Gray code is called cycle binary code or reflection binary code, only 0 and 1 can be identified in a digital system, various data can be processed only by converting into binary code, the Gray code is a weightless code and adopts an absolute coding mode, the typical Gray code is a single-step self-complementary code with reflection characteristic and cycle characteristic, the cycle and single-step characteristic eliminates the possibility of occurrence of great errors during random access, and the reflection and self-complementary characteristic enables negation to be very convenient. Gray code is a reliable code and is a coding method with minimized error, because the natural binary code can be directly converted into analog signal by digital-analog converter, but some cases, such as 3 to 4 decimal, change every bit of binary code, which makes digital circuit generate large peak current pulse. Gray code, which does not have this disadvantage, is a numeric ordering system in which all adjacent integers differ by only one digit in their numeric representation. It only changes one digit when it is switched between any two adjacent digits. It greatly reduces the confusion of logic from one state to the next. In addition, since only one number is different between the maximum number and the minimum number, the code is also called a gray reflective code or a cyclic code.

Disclosure of Invention

The invention successfully solves the requirement that an external system needs to use the original absolute value encoder signal of the MICROII system, and ensures the continuous and stable operation of the original system and the new system.

In order to solve the problems, the invention is realized by adopting the following technical scheme: a method of acquiring and processing an encoder signal, comprising: the method for collecting and processing the encoder signals comprises a software implementation method (1) and a hardware implementation method (2).

Preferably, the software implementation method (1) is implemented by interchanging binary gray codes and natural binary codes.

Preferably, the hardware implementation method (2) comprises a circuit for converting natural binary into gray code; the binary gray code is converted into a natural binary code circuit; and isolating the hardware amplifying circuit.

Preferably, the circuit for converting the natural binary system into the gray code comprises three exclusive or gates, and the three exclusive or gates are connected in parallel to output.

Preferably, the circuit for converting binary gray code into natural binary code comprises four exclusive or gates, and one end of the output of each exclusive or gate is used as the input of the next exclusive or gate.

The invention has the beneficial effects that:

the invention aims at the requirement that an external system needs to use a coding signal as a system trigger signal, takes the fact that an original machine does not have a proper position to install a new coder into consideration, and processes a MICROII absolute value coder signal of the original machine. The angle positioning of the new system does not need to be very accurate, only the angle positioning needs to be accurate to 1 degree, and the high 9 bits of the original encoder are adopted.

Drawings

FIG. 1 is a circuit diagram of native binary to Gray code according to one embodiment of the present invention;

FIG. 2 is a hardware circuit for converting binary Gray code into natural binary code according to one embodiment of the present invention;

FIG. 3 is an isolation amplification hardware circuit according to one embodiment of the invention;

FIG. 4 is a conversion diagram of natural binary code to binary Gray code;

fig. 5 is a conversion diagram of binary gray code into natural binary code.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the accompanying drawings and examples, which are not intended to limit the present invention.

The following table is a comparison table of several natural binary codes and gray codes:

decimal number Natural binary number Gray code Decimal number Natural binary number Gray code
0 0000 0000 8 1000 1100
1 0001 0001 9 1001 1101
2 0010 0011 10 1010 1111
3 0011 0010 11 1011 1110
4 0100 0110 12 1100 1010
5 0101 0111 13 1101 1011
6 0110 0101 14 1110 1001
7 0111 0100 15 1111 1000

1. Conversion of natural binary code into binary gray code

The natural binary code is converted into binary gray code by reserving the highest bit of the natural binary code as the highest bit of the gray code, the next highest gray code is the exclusive or of the high bit and the next highest bit of the binary code, and the rest bits of the gray code are similar to the next highest gray code.

A certain binary number of Bn-1Bn-2…B2B1B0

The corresponding gray code is: gn-1Gn-2…G2G1G0

Wherein the most significant bit is retained- - -Gn-1=Bn-1

Other sites- -i=0,1,2,3………,n-2.

2. Conversion of binary gray code into natural binary code

The binary gray code is converted into natural binary code by reserving the highest bit of gray code as the highest bit of natural binary code, the next highest natural binary code is the XOR of the high natural binary code and the next highest gray code, and the rest bits of natural binary code are similar to the calculation method of the next highest natural binary code.

Some binary gray code is Gn-1Gn-2…G2G1G0

The corresponding natural binary code is: b isn-1Bn-2…B2B1B0

Wherein the most significant bit is retained- - -Bn-1=Gn-1

Other sites- -i=0,1,2,3………,n-1.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:支持压缩数据的随机访问

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类