Design of a Remote Control Vehicle Based Wireless Communication used for Fighting Fire

Intelligent vehicle get the status information of its body by using sensors. After analyzing data, the vehicle gives the decision results to the driver. In addition, the Smart car also has a good ability to adapt to the environment which can be used in exploration, disaster and other special occasions. An intelligent car was designed to fight forest fire. Wireless remote controlled unmanned forest fire vehicle and remote control PC software was designed. The structure matching and motor coordination of drive the smart car's power and motion control system was studied. By test, it was proved it has have a good stability and reliability.


INTRODUCTION
Due to the increase of population, the popularity of vehicle, traffic accidents are increasing, which caused a great loss to people's lives and property. Therefore, improving the traffic environment and the safety performance of automobile, reducing road traffic accidents will be the important research issue related to the sustainable development.
Smart car belongs to the robotics, which is known as the most active areas of scientific and technological development integrating automatic control, artificial intelligence, mechanical engineering, sensor, image processing technology and latest research results of information technology. Now countries around the world showed enthusiasm in the research and development of intelligent vehicle technologies. The development of intelligent vehicle can improve the state of the traffic environment, vehicle safety and reliability, and reducing traffic accidents caused by human factors such as the driver.
The research of wireless intelligent remote control car is based on VC++ and controlled by joystick. After host computer received manipulator's instructions, the model car transmits the instructions to wireless module. After the wireless module of smart car receiving the instructions from the host computer, it runs in accordance with the instructions of the host computer. Meanwhile, the camera sends the road information to the control interface of the host computer, which realizes the smart car remote control.

II. OVERALL DESIGN OF THE SMART CAR
The chassis body uses the specified race car model of Freescale. The model car is four-wheel drive with McPherson independent suspension. A 16-bit microcon-troller Freescale MC9S12XS128 used as the core control unit for the control of intelligent vehicle systems. The signal of position is acquired by the CMOS image sensor, which can sends real-time images through the wireless module to the host computer to judge environment in front of the smart car and make motion control decisions. After receiving control commands sent by the host computer, the internal micro controller module of XS128 issues PWM wave, driving the DC motor controlling acceleration, deceleration, forward or reverse and the steering control of the smart car, so that the smart car can run according to the control instruction. In order to get precise speed control, the optical encoder is installed on the output shaft of smart car drive motor to acquire the speed pulse signal of wheel, after capturing by the MCU PID automatic control.
To build the forest fire fighting vehicle system, it needs to choose reasonable hardware, develop software, and improve the structure in accordance to the demand. The configuration of system is shown in Fig 1. The vehicle captures the scene by a camera. Then transfer it to the host computer. The controller judges it and sends a control signal to the vehicle by a joystick according to the scene.
To achieve good stability and dynamic response capability by optimizing the intelligent vehicle drive system, it has combined the computer simulation and laboratory test. The control mode is shown in Fig 2. The MCU MC9S12XS128 receives the scene transferred by a camera and velocity signal by a transducer. And control two motors, one for steering, and the other for driving. It can transfer its status to the host computer by wireless module.

A. Power supply module
Power supply module is an important part for a control system, it related to if the system can work properly. The smart car is powered by the 7.2V Ni-Cd battery. While the single-chip systems, optical encoder needs 5V power supply. Its range is 4-6V. Image sensor of environmental testing requires 3.3V power supply. And the battery can directly power the DC motor. 5V power supply module is used for the power supply of the SCM system, photoelectric encoder and etc. The usual power consists of the series linear regulated power supply (LM2940, 7805, etc.) and switching regulated power supply (LM2596, LM2575, etc.). Due to the good regulator linearity of LM2940, so it's a very good choice to use LM2940-5 to be a separate power supply.

B. Motor Drive Module
The PWM waves issued by the MCU control the motor voltage through 33886 microchip. The MCU P0, P1, P2 and P3 port outputs PWM wave separately, input through the IN1, IN2 port and the OUT outputs motor speed control signal. The internal of microchip MC33886 has the function of short circuit protection, under-voltage protection and over-temperature protection functions. The MC33886 internal is integrated of two half-bridge driver circuits. This design needs to control both the forward speed of the car and the car reversing. Therefore, a fullbridge driver motor is used.

C. Wireless Module Parameter Settings
Different options can be set according to the user's needs. RF-ANET software can set the serial port parameters, the transceiver parameters and address code. The APC220 wireless module is connected with the PC, so it need to convert TTL level to RS232 level through converter chip and the wireless module connecting with PC USB port.

D. Speed Sensor
Due to the limitation of mechanical structure of the car model, small size, light weight speed sensors must be adopted. So the photo electric sensor was chosen.
Set the down counter module of the S12 modulus, and capture the rising edge of the output electrical pulse of photoelectric encoder at the same time. Then a speed equivalent to the parameter values can be obtained by accumulating the number of pulses within a certain time.
The tire circumference is 16.7 cm. The drive ratio of the Motor to the wheel is f. The number of encoder line is e. One rotation of the tire will cause e * f the number of pulses accumulated.
The speed is: Where, t is the accumulated time of the pulse, n is the number of cumulative pulse in t s.
In the case of the transmission ratio being constant, the more the number of lines of the photoelectric encoder, the more number of pulses that can be detected within the same unit time under the same speed, and thus the higher resolution of the speed detection is. Besides, an increase in the number of lines, the duration time between adjacent pulses becomes short, and there liability of the pulse detector will be affected due to the interference of the adjacent pulses.

