Design of Serial Interface for Absolute Photoelectric Encoder Based on DSP

Publisher:大头玩家Latest update time:2012-10-22 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: In order to realize the detection of motor position by absolute photoelectric encoder with SSI interface in motor servo control system, the general I/O port of DSP chip TMS320F2812 is used to simulate the communication between SSI interface and absolute encoder, and the timing program of simulating SSI interface communication is written and the position detection experiment of absolute encoder is carried out. The output value of the full range of absolute encoder is obtained. The single-turn value is 0-25536, and the output value range is 0-268 435 456 after 4 096 turns. It is concluded that the absolute encoder can realize accurate position acquisition and precise control in the motor servo control system and realize SSI interface communication by using general I/O port. It has the characteristics of simple design, low cost, easy maintenance, accurate position detection and can replace special decoding chip.
Keywords: absolute encoder; DSP; serial communication SSI; TMS320F2812

0 Introduction
In the motor servo system, it is usually necessary to detect the position information of the rotor as the feedback signal of the closed-loop control. For high-precision servo systems, the detection accuracy of the position feedback link directly affects the performance of the servo system. Common position detection devices include photoelectric encoders and resolvers. The resolver has the advantages of simple structure, low cost, high reliability and protection level, but its disadvantages such as complex decoding, expensive dedicated decoding chips and sensitivity to electromagnetic interference limit its development. It has been gradually replaced by photoelectric encoders. There are two types of photoelectric encoders: incremental and absolute. The incremental photoelectric encoder has a relatively low accuracy. The A and B orthogonal signals it outputs are easily affected by electromagnetic interference and mechanical jitter, causing miscounting, resulting in incorrect position positioning, and it has no power-off memory function. The absolute photoelectric encoder has the characteristics of high accuracy, high reliability, strong anti-interference ability, and power-off memory function. Therefore, the absolute photoelectric encoder is widely used in radars, robots, precision machine tools, high-precision servo systems and other occasions with relatively high accuracy requirements.
The signal output of absolute encoders is in two forms: parallel and serial. Among them, serial output is widely used due to its performance advantages of SSI interface (synchronous serial interface) with fewer data connections and high reliability. However, the use of serial output will lead to a large transmission delay, which places relatively high requirements on the speed and reliability of serial communication. The application of absolute encoders requires a dedicated processing chip, which is very expensive. Some people use hardware such as CPLD and FPGA to process the encoder serial data, which undoubtedly increases the complexity of the system. This article introduces the design of SSI interface circuit and software for HMCT/16/4096/BA absolute photoelectric encoder of LIKA Company in Italy, with DSP chip TMS320F2812 as the core, to realize the communication between the general I/O port of DSP and the encoder.

1 Absolute photoelectric encoder
The HMCT/16/4096/BA absolute photoelectric encoder of LIKA, Italy, is a multi-turn high-precision encoder with a single-turn resolution of 16 bits (65,536) and a number of turns of 12 bits (4,096). Its resolution can reach 0.0015%. The output circuit form is SSI and other output modes. The output code system is optional for Gray code and binary code. The maximum load of the shaft (axial and radial) is 40 N. The maximum shaft rotation speed is 6,000 r/m. The moment of inertia is about 95 g·cm2. The power supply voltage is 10 to 30 V. The power consumption is 1 W. The maximum output current is 40 mA. The storage temperature range is -40 to 100 °C. The operating temperature range is -20 to 85 °C. The protection level is IP65. The mass is 0.3 kg. Electrical connection method: EML121H connector, the connector leads are shown in Table 1. Among them, Brown/Green is the positive power supply voltage, and White/Green is the negative power supply voltage. In addition to the power supply voltage signal, this solution only uses the CLOCK+, CLOCK-, DATA+ and DATA- signals.

2 Introduction to SSI interface and SSI protocol
The SSI interface photoelectric encoder adopts the host active reading method, which is based on 2 pairs of signal lines that meet the RS 422 level for signal transmission, 1 pair of data (Data) lines, and 1 pair of synchronous clock (Clock) lines. The SSI synchronous clock frequency determines the data transmission rate, which has a wide range of 0.1~2 MHz. The corresponding transmission rate can be selected according to the transmission distance, and the transmission rate is adaptive. The SSI data transmission sequence is shown in Figure 1. Under the control of the synchronous clock, data is transmitted from the most significant bit (MSB). At the first falling edge of the clock signal, such as the "1" position, the current position value of the encoder is stored. At the subsequent rising edge of the clock, such as the "2" position, the stored data is sent out, that is, the most significant bit MSB is sent out, and then the other valid bits are sent out in sequence until the least significant bit LSB is sent out. The last jump from low to high level, such as the "3" position, the output transmission cycle ends, and the encoder enters the next transmission cycle after Tm time. In the figure, T is the synchronous clock cycle, and Tm is the high level time at the end of the pulse sequence (Tm>T). If the number of bits is less than 25, it must be filled with "0". For specific zero-filling positions, see the "Tree (TR EE) Data Alignment Format" and "LSB Right Alignment Format" in the reference.

