Authors: Xu Ai, Tan Baocheng, Lian Chunyuan, Zhang Haigang

1 Introduction

Intelligent mobile robots integrate multi-disciplinary research achievements such as machinery, electronics, computers, automatic control, and artificial intelligence, and have a prominent position in the current field of robotics research. The control system is the core part of the robot. At present, the microcontrollers used in the bottom control system of the robot mainly include 8/16-bit microcontrollers and digital signal processors (DSPs). However, the use of 8/16-bit single-chip microcomputers has low data processing ability, and the hardware circuit is huge and the system stability is weak. The original intention of DSP design is for digital signal processing. In comparison, embedded microprocessor ARM has almost the same internal resources and operations. Speed, but the performance is better than DSP in control, and many ARM devices support TCP/IP protocol, which is beneficial to the network control of robots in the future. Considering the above factors, an intelligent wheeled mobile robot control system based on ARM and complex programmable logic device (CPLD) is proposed here to realize the underlying control of mobile robots.

2 System composition and working principle

The mechanical navigation structure of the wheeled mobile robot designed by the system adopts a four-wheel differential steering mechanical mechanism. The front two wheels are follower wheels, which play a supporting role, and the rear two wheels are driving wheels, which are driven by two synchronous motors, respectively. Controlling the rotational speed of the two driving wheels enables the robot to move in different directions and speeds, with flexible movement and good controllability.

The mobile robot uses the PC as the host computer, uses the camera to analyze the robot’s own position and the external environment, establishes an environment map, and performs path planning. The upper computer sends motion control commands to the bottom control system of the mobile robot, and provides the theoretical speed value of the left and right drive motors. The robot control system with ARM and CPLD as the core communicates with the host computer through the wireless transceiver module, controls the operation of the motor and the transmission and reception of the ultrasonic sensor group according to the command of the host computer; and makes obstacle avoidance decisions according to the obstacle information . The block diagram of the control system of the intelligent mobile robot is shown in Figure 1.

3 Control system hardware design

3.1 Design of the main control module

The core controller of the intelligent wheeled mobile robot control system adopts Samsung’s S3C44B0X, which is a 32-bit microprocessor based on ARM7TDMI core (suitable for real-time environment), with high-speed computing capability, A/D converter, rich I /O ports and interrupts are beneficial to realize the motor control, sensor information processing, external communication and complex control algorithms of mobile robots. The system adopts CPLD as coprocessor, provides programmable pulse generating circuit, photoelectric encoder input circuit, ultrasonic sensor input circuit, here we choose MAXⅡseries EPM1270 device from ALTERA Company. The system design makes full use of the high-speed logic processing capability of CPLD. The main controller ARM only needs to set the control parameters, which reduces the burden of the main controller, improves the real-time performance of the system, and also reduces the peripheral hardware circuits and improves the control system. stability and reconfigurability.

The ARM and the CPLD are connected through a parallel bus, which includes the address, data, control and multiple programmable I/O buses of the ARM device. ARM controls CPLD by accessing specific addresses and I/O ports, and CPLD sends interrupt requests to ARM through programmable I/O ports.

3.2 Design of Motor Control and Drive Module

The speed of the two driving wheels of the wheeled mobile robot is controlled by two driving motors respectively, so that the robot can move in different directions and speeds. The performance of the wheeled mobile robot requires large motor torque and small pulsation. The drive motor has good performance at high, medium and low speeds, and the control method is simple, so the drive motor adopts a square wave driven AC permanent magnet synchronous motor. This motor adopts electronic commutation operation according to the feedback information of the rotor position, and the motor speed is proportional to the frequency of the driving signal. Excellent advantages.

The system forms a control circuit through CPLD and external drive devices, adopts square wave drive and positioning control (power-on state control) to control two permanent magnet synchronous motors, and obtains adjustable and precise speed and position control, with a compact structure. The control principle of the two motors is the same, and only one is introduced here.

The motor control circuit in CPLD is composed of frequency dividing circuit, speed regulating circuit and phase sequence distribution circuit. Among them, the frequency dividing circuit is composed of frequency dividers; the speed regulating circuit is a 5-bit down counter that uses the arithmetic operation module lpm_counter of the LPM macrocell library of MAX+PLUS II to form a preset number. According to the required speed, set the preset number, the counter counts down the clk pulse signal output from the frequency dividing circuit to zero, and outputs a borrow pulse, and reloads the preset number to count down, and the borrow pulse cout As the output pulse of the speed control circuit, the frequency range of the cout borrow pulse is fclk/1-fclk/31, that is, a speed control factor (preset number) with a step size of 1 is introduced. By changing the speed regulation factor, the pulse signal can be continuously adjusted by 1 to 31 times, so as to adjust the speed of the motor; and the phase sequence distribution circuit uses the cout borrow pulse as the input, using two D flip-flops and gate circuits. Output 4 square wave pulses with a phase difference of 90° as the control signal of the two-phase synchronous motor; the stop signal controls the start and stop of the motor; the dir signal controls the direction of the motor. uAB leads uCD by 90°, and the frequency of each phase signal is 1/4 of the pulse frequency of cout. The principle of speed regulation and phase sequence distribution circuit input in CPLD is shown in Figure 2. The simulation results verify the correctness of the design logic, as shown in Figure 3.

