Design of a Chaotic Trajectory Generator Algorithm for Mobile Robots

This paper addresses the problem of designing an algorithm capable of generating chaotic trajectories for mobile robots. In particular, the chaotic behavior is induced in the linear and angular velocities of a differential drive mobile robot by infusing them with the states of the Hénon chaotic map. A possible application of patrolling a work area by using trajectories with chaotic motion in differential drive mobile robots is presented. In this work, obtained numerical and experimental results are reported and analyzed. In addition, two quantitative numerical tests are applied in order to measure the chaoticity of the generated trajectories. With the intention of expanding this work further, we explore the case where multiple mobile robots move simultaneously in the same work area with different trajectories, and the final results are exhaustively analyzed. In addition, experimental results are presented.


Introduction
Studies on food searching behavior of animal groups (especially ants) helps in the solution of many problems, primarily optimization problems. Recently, biologists have discovered that ant activity is mostly of a chaotic nature [1].
Research has been carried out on chaotic trajectory design for mobile robots in order to imitate this behavior found in nature. Some researchers have used chaotic systems alongside the behavioral equations of differential drive mobile robots to obtain a mathematical model that causes erratic motion [2]; in other research, the use of a standard map (a well-known discrete two-dimensional chaotic system) to generate a series of chaotic way-points to be followed by robots is presented in [3]. There has been other research [4] that used a chaotic random bit generator. In addition, some research [5] has studied the generation of chaotic behavior in mobile robots while they follow a specified path. Other works [6,7] have studied the emergence of chaotic behavior in mobile robots. Recently, [8] addressed the problem of surveillance from a confined area using a four-engine unmanned aerial vehicle by using chaotic systems to design an unpredictable velocity profile for the quadrotor.

Motivation
One of the main characteristics of a chaotic system is its unpredictability. Applying such a feature to a mobile robot's trajectory may bring several benefits and possible applications; some of them are as follows: border patrol, dangerous object search (for example, explosives), rescue, and unknown territory exploration, among others.
For example, let us suppose there is a valuable object located in a work area (such as a table or a room). A differential drive mobile robot is used to patrol the area, serving as a security guard for said object. The robot may move in a "predefined" manner, using predictable movement previously programmed (see Figure 1a). Any trespasser could easily predict the path the robot would follow, enabling him to reach the valuable object without being detected by it. However, by using unpredictable trajectories (Figure 1b), it would be technically impossible for the trespasser to reach the object without being detected. In order to achieve these unpredictable (chaotic) trajectories, some recent studies [9,10] have followed Nakamura's work [2], combining the mathematical model of the mobile robot with the state equations of chaotic systems, such as Lorenz's and Chua's. Other work [11] uses other chaotic systems, such as the logistic map, to generate way-points that the mobile robot should follow to move through the work area.
Unlike the previously mentioned works, the algorithm proposed in this article (Section 4) does not require modification of the mathematical model of the mobile robot, nor does it generate way-points. Instead, the chaotic trajectories emerge from the behavior of the robot inputs (as described in Section 7). In this case (using a Khepera III differential drive mobile robot, as described in Section 7.1), those inputs are the desired speed of each wheel of the robot. The main advantage of this methodology is the easiness to apply the algorithm to an actual mobile robot.
The main contribution of this work is the way to generate chaotic trajectories in mobile robots; that is, the application of Hénon's map to give velocity values to a differential drive mobile robot, in order to generate a chaotic trajectory that allows it to patrol a work area in an effective and unpredictable manner to outside spectators (for example, intruders). To our knowledge, no similar methodology has been reported in the literature before.
The rest of the paper is organized as follows. In Section 2 the state model of the chaotic Hénon map used to generate unpredictable trajectories in mobile robots is presented. In Section 3 the mathematical model of a differential drive mobile robot is described. The proposed chaotic trajectory generator algorithm for a differential drive mobile robot is presented in Section 4. The numerical results are reported in Section 5. In Section 6, the case of multiple robots moving simultaneously in the same work area is presented. Section 7 describes the experimental results. Finally, conclusions and future research directions are stated in Section 8.

