Research about sensors
Obstacle Avoiding Robot A Lego EV3 Robot
Co-Authors: Vignesh Jathavara, Preethi Ashwath Dept. of Computer Engineering Dept. of Electrical Engineering
University of California, Irvine, CA, USA
Abstract—George Bekey in Autonomous Robots defines Robot as a machine that senses, thinks, and acts. Robot can be made capable of operating in the real world environment without any form of external control for an extended period of time. A robot with cognitive capabilities include perception processing, attention allocation, anticipation, planning, complex motor coordination, reasoning about other agents and perhaps even about their own mental states. Robotic cognition embodies the behavior of intelligent system in the physical world. Ultimately the robot must be able to act in the real world. In our project, a robot was built to sense any obstacle in its path avoids it and resumes its running involving the pre-computation of an obstacle free path. The robot utilizes ultrasonic sensor to identify its target by taking advantage of the robot’s hard wire morphology.
Keywords— Cognitive Robotics, Lego robot, Sonar sensor, Obstacle avoidance, Evolutionary Algorithm, Genetic Algorithm, Algorithms, Neuro-evolution, Co- evolution
I. INTRODUCTION There are some very famous methods for robot navigation like wall-following, edge. One recently introduced commercial system uses wall-following method on a floor cleaning robot for long hallways [1]. A more general and commonly employed method for obstacle avoidance is based on edge detection [2, 3]. Real-time obstacle avoidance is one of the key issues to successful applications of mobile robot systems. A disadvantage with obstacle avoidance based on edge detecting is the need of the robot to stop in front of an obstacle in order to allow for a more accurate measurement. All mobile robots feature some kind of collision avoidance, ranging from primitive algorithms that detect an obstacle and stop the robot short of it in order to avoid a collision, through sophisticated algorithms, that enable the robot to detour obstacles. The latter algorithms are much more complex, since they involve not only the detection of an obstacle, but also some kind of quantitative measurements concerning the obstacle's dimensions. Once these have been determined, the obstacle avoidance algorithm needs to steer the robot around the obstacle and resume motion toward the
!
original target [4]. In this paper the dynamic steering algorithm ensures that the robot doesn't have to stop in front of an obstacle during its navigation. Hence the robots may overcome some of the problems during navigation, discussed above and it can navigate smoothly during its operation avoiding the collisions. We have presented a basic algorithm and design which can be further improved depending upon the required applications[5].
! Fig 2: Image of robot showing four Sonar sensors, two of which is fixed to face forward, the other two is placed to its left.
Fig 1: Symbolic representation of obstacle avoidance based on the distance of the object from the obstacle and time available for the robot to move between two cycles of the obstacle.
2017 International Conference on Recent Advances in Electronics and Communication Technology
978-1-5090-6701-5/17 $31.00 © 2017 IEEE
DOI 10.1109/ICRAECT.2017.61
43
2017 International Conference on Recent Advances in Electronics and Communication Technology
978-1-5090-6701-5/17 $31.00 © 2017 IEEE
DOI 10.1109/ICRAECT.2017.61
43
In this Lego robot demonstration, the obstacle avoidance is programmed to the robot. Utilizing Four Sonar sensors two of which facing front have been utilized to detect the distance to the obstacle and measure time available for the robot to move between two cycles of the obstacle. The other two placed on its left, are used to detect a crash when the robot moves forward.
II. DESIGN PRINCIPLES FOR COGNITIVE ROBOTS Pfeifer and Bongard introduced eight design principles for intelligent agents.
Agent design principle 1: The three-constituent principles are defined as ecological niche, behavior and design of the intelligent agent. The niche and behavior of our robots has been a controlled laboratory setting however if we claim that our robots are cognitive, then we need to test them under conditions by which cognitive scientists test their subjects. In our project the agents niche and behavior changes based on the lower surface of a room, laboratory or other conditions on which the agent move forward , which in turn effects the speed at which it cross the obstacle without collision. The third constituent agent design is very important since it plays a major role in obstacle detection and collision avoidance.
!
! Fig 3: Design of the agent for obstacle avoidance utilizing four Ultrasonic sensors
Agent design principle 2: the complete agent Many unplanned consequences emerge through interaction with the environment. For example, the act of moving through the environment avoiding obstacles has a continuous stream of information that can lead to invariant object recognition without the need for complex transformations (Krichmar & Edelman, 2002; Seth et al., 2004). Introducing saliency in this environment can help in these conditions.The obstacle
avoiding robot was designed to extract value in its environment. Agent design principle 3: cheap design The construction and design of agents that are built to exploit properties of the ecological niche will be much easier or ‘‘cheaper’’. The total setup for the obstacle and robot has been done using a Lego Mindstorm EV3 set, cardboard boxes, threads and tape, hence achieving cheaper design.
! !
! Fig 4: Representation of movement of obstacle
Agent design principle 4: redundancy or degeneracy Degeneracy is the ability of elements that are structurally different to perform the same function or yield the same output. In our project two pairs of motors are used one for the movement of the obstacle and other one for the movement of the obstacle avoider agent hence degeneracy can be noticed.
Agent design principle 5: sensory-motor coordination Embodied agents induce structured sensory stimulation through sensorimotor coordination by being situated in the environment. The motors utilized for movement of obstacle has synchronization between each other for back and forth movement of the obstacle.
Agent design principle 6: ecological balance There should be a balance between the complexity of the agent’s sensory, motor. Moreover, there should be a balance between the morphology and its environment. To obtain balance between Sonar and motors distance of the robot from the obstacle and time available for the robot to move between two cycles of the obstacle is measured.
Agent design principle 7: parallel, loosely coupled Processes The old way of thinking in cognitive science was ‘‘sense,
motor brick
4444
think, and act’’, and this carried over to Artificial Intelligence robots. To enhance this Evolution Algorithm, Fitness rules have been used.
Agent design principle 8: value Intelligent agents are equipped with a value system that constitutes a basic assumption of what is good and bad for an agent.
Effective Speed = baseSpeed + x*param1 + y*param2
Constants(Genes)- x,y Parameters- Param1!Distance between the robot and the obstacle. Param2 !Time available for the robot to move between two cycles of the obstacle.
III. BIOLOGICALLY INSPIRED LEARNING Evolution is a powerful natural phenomena that has adapted low intelligence organisms into beings capable of abstract thinking. Consider an initial population and a desirable property, further entitled as fitness. A number of parents are selected with a high fitness level. These parents produces a number of offspring with a genetic code that is a random mixture of the parents’ plus an individual mutation. The children form a new population and the algorithm is repeated.
The three main parts of genetic algorithm for evolution are Fitness, Mating and mutation.
A. Fitness Fitness determine how good or bad the robot performs at the task it is responsible for. There are 4 levels of fitness in our project. First if only the sensors on the front encounters the obstacle. Second if both the front and back sensors encounter the obstacle. Third, Only the sensor at the back senses the obstacle and the Fourth is a success where no sensor senses the obstacle .
B. Mating When all the members in the population have gone through simulation, the ones with the best fitness score are selected into a separate group where they then are picked randomly to create pairs. These pairs are the parents that will create the offspring for the next generation (often replacing the ones with the lowest fitness scores), and is done by dividing each parents’ gene strings and copying and merging them into new gene strings. Mating in the project is determined by the environment. The need to mutate occurs only when the robot fails to achieve its goal of avoiding the obstacle.
C. Mutation The last step of creating new offspring is the mutation, which is an operator that mimics the natural process occurring continuously in nature allowing species to
branch out even more than the mating procedure can. It is natures way of testing and experimenting with new things, but of course at a greater risk since it’s not based on anything but randomness. The robot in this case has two genes which are the factors with which each of the two parameters are multiplied to determine the speed of the robot movement.
IV. SENSOR AND MOTOR PERFORMANCE We use only sonars in this project. Each of the for sonars used are the EV3 ultrasonic sensors. These sensors detect and provide the distance to an object in front of it in centimeters. The range of values vary from a minimum of 3cm to a maximum of 250cm. Due to the limitation of the sensor, we cannot detect the actual crash and have to consider a distance of 3cm as a collision. The placement of these sensors are very important to get reliable readings. This is because they sense only along their line of sight, hence any error in the angle of the sensor (maybe lifted more upwards or drooping down) may result in unexpected values. We use large motors for both the robot as well as obstacle. The speed of these motors can be varied depending on the percentage of power(0% to 100%) output from them.
V. METHODOLOGY OF OBSTACLE AVOIDANCE The logic behind avoiding the obstacle is simple. The robot encounters a moving obstacle in front of it. The robot detects the distance of the obstacle from itself. The robot also detects the direction of movement of the obstacle i.e. either from right to left or from left to right. Based on this it calculates the time between the event when robot moves from right to left and the event when it moves from left to right. This gives the robot the time window within which it has to complete its movement. The robot also has a base speed to which the distance to obstacle and time window are added after being multiplied by factors. This determines the constant speed at which the robot should move to avoid the obstacle. The determination of distance from obstacle is straight forward using a sonar. To detect the direction of movement, we use a certain trick. Both the sensors in the front are given equal opportunity to detect any obstacle in front of it. If the left sonar detects the obstacle first, then the obstacle is moving from left to right and if the right sonar detects it first, then the obstacle is moving from right to left. For the calculation of time window we consider the time difference between when the left sensor detects the obstacle while it is moving from right to left and when the left sensor detects the obstacle while it is moving from left to right. The robot then starts moving with a speed calculated using the above method. If the robot is successful in avoiding the obstacle, it uses the current values of genes, else it mutates. The mutation in the genes is incrementing its value by a tiny amount. The mutation is
4545
done alternatively to each of its two genes i.e. first mutation mutates only gene1, next mutation mutates gene2, then gene 1 again and so on. The idea is to achieve a balance in the gene values and the environmental parameters so that depending on the parameter values, the robot can avoid the obstacle even on varying the speed of obstacle and distance of object from the obstacle.
VI. FLOWCHART
Flow chart of Obstacle Movement Code
Flow chart of Main Task Part 1
4646
Flow chart of Main Task Part 2 Flow chart o findFitness Task
4747
VII. PSEUDOCODE
The pseudocode of obstacle :
While(true) { Set Left motor speed as 20; Set Right motor speed as -20; sleep for 6.5seconds; Set Left motor speed as -20; Set Right motor speed as 20; sleep for 6.5seconds; }
The Pseudocode of findFitness Task:
Set flagB and flagF to false; while(stopFind == false) { if SensorValue of front sensor is 3 then set flagF to true; if SensorValue of back sensor is 3 then set flagB to true; }
if(flagF = true and flagB = false) fitness = 3; else if(flagF = true and flagB = true) fitness = 6; else if(flagF = false and flagB = true) fitness = 9; else fitness = 10;
The Pseudocode of Main Task:
while(1) { ClearTimer; flagL = false, flagR = false; mindDistLeft = 255, minDistRight = 255; while(1) { if(Left Sensor Detects){ if(flagR = true){ endTime = timerValue; flagL = true; } minDistLeft = SensorValue of Left Sensor; while(1){ if(Right Sensor Detects){ minDistRight = SensorValue of Right Sensor; break; } } playSound; }
if(Right Sensor Detects){ flagR = true; while(1){ if(Left Sensor Detects){ startTime = timerValue; break; } } playSound;
if(flagR=true and flagL = true) break; } time = endTime - startTime; distance = (minDistLeft +minDistRight)/2; Speed = calculateSpeed(time,distance); while(1){ if(LeftSensor Detects){ wait till right sensor detects; } if(RightSensor Detects){ wait till left sensor detects; stopFind = false; startTask findFitness; Move robot with Speed calculated; stopFind = true; break; } } playSound; }
VIII. DISCUSSION Obstacle avoiding technique is very useful in real life, this technique can also be used as a vision belt for blind people by changing the ultrasonic sensor by a kinetic sensor ,which is a type of microwave sensor whose sensing range is very high and the output of this sensor vary in according to the object position changes. This technique enables blind people to navigate obstacles easily by placing three vibratos in left, right and the centre of a belt named as Vision Belt. On top of obstacle avoiding robot temperature/ pressure sensors can be added to monitor the atmospheric conditions around. This is useful in places where the environment is not suitable for humans. Same technology can be used in various applications by modifying the program for example Line / Path finder Robot , automatic vacuum cleaner etc.
IX. CONCLUSION Almost all navigation robots demand some sort of obstacle detection, hence obstacle avoidance strategy is of importance. Obstacle avoidance robot has a vast field of application. They can be used as services robots, for the Low Cost Obstacle Avoidance Robot, purpose of household work and so many other indoor applications. Equally they have great importance in scientific exploration and emergency rescue, there may be places that are dangerous for humans or even impossible for humans to reach directly, then we should use robots to help us. In those challenging environments, the robots need to gather information about their surroundings to avoid obstacles. Nowadays, even in ordinary environments, people also require that robots can detect and avoid obstacles. For example, an industrial robot in a factory is expected to avoid workers so that it won’t hurt them. In conclusion, obstacle avoidance is widely researched and applied in the world, and it is
4848
probable that most robots in the future should have obstacle avoidance functionality built into them.
X. ACKNOWLEDGMENT
WE WOULD LIKE TO THANK PROF. JEFFREY KRICHMAR FOR HIS INTERESTING LECTURES IN THE COURSE PSYCH 268R WHICH HELPED US UNDERSTAND THE BASICS OF COGNITIVE ROBOTICS AND COMPLETE THIS PAPER. WE WOULD ALSO LIKE TO THANK OUR PEERS FOR THE CONSTRUCTIVE DISCUSSIONS DURING THE LECTURES.
XI. REFERENCES 1. Design principles for biologically inspired cognitive roboticsJeffrey L. Krichmar Department of Cognitive Sciences, 2328 Social and Behavioral Sciences Gateway, University of California, Irvine 92697-5100, USA
2. OBSTACLE AVOIDING ROBOT – A PROMISING ONE Rakesh Chandra Kumar1 , Md. Saddam Khan, Dinesh Kumar,Rajesh Birua, Sarmistha Mondal, ManasKr. Parai B.Tech students, Dept. of ECE, Siliguri Institute Of Technology, Sukna, Darjeeling-734009(W.B), India. Asst. Professor, Dept. of ECE, Siliguri Institute Of Technology, Sukna,Darjeeling-734009(W.B), India.
3. A Dynamical System Approach to Realtime Obstacle Avoidance S.M. Khansari-Zadeh · Aude Billiard
4. A Practical Obstacle Detection and Avoidance System Sumit Badal Srinivas Ravela Bruce Draper Allen Hanson Computer Vision Research Laboratory University of Massachusetts, Amherst, MA 01002
4949