Practical Application and Construction for Mobile Robot

This paper describes the construction of a rover mo bile robot which is used to follow the resultant optimal path from the global path planning technique. A remote computer is used to control the motion of the mobile robot and to upload the data of the path wirelessly. The control (positioning and directing) of the robot is based on the readings of two wheel encoders. The current direction and position of the robot are calculated relatively to its previous direction and position. The control algorithm is capable to move the mobile robot in order to follow a certain path. The software of the control algorithm is executed using PIC microcontroller. To prove the efficiency of the control algorithm, this algorithm applied on the constructed mobile robot to move it in real world environment between different start and end points. The constructed mobile robot shows that it can follow the required path and reach the target within specified error percent.


INTRODUCTION
uring the last decade, many researchers have dedicated their efforts to constructing revolutionary machines and to providing them with forms of artificial intelligence to perform some of the most hazardous, risky or monotonous tasks historically assigned to human beings.Among those machines, mobile robots are undoubtedly at the cutting edge of current research directions [1].
Mobile robot can be defined as; "An autonomous system capable of traversing a terrain with natural or artificial obstacles.Its chassis is equipped with wheels/tacks or legs and possibly a manipulator setup mounted on the chassis for handling of work pieces, tools or special devices.Various preplanned operations are executed based on a pre-programmed navigation strategy taking into account the current status of the environment" [2].In other words, mobile robot can be defined as; any intelligent machine which moves with respect to environment within limited human interaction (autonomously).
The mobile robots have the advantage of the simplicity of manufacturing and mobility in complex environments.The capacity to move without collision in such environment is one of the fundamental questions to be solved in autonomous robot-like problems.The robot should avoid the undesirable and potentially dangerous objects.These possibilities have much interest of the subject of robot-like research [3].
The methods to plan a path for mobile robot can be classified into two types: global path planning techniques and local path planning techniques or obstacles avoidance techniques.The global path planning techniques are related to those techniques that are done before the robot moves.On other hand online obstacles avoidance techniques are associated to those techniques that are done while the robot motion [4].
This paper describes the building of wheeled mobile robot that is directed through a known environment using global path planning technique based on the reading of an incremental optical encoder fixed on the wheels of the mobile robot.The reminder of this paper is organized as follows: section II illustrates the mobile robot system, section III shows the practical results and section IV introduces discussion and conclusion.

MOBILE ROBOT SYSTEM
First of all we should describe the overall system.The mobile robot system consists of three unites.These unites are mobile robot unit, wireless controller unit and computer unit.

Wireless Controller Unit
Computer Unit

USB interface
Each unit will be described in detail below.

Mobile Robot Unit
Mobile robot unit basically consists of two parts; mobile robot base and mobile robot control circuit.

a. Mobile Robot Base
The type of mobile robot is Rover 5.This robot consists of four DC motors.Each motor is supplied with gearbox of 87:1 ratio and an optical quadrature encoder that gives 1000 stage change over 3 revolutions of the output shaft.Furthermore, there are four noise suppression coils inside of the chassis for each motor.Other important specifications of this robot are: • Motor rated voltage: 7.2V.
• Speed: 1Km/hr.The mobile robot base carries the control circuit and the batteries that provide sufficient power to operate the motors and the control circuit.The mobile robot carries twelve AA batteries.Where, the four motors of the robot are derived using eight AA (1.5 V) serially connected batteries.While, the electronic circuit of control is supplied by the other four AA batteries.
Additional aluminum parts are added to the robot to fix the batteries and the control circuit on it during its motion.These parts are the batteries holder as shown in    The choice of Rover 5 mobile robot has significant advantage.The robot wheels at each side are interleaved by a robber belt.This will remove the slippery that may result at full speed and increases the accuracy of directing and positioning of the robot.In addition, the robot supplied with r elatively high torque motors and four noise suppression coils to remove the noise of the motors that may has a great effect on the electronic control circuit.