Chaotic Systems
Chaos theory can be defined as the qualitative study of non periodic dynamical behavior shown by non-linear deterministic systems [12]. It can be observed in many natural engineering systems. Among the principal features of chaotic systems, we have the following: • High sensibility to initial conditions; • Deterministic with apparently random behavior; • Non-periodic oscillations.
Initial condition sensibility indicates highly different temporal evolution on chaotic systems, despite very small differences in their initial conditions. This feature is desirable on patrolling robots, since it would cause the trajectory followed by the robot to be highly unpredictable. Chaotic systems are deterministic because, knowing the initial conditions and the equations of the system, their behavior can be determined. With this feature, we can say that a robot with a chaotic trajectory will be highly unpredictable for outside spectators, but known to the designer and any other observer that has the knowledge of the equations and the initial conditions used in its design.

Chaotic Hénon Map
Hénon's map is a two-dimensional discrete-time dynamical system, represented by the following state equations [13]: This map depends on a and b parameters, whose classical values for chaos generation are a = 1.4 and b = 0.3. For other a and b values, this map can be intermittent and converge to a periodic orbit or a fixed point. Figure 2 shows the chaotic attractor generated by Hénon's map by initial conditions x h (0) = y h (0) = 0.

Fractal Dimension
The Oxford dictionary [14] defines fractals as "A curve or geometrical figure, each part of which has the same statistical character as the whole". They are useful in modeling structures (such as snowflakes) in which similar patterns recur at progressively smaller scales, and in describing partly random or chaotic phenomena such as crystal growth and galaxy formation. The so-called fractal objects are very complex and detailed. If we amplify one section of such object, we find such complexity and detail as the whole object, so smaller sections are similar to the largest ones [15].
A definition of fractal dimension is that of similarity, also called self-similarity, suggested by Felix Hausdorff in 1919, later readjusted by Besicovich (dimension of Hausdorff-Besicovich) [16]: If N equal entities can be obtained from another entity H, similar to the original, with a similarity reason l, then the topological dimension of H is the real number D that verifies, There are certain geometric objects for which the D dimension is not an integer. We will call such geometric objects, using Benoit Mandelbrot terminology, fractals. In this work we use the mentioned dimension D to corroborate the presence of chaos in the generated trajectories for mobile robots.

Mathematical Model of a Differential Drive Mobile Robot
The behavior of a differential drive mobile robot is based on two independent wheels, one on each side of the robot's body ( Figure 3). Movement is achieved by applying different velocity values to each wheel. This way, the robot can move forward by making both wheels spin at the same speed, or it can turn in any direction using different speeds for each wheel. In this work, the approximated mathematical model of the differential drive mobile robot is used. Suster-Jadlosvska in [17] presents the following mathematical model for a differential drive mobile robot, observing the following considerations:

•
The robot moves in a perfectly flat surface without sliding, despite wheel resistance; • Robot position is given by x, y, and θ coordinates, where θ represents the robot rotation in relation to the coordinate system.
The position and rotation of the robot in the plane are based on the following state equations, forming the kinematic model of the mobile robot [17]: with v and ω defined as follows: where v is linear speed, ω is the angular speed, θ is the robot's orientation angle, l the distance between wheels, v r is the right wheel speed, v l the left wheel speed, and l = 8.841 cm (for simulation purposes, this value was taken from the distance between the two wheels present in the Khepera III mobile robot, presented in Section 7.1). A graphic representation of these variables is shown in Figure 3.
Isolating v l y v r from Equation (5) we obtain: These Equations (6) will be used later for the numerical simulations. The goal of this work is to generate chaotic behavior in the linear v and angular ω speed of the differential drive robot, described by Equations (4) and (5). To make this possible, an algorithm is designed using the Hénon map (1) as described in the sequel.

