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.
[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.
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.
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.
[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.
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.
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.
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.
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Synopsys IP Resources: A look at the complete Ethernet PHY IP for high-performance computing SoCs
- [National Technology N32 MCU Development Package] --N32G4FR Series
- CC3220 Wireless MCU LaunchPad Development Kit Design
- 422 Driver Output Level
- NB-IoT application classification and technical characteristics analysis
- "Operational Amplifier Parameter Analysis and LTspice Application Simulation" 2. Chapter 2 Bias Current
- I2C Timing
- CUBEMX configures six-step square wave drive BLDC
- Resource Download: IoT technology is everywhere in the home
- [GD32307E-START] Development practice->K2 button + USART to achieve user interaction control + USRT print output status