Plexibot MkI Servo Drive

The Plexibot MkI Servo Drive was a robot built by Jacob Beck for the 2013 Trinity Firefighting Competition. It is named for its plexiglass construction, and a last-minute switch from gearmotors to servos.

In the first run, Plexibot detected the candle while in a different room, and collided with a wall while attempting to approach it. In the second run, Plexibot successfully located the candle in the floating room, but ended up facing the wrong direction while trying to extinguish it.

Lessons Learned

 * Determine what sensors will be necessary ahead of time. Due to my unfamiliarity with the club inventory, a majority of construction time was spent on testing different hardware.
 * Design chassis from the ground up. Structural components were added as necessary, which made some of the hardware added earlier difficult to access.
 * Use a solenoid and pressure regulator with CO2. The mechanically-actuated valve was very leaky.
 * Use a more flexible algorithm, and enable interruption by certain events. My code was too strict; it followed a predetermined path, and had limited ability to cope with change or unexpected situations. Next year's code should monitor rangefinders ALL the time to prevent collisions (as opposed to just during wall following), and take a more flexible approach to navigation.

Hardware
Main components used on the final version of Plexibot:
 * 2 Parallax Continuous Rotation Servos for locomotion.
 * HiTec MODEL# servo for CO2 valve actuation.
 * Pololu Mini Maestro 16 servo controller for servo control.
 * 7.4V LiPO battery for power
 * Arduino Duemilanove for logic.
 * 2 Sharp MODEL# IR rangefinders for wall detection.
 * BRAND IR flame detector for locating candle.
 * Hamamatsu UVTron for confirming flame.
 * Devantech CMPS03 magnetic compass for navigation. Trinity rules recommend against the use of magnetic compasses due to interference, but in my experience it worked rather well. However, I mounted it as high as possible, and would not recommend 100% reliance.
 * Unbranded small motor for backup fan. The inspector said if I equipped a fan, I would forfeit my CO2 point bonus, regardless of whether or not it was used. I removed the fan, but kept the motor in case I decided to re-equip the fan between runs.
 * Photoresistor and red LED used for line detection.
 * RoboKits 16x2 Serial LCD for reporting status.

Hardware Configuration: "Pins and Hardware.txt" Arduino: A0 - Right IR rangefinder A1 - Front IR rangefinder A2 - Line dectector A3 - IR flame detector A4 - I2C SDA line A5 - I2C SCL line

D2 - UVTron D6 - Servo controller TX D7 - Servo Controller RX D9 - Start button D10 - LCD D13 - Fan

Mini Maestro: Channel 0 - Left servo Channel 1 - Right servo Channel 2 - CO2 servo

I2C Hardware: 0x60 Compass

Software
While the sourcecode is exceedingly long, it can be condensed to the following algorithm:
 * 1. Leave the home circle.
 * 2. Right wall follow until a line is detected, that means a room has been entered.
 * 3. Do a 360 sweep for the candle.
 * 4a. If the candle is detected, extinguish it and stop the program.
 * 4b. If the candle was not detected, leave the room.
 * 5. Repeat steps 2-4 for rooms 2 and 1.
 * 6a. Right wall follow until a line is detected. If there is no wall detected in front, you are in room 4. Do steps 3 and 4.
 * 6b. If a line AND a wall are detected, you have found the home circle. Turn 180 and do step 6a.
 * 7. If the candle was not found, just right wall follow and do a 360 sweep for the candle every 5 seconds.

Sourcecode: "maze_solving_ver13_CO2.ino"