E. PID control algorithm
The control of the car is divided into two parts: steering control and speed control. On the aspect of steering control, through adjusting the steering gear steering to adjust the duty cycle of the PWM wave. PID closed-loop control is used to control speed. To achieve the accuracy of the speed control, get smart real-time speed of the car, the wireless module is adopted. The PID control algorithm convert the deviation proportional P, integral I and derivative D into the control amount by the linear combination, use this control amount as the controlled object. There are four important parameters: the sampling period, the scaling factor, the integral coefficient and a differential coefficient in the PID control algorithm.
Sampling period T is an important parameter in the computer control system. Considering fidelity of the signal, the sampling period T shouldn't be too long. Considering the control performance, the sampling period T should be as short as possible. That is to say, the sampling angular frequency !s should be as high as possible. But as higher of the sampling frequency, the faster the speed of operation of the microcontroller requires, the greater memory capacity requires, which increases the working hours and work load of the computer. Otherwise, if the sampling frequency is higher to a certain extent, the improvement of the system performance is no longer significant. This system uses 20ms as the control cycle, which is effective and sufficient for the control.
Unit feedback e represents the error between the ideal input and the actual output. The error signal is sent to the controller to calculate the integral value and the differential value of it, and they are linear combined with the original error signal to get the output u. (2) Where, kp, ki, kd is proportional coefficient, integral coefficient and the differential coefficient. u is sent to the execution mechanism, thus obtaining a new output signal u. This new output signal is sent to the sensor again to the discovery new error signal, the process is going as a cycle. The PC program need to implement the following functions: serial communication, access to the joystick instruction, the LabVIEW instrument display, image acquisition of the camera and displaying.
After the execution PC application program, it should detect if the PC is connected with the joystick. Then open the serial port, start the wireless module connected to the USB port of a PC, receiving the camera image data sent by the camera and displaying the real-time road situation ahead. After the manipulator making steering instructions to the smart car, application program of PC receives data of joystick through the serial port of the wireless module, and then sent it to the smart car. So the smart car began to move forward or rewind.
In the advancing process of the smart car, speed sensor on the smart car acquire the motor speed, and fed back to the MCUPID closed-loop algorithm to achieve closedloop control of the speed of the smart car. Meanwhile, the motor speed is sent back to the host computer by MCU through the wireless module, and the LabVIEW instrument of the host computer displays the real-time intelligent speed and front wheel steering angle of the smart car. Each operation of the joystick will be displayed.
The system uses the DirectInput interface objects to achieve fast corresponding of the joystick input event. After Direct Input code is written and compiled without error. Prior to execution of the program, the joystick needs to insert in to the USB port of PC. The interface is divided into two parts: the upper portion of the text box is used to display the status data transmitted by the smart car, the lower portion of is used to display the key value of the joystick acquired by the program. During the commissioning phase, make the smart car still sent back the data directly to the host computer. Press any button of joystick, text box shows the serial data. Integrate collecting the video streams by DirectShow modules in OpenCV.
Before video capturing by the camera, camera opens according to the registered device number, and completing the initialization of video capture. The DirectShow support multiple cameras' acquisition. It will retrieve the current line number of the camera. If the camera number is zero means that the camera is not turned on, and end the acquisition. Otherwise, retrieve the name of the pending acquisition camera, and come into the acquisition cycle. In the acquisition process, firstly retrieve one, and displaying, coding, processing and storage operations of the image. If the acquisition is complete, then exit. Otherwise, continue to remove the other one processed, and finally complete the video stream collection. DirectShow video capture process is shown in Fig 3. Through integration and programming the serial communication, handle input module based on the DirectInput, image acquisition module assembly-based the OpenCV camera and LabVIEW-based virtual instrument interface, the interface as shown in the figure. Through the host computer, smart car travel remote control can be achieved with a joystick, and acquire the real-time steering angle and speed of the smart car. At the same time, the road in front of the smart car can also be informed.
To avoid misuse, the manipulator should be informed of their key operations timely. The joystick status bar can display operation status on the interface. Design and complete wireless smart car control system based on VC + +, and host computer based on Freescale MC9S12XS128 microcontroller. MCU timer module, SCI module and PWM module was used to realize the function of microcontroller control motor speed, steering gear steering control and wireless transmission. The interface can receive the information of manipulation handle, which is sent by wireless serial to smart car, collecting real-time image of the smart car camera feedback, clearly display on the control interface. By researching the wireless mechanism, error-free transmission between PC and realtime status data and control data of smart vehicle is completed.