Proposed Chaotic Trajectory Generator Algorithm for a Differential Drive Mobile Robot
The following algorithm is used for numerical simulations and generation of chaotic trajectories in a differential drive mobile robot. The equations corresponding to every stage are shown in Algorithm 1. The block diagram of the proposed algorithm is shown in Figure 4.
In step 1, the initial positions (x 0 , y 0 ) of the differential drive robot are taken as initial conditions for the Hénon map (Equation (1)). In step 2, the current values of Hénon's chaotic map are calculated (x h (n + 1), y h (n + 1)) and then assigned to the linear and angular speeds (v(n) and ω(n)) in step 3. Next, in step 4, right and left wheel speeds (v l and v r ) are calculated, obtaining the histograms shown in Figure 5. Then, a homogeneous dispersion is applied to these values in step 5, allowing us to re-scale the maximum and minimum speed values (v dl , v dr ) to the ones used by an actual differential drive mobile robot. Lastly, v dl and v dr values are sent to the mobile robot, which will be used for movement for 2 s (step 6). This execution time was chosen to allow the mobile robot to move in the work area.

Algorithm 1 Proposed Algorithm
Input: (x 0 , y 0 ) = Initial position (x, y) of the robot in the work area, steps = iterations Output: v dl , v dr = Left and right speeds for the mobile robot wheels 1: x h (0) = x 0 /1000, y h (0) = y 0 /1000, n = 0; While 1 ≤ n ≤ steps do 2: The number of iterations is determined by the application, each with an execution time of two seconds. For example, if the robot is required to operate for 2 min (that is, 120 s), the desired number of iterations would be 60. The number of iterations could be related to another kind of application; for example, the algorithm could stop when an object is found or a certain coverage percentage is achieved.
Isolating left and right wheel speeds from Equation (5), we obtain the histograms shown in Figure 5. We can observe that v l and v r values are mostly negative and positive, respectively, indicating that the resulting trajectory will be primarily based on left turns. Very similar behavior can be observed with different numbers of iterations. Because of this, dispersion and uniformity measures need to be taken for v l and v r values, as shown in Figure 6. The dispersion allows performing a re-escalation of the values to a range of velocities usable by the robot, limiting the minimum and maximum values so that the robot can use them without any problem. This speed range does not include negative values, preventing the robot from moving in reverse, so that the generated trajectory encompasses a larger area of coverage in a shorter time. The two-second run time in step 6 in Algorithm 1 is used to allow the robot to have the opportunity to move properly and to have greater coverage of the work area. This run time can be adjusted according to the individual capacities of the mobile robot type to implement (maximum and minimum speed, movement type, etc.). To perform the numerical simulations, an HP laptop with an A10 processor of 1.9 GHz, 12 GB of RAM, Windows 10 (64 bit), and MATLAB R2019a were used.

Work Area Boundaries
The work area size is 1400 × 2400 mm. The control objective is that the differential drive mobile robot covers the largest possible area of the work space in a chaotic way. The robot must change its trajectory when it reaches some of the boundaries of the work area to avoid colliding with them. In this case, a reflexive movement is adopted. When the robot senses proximity to one of these limits, the robot changes its direction of movement following the strategy shown in Figure 7. It takes an exit path at an angle that reflects the entry angle.

Results
In this section, the obtained results from the numerical simulations are reported. Starting the trajectory of the robot at the origin (x, y, θ) = (0, 0, 0), numerical simulations were carried out based on the proposed chaos generator algorithm with 200 and 300 iterations. The obtained results can be seen in Figure 8. The inner rectangle represents the boundaries of the work area previously described. Each color represents a time lapse of two seconds during which the mobile robot uses the speed values obtained from the proposed algorithm (that is, for each iteration) before moving on to the next speed values.  Figure 8 shows that the trajectories of the robot are apparently unpredictable and, with 300 iterations, the differential drive mobile robot covers (patrols) most of the work area. It is important to mention that, in the numerical simulations, the real dimensions of the robot are not considered, so the area actually covered by the robot is much larger than the one shown in the graphs. It can also be observed from these results (Figure 8), that the followed trajectory is the same in all cases under the same initial conditions, confirming the deterministic nature of the chaos. However, simulations to obtain Figure 9 were carried out using two different initial positions (in millimeters) with the same orientation (θ 0 = 0) (x 0 , y 0 ) = (0, 0.01) in Figure 9a  Comparing Figures 8a and 9a, it can be observed that trajectories change drastically despite having a change of only 0.01 mm in the initial condition of the x-axis, demonstrating sensitivity to initial conditions typical of a chaotic system.

