This is a balancing robot that I built over the weekend. It utilizes 2 SHARP IR sensors to ascertain tilt, and a RCTIME circuit for analog --> digital conversions to be read by a Basic Stamp II. The Basic Stamp runs the data through a PID algorithm and drives the motors. Bill of Materials: Mechanical: 2x - CDs for upper and lower chassis 4x - Wooden blocks (frame) Control: 1x - Basic Stamp II 1x - Bot Board II Sensors: 2x - SHARP GP2D120x IR sensors (analog) Motion: 2x - Pololu Micro Metal HP Gearmotors 1x - TB6612FNG Dual Motor Driver 1x - 9v alkaline battery (VLogic) For RCTIME Circuit: 2x - 100 ohm resistor 2x - 100k ohm resistor 2x - .1 microfarad capacitor 2x - 80505 switching transistor (Radioshack) Misc: Wire, Various nuts and bolts |
UPDATE** After some research, I came to the conclusion that there is no way for a simple balancer like this one to effectively balance on smooth surfaces without the use of encoders or tachometers to receive feedback from the motors. An informative post about this can be found here.
However, the robot does balance quite well on rough surfaces, like carpet.
Source Code:
balancercode1.bs2 |
pidcontrol.bs2 |