Foreword
The kinematic control of industrial robots places high demands on the real-time performance of the system. Currently, mainstream industrial robots utilize specially customized motion control cards coupled with real-time operating systems (RTS). This ensures both real-time data transmission and precise motion control execution, significantly improving the overall system stability and thus enhancing robot performance. Other robot products employ industrial PCs with high-speed bus servo control systems. These control PCs use RTS operating systems, such as VxWorks or Windows + RTX real-time expansion platforms, to ensure the real-time performance of the software operating environment. Through motion planning and motion control units, they can control bus-type servo drives, achieving precise robot control. Using RTS to build robot control systems is a good solution; however, it is also very expensive. The high cost of RTS significantly limits the industrialization of industrial robots in China. The shortcomings of using general-purpose operating system message processing mechanisms are that they cannot meet the high stability and rapid response requirements of industrial robots during operation. Frequent communication between the upper and lower control units inevitably leads to insufficient real-time performance to keep up with motion control requirements, greatly reducing the possibility of industrial robot industrialization. In addition, modular and reconfigurable new mechanical designs for industrial robots, high-performance open control systems based on real-time systems and high-speed communication buses, optimized design of industrial robots in high-speed and high-load working environments, motion planning and servo control of high-precision industrial robots, integration technology of industrial robot production lines based on 3D virtual simulation, robot dynamics control in complex environments, and remote diagnosis and repair technology for industrial robot faults are also key issues to be addressed in the critical functional components of robots.
Multi-information fusion in robot intelligent perception and human-computer interaction forms the foundation for the integration and interaction between robots and their environment, and between robots and humans. Robot perception and recognition technology has enormous potential for development in terms of efficient computing and accurate identification. Future intelligent perception and cognition will primarily rely on the development of sensor technology to effectively classify and summarize large amounts of data, extract reliable and effective information, and aggregate it into a feature data network reflecting the human-machine-environment interaction relationship. Combined with the development of artificial intelligence and the realization of high-performance computing capabilities, this will provide a fundamental guarantee for the intelligent development of robots.
Motion controllers are the actuators of intelligent robots, playing a crucial role in their smooth operation. With the continuous emergence of new intelligent control algorithms, intelligent robots are developing towards greater intelligence. MATLAB provides a high-performance mathematical and engineering computation software environment for numerical computation and graphical display. This easy-to-use MATLAB environment consists of numerical analysis, matrix computation, signal processing, and graphics rendering. In this environment, the solutions to problems are expressed almost exactly like their mathematical expressions, unlike the complexity of traditional programming.
1. Overview of Control System Structure
The motion control system of an intelligent robot is the foundation of the entire intelligent robot, and a reliable motion control system is a prerequisite for the experimental design of intelligent robots. The configuration diagram of the intelligent robot control system is shown in Figure 1.
Figure 1. Schematic diagram of intelligent robot control system
The main function of a mobile robot control system is to generate motion control information for the robot and control its movement. Trajectory tracking is one of the tasks a mobile robot needs to perform. Its typical process involves the robot motion controller generating motion control information based on a planned path, controlling the robot to complete the corresponding movements, and tracking the planned path. The input information used in motion control includes obstacle distance information provided by the underlying ultrasonic ranging module, robot position and speed information provided by the motor encoder, and video information acquired and processed by panoramic and monocular vision cameras.
The intelligent robot's onboard processor and host computer serve as the processing center, receiving obstacle distance information from ranging modules such as laser and ultrasonic sensors, as well as visual information from panoramic and binocular vision systems. Combined with preset functions in the host computer, the robot is controlled to perform corresponding actions by controlling the drive motors.
2. Main control board software design
The main control board hardware handles module management, device communication, and robot positioning pulse detection. In practical applications, the main control board hardware is also responsible for the software management of ultrasonic ranging, as its function is related to ultrasonic ranging software design.
Of the main control board hardware, only the main control board controller requires software design. The primary task of the TMS320LF2407A main control board controller is the software design and management of ultrasonic ranging; the remaining tasks are mostly basic settings, including orthogonal encoder pulse detection for the motor encoder. The TMS320LF2407A was initially selected as the main control board controller because this control system can serve as a platform for future robot applications. Real-time systems can be embedded into the TMS320LF2407A to improve system performance and facilitate interface development.
The software design of the main control board includes module initialization, serial communication, orthogonal coded pulse detection, and ultrasonic ranging software. This section describes the module initialization, serial communication, and orthogonal coded pulse detection.
Figure 2. Flowchart of the motherboard controller program
The program flowchart is shown in Figure 2, with the reset vector address as the program entry point. The program then initializes. Initialization includes basic configurations such as extension mode, overflow mode, DARAM, frequency multiplication, and JTAG. It also includes settings for relevant I/O 121s, timers, interrupts, and serial communication. These configurations constitute the basic configuration flow used by the controller. After initialization, the relevant interrupt routines are enabled, followed by the ultrasonic ranging program, which loops continuously. The interrupt service routine is in a ready state and executes immediately upon the occurrence of an interrupt.
In all programs for the TMS320LF2407A, the serial port data transmission and reception procedures need to be explained. Asynchronous communication uses three lines (ground, transmit, and receive) to connect to an RS232 format terminal. Each transmitted bit consists of a start bit, 1 to 8 data bits, an optional parity bit, and 1 to 2 stop bits. Therefore, the maximum data unit that serial communication can transmit is 8 bits, or one byte. In the design, the controller and each terminal will exchange various types of data, such as integer data and floating-point data, so data conversion is required for the serial port transmission and reception.
Considering the data transmission of four bytes of single-precision floating-point numbers, since the serial port can only transmit one byte at a time, it's sufficient to convert each four-byte floating-point number into byte form before sending. This is achieved using type casting in the design. It's important to note that the TMS320LF2407A is a 16-bit chip; therefore, data is stored as 16-bit integers. User data processing should be based on 16-bit integers, so floating-point numbers cannot be forcibly converted into byte arrays for processing. For example, to send a 4-byte floating-point number, it should first be forcibly converted into two integers. The processing method for the two integers is exactly the same, except that the high and low bits of the byte array differ in their storage address.
For the detection of orthogonal encoded pulses, the TMS320LF2407A has an independent orthogonal encoded pulse unit. With simple settings of the unit registers, the running direction and distance parameters of the robot's drive wheels can be obtained. The TMS320LF2407A sends this data to a host computer via serial port. The host computer then models and processes the data to obtain the robot's pose information.
3. Motor drive software design
The motor drive software handles motor drive control and closed-loop speed regulation. Drive control utilizes the on-chip PWM peripheral unit of the STC12C4052AD motor drive main control chip. The generated PWM signal drives the motor through the motor drive chip. The duty cycle of the PWM signal can be adjusted to regulate the duty cycle of the 24VDC voltage applied to the motor, thereby regulating the motor speed. The PWM duty cycle is controlled by an on-chip 8-bit PWM control register, with a value range of 0 to 255, representing the continuous change of the PWM signal duty cycle from 1 to 0. Simultaneously, the STC12C4052AD receives pulse signals from the motor's photoelectric encoder, calculates the motor speed using its on-chip clock, and completes closed-loop speed regulation of the motor through a speed control algorithm.
The flowchart of the motor drive and closed-loop speed control software algorithm is shown in Figure 3.
Figure 3 Flowchart of the motor drive controller program
4. Conclusion
The design of a motion control system for an intelligent robot focuses on the design of the motion control module, including software design and motor driver programming. The software design of the motion control system mainly controls the robot's speed and position, with motor control being the core. This paper selects an improved PID control algorithm. To synchronize the two motors, a synchronous PID algorithm was added and modified accordingly. To verify the improvement effect, simulations of the improved PID control algorithm and comparisons with a simple PID algorithm were performed. Experimental results show that the improved PID algorithm can meet the motion control requirements.
For more information, please follow the Motion Control channel.