Home
What Is 6.270
Hardware
Software
Game Strategy
Competition Results
Videos and Pictures |
Our code can be downloaded here.
The code for the competition was based off sample gyroscope code given to us that would (in theory) get the robot to drive straight. To prepare our robot for the competition, we made three major changes to the code:
- We added a function to read in data from the 4 IR-LED/phototransistor pairs that would let our robot decide which direction to drive in.
- We then added code that asked our robot to stop its motors (i.e. stop driving) when its front or back bump sensors were hit.
- Soon, we realized that the robot wasn't driving exactly straight with the given sample function because the original code corrected for errors by subtracting a fixed speed from each of the wheels, which would actually cause the robot to overcompensate when correcting errors. So, we coded up a proportional controller, which would subtract or add a speed proportional to the error between the given heading and current heading. Then, our robot flew AS STRAIGHT AS AN ARROW.
|