Coverage of the Work Area
In order to estimate the work area covered by the chaotic trajectories imposed by Algorithm 1 on the mobile robot, it was divided into a grid of 12 × 20 (240) frames with lateral measurements of 76.66 mm; this is to have a more precise idea of the effective coverage of the differential drive mobile robot employing the proposed algorithm for exploration or search applications. Figure 10 shows the percentage coverage of the test area by the differential drive mobile robot for 100 and 300 iterations of the trajectories imposed by Algorithm 1, when the initial conditions were (x 0 , y 0 , θ 0 ) = (0, 0, 0). We can see that with just 100 iterations the robot patrolled almost half of the work area and with 300 iterations it covered almost the entire work surface. Repeating the previous process 1000 times for arbitrarily selected initial conditions, using 300 iterations, an average of 84.1270% of covered work area is obtained.

Gottwald-Melbourne Test
To verify that the trajectories generated by the proposed algorithm are indeed chaotic, we use the 0-1 Gottwald-Melbourne test [18]. This test determines if a discrete deterministic dynamic system is chaotic or not. Contrary to the usual method of calculating the maximum Lyapunov exponent, this method is applied directly to the time series and does not require space-phase reconstruction. In addition, the dimension of the dynamic system and the form of its equations are irrelevant. To perform the test, 300 iterations of the chaotic trajectory generator algorithm are executed to the mobile robot with different initial conditions. Taking into consideration the data of the time series of the x and y states of the model of the differential drive mobile robot, obtained from the results of the performed numerical simulations, we can perform the 0-1 test to verify evidence of chaos in the trajectories of the mobile robot generated by the algorithm. The input is the data of the time series and the output is the amount of chaos between 0 and 1; this value indicates whether the input is chaotic or not, 0 denoting not chaotic and 1 totally chaotic. The test is applied to any dynamic deterministic system; see details of the test in [18]. Figure 11 shows the time series of the x and y coordinates for the initial experimental conditions (x 0 , y 0 , θ 0 ) = (0, 0, 0). The resulting value of the 0-1 test for our proposed algorithm in the x axis is 0.9854 and for the y axis is 0.9745. The number close to 1 is a clear indication that the test concludes that such time series are indeed chaotic.

Box-Counting Test
Some techniques used to estimate the fractional dimension of a geometric object were discussed by Mandelbrot [19]. In this work, the box-counting method is applied because of its simplicity, automatically calculable with the use of computer and applicable for patterns with or without self-similarity. In this test, each image or geometric object is covered by a sequence of squares of descendant measurements and for each of the squares two values are stored: the number of boxes intersected by the image N(l) and the lateral length of each frame l. The regression slope D of the straight line formed by the plot of log N(l) against log 1/l indicates the degree of complexity (or fractional dimension) between 1 and 2; 1 ≤ D ≤ 2 [19]. An image with a fractional dimension of 1 or 2 is considered completely differentiable. The linear regression used to estimate the fractional dimension [20] is given by log N(l) = log K + D log 1/l, where K is a constant and N(l) is proportional to (1/l) −D . Clearing D from Equation (7) we obtain the following expression: To perform this test, we return to the grid used to measure the percentage of coverage of the test area performed by the trajectories of the mobile robot generated by the algorithm designed in this work. The size of the grid with l = 1 will be taken for the case when the length of the work area (the dimensions of the work area are 1400 × 2400 mm) is equal to the length of a grid square. We start with squares of size l = 0.111, which will be reduced until we obtain very small squares (boxes) of size l = 0.0200. We take the path of the robot generated with the initial conditions (x 0 , y 0 , θ 0 ) = (0, 0, 0). Figure 12   After making 25 reductions of the grid and plotting log N(l) against log 1/l, the linear regression of the data results in Figure 13. We can see behavior very similar to the line given by the equation y = 1.7762x + 0.0028. Using Equation (8) for every grid size reduction we obtain D = 1.7762, which is a fractional dimension and therefore the trajectories are chaotic.

