The Vehicle behavior under Braitenberg Vehicle 4 Driven by Gaussian-like function

The goal of this paper is to recreate the Braitenberg vehicle 4 in Simulink via MATLAB. The attempt of using the Gaussian-like function to control the vehicles’ trajectory would result in the further analysis of the so-called behavior, which would then be classified into two types related to the term in the field of psychology “invasion” and “retraction”. The tool we used is the Robotics Expansion Pack in Simulink via MATLAB. The results were positive and served as excellent support of our assumption. By controlling the shape of the gaussian-like function, the vehicle would possess the behavior pattern of aggressive invasion or retraction in fear. The result sets a foundation for further research in bio-inspired robotics, it also provides a new attempt in controlling the Braitenberg vehicles.


Introduction
The Braitenberg vehicle was first introduced in the book Vehicles written by Valentino Braitenberg. The book mainly discussed the vehicles' intelligent behaviors, which are based on simple combinations of sensors and motors [1]. Traditionally, these vehicles are composed of two front facing omni-direction sensors, which could easily handle the simple environment of the original thought. After the conception of the Braitenberg Vehicle was put forward, it has been widely used in research on robotics and artificial intelligence. Braitenberg Vehicles indicated a simple way to make the vehicle's behavior seem to possess a specific form of 'intelligence'. This kind of action can be described by the terms from psychology, like love or invasion [1]. As Braitenberg Vehicle's definition is based on the ideal condition, it was easy to build up in a computer simulation environment. The results presented in [2] shows a complete and thorough research of Braitenberg vehicle 2 and 3. These vehicles would perform the so-called "invasion" or "retraction" behavior. Such result is due to the fact that their movement are controlled by the motors that attached to their wheels, which were also controlled by certain control functions. Their behavior, in general, is getting close to the stimulation or moving away from the retraction, just like a predator hunting a prey or an animal fleeing away from danger. The basis of such movement is the non-linear dynamical system. The Braitenberg Vehicle 2 and 3 can be modeled and analyzed as systems of nonlinear differential equations. And different kinds of stimuli can make Braitenberg Vehicles 2 and 3 do other behaviors. For example, the Braitenberg Vehicle 2b can be used for wondering, and the Braitenberg Vehicle 3a can be used for goal searching with appropriate stimuli [3]. Based on the simulation, the convergence of the Braitenberg vehicle 3a under parabolic-shaped stimuli can be analyzed and described by two features: conditional stability and oscillatory behavior. It has been proved that there are theoretical relations between the internal control and the stimuli of the environment, and they create the periodic trajectory of the vehicle [4]. The research done in [5] shows a further implementation of the Braitenberg vehicle 2 and 3 with the combination of the term "fuzzy logic", which used multiple sensors for navigation. But only a few studies have shown the model and the analysis of the Braitenberg Vehicles 4, the non-linear and non-monotonic response of the motor from the stimulation.
The response of the motor is different from that in Vehicles 2 and 3. When the stimulation's value grows to a certain value, the value of the motor speed will no longer keep increasing but decreasing instead. The difference between Braitenberg Vehicle 4 and the Braitenberg Vehicles 2 and 3 is simply the internal control function. In the non-linear dynamic system of Braitenberg Vehicle 4, the behavior of the vehicle under certain stimuli is also worthy of analysis. Our work establishes a model of the Braitenberg Vehicle 4, whose trajectory was simulated by the Robotics Playground via MATLAB R2020b. Our work's overall goal is to find the regularity behind the behavior of the Braitenberg Vehicle caused by the non-monotonic response to the stimulation from the environment. We classify the behavior into two types, "invasion" and "fear and retraction". The stimulation we choose in our research is the distance between the vehicle and the object. Then we find a Gaussian-like curve to simulate the non-linear response of the vehicle. The Gaussian-like curve we choose has two parameters that can affect the vehicle's trajectory when their values change. The shape and characteristics of the gaussianlike function could be altered by the two parameters, which would alter the vehicle's trajectory, in this paper, the vehicle's behavior. The result of our research is to analyze how the two parameters influence the behavior of the vehicle. The purpose and the meaning of this research are to reveal the method of altering the non-monotonous controlling parameters to control the vehicles' behavior. Under the stimulation from the source (in this research, the stimulation is the distance between the source and the vehicle), the vehicle would show invasion or retraction behavior. This method also provides a new approach to control the vehicle via simple functions and sets the foundation of further research of the variability of the controlling functions as well as the trajectory analysis.

