Share this

Design of a Distributed Robot Control System Based on CAN Bus

2026-04-06 05:12:49 · · #1
Abstract: Based on the performance requirements of robot control, a distributed robot control system based on CAN bus was designed. This system consists of a host computer, a communication unit, and lower-level joint controllers. It features simple wiring, convenient expansion, stable and reliable communication, and high real-time control performance. The hardware circuit design of the robot joint controllers and the control software design are described in detail. This control system has been used in the development of a 6DOF robot arm, demonstrating good control performance. Keywords: CAN bus; Motorola DSP; distributed control; robot controller Abstract: According to the requirements of robot control performance, a distributed robot control system based on CAN bus is designed, which is composed of computer, communication module and joint controllers. The control system has many features, including simple connection, convenient extension, reliable communication and good real-time, and so on. Besides these, it mainly describes the design of hardware circuit and control software of joint controller. A 6DOF robot has been controlled by the control system, and the good control result has been obtained. Key words: CAN bus; Motorola DSP; distributed control; robot controller 0 Introduction The robot control system is the main body of robot information processing and control. Its design will determine the overall behavior and performance of the robot system. The structure of robot control system can generally be divided into three types: (1) centralized control mode, which uses a microcomputer to realize all functions. This mode has the characteristics of simple structure and economy, but the processing capacity is limited, it is difficult to meet the high-performance control requirements and the control risk is highly concentrated. (2) Master-slave control mode, using two CPUs, master and slave, for control. The master CPU is responsible for system management, robot language compilation and human-machine interface functions, and also uses its computing power to complete coordinate transformation and trajectory interpolation; the slave CPU completes all joint position digital control. The master and slave CPUs exchange data through shared memory. It is difficult to further distribute functions by using more CPUs. (3) Distributed control, generally adopting a two-level distributed structure of upper and lower computer. The upper computer is responsible for the entire system management as well as kinematic calculation, trajectory planning, etc. The lower computer consists of multiple CPUs, each CPU controls the movement of one joint. These CPUs are connected to the upper computer through a bus. The controller working speed and control performance of this structure are significantly improved, which is a relatively ideal robot control mode [1]. Traditional robot controllers use MCU as the control chip, and its computing speed and processing power are difficult to meet the increasingly complex robot control. In terms of communication mode, RS422 or RS485 communication is commonly used. The real-time performance of communication is poor, the failure rate is high, and it is not easy to troubleshoot when a fault occurs [2]. The robot control system designed in this paper adopts a distributed control approach. The host computer uses a high-performance industrial PC, while the lower-level joint controllers utilize the Motorola DSP56F807, which integrates the high-speed computing power of a DSP and the control characteristics of an MCU. Communication between the host computer and the lower-level joint controllers employs a CAN (Controller Area Network) bus, which effectively supports distributed and real-time control. This approach enables rapid implementation of complex robot control algorithms while maintaining high real-time performance, resulting in a high-performance robot control system. 1. Control System Structure A robot is a multi-degree-of-freedom system. Robot control essentially involves controlling the movement of each joint to coordinate their motion and accomplish relatively complex actions. This control system adopts a distributed control approach, consisting of a host computer module, a communication module, and lower-level joint controller modules, as shown in Figure 1. The host computer is responsible for the scheduling and management of the entire system, online motion planning, fault diagnosis, and human-machine interaction. The communication module is responsible for real-time information exchange between the host computer and the lower-level joint controllers. Each joint controller and the drive brushless DC motor are integrated together; the movement of each joint is achieved by the PWM signals emitted by the joint controllers to drive the brushless DC motor. [align=center] Figure 1. Simplified Diagram of the Control System[/align] 1.1 Host Computer Module The host computer is the central hub of the control system. It is required to be small in size, have a fast processing speed, and meet the requirements of real-time robot control. High-performance industrial control computers are usually used. The host computer application program is developed in the visual programming environment VC++6.0 and is divided into a program interface, a communication initialization part, and a control part. The control part is the core of the entire host computer software control. It can realize single-joint control and multi-joint coordinated control. Figure 2 shows the flowchart of the single-joint control part. Single-joint control starts from the host computer, inputs the desired position value of the joint to be moved, and then sends the single-joint control command to the lower joint controller, and receives the actual position information of the joint from the lower joint controller. The lower joint controller receives the position information from the host computer, processes it, and outputs a PWM signal to drive the brushless DC motor to move to the desired position. The control cycle of the host computer is 20ms. It is connected to the communication bus through a CAN bus interface card and interacts with the joint controllers on the communication bus. [align=center] Figure 2 Flowchart of the host computer single joint control program[/align] 1.2 Communication Module In the distributed control system of the robot, the choice of communication method is crucial. The communication between the host computer and the lower joint controllers must not only meet the requirements of simple hardware connection and convenient expansion, but also meet the requirements of high reliability and real-time performance. This design adopts CAN bus as the communication standard. CAN bus is a serial communication network that effectively supports distributed control and real-time control. Compared with general communication networks, it has the advantages of high reliability, real-time performance and good flexibility, and is very suitable as the communication method in the robot control system [3]. In this control system, the host computer is connected to the CAN network through the USBCAN-II intelligent CAN interface card of Zhou Ligong Microcontroller Company. The host computer calls the ZLGVCI driver library function provided with the card to realize the management and monitoring of CAN communication. The devices in the CAN network are connected through twisted pair cables. Since the characteristic impedance of the twisted pair cable is 120 ohms, in order to enhance the reliability and anti-interference of CAN communication, a 120-ohm anti-reflection terminal matching resistor is added to the two ends of the CAN network. 1.3 Lower-Level Joint Controller Module The lower-level joint controller module is the bottom layer of the entire control system, integrated with the drive motors of each joint. It is essentially a single-joint motion control and drive module, primarily used to control the specific execution process of each joint's movement. The joint controller receives control commands from the main control computer, controls the movement of each joint, and simultaneously feeds back the lower-level information to the upper-level computer for coordinated planning and unified management. All lower-level joint controllers are identical in hardware structure; however, the internal software programs differ depending on the differences in joint motion control. The joint controller is the core of the entire control system and the focus of this study; its performance directly affects the overall performance of the robot. 2 Controller Hardware System Design The controller hardware system can be divided into modules based on structure and function, including a main processor unit, power supply circuit, motor drive circuit, CAN interface circuit, undervoltage protection circuit, and overcurrent detection circuit. The specific circuit is shown in Figure 3. [align=center] Figure 3 Schematic diagram of controller hardware circuit[/align] 2.1 Main processor chip The core control chip of this design is Motorola DSP56F807. This chip combines the high-speed computing power of DSP with the control characteristics of MCU. It provides many peripherals dedicated to motor control, including two pulse width modulation modules (PWMA, PWMB), two phase detector modules (quadrature decoder), 12-bit precision analog-to-digital converter (ADC), four timer modules, communication peripheral modules (SCI, SPI, CAN), etc. Therefore, it is very suitable for digital control of DC brushless motors that realize the movement of robot joints[4]. 2.2 CAN interface circuit The DSP56F807 chip integrates a CAN controller. To complete the transmission and reception of data frames, an external CAN driver chip is required. This design uses Philips' PCA82C250 as the CAN driver. In order to enhance the resistance to external interference, two high-speed optocouplers 6N137 are added between the MSCAN_TX and MSCAN_RX pins of DSP56F807 and the CAN driver. 2.3 Motor drive circuit The motor drive adopts Motorola's MPM3003, which is composed of three P-channel power MOSFETs in the upper bridge arm and three N-channel power MOSFETs in the lower bridge arm. It is an ideal servo motor drive integrated circuit chip [5]. Since the PWM output voltage cannot directly drive the MPM3003, a TTL to CMOS conversion chip MC14504B is added between the PWM output port and the MPM3003. 2.4 Power supply circuit The controller requires both 5.0V and 3.3V power supplies. The external power supply is a DC 24V power supply. The 24V is regulated to 5.0V by MAX724, and then the 5.0V is regulated to 3.3V by MAX604. In order to reduce electromagnetic interference, a ferrite bead is used to isolate the 3.3V digital power supply and the analog power supply. Due to space limitations, other circuit modules will not be introduced one by one. 3. Controller Software Design The controller software design was carried out in the Codewarrior 6.0 integrated development environment, adopting a modular design. It can be divided into an initialization module, a main loop module, and an interrupt subroutine module. The entire control function is implemented by each interrupt subroutine, as shown in Figure 4. The initialization module initializes the DSP and control parameters. The main loop module is an infinite loop, mainly checking if an interrupt has occurred. If an interrupt is detected, it executes the corresponding interrupt service subroutine. The digital PID control subroutine is the main body for implementing the control function, completing the PID control of the joint position and speed, which is achieved through timer interrupts. [align=center] Figure 4 Simplified diagram of controller software structure[/align] For the PID algorithm in the digital PID control subroutine, an improved variable-speed integral PID algorithm is adopted, which effectively overcomes the shortcomings of conventional PID algorithms, such as increased overshoot and deteriorated regulation quality when integral saturation occurs. The basic idea of ​​the variable-speed integral method is to change the accumulation speed of the integral term to correspond to the magnitude of the deviation. When the deviation is large, the integral action is weakened, and vice versa. The conventional PID algorithm is digitally discretized as follows: Where KP, KI, and KD are the proportional, integral, and derivative coefficients of the controller, respectively; E(k) and E(k-1) are the expected deviation values ​​for the k-th and k-1-th iterations, respectively; and U(k) is the controller output for the k-th iteration. The improved variable-speed integral PID algorithm is as follows: f[E(k)] is a function of E(k). When |E(k)|≤B, conventional PID control is performed; when |E(k)|>(A+B), the integral term is no longer accumulated; and when B<|E(k)|>(A+B), f[E(k)] increases as E(k) decreases, and the accumulation speed increases. Where A and B are the separation intervals. 4 Conclusion The robot distributed control system designed in this paper uses the CAN bus as the communication method, which has advantages such as stable and reliable communication and high real-time performance compared with the RS485 bus commonly used in robot control in the past. The Motorola DSP56F807 was selected as the control chip in the lower-level joint controller. This chip not only facilitates the implementation of control functions using a wide range of peripheral modules but also enables the execution of complex control algorithms with a fast processing speed, overcoming the limitations of using MCUs as control chips in implementing complex algorithms. The controller software employs an improved variable-speed integral PID algorithm for digital PID control of joint position and speed. This control system is plug-and-play, with convenient function expansion and fault handling; wiring is simple—previously, controlling a 6DOF robot required 118 cables (including motor wires, sensor wires, and other switching control wires); now only a single twisted-pair cable is needed, resulting in a more aesthetically pleasing design. Furthermore, the joint controllers are directly distributed at the control site, significantly shortening the analog signal transmission distance and effectively improving anti-interference capabilities. References: [1] Fan Yong, Tan Min. Current status and prospects of robot controllers. Robot. 1999, 21 [2] Liu Hua, Cheng Li et al. Research on communication methods between robot controllers and controlled robots. Robot Technology and Application. 2002, 4 [3] Wu Kuanming. CAN bus principle and application system design. Beijing: Beijing University of Aeronautics and Astronautics Press, 1996 [4] DSP56F800 User Manual. Rev.6.0 Motorola Inc, 2004 [5] Chen Yuechu. Application system design of Motorola microcontroller and dedicated integrated chip. Beijing: Beijing University of Aeronautics and Astronautics Press, 1994 [6] Yang Fei, Zheng Guilin. Design of monitoring system based on CAN bus. Microcomputer Information. 2005, 21 (7)
Read next

CATDOLL 108CM Bebe Full Silicone Doll

Height: 108 Silicone Weight: 17kg Shoulder Width: 26cm Bust/Waist/Hip: 51/47/59cm Oral Depth: N/A Vaginal Depth: 3-13cm...

Articles 2026-02-22