How the SumoBot Tilt Controller Works

How it Works

If you tilt the HomeWork Board forward a little bit, the robot will roll forward slowly.  If you tilt it forward a lot, it will roll forward quickly. Tilting and rolling backward works the same way.  If you tilt the board to the right or left also, the robot will turn in that direction. 

The Memsic 2-axis accelerometer on your HomeWork Board can sense if the board is being held flat, or if it is tilted, how far and in what direction.    It reports these tilts on each axis (front-to-back and side-to-side) as pulses that last certain amounts of time.  The PBASIC program running in the BASIC Stamp HomeWork Board's onboard BASIC Stamp microcontroller makes it measure these pulses and convert them to numbers.  The program also makes the BASIC Stamp send these numbers as serial messages to the XBee transceiver, which in turn broadcasts these serial messages for the XBee on the robot.

The XBee on the robot receives the serial messages and forwards them to the robot's BASIC Stamp.  Its program converts the serial messages back to the numbers they represent.  Then, it does some math on the values to figure out the speed and direction it should make the servo turn.  It then sends a series of pulses to the servos.  The amount of time each pulse stays high is what tells the servo what speed and direction to turn.   

Learn much more about how it all works

To learn more about programming your robot for autonomous navigation, try Robotics with the Boe-Bot or the SumoBot Manual along with Applied Robotics with the SumoBot