Design of mobile robot system based on OPenWrt

In recent years, with the development of artificial intelligence technology, computer technology and other related technologies, research on mobile robots has become more and more extensive. This design is a mobile robot using the OpenWrt operating system, which can realize a variety of different functions, such as detecting danger, patrolling, image acquisition, positioning, wireless communication, etc. It can also be used as a good carrier for various intelligent control methods (including dynamic obstacle avoidance, path planning, and group collaboration strategies) for research.

introduction

In recent years, with the development of artificial intelligence technology, computer technology and other related technologies, research on mobile robots has become more and more extensive. This design is a mobile robot using the OpenWrt operating system, which can realize a variety of different functions, such as detecting danger, patrolling, image acquisition, positioning, wireless communication, etc. It can also be used as a good carrier for various intelligent control methods (including dynamic obstacle avoidance, path planning, and group collaboration strategies) for research.

1 System solution

Adopt a 2-tier architecture. The upper layer uses the ARM processor S3C2440 as the core, and the MINI2440 development board is selected as the upper main board, which is responsible for image acquisition and sends the image to the remote PC via Wi-Fi. Wi-Fi wireless communication is realized by using a PC and a wireless router to build an environmental platform.

The lower layer is a single-chip microcomputer control board with 51 single-chip microcomputer as the core, which is composed of 51 single-chip microcomputers and peripheral circuits. The lower layer is mainly responsible for robot movement control and sensor data processing. The 51 single-chip microcomputer controls the speed and steering of the DC motor through the I/O port output PWM signal, and realizes the robot’s forward, stop, left and right rotation. The interface circuit of the single-chip microcomputer is connected with an ultrasonic distance measuring module, a human infrared sensor module, and a stepping motor module. Ultrasonic distance measurement module is used to realize robot avoidance. A stepping motor is installed at the front end of the embedded intelligence, and the ultrasonic ranging module is placed on the shaft of the stepping motor. The stepping motor keeps rotating back and forth, and the ultrasonic ranging module also rotates accordingly. In this way, one ultrasonic ranging module can realize multi-directional ranging, thereby reducing the number of ultrasonic ranging modules.

The robot is mainly composed of a hardware system and a software system. The hardware system mainly includes: ARM processor, single chip microcomputer, peripheral interface circuit, robot chassis and power supply, etc. Among them, the ARM processor is the core of the upper layer, and the 51 single-chip microcomputer is the core of the lower layer. The software includes: embedded Linux operating system, peripheral driver, Linux application and microcontroller application, etc. The system did not choose the usual embedded Linux version, but took a different approach and chose one of the unique embedded Linux distributions, OpenWrt, as the operating system. OpenWrt provides a fully writable file system and software package management. It reduces the threshold of embedded Linux development and improves the efficiency of system software development in a simple and easy-to-use way.

The working process of the embedded intelligent mobile robot is: the sensor module collects the surrounding environment information in real time, and transmits this data information to the robot control system. The single-chip microcomputer obtains effective data through data analysis, thereby knowing the relative position of the robot and the obstacle, and then according to this The position information generates a control signal; the single-chip microcomputer generates a PWM signal to control a DC motor to control the steering of the robot, so as to achieve the purpose of autonomous “walking” of the robot. The lower-layer single-chip microcomputer communicates with the upper-layer ARM processor through a serial port, and the ARM motherboard can transmit the working data of the lower-layer single-chip microcomputer control board to the remote PC through wireless Wi-Fi. The ARM motherboard can continuously send clear live pictures collected by the USB camera to the remote PC control terminal.

2 System hardware design

The hardware system mainly includes: ARM processor, single-chip microcomputer, peripheral interface circuit, robot chassis and power supply, among which the ARM processor is the core of the upper layer, and the 51 single-chip microcomputer is the core of the lower layer. The hardware structure block diagram is shown as in Fig. 1.

Design of mobile robot system based on OPenWrt

