EquipoiseBot is my two wheeled self balancing robot. It can be controlled using a homebuilt IR remote. This robot is based on a couple of PIC microcontrollers that work together. I have built all the mechanics and electronics from scratch.

The robot uses two accelerometers and one gyro to make it balance. Two different values representing the angle of the robot are calculated. One from the accelerometers using the mathematical tangens-funktion and one from the gyro using integration. Those two angle values are combined in a filter to make one new value which is used as input in a PID regulator to contol the motors, keeping the robot in balance.








The remote is built in the casing of an old transmitter from an RC helicopter. The transmitter sends the X and Y positions of the control stick over IR using using standrad 1200 baud serial data modulated with 38KHz and a homemade data protocol.

The steering signal from the remote is just added to one of the motorsignals and subtracted from the other. The forvard/reverse signal from the remote are added to the angle value after the filter described above. The steering works great but the forward/reverse is far from perfect. The remote is commanding the robot to lean at an angle, not to drive at a commanded speed. There is nothing preventing the robot from driving to fast, if this occurs it falls over. This makes the robot hard to control.

EquipoiseBot is equipped with quadrature wheel encoders. Those are not used at all but in the future they can be used to make the robot stand still in one place, or to improve the remote control function.

Below are some pictures from the building of EquipoiseBot. If you like you can read more and see more pictures of EquipoiseBot at my website: http://diytechinnovations.se/robots/equipoisebot/equipoisebot.html


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Torrentula's picture

I just love the case and how you connected all the ICSP lines to one 9pin SubD connector :)

kiwiclive's picture

Hi Axbri,

Your workmanship is superb. There are not many people who have a mastery of mechanical, electronics and software and you are one of the few, what excellent work! All your projects are testimony to the effort and attention to detail you apply.

I'm interested in how you program all the separate PICs, do you do this external to the robot and plug them into the hardware or do you use a port and multiplex the ICSP bus ?


Axbri's picture

Thank you Clive. I use ICSP to program the microcontrollers trough the 9 pole D-sub connector mounted on the side of the robot. The CLK, DAT and GND wires are connected in parallel and use the same pins on the D-sub connector. Only the MCLR wires are separate for each microcontroller. I then have a special programming cable to connect the PICkit2 the each of the microcontrollers.

abhinav.arora's picture

Great one!

merser's picture

Wow another nice build. I remember your first post and what a great build that was. Runs really well too. I can't wait to see what you've got for us next. One thing,well two I've wondered about balancing robots is can they be driven at a tilt say to go under something lower than them and how far can they tilt before they reach the point of no return?

Axbri's picture

Thank you Merser. I do not believe it is possible to make the robot lean enough to get clear under an obstacle as you describe. To counteract the force from the leaning the robot has to accelerate. In a very short time the robot will reach its maximum speed and fall over. The maximum tilt angle depends on the maximum possible acceleration.

In the first picture with a part of the Baltic Sea in the background you can see that the robot is leaning slightly forward. This is because the wind, one of the disturbing factors, is affecting the robot.

NilsB's picture

Indeed merser. Me too. I have still the pressure sensors in mind from his first post.

NilsB's picture

The way you mounted the cables using a serial cable plug is smart. But to mathematically mix-in the remote control command as angle into the stabilizer is brilliant. Thank you for sharing this. Collected!

Using some sort of rotation to convert linear movement into a turning moment, could that help to attack the "fall due to driving to fast" problem? That could be: When velocity exeeds threshold then rotate 90° very fast and stabilize.

Axbri's picture

Thank you NilsB for your comments. I think converting the linear movement into turning moment would just make the robot fall over to the side. I believe it is better to try something like: When the velocity exceeds a predefined threshold, apply maximum power to the motors to make the robot lean the other way and then slow down. But of course, I would have to use the encoders to do this. I will not continue to develop this robot right now, but probably in the future...

TeleFox's picture

Gotta get those encoders online for speed feedback first =)