Direction and Position Reconstruction on Mobile Robots

— The control of autonomous mobile robot motion are still a big challenge due to the uncertainties of the complex environment, noisy sensor signals on robot and failure of mechanical design. Mobile robot needs to determine its location accurately for performing different task such as trajectory tracking and mapping. In this paper, we propose two different rule-based methods for reconstructing robot position and the direction during the motion. We initially introduce the four wheel mobile robot that we have developed for this study by giving the detail information about mechanical, electronic and software design steps and components. The proposed methods are used to estimate position and direction error and then reconstruct its motion while moving in the forward direction. The proposed methods are tested on a real mobile robot.

INTRODUCTION HERE have been so many types of mobile robots designed for achieving complex task such as search and rescue, mine dragging, shipping and mapping during the last decades [1,2]. While wheel based structured mobile robot are designed to move on a flat surface, leg based mobile robot are developed to demonstrate locomotion in non-deterministic environment. These robots are all equipped with some sensors such as sonar, infrared, laser, camera or Wifi. By the help of these sensors, robots can able to contact with an environment such that they can measure distance of any object or determine its location in a space and so on. Moreover, these mobile robot can be remotely controlled by computer via wireless communication protocols to perform autonomous movement.
In the literature, 3D mapping in complex environment, distributed multi agent system and autonomous swarm robotics have been studied mostly in the mobile robotics in the last decades [3][4][5][6]. To achieve autonomous movement of mobile robot, the initial step is to determine the location of robots accurately by using sensors mounted on robots. However, sensory data coming from the different sensor are so noisy. For instance, the encoder that measure the displacement of motor shaft reads unreliable data due to unexpected changes on the ground and wheel rotation. Kalman filter and particle filter are well known algorithm to filter the noisy data that decreases error in controlling the motion [7]. The sensitive and precise component that are used in the while developing a robot is another important issue to decrease the noisy data, however in that case production cost increases. In addition to the sensor mounted on the mobile robot, the communication protocols between the controller and robots is another important issue that should be considered to design a mobile robot [8]. In spite of Bluetooth, infrared and RF that are commonly used to control mobile robots for indoor application, UDP and TCP protocols is more preferable that is because they are more safe and stable in short distance range applications [9], [13]. By the increasing the technological sophistication of the internet, cloud robotics are become popular in robotic research area [14]. The cloud system allows user to communicate with robots from all over the world. This approach is a new generation of robots that provide wireless networking, big data, artificial intelligence algorithms and wide range applications such as surgery, driving and shipping [10]- [12]. Despite these developments, in order to achieve autonomously control the mobile robot, there is still need to estimate the noisy data coming from the sensor to determine the direction and location of the robot accurately.
In this study, we propose rule-based method to estimate and fix the error while moving in a forward direction, which leads to autonomous motion. The rest of the paper is organized as follows. In Section II, we represent the designing steps including mechanical, electronics, communication and software design. The problem definition is given in Section III. The detail information about the proposed method to estimate the direction and position deviation are given in Section IV. The real time experimental results are represented in Section V. We conclude and give the future direction of our research in the last section.

II. MOBILE ROBOT DESIGN
Our major goal to design such a 4 wheeled mobile robot is to achieve autonomous motion indoor area by fixing the positional and directional error. In this section, we represent three design stages consisting of mechanical, electronics and software design.

A. Mechanical Design
As shown from the Figure-1a, we initially manufactured the body of the robot using transparent board. The size of the body of the robot is about 15x25 cm that is enough to mount 4 dc

Direction and Position Reconstruction on
Mobile Robots E. Şimşek, G. Tümüklü Ozyer and B. Özyer T motors, electronic cards, sensors, wires and microcontroller. As shown on the right hand side of the Fig.1-a, there are screw holes on chassis to stabilize electronic modules, sensors and other components. Wheels are only allowed to move in a forward direction. The left and right rotational motion of robot is realized by adjusting the velocity of the wheels. The final version of the robot at the end of the design process is shown in Fig.1

B. Electronic Design
In this section, we describe the electronic design process to gather the electronic components. The schematic view of the electronic components including sensor, microcontroller digital compass, Wifi Module and motors are shown in Figure-2. In order to measure the direction of the motor, we use HMC588L3 type 3 axis digital compass. Hc-SR04 type ultra-sonic sensor is used to measure the distance of the obstacle while moving in direction. Spark Core Wi-Fi module is used to communicate the robot with PC. Arduino Mega 2560 microcontroller is used to interface with the hardware component and implement PWM functions to control the motors. The robot is remotely controlled by PC via Wifi Network.
We use serial communication protocols with 2 digital pins in same clock frequency as shown Figure-3. This protocol allow us to data transfer in 2Mbps.