d.JPG [page]

3 Hardware Circuit Design
The motor servo control system using an absolute encoder includes: a motor whose rotation position is to be measured, an absolute encoder, a level conversion element MAX488, a motor control board with DSP as the core, and a motor power drive circuit. This article mainly introduces the interface between the absolute encoder HMCT/16/4096/BA and the DSP chip.
Since the encoder output interface is an SSI interface, and controllers commonly used in the industrial control field such as single-chip microcomputers, DSPs, PC104s, and industrial computers generally do not provide SSI interfaces, and SSI photoelectric encoder suppliers generally do not provide interface converters, it is necessary to convert the SSI interface into a serial interface that can communicate with DSPs, etc. The interface circuit is shown in Figure 2.

e.JPG


As can be seen from the figure, the input clock signal (CLOCK) and output data signal (DATA) of the absolute photoelectric encoder are differential signals. Its data transmission complies with the EIA RS 22 standard and is in line with the RS 422 protocol level, so it needs to be converted into a level that can be input into a single-chip microcomputer or DSP. There are many chips that can complete this conversion, which can be roughly divided into two categories: full-duplex and half-duplex. According to the encoder reading timing diagram, the output of the data is converted at the falling edge of the clock signal and transmitted at the rising edge of the clock signal, so a full-duplex conversion chip should be selected. This article selects the MAX488 chip as the interface chip for the absolute photoelectric encoder to communicate with the DSP chip MS320F2812. It is powered by 5 V and is a low-power transceiver suitable for RS 422 and RS 485. Its chip contains a driver and a receiver, and can transmit at a rate of 2.5 Mb/s. The interface circuit diagram of the absolute photoelectric encoder communicating with the DSP chip TMS320F2812 is shown in Figure 3.

f.JPG


In this circuit, the GPIOF7 (CANRXA) port of the DSP is used to simulate the synchronous clock signal required for absolute encoder reading, and the GPIOF6 (CANTXA) port is used to receive data. At the same time, in order to reduce the interference before and after the circuit and achieve matching with the 3.3 V level of the DSP interface, two high-speed optocouplers are used in the circuit for photoelectric isolation and level conversion.

4 Software Design
The high-precision multi-turn absolute encoder can output multi-turn position information (nMT bits) and single-turn position information (nST bits) at the same time. The data transmission timing relationship is shown in Figure 4. When the encoder receives the first falling edge of the clock signal in the transmission cycle, the absolute position value of the word length of (nMT+nST) bits is read and stored in the data buffer. The data in the data buffer is serially and synchronously transmitted along the falling edge of the clock signal. The first data bit sent is the highest bit (MSB) of the absolute position value, and the last data bit sent is the lowest bit (LSB) of the absolute position value.

g.JPG [page]

Generally, the SSI standard signal is 25 bits. If it is less than 25 bits, it must be padded with zeros. The encoder used in this article is a single-turn 16-bit 4096-turn high-precision encoder with a total of 28 bits. The SSI transmission format it follows is shown in Figure 5.

a.JPG


As shown in Figure 5, for encoders with more than 25 digits for single-turn and multi-turn digits, 32 CLOCK timings need to be generated when writing the communication program to complete the transmission and reception of all encoder data. As can be seen from the hardware circuit, the GPIOF7 (CANRXA) port of the DSP is used to simulate the synchronous clock signal required for absolute encoder reading, and the GPIOF6 (CANTXA) port is used to receive data. The specific communication process is shown in Flowchart 6.
In the entire process, generating CLOCK synchronous clock timing and data processing are key parts. The whole implementation process is as follows:
(1) GPIOF7 generates a high-to-low transition level and delays appropriately, at which time the data conversion starts;
(2) GPIOF7 generates a low-to-high transition level and delays appropriately, at which time the most significant bit data MSB has been transmitted to the data port, and the data is read into the data register GPF DAT;
(3) 32 synchronous clock CLOCK signals are continuously generated, and 32 bits of data are transmitted to the data register GPF DAT in turn. The data reading method in this paper is to read bit by bit. Each time new data is added, the previous data is shifted left by 1 bit and then added until all data bits are read;
(4) GPIOF7 generates a low-to-high transition level, and the high level is maintained for a longer time than the previous CLOCK synchronous clock timing, and the data conversion is completed.
The following is part of the code related to this article in the InitGpio(void) function.
h.JPG