b. Mobile Robot Control Unit (MRCU)
The control unit of mobile robot is used to receive and transmit data from and to the wireless controller unit.The count of pulses for each encoder is transmitted to calculate the robot displacement.The received data of control drives the robot motors to create a robot motion according to the received data.
The MRCU consists of three subunits; wireless receiver transmitter unit, motors driving unit and process unit.This unit was used to establish a wireless interface between the mobile robot unit and the computer unit.It should provide a reliable wireless communication in order to transmit the information of robot to the computer, like; robot status (on or off), robot position and direction, and to receive direct information from the computer, like move forward, backward, right, left or break.
ii) Motors Driving Unit The Rover 5 mobile robot consists of four motors as mentioned earlier.These motors are supplied with 12V DC.The maximum current of each motor equals to 2.5A.Furthermore, each two motors on the same side of the robot are engaged with a robber belt.This means that the motors of the same side have the same speed and direction all the time.In other word, the motors on the same side can be treated as single motor.
In order to control the pattern and velocity of the robot motion according to the certain algorithm, we need to control the direction and speed of the motors of the mobile robot.On other hand motors speed are controlled using pulse width modulation (PWM) technique.A PWM technique works by making a square wave with a variable on-tooff ratio.This ratio called duty cycle.The average on time may be varied from 0 to 100 percent.In this manner, a variable amount of power could be transferred to the motor.Thus, when 50%duty is supplied to the motor, the resultant speed is 50% of the motor's full speed and when 75% duty cycle is applied, the motor speed is 75% of its full speed as shown in   The square wave of the process unit (0V-5V) is connected to the ENABLE pin of the H-bridge as shown in Figure (8) and Table (1).This will cause the H-bridge L6203 to turn off and on periodically according to the square wave and its duty cycle.Result in a 0V to 12V square wave output on pin OUT1 or OUT2 identical to the 0V to 5V square wave of the process unit.Figure (10) shows the block diagram of the motors driver unit.

iii) Process Unit
This unit is the core of the mobile robot control unit and it is responsible for all the operations related to it.In our work, a microcontroller PIC18F4550 is used as the process unit.
PIC18F4550 is a 40Pin, high-performance, enhanced flash, USB microcontroller with nanowatt technology.PIC18F4550 offers a lot of useful features; refer to [5] for more information.
The PIC microcontroller is operating with 20MHz crystal clock to execute the necessary program.The program is written using compiler under integrated development environment (IDE).
The PIC18F4550 performs three types of necessary operations to derive the mobile robot.These types of operations are; receiving and transmitting operations, position and direction estimation operations and mobile robot driving operation.

Receiving and Transmitting Operation
Our purpose is to make the mobile robot follows the optimal path in static known environment between two specific points.This optimal path is found using global path planning technique.These techniques require high processing power and large memory.So, to perform that high processing, the relatively small microcontroller unit cannot achieve this task.Thus, the path planning operation is done using remote computer and then the resultant optimal path is wirelessly transmitted to the mobile robot control unit through the ZBS-100 wireless module to be executed.

Process Unit
To transmit the data efficiently between mobile robot control unit and the computer unit, serial transceiver module of PIC18F4550 is used.PIC18F4550 consists of two types of serial communication modules.These modules are master synchronous serial port (MSSP) module and enhanced universal synchronous asynchronous receiver transmitter (EUSART).Generally, the synchronous modes can't be used with the wireless module.The synchronous modes always require a clock signal along with serial data to be transmitted at the same time.Thus, synchronous mode is not useful to our application.In other hand, the wireless module ZBS-100 can handle only one transmitting or receiving operation at one time.So, the MSSP module and EUSART module with synchronous mode can't be used.This let us interest in an asynchronous mode of EUSART model.
The asynchronous mode of the EUSART uses two pins; pin 25 RC6/TX/CK for serial data transmit and pin 26 RC7/RX/DT/SDO to receive serial data which are connected respectively to TX pin and RX pin of the ZBS-100 module.
The baud rate of the EUSART should set to the baud rate of wireless module (ZBS-100) which is 9600BPS to ensure the wireless serial data transfer.
The EUSART module has some limitations where it transmits or receives 8 bits or 9 bits only at each time.In order to send piece of data (like a distance or direction) which consists of more than 9 bits, a certain algorithm have to follow.In our case, the largest piece of data to be sent or received is of 16 bits long.The transmitter sends the first 8 bits and then when the receiver gets the first 8 bits, it sends an acknowledgment byte to the transmitter to inform that the first piece of data is received and the receiver ready for the second 8 bits, then the transmitter sends the rest 8 bits.The two 8 bits data pieces are companied to form the completed 16 bits data.
The information of the optimal path is transmitted to the robot as a block of data.The algorithm which is used to send the data of the optimal path to the robot is illustrated in Figure (11).
After the PIC microcontroller receives the data of the path, it stores this data in the EEPROM.This data is saved even if the PIC power is off, so there is no need to upload the data to the robot again after the power is off.

