Intelligent mobile robot integrates the research results of mechanical, electronic, computer, automatic control, artificial intelligence and other disciplines, and has a prominent position in the current robot research field. The control system is the core part of the robot. At present, there are mainly 8 / 16 bit microcontroller and digital signal processor (DSP) used in the bottom control system of the robot. But the ability of 8 / 16 bit MCU to process data is low, and the hardware circuit is huge, and the system stability is weak. DSP is designed for digital signal processing. In contrast, arm has almost the same internal resources and operation speed, but its control performance is better than DSP, and many arm devices support TCP / IP protocol, It is beneficial to the network control of robots in the future. Considering the above factors, this paper proposes an intelligent wheeled mobile robot control system based on arm and CPLD to realize the bottom control of mobile robot.
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 follow-up wheels, which play a supporting role, and the back two wheels are driving wheels, which are driven by two synchronous motors. The rotation speed of the two driving wheels is controlled respectively, so that the robot can move in different directions and speeds, with flexible movement and good controllability.
The mobile robot takes PC as the upper computer, analyzes the robot’s own position and external environment by using the camera, establishes the environment map, and carries on the path planning. The upper computer sends the motion control command to the bottom control system of the mobile robot to provide the theoretical speed value of the left and right driving motors. The robot control system with arm and CPLD as the core communicates with the host computer through the wireless transceiver module. According to the command of the host computer, it controls the operation of the motor and the sending and receiving of the ultrasonic sensor group; According to the information of obstacles, the decision of obstacle avoidance is made. The structure block diagram of intelligent mobile robot control system is shown in Figure 1.
3. Hardware design of control system
3.1 main control module design
The core controller of the intelligent wheeled mobile robot control system adopts Samsung’s S3C44B0X. It is a 32-bit microprocessor based on ARM7TDMI core (suitable for real-time environment). It has high-speed computing ability, a / D converter, rich I / O ports and interrupts, which is conducive to the realization of motor control, sensor information processing, external communication and complex control algorithm of mobile robot. CPLD is used as coprocessor in the system. Programmable pulse generation circuit, photoelectric encoder input circuit and ultrasonic sensor input circuit are provided. Max Ⅱ series epm1270 device of Altera company is selected here. The design of the system makes full use of the high-speed logic processing ability of CPLD, and the main controller arm only needs to set the control parameters, so as to reduce the burden of the main controller, improve the real-time performance of the system, reduce the peripheral hardware circuit, and improve the stability and reconfigurability of the control system.
Arm and CPLD are connected by parallel bus, which includes address, data, control and multi-channel programmable I / O bus of arm devices. Arm controls CPLD by accessing specific address and I / O port, and CPLD sends interrupt request to arm through programmable I / O port.
3.2 design of motor control and drive module
The speed of two driving wheels of wheeled mobile robot is controlled by two driving motors respectively to realize the movement of robot in different directions and speeds. The performance of wheeled mobile robot requires large motor torque and small pulsation. At high, medium and low speed, the drive motor has good performance, and the control mode is simple. Therefore, the AC permanent magnet synchronous motor driven by square wave is selected as the drive motor. According to the feedback information of rotor position, this kind of motor adopts electronic commutation operation, and the motor speed is proportional to the frequency of driving signal. It not only has the advantages of simple structure, reliable operation and convenient maintenance of AC motor, but also has the advantages of good dynamic characteristics and excellent speed regulation performance of DC motor.
The control circuit is composed of CPLD and external driver. The system controls two permanent magnet synchronous motors by means of square wave drive and positioning control (power on state control), so as to obtain adjustable accurate speed and position control, with compact structure. The control principle of the two motors is the same, here only one is introduced.
The motor control circuit in CPLD consists of frequency division circuit, speed regulation circuit and phase sequence distribution circuit. The frequency divider circuit is composed of a frequency divider; The speed regulating circuit is an arithmetic operation module LPM of MAX + plus Ⅱ LPM macro cell library_ Counter is a 5-bit counter that can be preset. According to the required speed, the preset number is set. When the counter counts down the CLK pulse signal from the frequency dividing circuit to zero, it outputs a borrow pulse, and loads the preset number again for counting down. The borrow pulse cout is used as the output pulse of the speed regulating circuit. The frequency range of the borrow pulse cout is fclk / 1-fclk / 31, that is, the speed regulating factor (preset number) with step size of 1 is introduced. The speed of the motor can be adjusted by changing the speed regulating factor to divide the pulse signal 1 ~ 31 times continuously; The phase sequence distribution circuit takes cout borrow pulse as input, and uses two D flip flops and gate circuit to output four square wave pulses with phase difference of 90 ° as control signals of two-phase synchronous motor; The stop signal controls the start and stop of the motor; The phase voltage UCD is 90 ° ahead of UAB in forward rotation and 90 ° ahead of UCD in reverse rotation. The frequency of each phase signal is 1 / 4 of cout pulse frequency. 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. The four phase square wave signal generated by pulse generator circuit is output to the input terminals in1-in4 of L298 through bus transceiver 74ls245 to control the on-off of H-bridge and make the motor rotate or stop. In order to prevent L298 from being damaged by the feedback voltage at the moment of starting and stopping, eight diodes are added between the L298 output terminal and the motor to protect the power-off freewheeling.
In order to improve the control performance of the motor and realize more accurate 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. In this system, incremental photoelectric encoders are used for speed detection. Two photoelectric encoders are coaxially connected with two circuits of motors, and CPLD and arm are used to realize variable pulse number / pulse period speed measurement, That is variable m / t speed measurement, timing of motor speed sampling. The difference between the sampling speed and the given speed of the upper computer is transmitted to the PID controller. So as to realize the closed-loop control of the motor speed.
3.3 ultrasonic sensor module
Obstacle avoidance is the basic function of intelligent mobile robot. The primary task of obstacle avoidance is to determine the location of obstacles. The path planning of PC based on robot vision system is easy to be interfered by the light intensity and background color in the field of view. In order to solve this problem, ultrasonic sensor is used in the single chip microcomputer control system to realize the detection and positioning of obstacles.
The time-lapse ranging method is used for ultrasonic ranging, that is, according to the time t from the ultrasonic generator to the ultrasonic receiver receiving the reflected wave when it encounters obstacles in the process of propagation, and the propagation velocity V (v = 331.4 (1 + T / 273) 1 / 2m / s in the air; The distance between the robot and the obstacle is L = VT / 2. The module uses three pairs of ultrasonic transducers, which are distributed in front, left front and right front of the robot. Arm sends out control signal to start internal timer for timing. After power amplification, the control signal is used as the start signal of the driving circuit of the ultrasonic sensor. The ultrasonic sensor generates the high-frequency oscillation signal returned when encountering obstacles. After amplification, the external interrupt of arm is caused by the receiving circuit. In the interrupt program, the count value of the timer can be obtained and the distance can be calculated. The block diagram of ultrasonic sensor module is shown in Figure 4.
4. Control system software design
4.1 embedded operating system
Intelligent wheeled mobile robot is a typical real-time multi task system. The traditional single task sequential execution mechanism can not meet the real-time requirements of the system design, and the reliability of the complex system is not high, so the real-time operating system is selected μ C/OS-Ⅱ。 It is an open source, portable, solidifiable and tailorable embedded operating system. It has the characteristics of small code size, occupying real-time kernel, many tasks, determining execution time, stable and reliable operation. take μ C / OS – Ⅱ is transplanted to S3C44B0X, and the operating system is tailored to save storage space.
Multitasking system based on real-time kernel can be divided into system layer and application layer. The system layer consists of kernel and driver library; The application layer includes all the codes used to achieve the goal of robot task. In the software application layer programming of the system, the task of the robot is divided into communication, information acquisition, motor control and other user tasks. Embedded operating system μ C / OS – Ⅱ manages and schedules the 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 algorithm
In order to ensure the stability and accuracy of the mobile robot, the system can respond quickly and the overshoot is small when controlling the robot forward, backward, turning, braking and other actions. In the process of controlling the motor, the system adopts the integral separation PID control algorithm. The implementation of the algorithm is as follows
This paper presents a control system of intelligent wheeled mobile robot based on arm and CPLD. This scheme makes full use of the internal resources of arm and CPLD. It not only has the characteristics of small volume of ARM microcontroller and fast operation speed, but also has the high-speed logic processing ability of CPLD, flexible scalability and reconfigurability. Software and hardware debugging and operation experiments show that the system has flexible control, good real-time performance and high reliability, and can meet the control requirements of intelligent wheeled mobile robot. This intelligent wheeled mobile robot control system can be used in different occasions of mobile robot control system, and has a certain universal applicability, and cost-effective, has a strong practical value.
Editor in charge: GT