96 CHAPTER 5. SENSOR DESIGN Chapter 6 Robot Control Most people who have seen past contests (or any of the raw videotape footage of past contests), remember round after round of wedged robots|robots that got stuck against a wall, or stuck against another robot, and stayed that way for the duration of a round. Often these robots did not su er from mechanical or electronic failures, but rather from poor software design. Perhaps a robot were running into the wall, and its front touch sensor did not trigger. This robot was not physically stuck, but it was \mentally stuck": its program did not. | 96 CHAPTERS. SENSOR DESIGN Chapter 6 Robot Control Most people who have seen past contests or any of the raw videotape footage of past contests remember round after round of wedged robots robots that got stuck against a wall or stuck against another robot and stayed that way for the duration of a round. Often these robots did not suffer from mechanical or electronic failures but rather from poor software design. Perhaps a robot were running into the wall and its front touch sensor did not trigger. This robot was not physically stuck but it was mentally stuck its program did not account for this situation and did not provide a way for the robot to get free. Robot after robot has failed in this way infuriating their creators and boring the audience. This chapter will discuss the hard truth about robot sensors and present a framework for thinking about control that will help the reader prevent his or her robot from suffering the same fate. A few words of advice most people severely underestimate the amount of time that is necesssary to write control software. A program can be hacked together in a couple nights but if a robot is to be able to deal with a spectrum of situations in a capable way more work will be required. Also it s very painful to be developing contest-ready software at the same time as one is making changes hardware. Any hardware change will necessitate software changes. Some of these changes may be obvious but others will not. One sad story is of a team that revamped their robot s entire geartrain in between the first and second nights of the contest. The new geartrain performed much better but all of the timing parameters in their code needed to be adjusted. The team never recovered from their mechanical upgrade. In the past it has been observed that that the most successful robots were the ones that had their mechanics and sensors completed about a week before contest. We urge you to make this your goal Finish your robot with a week to .