Self Balancing Robot
Self Balancing Robot
ALGORITHM
The algorithm for the controller is as follows:
Step1:
Initialize the values of rate gyro bias and accelerometer bias for
zero value of & .
Step2:
Measure the value of voltage of gyro and accelerometer outputs
and store those values as and Ax.
Step3:
Integrate the rate gyro reading by: t = t-1 + *t
Differentiate the rate gyro reading by: t = ( t t-1 )/ t t in
each case is assumed to be constant and is equal to the cycle
time.
Step4:
Calculate the raw angle and gravity angle and compute the error
value.
Step5:
Update the raw angle by:
stabilized = raw angle + K2 (gravity angle - raw angle)
K2 is taken as .2
Step6:
Calculate the torque required to restore:
= K3 * sin
for small angles:
= K3 *
Step7:
Obtain the direction of rotation of the reaction wheel:
If < 0 ; counterclockwise
If > 0 ; clockwise
Step8:
Send the output to the DC motor attached to the reaction wheel.
Step9:
Repeat steps (2-8)
ACTUATOR UNIT
PARTS REQUIRED:
Wheels
AtMega 16
Rate gyro & accelerometer
DC Gear Motor
Simple DC Motor
9V Battery
Balancing Wheel
Flywheel