Robot control Devika Subramanian Fall 2008 Comp 140 1
Robots 2
The sense-decide-act cycle World Actuators Sensors 3
Sensors for mobile robots Contact sensors bumpers Internal sensors accelerometers gyroscopes compasses Proximity sensors sonars infra-red laser range finders Visual sensors: cameras Satellite-based sensors: GPS 4
Sonars 40kHz sonar range finders 16 cm to 600 cm range Ultrasonic SRF02 http://www.robot-electronics.co.uk/htm/srf02tech.htm has the tech specs http://www.robot-electronics.co.uk/htm/sonar_faq.htm has a cool FAQ on sonars 5
How sonars work http://www.cs.brown.edu/~tld/courses/cs148/02/sonar.html 6
Sonar characteristics http://www.cs.brown.edu/~tld/courses/cs148/02/sonar.html 7
Sonar characteristics http://www.cs.brown.edu/~tld/courses/cs148/02/sonar.html 8
Sonar characteristics Seattle Robotics Club 9
Building sensor models d 0 15 30 45 10cm 20cm 30cm 40cm 50cm degree of inclination 10
Compass degrees (0-360) 0: north 90: west 180: south 270: east Measurements in deci-degrees 4 significant digits in reading http://www.robot-electronics.co.uk/htm/cmpsqa.shtml http://www.robot-electronics.co.uk/htm/cmps3doc.shtml 90 West North 0/360 180 South East 270 11
Robot actuators turn motors command a turn in degrees per second forward/reverse motors command forward or backward motion in cm/ sec 12
Programming embedded systems Embedded systems interact with the external world, sense it, and take actions to change their world. As the system computes, the world underneath it is changing. Embedded systems work in a sensedecide-act loop. 13
The inadequacy of fixed plans In the maze world shown in the Markov decision processes example move north by 2 move east by 3.. is not a robust plan! world responds in a stochastic way to robot s actions Yet, it is possible for the robot to succeed in the maze world with a policy that gets it to the goal state while avoiding the trap state. 14
The sense-decide-act cycle get information from sensors perform computation to interpret sensors, and to determine the next action take computed action A reactive system responds to current sensors. It estimates what to do based on current state. 15
Get robot to within 50 cm of wall Perfect actuation/sensing Let d = current distance to wall (in cm) move(d-50) open loop control 16
Get robot to within 50 cm of wall Imperfect actuation/perfect sensing sense act Let d = current distance to wall (in cm) while d > 50: move(1) closed loop control Is this program guaranteed to succeed? 17
Uncertainty in sensing and actuation while distance > threshold-distance: move(1) Have robot creep up to desired distance slowly allows for dynamical changes in world (appearance of a sudden obstacle) allows for less than perfect actuation 18
Proportional control Instead of moving by a fixed amount each time, move proportional to the remaining distance Let d = current distance to wall (in cm) while d > 50: move(k*(d-50)) 19
Get robot to within 50 cm of wall Imperfect actuation/imperfect sensing sense act Let d = current distance to wall (in cm) while Pr(d > 50)>epsilon: move(k*(d-50)) closed loop control Is this program guaranteed to succeed? 20
State machines State machines are a way of constructing embedded systems with state (i.e., that remember their past) initial state next state function: map input and state to next state(s) output function: map input and state to output 21
Duncan hall entry machine S = {open,closed} # the states I = {swipe-card,pull-door} # the inputs O = {click,none} # the outputs swipe-card closed open pull-door 22
Specification of Duncan Hall entry machine next: states x input --> state next(closed,swipe-card) = open next(open,pull-door) = closed next(s,i) = s for all other s,i combinations output: states x input --> state output(closed,swipe-card) = click output(open,pull-door) = click output(s,i) = None for all other s,i combinations 23
A squirrel bot d = too_far d = too_close content d=just_right d=just_right curious d = too_close scared d = too_far Each state has an associated behavior. Curious -- approach object slowly Scared -- back away quickly Content -- do nothing 24