Balancing bot with ultrasonic sensor - no gyros
Here's my slightly unusual balancing bot.
Normally balancing bots use motors and gyros,but my minimal bot uses just servos and an untrasonic distance sensor.
Used an old boe-bot platform:
2x continuous rotation servos
Aluminium base
The boe-bot came with a a basic stamp MCU, so I replaced that with an Arduino Uno
Boe-bot's are normally rover type bots, but I moved the servo/wheel mountings to the edge
and stood it up on its end to make a balancing robot.
You need accelerometers and gyros for a balancing bot, right ?
Not here - I just used a HC-SR04 ultrasonic distance sensor pointed at the floor:
shorter distance = falling forward,
longer distance = falling backward.
Feeding that into a PID loop got some balancing, at least for several seconds,
and longer with some tuning (0:14 onwards in the video)
Connected the ultrasonic like this:
The two servos on top are just for weight
- balancing works better with the centre of gravity higher up
I've put the full arduino source code on github here:
https://github.com/mikerr/SonicBalancer
Balances without gyros - arduino, hc-sr04, continuous servos