Direction and Position Estimation Operation
The positioning and directing algorithm of the robot is of type an incremental algorithm.The process unit (PIC18F4550) aggregates the amount of displacements and directions of the robot continually during the motion of the robot to estimate the current robot position and direction of the robot.
The PIC18F4550 contains four 16-bits timers (timer-0 to timer-3).These timers can work in two modes; timer mode if the clock is provided by the PIC clock and as a counter if an external clock is given to these timers.Two of these timers (timer-0 and timer-1) are used as counters to calculate the numbers of pulses of a two encoders of the robot.The number of pulses of each encoder is used to estimate the angular displacement of the robot's wheels.Then the angular and straight displacement of the robot is calculated according to equation (1) and equation ( 2) respectively.Where; is the number of pulses of encoder that is counted by the counter, is the angular resolution of the encoder of the robot ( ) and is the straight resolution of the encoder of the robot ( ).According to the above equations the mobile robot can be directed to the desired angle and moved by the desired distance using an interrupt routine algorithm.Where, PIC18F4550 can produce a software interrupt when one of the timers (timer-0 or timer-1) over float after receiving a specific number of the encoder pulses.This feature is used to monitor the pulses of encoder and achieve the right displacement.The directing and positioning interrupt algorithm is illustrated in Figure (12).Mobile Robot Driving Operation: PIC18F4550 microcontroller contains 35 digital I/O and 2 PWM modules.Four digital I/O pins are used as input to the two H-bridges in order to control the direction of the motors that is connected to it and the two PWM modules used to control the motors speed.
The PWM modules of the PIC18F4550 are initialized to work with 50 KHz frequency and with variable duty cycle that is related to the required velocity of robot which is sent by the computer unit.Figure (13) shows the full electronic circuit of the mobile control unit.

Wireless Controller Unit
This unit represents the link between the computer unit and the robot unit.It receives the data from the computer unit through a USB interface connection and transmits this data wirelessly using ZBS-100 module to the mobile robot unit.
PIC18F4550 microcontroller in this unit is used to perform the wireless connection operation with control unit.PIC18F4550 microcontroller contains USB module which facilitates to use with the USB interface of the computer.The USB module provides high speed, USB 2.0 connection with frequency of 48 MHz.
Each USB device has a product ID (PID) and vendor ID (VID) to recognize it from the others.Furthermore USB devices have certain classes like; USB audio device, USB communications device, USB human interface device (HID) and many others.In our work HID USB class is used because it is easy to program and requires no specific driver installation.
CCS compiler provides a set of functions to deal with USB HID.These functions used directly to send and receive data along the USB cable.
Furthermore, wireless control unit needs no external power source.The whole unit works with 5V and with current less than 900 mA.Thus the control unit is supplied from the computer itself through the USB cable.

