Simulation of Expert-system Based Path Planning for Self-propelled Robots

Abstract In this paper, an expert-system based path planning scheme for small self-propelled robots is proposed. Many thousands of small robots can follow commands received by radio transmission to automatically assemble themselves into a predetermined formation. Due to the cost issue, the results will be verified using software simulation. To start with, color recognition technology is used to distinguish color and pattern and then each image is reduced to 39 colors using HSV color space. The optimal path is then planned by a Central Supervision Remote Control System using the results of image segmentation. The path planning data can be sent to all the robots simultaneously using WiFi, and this causes them to gradually arrange themselves into complex patterns using two independent servo motors that drive two wheels. The path planning data will be simulated by the LabVIEW software. In the simulation screen, the robot will gradually arrange the pattern autonomously. The simulation results clearly indicate the practicality of the proposed path planning for self-propelled robots.


Introduction
Color image processing technology has made significant advances in recent years and is now widely applied in many different fields. In the process of color image processing, the extraction and segmentation of image features is very important. Color image segmentation methods include threshold segmentation [1][2][3] and the direct multispectral space clustering methods [4]. Multispectral space clustering is time-consuming but the results are more accurate than those of threshold segmentation. In threshold segmentation, the image in RGB color space is transformed into HSV color space. HSV color space has three components: Hue, Saturation, and Value. Human visual identification of color patterns is generally based upon three considerations. What color is it? How vivid is the color? How bright is the color? This method of judgment is very similar to that of HSV because HSV was designed to approximate human vision. This makes the adjustment of the three HSV parameters quick and intuitive.
The term swarm robotics [5][6][7][8][9][10] describes a lot of autonomous robots which behave like rather insects and themselves into an orderly pattern similar to that of the compressed image. Transfer can be done by the computer on a one-to-many communication transmission within a specific range. (Arrangement area size: 100 × 100 PIX; Image size: 99 × 99 PIX). In the simulation experiment, the unit size of the arrangement area was 1 PIX, but this depends on the size of the robot.

Expert-system Based Path Planning
LabVIEW software was used for these simulation experiments because of the very large number of robots used. Figure 3 shows the simulation movement path of the small robots. To accelerate the speed of the arrangement, six robots were moved together each time. After receiving instructions each moved in a straight line to travel the shortest distance from the origin to the destination in the presentation area. To avoid collisions between the robots, an expert system was used. First, the straight-line distance from the starting point to the end point was calculated for each robot. The one that has to move the shortest distance was given movement priority. Secondly, the movement time interval was set to 10 PIX. In other words, each robot could only move after the one before it had moved 10 PIX. The trajectory traces are retained on the simulation display (see Figure 3) until the robot reaches the target point when they are erased to start again with the next six. The number of robots in the preparation area is gradually reduced.

Self-propelling Robots
Schematic diagrams of a small robot are shown in Figure 4. Each robot contain an Arduino pro-mini microcontroller, an ESP8266 WiFi module, two mini servo motors, and a 9 V lithium battery. The servo motors are controlled by PWM to facilitate the robotic movement and the directed control. The Arduino pro-mini microcontroller has 14 digital input/output pins. Six of the pins can be used for PWM output and two are used for TTL serial data. A 9 V lithium battery provides enough power to keep a robot operating for a long time. However, space inside the body is limited and since the voltage also needs small robots discussed in this study. In the next step, the compressed image is segmented into 15 colors wherein each color may be light, medium or dark, except in the case of black, gray, and white. So the image ends up as being composed of only 39 colors.
The HSV color space model is defined by three parameters. H represents hue, such as red, yellow, green, and so on. S represents degree of saturation which indicates the vividness of the color. The higher the value, the more vivid the color. The lower the value, the grayer the color will be. V presents luminosity and a high value represents and light color (high brightness) and a low value a darker color. In this study, the threshold was adjusted to distinguish color. Figure 1 is a flow diagram of the image processing simulation.
After the colors had been designated, the optimal path was planned by the CSRCS, see Figure 2. In our simulation there were 39 sets of colored robots, 2000 per color, each with a unique ID number, in the preparation area. The path planning results will be presented as a simulation. In the simulation screen, 1 pixel represents 1 robot. The path planning results can be sent to the robots simultaneously via WiFi (IEEE 802.11) so that the robots will arrange Preparation area A rrangement area to be reduced to 5 V to power the sensors, a decision was made to use a smaller battery.

HSV Image Segmentation Results
The H, S, V parameters range between 0 and 255 and RGB (255,0,0) was set as a solid color. The images in RGB color space were then transformed into HSV color space.
The H parameters of all the major colors were recorded and the average range was calculated. In addition, the S and V parameters were set. Figure 5(a) shows the relationship between the S and V parameters when H = 0. The S parameters increase from left to right and the V parameters increase from the top down. After a long series of experiments, we summarized the shade range of the different colors, as shown in Table 1. Figure 5(b) shows the segmented results from HSV. The correct color can quickly be determined from a comparison of Figure 5(a) and (b). We selected two famous paintings for our experiments and Figures 6-11, show the HSV image segmenting process used on images of the paintings. The first image, Starry Night, seen in Figure 6, was reduced as shown in Figure 7 and then divided into 39 different colors, see Figure 8. The second picture (Irises) was treated in the same way, see  (1)    where V 1 indicates the length of the slash between white and light, shown as Figure 5(b). V 2 indicates the length of the slash between light and dark, shown as Figure  5(b). The value of S is between 0 and 255. According to the rules set out in Table 1, V 1 and V 2 can be calculated by substituting the value of S into Equations (1) and (2).

Simulation Results of Self-propelled Robots
The simulation results of the self-propelled robot experiments are shown in Figures 12 and 13. The lower right corner of the arrangement area was defined as the starting point. The arranged process ran from bottom to top and right to left.

Conclusions
We successfully used HSV color space and a preselected threshold to simplify images to 39 colors. The image segmentation and path planning were simulated by the LabVIEW software. In the simulation screen, the robot will gradually arrange the pattern autonomously. The results of the image segmentation and the planned optimal path data can be sent to small self-propelled robots with different colored swatches simultaneously using wireless transmission. They gradually arrange themselves into complex patterns and this simulation clearly demonstrated the practicality of the proposed method of path planning for self-propelled robots.