5 Experimental results
The experimental results are shown in Figure 7. It can be seen from the figure that the CH2 channel is a 32 CLOCK timing diagram, and the CH1 channel is a DATA waveform diagram corresponding to the output under the 32 CLOCK timing. The single-turn value of the absolute encoder is 0 to 25,536. After 4,096 turns, the output range is 0 to 268,435,456. The detection accuracy is 0.001 5%, and the operation is stable and reliable.

b.JPG



6 Conclusion
This paper provides a hardware schematic diagram, software flow, program implementation steps and partial code for the communication between the general I/O port of the DSP chip TMS320F2812 and the SSI interface of the absolute encoder. The method of using software to control the DSP I/O port to simulate the clock signal successfully solves the technical bottleneck of the communication between the SSI interface of the absolute encoder and the microprocessor. It has good versatility and is easy to implement. It has been successfully applied to the motor servo control system and provides a design reference for the communication between the microprocessor and other serial peripherals. It has certain practical value.

Reference address:Design of Serial Interface for Absolute Photoelectric Encoder Based on DSP

Previous article:Hardware Design of Unattended Ground Detection System Based on DSP
Next article:Power Supply Design Based on TMS320C6678 DSP

Recommended ReadingLatest update time:2024-11-16 17:37

Design of fingerprint identification system based on DSP
   1 Introduction   Fingerprint recognition technology analyzes the local characteristics of fingerprints and extracts detailed feature points to reliably confirm personal identity. The advantage of fingerprint recognition is that fingerprints are unique features of the human body. Its complexity can provide suffici
[Embedded]
Embedded applications using integrated DSP and microprocessor cores
Embedded applications include signal processing algorithms and control algorithms, which work together to perform necessary functions in many real-time embedded systems, so we need to understand how control algorithms and digital signal processor (DSP) algorithms interoperate. In applications such as mobile phones and
[Microcontroller]
Embedded applications using integrated DSP and microprocessor cores
Design of Power Fault Monitoring Recorder Based on DSP and LabWindows/CVI
Introduction Fault recorder is an important automatic device to improve the safe operation of power system. When the power system fails or oscillates, it can automatically record the changes of various electrical quantities within a certain time before and after the fault point. The fault recorder designed in th
[Test Measurement]
Design of Power Fault Monitoring Recorder Based on DSP and LabWindows/CVI
Implementation of external memory boot method based on DSP
TI's high-speed digital signal processor TMS320C6000 series DSP supports parallel processing and adopts a very long instruction word (VLIW) architecture. It has 8 functional units (two multipliers and 6 ALUs) inside. The 8 functional units can operate in parallel and can execute up to eight 32-bit instructions sim
[Embedded]
Implementation of external memory boot method based on DSP
Design of multifunctional power supply control system based on DSP2407
In the process of vehicle equipment inspection, maintenance and repair, the existing external power supply is large in size and weight and difficult to move, which brings a lot of difficulties to the actual inspection and maintenance work. Therefore, the development of a multifunctional vehicle maintenance power sup
[Embedded]
Implementation of high-precision division in fixed-point DSP
   introduction   Various integrated single-chip digital signal processors ( DSPs ) have become increasingly dominant in signal processing and system control due to their powerful functions, high integration, flexible applications, and high cost-effectiveness. Many signal processing and control operations require th
[Embedded]
Implementation of high-precision division in fixed-point DSP
DSP supports dual input clock control and dual audio processing paths Reason analysis solution
The Cirrus CS485xx DSP family provides high-performance post-processing and mixing of digital audio. Dual clock domains provided on the PCM input allow mixing of audio streams with different sampling frequencies. Low-power standby mode extends battery life, making it suitable for applications such as car audio syste
[Embedded]
DSP supports dual input clock control and dual audio processing paths Reason analysis solution
The key to extending battery life in DSP systems: DC/DC regulators
  A long-standing challenge for designers of MP3 players, personal media players, digital cameras, and other portable consumer applications is to achieve high performance and low power consumption. These battery-powered systems typically use an embedded digital signal processor ( DSP ) that maximizes processing po
[Power Management]
The key to extending battery life in DSP systems: DC/DC regulators
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号