It can be seen from Figure 1 that the system is mainly composed of the following modules: image acquisition module, wireless communication module, ultrasonic ranging module, infrared sensor module, MINI2440, single-chip microcomputer STC89 C52 and DC motor drive module. The following focuses on the DC motor drive module.

The DC motor drive module is based on the L298N chip, which has the characteristics of strong load capacity. The DC motor drive circuit is shown in Figure 2. The peripheral circuit of the drive circuit chip is mainly a bridge circuit composed of diodes connected in parallel with 2 groups of motors to achieve the purpose of controlling the motor to operate according to the setting.

Design of mobile robot system based on OPenWrt

The mobile robot adopts the H-bridge control scheme, and the overall control scheme is shown in Figure 3.

Design of mobile robot system based on OPenWrt

The motor has 4 PWM outputs Ⅲ as the driving of the left and right wheels respectively, and one motor can be controlled through 2 PWM outputs, and the two motors are connected in parallel.

When the L298N chip enable signal ENABLE is high, the output changes with the input, otherwise it is in a high-impedance state, so during welding, both the ENABLE pin and the power supply pin VS are connected to the power supply VCC.

The specific driving process is as follows: through programming, the control chip sends out a driving signal through PWM, the PWM output is used as the input of L298N, and the control signal is converted and output by L298N to make the motor rotate, thereby realizing the driving of the motor.

The level of the PWM output signal can control the speed of the DC motor. When the duty cycle increases, the speed increases; when the duty cycle decreases, the speed decreases; when the PWM signal output duty cycle is 0, the motor can be controlled to stop.

When the left wheel stops and the right wheel turns, the trolley turns left; when the right wheel stops and the left wheel turns, the trolley turns right. The positive and negative sequence conversion of the 2-channel PWM output can control the forward and reverse of the motor, and then control the forward and backward of the car.

3 System software design

The software part is the embodiment of the intelligence of the mobile robot, which controls all the running states of the mobile robot.

The operating system uses the OpenWrt operating system, which simplifies the customization process of the Linux kernel and allows developers to customize embedded devices using the concept of software packages, thereby simplifying the process of embedded software development.

The program is written in the Kubuntu CodeBlock IDE integrated development environment, compiled with the ARM eabi cross-compilation tool compiled by OpenWrt, and then burned into the mobile terminal through the serial port of the terminal Sercurt-CRT and the cross-compiled program and system.

The application software controls the obstacle avoidance, camera, video sending and other behaviors of the car. In terms of communication, an FTP server is set up with vsttp software on the host side, and a wireless local area network is established through the IEEE802.11g (RTL8187) wireless network card. In this way, the mobile terminal can receive the control command from the host computer to arrive at the designated place to take pictures and send the pictures, while the PC terminal can receive the pictures transmitted via Wi-Fi.

The system software structure is shown as in Fig. 4.

Design of mobile robot system based on OPenWrt

The system driver is rewritten using routines provided by the MINI2440 development board and compiled into the kernel.

The camera control software mjpg-strearner is provided by OpenWrt in the form of a software package, and it outputs images in MJPEG format through port 8080. The wireless communication part is socket programming under Linux, which provides remote control support for the client. Part of the code for wireless communication is as follows:

Design of mobile robot system based on OPenWrt

The system drives and controls the camera through the MINI2440, controls the underlying single-chip microcomputer through the serial port, drives and connects the wireless network card, runs the server, and provides a UI interface. The OpenWrt rendering after compilation is shown in Figure 5.

Design of mobile robot system based on OPenWrt

Concluding remarks

The OpenWrt operating system selected for this system is suitable for the design requirements of mobile robots. The software package provided by the system simplifies the system development process and improves the development efficiency. After actual debugging and running, the system can fully meet the design requirements, and can be used in areas such as danger detection, image acquisition, target positioning, and wireless communication.

The Links:   ASSYHLD1014-03-0010 LB104S01-TL05 LCD-DISPLAY