Multiple Robots
In this section, we analyze the behavior obtained when Algorithm 1 is applied to multiple mobile robots. In the next subsections, we show the results obtained for 2, 3, and n robots moving simultaneously in the work area. Figure 14 shows the trajectories generated by two differential mobile robots in the same work area with different initial conditions. In this case, when the two robots are close to colliding, a reflective strategy is taken, so that both mobile robots can continue on their way but in the opposite direction (taking a 180 • turn). Red and blue circles indicate a collision that is avoided using the reflective strategy. Each simulation is performed with 150 iterations of the proposed algorithm. In both cases, (θ 0 = 0 • ) is considered. The blue line represents the trajectory of robot 1 and the red line represents robot 2. Repeating the procedure (Figure 14) 1000 times with different initial conditions, a coverage percentage average of 83.6429% is obtained. It is important to note that only half of the iterations are necessary to cover a percentage of the work area similar to the case when using a single mobile robot. Figure 14 shows the trajectories generated by three differential mobile robots moving simultaneously in the same work area with different initial conditions for each one. In a similar manner to that explained in the previous section, when two or three of the robots are to collide, the reflective strategy is taken. In Figure 15, the red, green, and blue circles indicate a collision that is avoided using the reflective strategy. Each simulation is performed with 100 iterations of the algorithm. The blue line represents the trajectory of robot 1, the red line represents robot 2, and the green line represents the trajectory of robot 3. Repeating the procedure 1000 times with different initial conditions, a coverage percentage average of 84.1826% is obtained. We can see that fewer iterations are needed to cover a percentage of the work area similar to the case when using a single mobile robot.

n-Mobile Robots in the Same Work Area
In a similar way as before, we repeat the process for n mobile robots (n ≤ 10). No figure is shown because the trajectories would not be easily visualized due to the number of robots. However, in the next subsection we offer the results obtained for this case.

Presence of Chaos in Generated Trajectories for Multiple Mobile Robots
Following the procedure shown previously in Section 5, coverage and presence of chaos are analyzed for multiple mobile robots.

Coverage Percentage of the Test Area
In Table 1 we show the average coverage percentage obtained for 1 ≤ n ≤ 10 mobile robots. The trajectories were calculated using 100 different initial conditions for each robot. We used 25 iterations of the algorithm for each trajectory so the full coverage (100%) was not reached.
It can be observed that the increment in coverage does not follow linear behavior. This is partially due the size of the robot taking up space in the work area, and could also imply that there is an optimum number of robots for a given work area. We plan to further investigate this result as part of our future work.

Gottwald-Melbourne Test
We applied the Gottwald-Melbourne test to verify the presence of chaos in the generated trajectories. We used 300 iterations and different initial conditions for each trajectory. Table 2 shows the average results for x and y after 100 repetitions, and each one is an average of the results of the number of mobile robots used in each case. For example, in the case of using three robots, the value shown for the x axis is an average of the test result for the three robots, 100 times. We can conclude that, for 1 ≤ n ≤ 10 mobile robots moving simultaneously in the work area, chaos is present in their trajectories.

Box-Counting Test
After applying the box-counting test (see Section 5.3) to 1 ≤ n ≤ 10 mobile robots, the results shown in Table 3 were obtained. Table 3. Box-counting results for n robots simultaneously in the same work area. We can observe that a fractal dimension is present in the generated trajectories even with multiple mobile robots, which is a chaotic property. Based on the obtained result of the tests applied, we can conclude that every generated trajectory by means of the proposed algorithm presented in this work is chaotic.

Experimental Results
In this section we present the results obtained by applying the proposed algorithm (Algorithm 1) to a real differential drive mobile robot.