Braitenberg Vehicle 4
The Braitenberg Vehicle 4 is fundamentally different from the first three types. The equations of the motor speed and stimulus intensity are no longer monotonous. The maximum speed of the motor appears under a certain stimulus intensity. (Such as figure 1). Theoretically speaking, as long as the perfect function is set to control the vehicle's two motors, the track of the vehicle can complete almost all the basic graphics text.
There are many different kinds of stimulus. In this experiment, in order to simplify the analysis, the distance between the object block and the vehicle is chosen as a single stimulus source. Although in the original experiment, two sensors receiving signals were needed to control the two motors respectively. The experiment's analysis could also be completed by keeping the speed of one motor constant while the other motor received the stimulus signal and performed the corresponding speed change. It could be understood as one motor is extremely dull to the stimulus.  Figure 1 .The peak is appeared at about 13. The velocity is decreased as the intensity increasing after the peak.
The selection of the response curve is the most critical part of the experiment. The bell-like curve is chosen as the response curve, which consists of a constant and Gaussian curve. In further context, it is called a Gaussian-like curve. Its expression is: Four parameters can be adjusted: the minimum value of speed 0 V , the range of speed K , the distance where the speed reaches the peak value  , and the vehicle's accelerated speed  . setting of the initial position of the stimulus source, the vehicle's initial speed, and the range of speed change only needs to be fixed and reasonable.
The first step is to determine the relationship between distance and motor speed. We stipulate that a Gaussian-like function controls the vehicle's left motor, and the speed of the right motor is a constant value 0 V K  . Therefore, the vehicle can only turn to the left in the process of movement. Adjust the arena so that the initial position of the vehicle is (0,0). Set the current position as the origin of the Cartesian coordinate system. The stimulus's location is (x, y) (both x and y are greater than zero). In each experiment, the location of the stimulus source will not be changed. Only one parameter  or  , is changing. We analyse the vehicle's behavior meaning from the analysis of the coordinates and direction of the special position in the process of the vehicle returning to the Y axis again. The auxiliary Cartesian coordinate system is made with the stimulus source as the center. There are two kinds of situations in the process of vehicle movement due to the change of parameters: the vehicle moves through the 4 regions and does not. (figure 2) While adjusting the parameters, it should ensure that the track of the vehicle does not pass through area 4. And the coordinates that the vehicle comes back to the Y axis should be positive. The case that the vehicle's trajectory forms a closed graph before returning to the Y axis couldn't be included in the final statistics. As the vehicle passes through the fourth region during the movement, the 'influence' of the vehicle's movement's stimulus is not large enough. Even if the vehicle ends up back on the Y axis, the stimulus doesn't play a critical role, like in figure 3.
Besides, if the trajectory has formed a closed pattern, it means that the influence of the vehicle's stimulus is no longer the first round and shouldn't be included, like in figure 4.