Computer Unit
Computer unit can be considered as the main controller of the robot system.It is responsible for three main operations.The first one is calculating the optimal path for the mobile robot in specific environment.The second operation is converting the optimal path to a series of X,Y points and then a series of angles and distances.The third operation is transmitting this path to the mobile robot To facilitate the operation of computer unit, an under window user interface software is developed using VC++.When this software is running it is started with the control window as shown in Figure ( 16).After the optimal path is planned, the control window will be used to transform the data of the path to a simpler form and then send it to the mobile robot.This window contains three control groups.These groups are: a.The Path Group The path group contains three buttons; the "Initial Angle" button to define the current robot angle, "Load Path" button to load the resultant optimal path from the path address that is defined in the text control in front of the button then converts the path from a series of X, Y points into a series of angles and distances.The last button is the "Upload Path", this one transmits the path (angles and distances), which is defined in a file with address written in the text control in front of the button, to the mobile robot unit through USB cable and then through wireless connection.
b. Velocity Control Group This group consists of four control slides which are used to remotely control different velocities of the mobile robot.These velocities are forward, backward, turning and differential wheels velocities.Each slide of controller represents a value of a certain velocity that is sent to the robot.When, the slide moves along its range, the velocity changes accordingly from 0 to full speed of the motor.So, any position of slide represents a certain percentage of the full range value.

c. Direction Control Group
This group consists of five buttons to send a manual direction and break to the mobile robot.In this case, the robot is controlled using the buttons, "Break", "Forward", "Backward", "Right" and "Left", through mouse.The group also consists of Keyboard Enable check box.If this check box is true the keyboard manual control is activated.In this case, the keys of arrows of the keyboard are used as directions while the space key is used as a break.
Two other buttons are existent in the control window.The first button is the robot connection button sends to the robot the question "are you there" as code of byte length, if the robot received that byte it will respond by sending back "Yes" as code of byte length.When, the mobile robot responds the statues bar of robot will change to indicate "Robot is Online" Otherwise the robot still indicates to state "Robot is Offline".The second one is "Follow Path" button gives an order to the robot to follow the uploaded path.The control window also has a status bar to inform us whether the USB device is connected or not.

I. PRACTICAL RESULTS
To prove the efficiency of our robot system, it is applied on real world environment.Five different paths are chosen with different start and target points in an environment of size 2.1m×2.1mwhich contains 11 obstacles.The optimal paths for all cases are obtained using EGA which is proposed in [6].The results for these cases are shown in Table (2).After the optimal paths are found, these paths are uploaded to the robot one by one to be followed.Table (3) shows the practical results of the robot.

II. CONCLUSIONS
In this paper, the building of mobile robot is presented.The mobile robot is built to be controlled wirelessly through a remote computer.The whole system consists of three main units.The mobile robot unit, which consists of the rover robot base, the electronic circuit that is responsible for the control of the robot (positioning and directing) and the component of transmitting and receiving of the data to and from the computer.The second unit is wireless control unit, which is constructed to be as an intermediate interface device between the mobile robot and the third unit the computer unit.The computer unit is used to calculate the optimal global path for the mobile robot and transmitting that path to the robot to be followed.The operations of the computer unit are facilitated through the developing of user interface software under WINDOWS operating system using VC++ programming language.
Figure (1) Block diagram of the system of mobile robot.

Figure ( 3
Figure (3) and circuit holder as shown in Figure (4).The final form of the mobile robot is shown in Figure (5).
Figure (5): Complete form of the rover mobile robot.
The control signals are 5 v signals which are delivered by the process unit.Thus, two H-bridges L6203 (one for the right and the other for left motors) are used to amplify process unit signals, so that these amplified signals can drive the motors of robot.Figure (8) shows the pins diagram of the L6203 H-bridge.L6203 can work with supply voltage up to 60V, 10A output current, operating frequency up to 100 KHz, thermal shutdown, internal logic supply and high efficiency.

Figure
Figure (13) The electronic circuit of Mobile robot control unit.
Figure (14)  shows the full electronic circuit of this unit and Figure (15) shows the actual wireless controller.

Figure
Figure (14) The full electronic circuit of Wireless control unit.
Figure (17) to Figure (21)  show the optimal paths of the theoretical result.The maximum error is calculated according to equation (3).