Materials
For the experimental application of the proposed algorithm, a Khepera III differential drive mobile robot (Figure 16  Eight Flex 13 cameras and the Motive software, by Optitrack, were used for robot position measuring. This setup uses infrared lights, allowing real-time position measuring of small reflective spheres placed on top of the Khepera III robot with a precision of tens of millimeters. The software can export real live data, easily retrievable by Matlab. This allows the generation of the same type of graphical representation as the ones presented for the simulations in Section 5, enabling an easier visual comparison between the numerical and experimental results.

Methodology
Three experiments with the Khepera III differential robot were performed using different initial conditions with 200 iterations for each of the following cases: 1. x The black square represents the boundaries of the work area (table) described above. The dimensions of the table are 1400 × 2400 mm, the same as the work area taken for the simulations shown in previous sections.
The experimental results are shown in Figure 17. Each color represents a time span of two seconds during which the robot uses the speed values obtained by each iteration before moving to the next ones.
It can be seen from Figure 17a,b that a small change in millimeters in the initial conditions produces completely different and unpredictable trajectories in the robot, demonstrating experimentally that the chaotic property of sensitivity to initial conditions is met. It is notable that with 200 iterations most of the work area is covered. It should be mentioned that these experimental results are preliminary; it is necessary to improve the algorithm of evasion of edges so that the angle of reflection is more precise and use other chaotic systems to compare their performance.

Coverage of the Work Area
In order to estimate the work area covered by the chaotic trajectories imposed on the mobile robot, it was divided into a grid of 12 × 20 (240) frames with lateral measurements of 76.66 mm, so we can have a more precise idea of the effective coverage of the proposed Algorithm 1 for exploration or search applications. In Figure 18 the results obtained from the trajectory of the Khepera III robot with initial conditions x 0 = 1.1, y 0 = −0.9, θ = 1.  We can see that, with only 200 iterations of the chaotic trajectory generator algorithm, the test area is covered almost entirely. It should be remembered that the area occupied by the robot and the range of its sensors are not taken into account. Figure 19 shows the time series of the x and y coordinates for the initial experimental conditions x 0 = 1.1, y 0 = −0.9, θ 0 = 1.8 • . The resulting value of the test for x is 0.9743 and for y is 0.9465. The number close to 1 is a clear indication that the test concludes that such time series are indeed chaotic.

Box-Counting Test
We took the path of the robot generated with the initial conditions x 0 = 1.1, y 0 = −0.9, θ 0 = 1.8 • for this test. Table 4 shows the measured values of N, l, log N(l), log 1/1, and D for this case. When plotting log N(l) against log 1/1 and performing the linear regression to the data shown, we obtained Figure 20. We can see behavior very similar to the line given by the equation y = 117837x − 0.0462.
We note that the slope of this line (1.7762) is very similar to the obtained values of D. This result verifies that the trajectory has a fractional dimension and, therefore, is chaotic. Among the conditions that affect the experimental results are the intrinsic physical limitations of the Khepera III robot, as well as some characteristics of the test area.

Conclusions
In this paper, a simple and easy-to-implement algorithm to generate trajectories infused with chaotic properties was designed, using Hénon's map to produce wheel speeds for the mobile robot to use. This allows the robot to have unpredictable movement, making it ideal for patrolling purposes. The obtained numerical results confirm that these trajectories are unpredictable. Numerical tests were performed to determine the existence of chaos in the generated trajectories for the differential drive mobile robot. The Gottwald-Melbourne test shows that the resulting time series are indeed chaotic, while the box-counting test shows that the final trajectory has a fractional dimension and, therefore, is chaotic.
Numerical tests also show that, for 1 ≤ n ≤ 10 mobile robots running simultaneously, the generated trajectories are still chaotic. Furthermore, experimental results show that applying the proposed algorithm to a real differential drive mobile robot successfully imparts it with chaotic properties.
With these results, the authors of this work believe that we leave a solid base from which to reproduce the results obtained in this work for its application in other research, with applications such as border patrol, dangerous object search (for example, explosives), rescue, and unknown territory exploration, among others.
For future work, the improvement of the edge evasion strategy will be proposed. In addition, other chaotic systems will be implemented to compare the behavior and generated trajectories for different mobile robots. We will work on the verification of the presence of chaos in the generated trajectories of the differential mobile robots using other indicators of chaos. We will also analyze the existence of optimal initial conditions that allow high work area coverage with few iterations for one and multiple mobile robots.