Design and Implementation of a DSP-Based Mobile Robot
2026-04-06 04:48:02··#1
Abstract : Intelligent Transportation Systems (ITS) represent the future direction of urban transportation in the 21st century. Mobile robots, as a key component of the experimental platform for intelligent vehicle control systems, are of great significance for research on key technologies of ITS. This paper introduces the composition and structure of the SJTNC-1 mobile robot for ITS and details the design and implementation of the control system based on the TMS320LF2407A digital signal processor. Keywords : Intelligent Transportation System, Mobile Robot, Digital Signal Processor The concept of Intelligent Transportation Systems (ITS) was proposed by the Intelligent Transportation Systems Society (ITS) in 1990. It integrates advanced information technology, communication technology, automatic control technology, electronic technology, and computer processing technology into the entire transportation management system. Through the collection, transmission, and processing of traffic information, it coordinates and manages transportation, establishing a real-time, accurate, and efficient integrated transportation management system, thereby improving traffic efficiency and safety and realizing the intelligentization of transportation services and management. Research on key technologies of ITS, such as navigation and positioning, autonomous driving and control, and vehicle early warning and collision avoidance, has received increasing attention both domestically and internationally in recent years, and has yielded fruitful results. However, actual experimental research is still limited, with simulation experiments being the most common approach. Given the significant discrepancy between theoretical simulations and practical applications, a vehicle-type mobile robot, characterized by its intelligence, scalability, and mobility, was chosen as the main component of the research platform for key ITS technologies—the vehicle simulator. The mobile robot SJTNC-1 described in this paper is specifically designed for ITS. Considering the extensive computational requirements in key technology research, such as fuzzy control, Kalman filtering, and path guidance, and the high real-time performance requirements of the system, a digital signal processor (DSP) was adopted as the main control CPU for the mobile robot. 1. Introduction to TMS320LF2407A The TMS320LF2407A (hereinafter referred to as F2407) is a digital motor control DSP designed by TI based on the TMS320 series DSPs. In addition to the advantages of improved Harvard architecture, multi-bus architecture, and pipelined architecture found in general DSPs, it also employs high-performance static CMOS technology, reducing the voltage from 5V to 3.3V, thus reducing power consumption. Furthermore, the instruction execution speed is increased to 40 MIPS, with almost all instructions completed within a single 25ns cycle. Such high computing speed allows for improved system performance through the use of advanced control algorithms such as fuzzy control, Kalman filtering, and state control. Furthermore, it possesses the necessary peripherals for motor control applications, such as: 32K on-chip FLASH, 2K single-access RAM, Serial Peripheral Interface (SPI), Serial Communication Interface (SCI), two event management modules, a 16-channel dual 10-bit A/D converter, and a CAN controller module. 2. Motion Mechanism of the Mobile Robot Considering that this mobile robot is designed for ITS (Integrated Device System), a vehicle-type structure (four-wheel structure) is adopted. The first two wheels are connected to the steering motor via an 8:1 gear reduction mechanism to achieve the robot's steering function; the last two wheels are connected to the drive motor via a 6:1 gear reduction mechanism to achieve the robot's drive. The motor selection can be based on the actual situation, choosing either a small stepper motor or a small DC motor. Here, a DC motor manufactured by Minimotor GmbH of Switzerland is selected, which features small size and high torque. 3. Mobile Robot Control System The control system is based on the F2407 controller and consists of wireless communication, motor drive, speed sensor, digital compass, differential GPS (DGPS) receiver, and a 4-to-1 serial communication module, as shown in Figure 1. The wireless communication module receives the planned path information from the host computer according to a self-defined communication protocol. The entire control system controls the drive motor and steering motor to make the mobile robot follow this path. The motors use PWM speed regulation, with the drive motor employing a dual-closed-loop (speed and current) PID control strategy, while the steering motor uses the heading information from the digital compass as feedback for PID control. The entire control system uses the position information from the DGPS receiver as the system's position feedback information to complete the closed-loop position control of the entire system. 3.1 The MC35 wireless communication module is a dual-band GSM module supporting GPRS, manufactured by Siemens, Germany, and can be further developed. It can be connected to a PC via a standard serial port. This system uses the MC35 as the communication module between the mobile robot and the host computer. It has all the advantages of GPRS technology, such as always-on connectivity and providing high-speed, low-cost data transmission services. The product features are as follows: • Supports dual-band: EGSM900/GSM1800 • Supports GPRS Class 8 protocol • Supports data, voice, SMS, and fax services • Uses circuit switching with a maximum transmission rate of 14.4kbps • Supported voltage range: 8V~30V • Uses standard industrial interface • Dimensions: 65mm×74mm×33mm • Weight: 130g 3.2 Drive Module The drive principle of the drive motor and steering motor is the same, both using pulse width modulation (PWM) for speed control. The PWM signal is generated by F2407. The drive circuit adopts an H-bridge configuration, consisting of 4 Darlington transistors (2 TIP132 and 2 TIP137), 4 IN4001 diodes, and NAND gates. The circuit schematic is shown in Figure 2. When PWM2 and PWM4 are low and PWM1 and PWM3 are high, transistors T1 and T4 are saturated and conducting, while transistors T2 and T3 are cut off. Current flows from T1 to the motor and then to T4, causing the motor to rotate forward. Conversely, when PWM1 and PWM3 are low and PWM2 and PWM4 are high, transistors T2 and T3 are saturated and conducting, while transistors T1 and T4 are cut off. Current flows from T2 to the motor and then to T3, causing the motor to rotate in reverse. To prevent simultaneous conduction of transistors T1 and T3 or T2 and T4, which could cause a short circuit and damage the devices, a pair of non-overlapping PWM outputs must be used to correctly turn these two pairs of transistors on and off. A dead time is added between the turn-off of one transistor and the turn-on of the other, ensuring that the other transistor is completely off before the first one turns on. The F2407's dead time control unit is a key feature, allowing software to ensure that the turn-on intervals of the upper and lower bridge arm switching elements in the power circuit do not overlap, simplifying hardware circuit design and improving reliability. 3.3 4-to-1 Serial Communication Module Since the DGPS receiver, magnetic compass, odometer, and MC35 communication module all use RS-232 asynchronous serial communication, while the F2407 only has one serial port, the data from the four serial ports must be converted to complete serial communication with the F2407. Therefore, a 4-to-1 serial communication module based on time-division multiplexing was developed. When the F2407 needs data from a specific sensor (or wireless communication module), the circuit selects that sensor to use the F2407's serial port for communication; when it needs data from another sensor or wireless communication module, the selection of the previous sensor is disabled, and the current sensor or wireless communication module is selected. The 4-to-1 serial communication module consists of a 3-to-8 decoder 74LS138, a tri-state output four-bus buffer gate 74LS125, and a level converter MAX232, etc., and its circuit schematic is shown in Figure 3. 3.4 Positioning Sensors 3.4.1 DGPS Receiver GPS (Global Positioning System) is a satellite-based radio navigation system that provides a cost-effective and practical tool for determining position, velocity, and time globally. GPS consists of a constellation of 24 satellites (21 operational and 3 backup), distributed across six orbital planes with an inclination of 55° to the Earth's equator. Its orbital period is 11 hours and 58 minutes, with an orbital radius of 20,200 km and an inclination of 60° between each orbital plane. Each satellite transmits ultra-high frequency (UHV) continuous waves in the L-band, modulated with two pseudo-random codes (military high-precision secure P-code and civilian C/A-code). This distribution ensures that users can continuously receive navigation signals from at least four satellites at any location and at any time on Earth, allowing for the simultaneous calculation of the receiver's three-dimensional coordinates and the time offset between the receiver and GPS. The three-dimensional coordinates are calculated using the ECEF Cartesian coordinate system or a geodetic coordinate system such as WGS84. Although the US government removed the optional protection of civilian C/A codes in May 2001, the single-point real-time positioning accuracy of civilian navigation GPS receivers can only reach about 25m, which cannot meet the positioning and navigation requirements of the system. However, using real-time differential GPS (DGPS), the positioning accuracy can reach 2-5m, which is sufficient for the system's positioning and navigation requirements. Therefore, a single-base station DGPS (SRDGPS) system was developed, and its structural block diagram is shown in Figure 4. The base station consists of an ALLSTAR BASE GPS receiver, antenna, and MDS radio transmitter and antenna, while the rover station consists of a SUPERSTAR GPS receiver, antenna, and MDX radio receiver and antenna. The base station is installed on the roof of the first teaching building at Shanghai Jiao Tong University's Xujiahui campus, covering a radius of 30 kilometers. The rover station is installed on a vehicle-mounted unit. 3.4.2 Digital Compass and Vehicle Speed Sensor: The Honeywell HMR 3300 digital compass is used as the direction detection sensor for the mobile robot. Its main technical indicators are: (1) 1 degree heading accuracy, 0.1 degree resolution; (2) 0.5 degree repeatability; (3) ±60 degree tilt and pitch range; (4) 15Hz response time; (5) -40±85 degree operating temperature; (6) 6~15V DC voltage. At the same time, the Hall speed sensor used in Volkswagen Santana 2000 cars is used as the speed sensor of the mobile robot. Its working principle is to use the Hall sensor as the conversion element to convert the mechanical rotation into an electrical pulse signal output. The main technical indicators are: (1) the output waveform is a rectangular pulse with a duty cycle of 50%; (2) 6 pulses are generated for each rotation; (3) the rated voltage is 12V. 4 Power Module The power module needs to supply power to each sensor, DSP chip, other chips and motor respectively. Among them, the magnetic compass, code disk and DGPS receiver use 12V DC voltage, the DSP chip uses 3.3V DC voltage, other chips use 5V DC voltage, and the motor power supply uses 12V DC voltage. Therefore, a single 12V DC battery (4AH) is used, and the 5V DC power is achieved through STMicroelectronics' L7805 and a power transistor for current amplification. The DSP chip uses a 3.3V power supply from ON Semiconductor's 1SMB5913BT3. When the F2407 is working normally, all power pins are at 3.3V; when writing to the FLASH memory, the VCCP pin is powered at 5V; during reset, the reset circuit generates a 10μs-wide continuous low level to reset the chip. The DSP program consists of five main functional modules: system initialization module, serial communication module, path guidance module, drive motor control module, and steering motor control module. TI provides the CC and CCS platforms for C language development. This platform includes an ANSI C optimized compiler, allowing development and debugging at the source code level. This approach greatly improves software development speed and readability, facilitating software modification and portability. However, in some cases, the efficiency of the code still cannot compare to that of manually written assembly code. Furthermore, implementing certain hardware controls of the chip using C language is not as convenient as using assembly code, and some are even impossible to implement using the language. To fully utilize chip resources and better leverage the respective advantages of C and assembly languages in software development, a hybrid programming approach is adopted to organically combine the two, balancing their strengths and avoiding their weaknesses. The system framework is shown in Figure 5. The key modules are briefly described below. 5.1 Serial Communication Module This module uses serial port interrupts. The main program consists of system initialization, serial port initialization, serial port interrupt settings, and interrupt waiting. The interrupt subroutines are divided into sending and receiving subroutines. The flowchart of the sending subroutine is provided. The flowcharts of the main program and sending subroutines are shown in Figure 6. 5.2 Path Guidance Module This module provides real-time speed and steering commands to the mobile robot, guiding it along the path given by the host computer. It mainly includes two stages: generating driving commands and tracking the planned path. Based on the pre-aiming and following theory and the characteristics of driver behavior, intelligent driving and driver control behavior are inherently consistent. Through research on driver control behavior, it was found that the vehicle's forward speed is mainly determined by two factors: the curvature of the road and the robot's directional deviation relative to the reference path. The forward speed control of the mobile robot does not need to be continuously changed and can be set to three levels, corresponding to high, medium, and low speeds respectively. The forward speed tracking rules are determined as follows: • When the directional deviation is less than 10 degrees, the path is basically straight, and the forward speed is set to high; • When the directional deviation is less than 90 degrees, the path is severely curved, and the forward speed is set to low; • In other cases, the forward speed is medium. 5.3 Drive Motor and Steering Motor Control Modules The drive motor module adopts a PID control strategy, using the signal detected by the vehicle speed sensor as the feedback signal for the motor, achieving good control results. The control strategy of the steering control module is similar to that of the drive motor, except that its feedback signal is the direction signal from a digital compass. The PID control formula is: Where u(k) is the control output; e(k) is the deviation at time k; Kp, Ki, and Kd are the proportional coefficient, integral constant, and derivative constant of the PID control algorithm, respectively. References 1 Shi Xinhong. Development of Intelligent Transportation Systems. Journal of Northern Jiaotong University, 2002; 26(1): 29-34 2 Li Xianyong. Visual C++ Serial Communication Technology and Engineering Practice. Beijing: People's Posts and Telecommunications Press, 2002 3 Liu Heping. Structure, Principle and Application of TMS320LF240X DSP. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002 4 Huang Yingzhe. Principle of TMS320C240 and C Language Control Application Practice. Beijing: China Water Resources and Hydropower Press, 2003 5 Li Qingzhong. Research on Intelligent Pre-aiming Control Method for Path Tracking of Mobile Robots. Robot, 2002; 24(3): 252-255