Self Balancing Bot
Self Balancing Bot
Self Balancing Bot
Summer project
completed as a part of
electronics club, IIT Kanpur
Project documentation
: By Vipul Gupta
Team members :
Vipul Gupta
Sonu Agarwal
Shubham Singh
Ritesh Kumar
Shubham Singh
Suyash Somvanshi
Vaibhav Gupta
Team Mentors :
Rohinish Gupta
Nitish Shrivastav
Contents :
Introduction (Basic aim, How was it done,
How do we get the Idea)
Mechanical Structure
Arduino Mega 2560
6 DOF IMU (3-AXIS Accelerometer
ADXL345 Gyroscope Gyro L3G4200D)
I2C Protocol
Kalman Filter
PID Control
BASIC AIM :
To demonstrate the techniques involved in
balancing an unstable robotic platform on two
wheels.
To design a complete discrete digital control
system that will provide the needed stability.
Mechanical Structure:
The bot consists of three platforms which have
arduino, IMU, motor driver mounted on it. On the
lower part of the base platform, the two high torque
motors (300 rpm) are clamped. The whole bot gets
balanced on two wheels having the required grip
providing sufficient friction (as there are large chances
for wheels to skid). Here is a pic of the bot :
VIN. The input voltage (7-12 volts) to the Arduino board when
it's using an external power source (as opposed to 5 volts from
the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the
power jack, access it through this pin.
5V. The regulated power supply used to power the
microcontroller and other components on the board. This can
come either from VIN via an on-board regulator, or be supplied
by USB or another regulated 5V supply.
3V3. A 3.3 volt supply generated by the on-board FTDI chip.
Maximum current draw is 50 mA.
GND. Ground pins.
Features:
Tiny!
Two mounting holes
ADXL345 accelerometer
ITG-3200 gyro
3.3V input
I2C interface
I2C Interface:
Inter-Integrated Circuit (IC pronounced I- Squared- C)
is a 2 wire serial bus typically used to communicate
with sensors and other small components.
The two lines of the I2C bus are SDA (Data) and SLC
(clock) which can be run in parallel to communicate
with several devices at once. I2C allows up to 112
"slave" (such as a sensor) devices to be controlled by a
single "master" (such as Arduino, in our case). Each
slave device on the bus must have it's own unique
address so the master can communicate directly with
the intended device. These addresses are typically hardcoded into the slave device, but often allow it to be
changed by simply pulling one of the pins of the sensor
high or low. This allows more than one of the same
device to be on the same bus without conflicting
addresses.
I2C is often referred to as TWI or 2-wire-serial.
I2C Tutorial : I2C basic command sequence.
Kalman Filter :
The Kalman filter is a set of mathematical equations
that provides an efficient computational (recursive)
means to estimate the state of a process, in a way that
minimizes the mean of the squared error. The filter is
very powerful in several aspects: it supports
estimations of past, present, and even future states,
and it can do so even when the precise nature of the
modelled system is unknown.
The filter is used in control engineering to remove
measurement noise that can affect the performance of
system under control. It also provides an estimate of
the current state of the process or system. The Kalman
filter is a tool that can estimate the variables of a wide
range of processes. In mathematical terms we would
say that a Kalman filter estimates the states of a linear
system. The Kalman filter not only works well in
practice, but it is theoretically attractive because it can
be shown that of all possible filters, it is the one that
minimizes the variance of the estimation error.
PID Tuning :
Here are some steps which will help to get Kp, Ki and
Kd faster :
A word of thanks
We would like to thank our team mentors Rohinish
Gupta, Nitish Shrivastav and our club coordinators
Anurag Dwivedi, Rudra Pratap Suman and Nikhil Gupta
for guiding us to complete our project in time and
providing a chill learning experience.