Hi all
this is my first post .
I am in the process of designing an obstacle avoidance mobile robot controlled by fuzzy logic , the idea of this work is that the robot should moves straight in an desired angle given by the user and if it faces an obstacle in his way , it should avoid that obstacle and then re-correct its heading angle to the desired angle .
My mobile robot is Rover 5 with two DC motors and Encoders and three ultrasonic sensors , one of sensors is in front side and two others on two sides of robot with 45 & -45 degree .
But I face a problem and I will explain it in the figures below because I couldn't to snapshot my real robot .
In figure below the initial heading angle of robot is zero with X-axis and desired angle (for example) is 45 degree .
so the fuzzy control will increase right motor and decease left to point or steer robot with angle 45 , and when the heading angle of robot is equaled to desired angle "45" , the robot moves straight and until now everything is OK .
but the problem started when the robot faces an obstacle in his way .
so to avoid that obstacle , fuzzy control will increase right motor and decrease left to make robot change its heading to avoid it , as shown in figure below
In the state above , instead that the robot move a little forward , It suddenly change its heading angle by increasing left motor and decrease right one and that happens because one of fuzzy rule is triggered which is telling robot to re-correct its heading to desired angle when no sensor sense an obstacles . So the robot will return to old state as in picture below
now robot again tries to avoid obstacle and change its direction and then re-correct its heading to desired angle
and it stacked in these two states , switching between them and don't move , so any help / idea about how to solve this problem
Hint : Actually my fuzzy controller is with four inputs (Front sensor reading , Right sensor reading , Left sensor reading , Desired angle ) and two outputs (Right Wheel Speed , Left Wheel Speed ) and simply the rules base scheme as follow :
If Front Sensor triggered Turn Left
If Left Sensor triggered Turn Right
If Right Sensor triggered Turn Left
If No Sensor triggered Re-correct Heading Angle to Desired angle and move Forward .
Update :
thanks for all your posts
Now , I realized that I should force a slight move forwards after the turn before returning to the heading . but the problem how could I make this force or modifier , should it be located inside rule base ? I tried to add or modify a rule in my rules base to perform this force but I failed to find right place to this force .
these are my rules and membership functions by Matlab , actually I converted MATLAB Fuzzy Inference System to Arduino C Converter by http://www.makeproto.com/