A Self-Balancing Robot is based on the concept of balancing an inverted pendulum. This specific type of robot consists of a body above two wheels with no balancing support. Its main task is to maintain the pitch angle in a vertical position to stabilize the structure.
344482813_5622217101212757_629547684159143977_n.mp4
In this section, let's illustrate the control of the system using a block diagram. The PID controller takes the disorientation error as input and outputs motor commands in the form of voltage.
At each sampling time, we apply the following command.
command= Kp *Error+ Ki *SumErrors+ Kd *(error- PreviousEror)/0.001