Design of joint controller for humanoid robot based on DSP

Publisher:EuphoricMelodyLatest update time:2009-12-02 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

Humanoid robots are mobile and have many degrees of freedom, including arms, neck, waist, legs, etc. They can complete more complex tasks. These joints need to be connected together for unified coordinated control, which puts higher requirements on the reliability and real-time performance of the control system. The centralized control system used in the past has highly centralized control functions. Local failures may cause the overall failure of the system, reducing the reliability and stability of the system. Therefore, it is considered to use a distributed control system to realize the control function of the system.

Considering the computational complexity of the control algorithm of the robot control system and the multi-axis coordinated control, the distributed control architecture based on RS 485 bus is adopted, as shown in Figure 1. The motion planning algorithm is implemented by the main computer, and the main computer will also communicate with each joint controller through the RS 485 bus and be responsible for the coordination of each joint controller. Each joint controller and a motor, driver, detection feedback device, etc. constitute a position servo system, which is responsible for the specific control task of a joint variable of the robot.

The architecture of distributed control based on RS 485 bus

1 Hardware Design of Distributed Controller for Humanoid Robot

1.1 Joint controller hardware circuit design

This design uses TI's 2000 series DSPTMS320F240 as the control unit. Its clock frequency can reach 20 MHz, with high-speed processing capabilities and rich on-chip resources, especially its unique built-in event manager module, which makes it widely used in the field of motor control. The chip itself is very small in size, and few resources are required for external expansion, saving space on the circuit board. The block diagram of the joint controller hardware circuit is shown in Figure 2.

Joint controller hardware circuit schematic diagram

1.2 Interface circuit of motor driver

The control mode of the driver can be divided into two types: speed control mode and position control mode (usually a potentiometer is used as the position sensor of the motor). Here, its speed control mode is adopted, and the input command signal is an analog quantity of 0 to 10 V. Therefore, a D/A conversion circuit is required to convert the digital quantity given by the DSP output into an analog signal. The circuit diagram is shown in Figure 3. DAC7621 is a 12-bit parallel input D/A converter with a built-in reference source and an output range of 0 to 4.095 V. Its 12-bit input is connected to D0 to D11 in the DSP data bus. Its chip select input pin can be connected to the I/O control line /IS of the DSP. In order to obtain a 0 to 10 V analog signal, a common-phase proportional amplifier circuit composed of an operational amplifier in the LM358 is also used to amplify the 0 to 4.095 V signal by 2.5 times.

Circuit Diagram

If the driver and controller are not isolated, the spike will damage the devices in the controller circuit, such as RAM. Therefore, an isolation circuit based on linear optocoupler HCNR201 is designed, as shown in Figure 4.

Isolation circuit based on linear optocoupler HCNR201

The linear optocoupler HCNR201 can only isolate the current, and the input current and output current are linearly related. U6B is another operational amplifier in the chip LM358 in Figure 3. It converts the input 0-10 V voltage into a current signal within 20 mA and inputs it into the linear optocoupler HC-NR201. The output current of HCNR201 is then converted into a 0-10 V voltage signal through a voltage follower composed of a single power rail-to-rail op amp AD8519, which serves as the analog signal input of the driver. Obviously, the circuits on both sides of HCNR201 should use different power supplies and grounds. The two operational amplifiers in LM358 are powered by the 12 V power supply input by the controller, while the AD8519 is powered by the 10 V voltage provided by the driver input.

1.3 Incremental encoder signal processing circuit

The incremental encoder signal processing circuit is shown in Figure 5. J8 is the signal input interface of the MR encoder, which uses AM26C32 to convert the RS 422 differential signals of the three channels output by the MR encoder into TTL levels to obtain three signals of A, B, and Z.

Incremental encoder signal processing circuit

1.4 RS 485 bus communication circuit

RS 485 bus is a communication bus. TMS320F240 DSP chip itself does not have RS 485 bus interface. Two 485 communication chips MAX485 can convert the TTL level of the serial port RXD and TXD of TMS320F240 into RS 485 level. The RXD and TXD pins of TMS320F240DSP are connected to the pins of the first 485 communication chip RO and the second 485 communication chip DI respectively. SPISIMO and SPISOMI of TMS320F240 DSP are connected to the enable pin RE of MAX485, which is used to control the data transmission port of TMS320F240 DSP chip to be connected to the bus or separated from the bus. The circuit is shown in Figure 6.

Circuit Diagram

2 Software Design of Humanoid Robot Controller

2.1 Joint controller main program

The main program flow is shown in Figure 7.

Main program flow

The register initialization operations mainly include: setting the CPU CLK to twice the frequency of the external crystal oscillator, that is, 16 MHz; setting the serial communication baud rate to: 38.4 Kb/s; setting the timer/counter related registers; setting the QEP circuit unit related registers; setting the interrupt control register, etc.

2.2 Serial port data receiving interrupt service routine

The flow chart of the serial port data receiving interrupt service program is shown in Figure 8. In the interrupt service program, the data in the data receiving register is read and stored in the data receiving area without any further analysis and processing. The data receiving area is an area in the memory that temporarily stores data. When a complete instruction information is stored, it is analyzed and processed by the main program.

Serial port data receiving interrupt service program flow chart

2.3 Control cycle timer interrupt service program

The flow of the timing interrupt service program with a control cycle of 2 ms is shown in Figure 9. The timer/counter is used to time the position loop and speed loop control cycle of 2 ms. It enters the timing interrupt service program once every 2 ms, reads the position feedback value and speed feedback value, performs integral separation PID operation, and finally outputs it to D/A to convert it into analog quantity.

Control cycle 2 ms timer interrupt service program flow

In each interpolation cycle (50 ms), the main computer sends the target position after motion planning to the joint controller. The target position is in units of the number of pulses after the quadruple frequency of the incremental encoder signal, and the previous target position is used as the zero point of the pulse count. Therefore, after reading the new target position, the joint controller should also use the previous target position as the new incremental encoder pulse count zero point, measure the actual motor position, and compare and calculate it with the new target position. The main computer can query the actual position of the current motor operation as needed, and the position returned by the joint controller is the absolute position of the joint angle, in units of 0.1°.

3 Conclusion

The research and design of the distributed joint controller of the humanoid robot arm has important scientific research value and practical significance for improving the overall performance and human-machine interaction ability of the humanoid robot. The high real-time, fault-tolerant, reliable and scalable distributed controller of the robot arm provides an advanced network architecture and communication standard for the humanoid robot system. Practice shows that the application prospects are extremely broad.

Reference address:Design of joint controller for humanoid robot based on DSP

Previous article:Estimation of Doppler modulation rate of high-resolution SAR based on DSP
Next article:Three-phase asynchronous motor vector servo system based on DSP and FPGA

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号