Robotics Playground
The robotics playground is an application that uses the Simulink module in MATLAB. It was designed by MATLAB Student Competitions Team and was used to serve as a simple tool for students and researchers to operate simple simulations. Our experiment was using it to complete the simulation. During the simulation, detecting that the color of the obstacles could control would output the distance as well as the angle (the angle of the velocity vector and the direct distance to the obstacle) of the obstacles. Due to the limitations of the robotics environment, we only use the distance as well as the angle sensors to detect and quantify the stimulus, unlike the research did in [6], which used visual sensors that could produce the visual information. Others even use the sensor array to guarantee the abundance of the data [7]. However, compared to other sensors, the distance sensors have a significant advantage, which is that the sensors have a detecting range of 360 degrees, which would make the vehicle collecting the data of the obstacles much easier, unlike the researchers did in [8][9][10][11][12], they had to divide their vehicle loading plane into 12 parts evenly at every 30-degree angle, and doing experiments to find out the optimal facing direction. The environment is called the "Object Environment", which would provide enough space as well as up to five obstacles that could be colored into three different colors: red, green, and blue. The robot that we programmed to control is a simple physical model that runs on two wheels controlled by two motors as actuators. These motors would receive the input signal ranging from -127 to +127 and outputs the motor's angular velocity. To have a better simulation of the real-world environment, the robot is designed to have some parameters that the theoretical ones don't possess, such as the friction between components, damping coefficient, and so on, which could be altered in the environment for different purposes. The default value of such values is listed in Table 1 below.  For the first part of the situation, the value  is much larger than 13, and the motor's initial speed tends to decrease. The motion of the vehicle can be divided into two stages in this part: Stage one: the direction of the initial speed of the vehicle is toward the source, so the distance between the vehicle and 6 the source will reduce, then the speed of the left motor will decrease, the vehicle starts to turn aside. Stage two: when the vehicle moves close to the source, the vehicle will turn nearly vertical, and gradually move away from the source. The speed of the right motor will increase slowly.
For the second part of the situation, the value of  is a little larger than 13, and the initial speed of the left motor is steady (just reduce insignificantly). There will be another motion stage except for the two stages above, and we call it the stage three. Stage three: when the vehicle moves away from the source and the distance between the vehicle and the source gradually grows bigger than the initial distance 13, the left motor's speed will bigger than the peak value 47 and start to reduce. So, the vehicle starts to turn aside again and gradually begins to move back.
For the third part of the situation, the value of  is smaller than 13. In this part, there is another stage before stage one, and we call it stage four. So, the order of the four stages in this part is: stage four, stage one, stage two, stage three. Stage four: before stage one, the left motor's speed will increase to the peak value because of the reduction of the distance caused by the direction of the motor's speed.
When we analyze the effects of the vehicle's behavior, we set a value of  preliminarily, and the value of  meets the limitation above. Then we change the magnitude of the  (the unit digit, the double-digit number, the three-digit number) to find a suitable magnitude for the further experiment.
Then we start to analyse the influence of the vehicle's behavior caused by  . After finishing the analysis of  , we then set a suitable value of  from the analysis of  and then change the value of  . There is no need to change the magnitude of  , we just need to change the value of  little by little in the region of the three parts of situations above. Then we analyse the influence of the vehicle's behavior caused by  .
We choose to measure the influence of the vehicle behavior by setting some other parameters. First, we choose the smallest distance between the vehicle and the source during the whole part of the movement, we name it Dist1. The Dist1 can reflect the proximity of the vehicle and the source. It can also stand for the awareness of invasion of the vehicle. When the value of the Dist1 grows smaller, the awareness of invasion of the vehicle is stronger. On the contrary, if the value of Dist1 gets bigger, the awareness of invasion of the vehicle is weaker. Second, we choose the location where the vehicle gets back, and there is only a vertical distance between the location and the initial location. We name this location the final location. The distance between the final location the initial location is the distance we wanted. Due to the Robotics Playground limitation, the distance between the final location and the source is the distance we measure. The distance we wanted and the distance we measure are proportionate. (figure 6) Then we name the distance we measure Dist2, and the direction of the vehicle when the vehicle arrives at the final location is Ang1. Dist2 can measure the vehicle's departure, and Ang1 can reflect the vehicle's final direction. These two parameters can represent the fear of the source. When the value of Dist2 is bigger and the value of Ang1 is smaller, the trend of escaping from the source of the vehicle is more obvious, which means the vehicle is more frightening. When the value of Dist2 is smaller, and the value of Ang1 is bigger, the trend of escaping from the source of the vehicle is weaker, which means the vehicle is less fearful. When the value of Ang1 is larger than 180 degrees, the vehicle has the trend of moving toward the source, and it's no longer the behavior of fear and retraction. So at this time, only Dist2 can be the standard of measuring the behavior of fear and retraction of the vehicle.  Figure 6. Two distance in the experiments

