Incline Feedback for the Toddler® RobotAppeared in the 2003 Product Catalog.
Determining Optimum Tilts Shouldn’t be a Guessing Game
The Toddler® robot walks using a series of tilt-stride movements. First, the robot tilts left or right then raises the opposite foot. Next the foot moves forward to take a step. Turns are accomplished by sliding both feet in opposite directions. The tilting movement is accomplished by setting right and left leaning limits which must be set far enough to raise the opposite foot off the ground, but not so far as to fall over. This is normally accomplished through an iterative process: plug in a servo limit; run the code and try again. But if the Toddler robot steps on a couple of LEDs then you could have a problem.
For this project you need the following parts:
- Toddler robot
- Memsic 2125 Accelerometer (#28017)
With an accelerometer, it’s easy to check the tilts between each servo pulse. Set the left or right limits as far as you wish. Using the PULSIN command check the accelerometer during each servo loop. Once you’ve received three or four tilt values beyond your threshold (escVal) then branch to the routine which moves your Toddler back the other way.
The Memsic 2125 poses a few unique considerations on the Toddler. First, sudden movements along the sensor’s Y axis produce a pulsewidth for acceleration. When your Toddler robot tilts from the middle position it will produce values greater than the desired incline, so the Counter variable is used in conjunction with a LOOKDOWN table to count these occurrences, checking for a total number greater than the escVal constant.
Because the Toddler can execute 34 different movements, the use of an accelerometer quickly becomes a real-time programming project in which variables must be tracked for use in other subroutines. For example, what servo pulse width was used when the Toddler encountered the tilt limit? This same value must be the start of the control loop for leaning in the opposite direction. |