1. DESIGN AND CONTROL OF A
TWO WHEELED INVERTED
PENDULUM
NANDAN S (608)
NANDU MOHAN C (609)
NIKHIL JACOB MATHEW (610)
JOBIN JOSEPH (666)
1
GUIDED BY,
Prof (Dr) SHEEJA M.K
HOD, DEPARTMENT OF ECE
SCTCE
2. INTRODUCTION
An Inverted pendulum is one in which the center of mass is above the axis of
rotation.
An Inverted pendulum is inherently unstable, and must be actively balanced in
order to remain upright.
Self balancing property can be achieved by using a feedback network.
An example of Inverted pendulum is HUMAN BEING. A person with an upright
body needs to make adjustments constantly to maintain balance whether
walking, standing or running.
2
3. CONCEPT INVOLVED
Self balancing property of an Inverted Pendulum can be applied to two
wheeled vehicles.
Self balancing is attained using a feedback network.
A PID (Proportional integral Derivative)controller is used as the closed loop
feedback system.
3
4. WORKING PRINCIPLE
The Inverted Pendulum works on the simple Principle of
Newton’s Third Law of Motion ( Action and Reaction).
Action : The body tends to fall in the forward direction.
Reaction : The speed of the system is increased by the feedback
system thus helping in attaining stability.
4
6. PROPORTIONAL INTERGAL DERIVATIVE
CONTROL SYSTEM
6
► Kp: Proportional gain, a tuning parameter
► Ki: Integral gain, a tuning parameter
► Kd: Derivative gain, a tuning parameter
► e: Error = SP - PV
► t: Time or instantaneous time (the present)
► τ : Variable of integration; takes on values from time 0 to the
present t.
7. A PID controller calculates an error value as the difference between a
measured process variable and a desired set point.
PID algorithm 3 separate constant parameter,
P - depends on the present error.
I – is the accumulation of past errors.
D- is the prediction of future errors using current rate of change.
► Advantages
no offset
faster response
no or very less oscillations
7
8. PID CONTROLLER TUNING 8
• The faster response, the worse
stability.
• The better stability, the slower
response.
So, for the control system, we look for
the following compromise:
Acceptable stability, and medium
fastness of response
10. ARDUINO UNO 10
Microcontroller- Atmega328.
It is a microcontroller board with 14 digital
input/output pins and 6 analog pins.
It has 16MHz ceramic resonator, a USB
connector, power jack and a reset button.
Its operating voltage is 5V.
11. MPU 6050
MPU-6050 sensor contains a MEMS Accelerometer and
Gyroscope in a single chip.
It is very accurate as it contains 16 bit A to D conversion
hardware for each channel.
It captures X Y and Z channels at the same time.
The sensor uses I2C-bus to interface with Arduino.
The Accelerometer gives the position values and the Gyroscope
gives the angular values.
11
12. L298N – DRIVER IC 12
•Logic Control Voltage:5V (From Arduino)
•Motor Driven Voltage:4.8~35V
•Logic supply current Iss:≤36mA
•Motor Driven current Io:≤2A
•Maximum power consumption:25W
•PWM,PLL Speed control mode
13. I²C COMMUNICATION PROTOCOL
I²C is a serial protocol for two-wire interface to connect low-speed devices
like microcontrollers other similar peripherals in embedded systems.
I²C uses only two bidirectional lines, Serial Data Line (SDA) and Serial Clock
Line (SCL), pulled up with resistors.
Typical voltages used are +5 V or +3.3 .
13
15. Vcc and GND pins of the MPU-6050 module is connected to the Vcc and GND
pins of Arduino UNO board.
5V DC required for the working od MPU-6050 module is supplied from the
Vcc pin of Arduino.
Serial Clock Line (SCL) and Serial Data Line (SDA) are used for the I2C
communication.
SDA and SCL pins of Arduino UNO board (A4 and A5) and MPU 6050 are
connected respectively.
15
17. GND and Vcc pins of L298N is connected to the respective Vcc and GND
pins of Arduino UNO board.
PWM MOTOR 1 Pin (E1) and PWM MOTOR 2 Pin (E2) of the driver module
is connected to Pin 6 and Pin 5 of the Arduino board.
POLARITY MOTOR 1 Pin (M1) and POLARITY MOTOR 2 Pin (M2) of the
driver module is connected to Pin 7 and Pin 4 of the Arduino UNO.
The GROUND MOTOR and POWER MOTOR Pins of the L298N module is
used for connecting the Johnson Motors.
17
19. 12V DC power supply is provided to the driver module.
ENA and ENB are used for enabling and disabling the motors.
IN1 and IN2 are the pins used for the deciding the direction of rotation of
motor A .
IN3 and IN4 are used for deciding the direction of rotation of the motor B.
19
21. RESULT 21
The TWO WHEELED INVERTED PENDULUM was
successfully designed.
In order to test the self balancing capacity, the setup was
tested at different surfaces.
22. SCOPE AND FUTURE DEVELOPMENT
By using an advanced processor like ARM Processor we can implement a
more faster and much advanced weight balancing system.
The system can be further designed to produce:
2 wheeled wheel chair
2 wheeled vehicle
22