Hey! Fellow nerds!  I hope you are having a great weekend. Just a quick reminder the Chinese new year is starting from February 8th so Happy New Year to all my Chinese readers and for all other folks it just means a Chinese electronics market shut down for a month, hopefully, you have stocked the parts you need.  I didn’t, was really in need of some motors and yeah shipping time 15 – 38 days, so going to try my luck in the local market tomorrow.

It’s my Sixth semester this time and that means I have to make a mini project and after a ton of pleading to my project guide, he accepted my project topic which I really wanted to do for a long time “The self-balancing robot”.
This post will be about just some basic explanations and ideas I have for the project and info on upcoming in-depth posts on the same.

Here is a hand-drawn model I made to give a general idea about the project.

bot diagram
Self-balancing robot sketch

I meant Motor with encoders in the diagram.

So what is does? A. It’s a two-wheeled robot that stands and balances itself, it also does all the basic stuff that other robots do like running around, turning and also balances any load kept on it.

What can be its possible application other than a control engineer flexing his/her muscles? A. Segway, Hoverboard, Uni-wheeler which are all the new rage. Not only those but similar setup can be used to make camera stabilizers, maintaining canon position in the tanks, etc.

For those who may not know, what is a self-balancing robot is. This is just a basic rundown of the same – It’s a classic Control System problem which is an idea of stabilizing an inverted pendulum (wiki link), In which you try and balance an inverted pendulum that has its center of mass above its pivot point using a control system. In simpler terms, it’s like the process of balancing a stick on your finger (or palm).

How does it work? A. Lets us again consider the simpler example of balancing a stick on your hand. Now imagine the stick is starting to lean towards the right and is going to fall what you do? You move your hand towards the right and balance it again. This moment of your hand bringing the bottom part of the stick under the top is your way to keep its center of gravity stable, thus keeping the stick from falling.

This is precisely what the robot does! In the case of the stick the point of the contact to your hand was just at a single point so you have to balance the stick in all four directions (forward, backward and to both sides) but in robot due to two wheels arrangement the robot doesn’t have to worry about falling on the sides it just has to balance forward and backward motion.

There are two important sensors used for measurement the robots falling, they are an Accelerometer and Gyroscope which gives us proper acceleration and orientation of robot respectively. This data is then processed by the micro-controller and it sends the motor instruction to move forward or backward.

This instruction, in this case, is given through a PID controller then to the motor driver. (why use a PID controller? coming soon.. ) For now, its just good to know that due to this PID program the robot remains stable and does not oscillates.

Besides the feedback from the Accelerometer and Gyroscope, there is one other feedback form the motor’s encoder which gives the RPM of the motors. Why?

A. Used in the PID program for stabilization (more on that in later posts).

And this is how the robot is able to stabilize itself on two wheels. This is also the working principle behind the Segway.

That’s all for today! Soon we will be getting into details with each aspect of the robot, its mechanical structure, PID code, primary code, Bluetooth control and much more. This is a live project which I am writing about as I go, so you will get an idea of all the problems I face and how to deal with it if they present to you. Before all of that there will be a post filled with images of the industrial event going on in Pune called MAHA Tech which I visited (still happening till 7th), there where some serious gear in there all coming up soon, so stay subscribed.

To get notified via email subscribe to blog link is at the bottom.

Leave a Reply