-
Notifications
You must be signed in to change notification settings - Fork 32
PiTeR startup
PiTeR has a couple of safety interlocks. When powered up, the Arduino reads the accelerometer to see if the robot is upright. If it isn't, a boolean, 'calibrated' is set to false. This boolean prevents the motor receiving any current, even if the robot is subsequently set upright.
If the robot is upright when the Arduino starts, 'calibrated' is set to true and the zero point is set at the moment it leaves the reset state. If the robot angle subsequently stays outside of the range in which the robot could possibly balance for a given timeout, the robot assumes it has fallen over and disarms its motors. In this state, restoring it to the upright position rearms the motors.
So to start PiTeR balancing, follow the following procedure.
- Hold the robot as close to the vertical as possible
- Reset the ATMega controller
- The robot will start to balance, but will almost certainly be wandering either forwards or backwards
- Push the home button to enter the tuning mode, the wii-mote will rumble to confirm
- Use the cross buttons to alter the pitch tuning until the wandering reduces and stops
- If the robot shows a tendency to turn, use the cross buttons to correct for this
- Push the home button twice to return to the drive mode
- The robot should now be controllable, button 2 to accelerate, button 1 to brake, tilt the wii-mote to steer
If the robot falls over, follow this simpler procedure.
- Hold the robot upright again, close to the vertical
- Wait for the motors to kick slightly as they are rearmed
- The robot is now controllable again
If you want to be sure the robot will not become active after falling over, reset the Arduino while it is lying down.