190 likes | 208 Views
Control. Some Material taken from RobotSubsumption.pdf. Remember Where Are We Going?. Sumo-Bot competitions. QTI Sensors. Used to “see” the white boundary ring. P7. P3. P6. P2. Left Side. Right Side. QTI Sensors. Code. More Info: Chapter 3 of Applied Robotics with the SumoBot.
E N D
Control Some Material taken from RobotSubsumption.pdf
Remember Where Are We Going? Sumo-Bot competitions
QTI Sensors Used to “see” the white boundary ring
P7 P3 P6 P2 Left Side Right Side QTI Sensors Code More Info: Chapter 3 of Applied Robotics with the SumoBot
Sonar Range Finder Used to “see” the your opponent
Sonar Range Finder Documentation Code
IR Detectors Often used to “see” to the side (short-range)
IR Detectors More Info: Chapter 3 of Applied Robotics with the SumoBot Code
No Obj Obj left Obj right Obj forward Read IR go forward turn right turn left go backward Finite State Machine (FSM) Representation
go forward turn left turn right backup Read QTI How to Put It Together? No Obj Obj left Obj right Obj forward Read IR & sonar Go forward turn right turn left go forward both high left low right low both low
Possible Problems • Jerky or halting movement • Chase object over boundary • Never detect opponent • More?
Possible Solution • Subsumption Architecture A programming process by which one behavior subsumes, or over-rides another based on an explicit priority that we have defined. First described by Dr. Rodney Brooks in "A robust layered control system for a mobile robot,” IEEE Journal of Robotics and Automation., RA-2, April, 14-23, 1986. • FSM with exit conditions
Go forward Go backwards turn teft turn right read IR & sonar and set nextState variable Read QTI and set nextState variable check nextState variable and branch FSM
backup turn right turn left go forward read Photoresistors and set nextState variable check nextState variable and branch Read IR Alternative FSM Go forward turn right turn left go forward
Program High-Level Outline • Declare pin assignments, constants and variables • Initialize thresholds • Wait the required start delay • Read boundary line sensors and move accordingly • If the boundary line is not detected, read proximity sensors and move accordingly • Repeat steps 4 and 5 until completion
Main Loop Do GOSUB Read_Line_Sensors IF (lightLeft < leftThresh) AND (lightRight < rightThresh) THEN GOSUB About_Face ' boundary ahead ELSEIF (lightLeft < leftThresh) THEN GOSUB Spin_Right ' boundary to left ELSEIF (lightRight < rightThresh) THEN GOSUB Spin_Left ' boundary to right ELSE PULSOUT LMotor, LFwdFast PULSOUT RMotor, RFwdFast GOSUB Search_For_Opponent ENDIF Loop Code
Changes that you should make • Change all I/O Definitions to match your configuration • Change motion control subroutines to suit your wheel base • Use debug statements to make sure that all sensors are working • Modify the code to incorporate your winning stragegy