The external driver adopts L298 dual H-bridge high-voltage and high-current power integrated circuit, and outputs the 4-phase square wave signal generated by the pulse generator circuit to the input terminals IN1~IN4 of L298 through the bus transceiver 74LS245 to control the on-off of the H-bridge, so that the motor Reverse or stop. In order to prevent the feedback voltage of the motor from damaging the L298 at the moment of starting and stopping, 8 diodes are added between the output end of the L298 and the motor to protect the freewheeling current.

In order to improve the control performance of the motor and realize more precise and stable motion control of the robot, it is necessary to obtain the speed information of the motor as the feedback link of the motor control. The system uses an incremental photoelectric encoder for speed detection. The two photoelectric encoders are respectively It is coaxially connected with the two motors, and the CPLD cooperates with the ARM device to realize the variable pulse number/pulse cycle speed measurement, that is, the variable M/T speed measurement, and the motor speed is sampled regularly. The difference between the sampling speed and the given speed of the host computer is passed to the PID controller. So as to realize the closed-loop control of the motor speed.

3.3 Ultrasonic Sensing Module

Obstacle avoidance is the basic function of an intelligent mobile robot, and the primary task of obstacle avoidance is to determine the location of the obstacle. The path planning implemented by the PC based on the robot vision system is easily disturbed by factors such as the intensity of the field of view light and the background color. To solve this problem, the robot uses the ultrasonic sensor distance measurement in the single-chip control system to realize the robot’s detection and positioning of obstacles.

Ultrasonic ranging adopts the time-transit ranging method, that is, according to the time t taken by the ultrasonic receiver to receive the reflected wave after the ultrasonic wave is emitted from the ultrasonic generator to the ultrasonic wave encounters obstacles in the propagation process, and the propagation speed of the ultrasonic wave in the air. v(v=331.4(1+T/273)1/2m/s; T is the temperature in Celsius), the distance between the robot and the obstacle is l=vt/2. The module uses a total of 3 pairs of ultrasonic transducers, which are distributed in the front, left front, and right front of the robot. The ARM sends out a control signal to start the internal timer for timing. After the control signal is amplified by the power, it is used as the startup signal of the ultrasonic sensor drive circuit. The high-frequency oscillation signal returned by the ultrasonic sensor when it encounters an obstacle is amplified and then caused by the receiving circuit to cause an external interrupt of the ARM. The timer can be obtained in the interrupt program. Count the value and calculate the distance. The block diagram of the ultrasonic sensor module is shown in Figure 4.

4. Software design of control system

4.1 Embedded Operating System

The intelligent wheeled mobile robot is a typical real-time multi-task system. The traditional single-task sequential execution mechanism cannot meet the real-time requirements of the system design, and the reliability is not high for complex systems. Therefore, the real-time operating system μC/OS- II. It is an open source, portable, curable, and tailorable embedded operating system. It has the characteristics of small code size, occupied real-time kernel, many tasks, determinable execution time, and stable and reliable operation. Transplant μC/OS-Ⅱ to S3C44B0X, and cut the operating system to save storage space.

The multitasking system based on real-time kernel can be divided into system layer and application layer. The system layer consists of the kernel and driver libraries; the application layer includes all the code used to achieve the goal of the robot’s task. In the program design of the system software application layer, the tasks of the robot are decomposed into multiple user tasks such as communication, information collection, and motor control. The embedded operating system μC/OS-Ⅱ manages and schedules task modules, coordinates the operation of various tasks of the robot, and ensures the real-time and reliability of the system.

4.2 Motion Control Algorithms

In order to ensure the stability and accuracy of the movement of the mobile robot, so that the system can respond quickly and with a small overshoot when controlling the robot’s forward, backward, turning, braking and other actions. In the process of controlling the motor, the system adopts an integral separation method PID control algorithm. The specific implementation method of the algorithm is as follows:

5 Conclusion

An intelligent wheeled mobile robot control system based on ARM and CPLD is proposed. This scheme makes full use of the internal resources of ARM and CPLD. It not only has the characteristics of small size and fast operation speed of ARM microcontroller, but also has the high-speed logic of CPLD. Processing power, flexible scalability and reconfigurability. The debugging and running experiments of software and hardware have proved that the system has flexible control, good real-time performance and high reliability, which can meet the control requirements of intelligent wheeled mobile robots. The control system of the intelligent wheeled mobile robot can be used for mobile robot control systems in different occasions, has certain universal applicability, is cost-effective, and has strong practical value.

Responsible editor: gt

Leave a Reply

Your email address will not be published.