Results and Discussion
When  is smaller than 13, we change the value of  from 0.5 to 15, the interval of each value of  is 0.5. the relations between  and Dist1,  and Dist2 are listed below (figure 7): In the chart, we can find out that when the value of  grows bigger, Dist1 is decreasing, which means the awareness of invasion of the vehicle gets stronger when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting bigger, the value of Ang1 is larger than 180°, so the vehicle is more fearful. We can find out in the chart that when the value of  grows bigger, Dist1 increases, which means the awareness of invasion of the vehicle gets weaker when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting smaller, the value of Ang1 is getting bigger, so the vehicle is less fearful.
When  is about 13, we change the value of  from 5 to 45. At the beginning of 14, the interval of each value of  is 1. the relations between  and Dist1,  and Dist2,  and Ang1 is listed below In the chart, we can find out that when the value of  grows bigger, Dist1 is decreasing, which means the awareness of invasion of the vehicle gets stronger when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting bigger, the value of Ang1 is decreasing, so the vehicle is more fearful.
When changing the value of  , we choose the moderate value of  , 30, and change the value of  from 13 to 19. The interval of every value of  is 0.2, the relations between  and Dist1,  and Dist2,  and Ang1 are listed below (figure 10):   Figure 10. The relations between  and Dist1,  and Dist2,  and Ang1 We can find out in the chart that when the value of  grows bigger, Dist1 is increasing, which means the awareness of invasion of the vehicle gets weaker when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting smaller, the value of Ang1 is getting bigger, so the vehicle is less fearful.
When  is larger than 13, we change the value of  from 210 to 500, the interval of each value of  is 10. the relations between  and Dis1,  and Dis2,  and Ang1 are listed below (figure 11):  Figure 11. The relations between  and Dist1,  and Dist2,  and Ang1 In the chart, we can find out that when the value of  grows bigger, Dist1 is decreasing, which means the awareness of invasion of the vehicle gets stronger when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting bigger, the value of Ang1 is decreasing, so the vehicle is more fearful.
When changing the value of  , we choose the moderate value of  , 350, and change the value of  from 23 to 29. The interval of every value of  is 0.2, the relations between  and Dist1,  and Dist2,  and Ang1 are listed below(figure 12):   Figure 12. The relations between  and Dist1,  and Dist2,  and Ang1 We can find out in the chart that when the value of  grows bigger, Dist1 is increasing, which means the awareness of invasion of the vehicle gets weaker when the value of  is increasing. Meanwhile, when  grows bigger, the Dist2 is getting smaller, the value of Ang1 is getting bigger, so the vehicle is less fearful.

4.Conclusion and future expectation
According to the discussion of the three scenarios mentioned above, the two parameters  and  have the similar effect on the intention in invasion as well as the retraction of fear,  has the positive correlation with the two status while  would have a negative correction. This has also proved that we could easily control the vehicles' behaviour by altering the simple controlling function parameters. Such a method could be widely adopted in the field of robotics control. However, the friction between the wheels and the ground surface in the entire simulation process would cause errors between the velocity of the vehicle and the motor's rotation speed, and the former can't be directly measured due to the limitations of the simulation environment. Also, due to the simulation's sampling rate as well as the manual controlling method, the output of the output measurement by the software is discrete and would have a delay. The delay of the statistics post by the sensors would also cause the vehicle's end position to have a slight difference from the position that we calculated. Therefore, under such disadvantages, making a quantitative analysis would be unreasonable. Thus, we eventually made a qualitative analysis of the experiment. This made building a more accurate simulation environment and tracking a more complete trajectory of the vehicle the primary focus in this subject's future research. Also, the research only concludes the analysis under two objects in total: the vehicle and the stimulation object. Therefore, a more thorough and complex research could be done by adding additional numbers of the stimulation objects. There is a research team that applied the Braitenberg vehicle controlling method into a snakelike robot (in this case, multiple vehicles were connected in a row with the function controls only the movements of the connecting joints rather than individual wheels), this would provide a new way to future research. Furthermore, by adding multiple vehicles into the simulation environment could also lead to a more complex behavioral analysis, for the vehicle itself are served as the stimulation object. And for the evolution of the Braitenberg vehicle, the evolution strategy is also a good way to apply. From another perspective, changing the form of the stimulation, such as odor, is also easy to build and accomplish.