C. Software Design
Software design process consists of three main stages. The first one is applied on microcontroller using C programming language to control the motors and read the sensor signals. The second one is used for communication protocols between Arduino microcontroller and PC. The last one is designing interface to allow the user to control the motors and illustrating the sensor data. The Arduino IDE, which very simple and useful in designing and programming electronic circuit, is used to program the microcontroller. Wifi modules are used to communicate the PC and microcontroller. We developed communication techniques using serial ports that enable to control the motor in real time. The user interface is designed in MATLAB as shown Figure-4. The user can set velocity and direction of the motors by sending commands on the interface. The position of the motor obtained from the encoder and direction of the motor obtained from the digital compass are also monitored on the interface. In this section, we descried the problem definition by giving an example at first. Then, we will present details of the methods that we proposed for this study in the following sections. While the mobile robot autonomously moves through the environment, there would be some error measurement caused by the floor, wheel encoders and sensors. These error leads to directional and positional deviations of the robot. In this study, our goal is to estimate these errors at first and then develop a method to fix these undesirable errors. In order to clarify the problem, we consider the scenario shown in Figure  5. As shown from the figure, robot starts its movement at the instant of t 0 and intends to move through the line. After a while robot moving in a forward direction, there is a directional deviation from the path at the instant of t 1 due to the external errors. Our first goal is to estimate the directional deviation and fix it as fast as possible. Then, at time t 2 , although the directional deviation is fixed, the position of the deviation cannot be fixed as shown from the Figure 5. This is because the sensors and encoders is not enough to compensate the velocity of the motors. On the other hand, it is important to protect robots direction and position for achieving autonomous motion.

IV. METHOD
We propose two different methods to fix the directional and positional deviations while the robots move autonomously in the indoor environment. Before representing the algorithms to fix these deviations, we first describe how to estimate the error caused by the sensors, mechanical components and environment factors. We assume that robot moves at a constant speed to the line in forward direction as shown in Figure-6. The rotational angle of the motors on the robot obtained from the encoder is vertically placed behind to each motors. The rotational angle is theoretically calculated by the following equation where m is the distance of wheel's movement, L is the width of mobile robot, is rotation degree around the z axis. (2) where m b and m k is the distance of the inner and outer of the front wheel respectively. The equation (2) is recalculated as follows, The positional deviation along x-y axis is estimated by the following equation, where KF x and KF y is the amount of positional deviation along x-axis and y-axis respectively.
The first method that we propose is aimed to detect and estimate the directional deviation. Digital compass is used to measure the directional deviations of robots while moving in forward directions. Figure-8 shows the directional deviations robot at the instant of time t 1 . The velocity of the motors on the wheels at different time step is calculated by the following equations, where V k and V b is the velocity of the left and right of the wheel. V fark is the difference velocity that is calculated by the equation represented as, The second method that we propose is to fix the positional deviation. We assume that positional deviation consist of four stages at different time step shown in Figure-9. The directional deviation initially is estimated and fixed at t 1 and t 2 . The velocity of the wheels at all-time step is calculated by the following equation, The positional deviation is fixed by setting the inversion velocity of the both left and right front wheels at t 3 and t 4 time. Algorithm-1 represents how to protect the positional deviations. EXPERIMENTAL RESULTS The proposed methods are tested on real mobile robot which has four motors, digital compass, sonar sensors. Our major goal is to test the proposed algorithms with real data. We observe that even if the robot moves to line at constant speed on the flat surface, the directional deviation is increasing over time. The reason is for this deviation is caused by the mechanical and electronic components on the robot. For instance, we put some weight on the robot to investigate how positional deviation will change during the motion. We observe that robot moves more stably under the heavy weights.
In order to show the performance of the algorithms, firstly the directional deviation is measured about 5 degree by using digital compass. The data is read every 0.6 seconds from the digital compass represented in Algorithm-1. When the mobile robot get out of the line, equation (9) and (10) is used to calculate the velocity of the motor that is being applied on motors for protecting the directions at t 1 shown in Figure-9. If there is not any direction deviation, the velocities of the motor will not be changed. Table -1 shows the values of the velocity of motors, directions of the motion and compass sensor information during the motions. The first column represents the time, second column KD represents command direction value, GD represents running direction value of mobile robot. Left and right are the motor's velocity, DH is angular velocity. The velocity of the right and left front wheel are set to 120 cm/s and 136 cm/s at the instant of t 4 . Figure-10 shows the angular velocity values at different time step. Figure-11 illustrates the total trajectory of robot from t 0 to t 4 .  11. The figure shows the forward direction of the robot's movement at different time step. The deviation in the direction is formed at t=0.6 seconds, then robot fixed its direction at t=1.2 seconds. Robot starts to move to fix its the location about t=1.8 seconds and achieve to fix both location and direction at t=2.4 seconds. VI.

CONCLUSION AND DISCUSSION
In this study, we present a ruled based method to estimate and fix the positional and directional deviations of mobile robot while moving autonomously indoor environment. At first, we described the mechanical and electronic design process of the mobile robot. Digital compass is used to measure the directional deviations. We observe that digital compass is not enough to accurately measure the directional deviation in real time application. There is another important result of the experiment is that robots cannot achieve simple task due to error caused by the mechanical and electronic components. The proposed ruled based method is sufficient in some cases when the floor is flat and the velocity of the motors should be low enough to measure the sensor values. As a future work, we are planning to implement the mapping algorithms on the robot while it's moving in the environment autonomously.

THANKS
This study is supported by TUBITAK 2209-A Supporting Program for Country-House Research Projects.