40 views

Uploaded by shivimshr

DIY

- 2degrees of Freedom
- Close Loop Control System
- KLM Intro Process Control Rev 3
- Minxia Zhuang - Optimum Cascade PID Controller Design for SISO Systems
- Tugas Pengendalian Proses Contohsoal&Penyelesaian
- anss
- 499 Proje Slayt
- DELTA_IA-TC_DTB_OM_EN_20100420.pdf
- Instrumentation Textbook
- 3 Zone Furnace Controller
- EG243_10(1)
- Testing of Concrete Under Closed-Loop Control
- control technology
- Assessing and Dealing With Defect and Variation
- 04-MathematicalReference TRNSYS
- Water Flow Control
- grafcetECC95
- điều khiển tầng
- Section 7.2 - I2CNewMarch27
- 91842v00_NN10_FA_PID

You are on page 1of 14

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.

will be required in making a unicycle.

It will be prevented from falling by giving acceleration

to the wheels according to its inclination from the

vertical. If the bot gets tilts by an angle, than in the

frame of the wheels, the centre of mass of the bot will

experience a pseudo force which will apply a torque

opposite to the direction of tilt.

Keeping in mind of our ultimate aim, the unicycle, we

had to complete the basics in summer and need to

understand what efforts would it require. Also at the

very first we thought of making a self balancing

platform, which used data from accelerometer and

gyroscope. A self balancing bot is an advanced version

of this platform. Self balancing bot includes the basic

signal processing part of the unicycle.

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 :

The Arduino Mega is a microcontroller board based on

the ATmega1280. It has 54 digital input/output pins (of

which 14 can be used as PWM outputs), 16 analog

inputs, 4 UARTs (hardware serial ports), a 16 MHz

crystal oscillator, a USB connection, a power jack, an

ICSP header, and a reset button. It contains everything

needed to support the microcontroller; simply connect

it to a computer with a USB cable or power it with a

AC-to-DC adapter or battery to get started.

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

acceleration(g) along its three axis.

Gyroscope- Gives the components of angular

velocity along its three axis.

-Less sensitive but its output gets DRIFTED along

with the time.

Description: This is a simple breakout for the ADXL345

accelerometer and the ITG-3200 gyro. With this board,

you get a full 6 degrees of freedom. The sensors

communicate over I2C and one INT output pin from

each sensor is broken out.

Hooking it up

The both components of the Digital IMU 6DOF are I2C

devices on a single bus. I2C is a 2-wire serial

connection, so we just need to connect the SDA (Data)

and SCL (Clock) lines to your Arduino for

communication. On our Arduino (arduino mega), SDA

is digital 20, and SCL is digital 21. . Other than these 2

lines, we just need to connect power(3.3v), ground and

we are all set.

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.

2. Send the slave address (ADDR).

3. Send the Read(R)-1 / Write(W)-0 bit.

4. Wait for/Send an acknowledge bit (A).

5. Send/Receive the data byte (8 bits) (DATA).

7. Send the STOP bit (P).

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.

modelled by linear system. A linear system can best be

described by the following two state space

representation equations :

x(k) = Bu(k-1) + w(k-1)

z(k) = Hx(k) + v(k)

First equation represents the process state equation.

A, B, and H represent the state matrices, the w(k-1)

represents the process noise, k is the time index, x(k-1)

is the state of the process, and u(k-1) is the known

input to the process. Second equation above

represents the output state equation. The z(k)

represents the measured process output and the v(k)

represents the measurement noise. The sensor data

for the system are taken at discrete time sample

points. The measurements are dependent on the state

of the process or system.

Finally what we conclude about Kalman Filter is:

It is being used for the fusion of the outputs of the

two sensors used.

Will reduce the noise of the two sensors by taking

appropriate weightage which will vary according to

time.

from the last stage and current state

measurement.

Why is Kalman Filter necessary :

Based on recursive process so consume less

memory of processor.

Gives theoretically and practically accurate data.

It is based on weighted average giving more

weightage to the reading which is more certain.

The control algorithm that was used to maintain it

balance on the autonomous self-balancing two wheel

robot was the PID controller. The proportional,

integral, and derivative (PID) controller, is well known

as a three term controller.

The input to the controller is the error from the

system. The Kp, Ki, and Kd are referred as the

proportional, integral, and derivative constants (the

three terms get multiplied by these constants

respectively). The closed loop control system is also

idea of a negative feedback system is that it measures

the process output y from a sensor. The measured

process output gets subtracted from the reference setpoint value to produce an error. The error is then fed

into the PID controller, where the error gets managed

in three ways. The error will be used on the PID

controller to execute the proportional term, integral

term for reduction of steady state errors, and the

derivative term to handle overshoots. After the PID

algorithm processes the error, the controller produces

a control signal u. The PID control signal then gets fed

into the process under control.

The process under PID control is the two wheeled

robot. The PID control signal will try to drive the

process to the desired reference setpoint value. In the

case of the two wheel robot, the desired set-point

value is the zero degree vertical position. The PID

control algorithm can be modelled in a mathematical

representation.

PID is used to calculate the correction term :

Correction = Kp*error + Ki* error + Kd*

d/dt(error);

Kp , Ki and Kd are constants which are set

experimentally.

correction, the robot would have reacted in the same

way as in the classical line following algorithm. The

second term forces the robot to move towards the

mean position faster. The third term resists sudden

change in deviation.

The integral term is simply the summation of all

previous deviations. Call this integral- totalerror. The

derivative is the difference between the current

deviation and the previous deviation. Following is the

code for evaluating the correction.

These lines should run in each iteration :

correction = Kp*deviation + Ki*totalerror +

Kd*(deviation - previousdeviation);

totalerror += correction;

previousdeviation = deviation;

PID Tuning :

Here are some steps which will help to get Kp, Ki and

Kd faster :

robot starts to oscillate (move back and forth)

about the balance position. P should be large

enough for the robot to move but not too large

otherwise the movement would not be smooth.

With P set, increase I so that the robot accelerates

faster when off balance. With P and I properly

tuned, the robot should be able to self-balance for

at least a few seconds.

Finally, increase D so that the robot would move

about its balanced position more gentle, and there

shouldnt be any significant overshoots.

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.

- 2degrees of FreedomUploaded byPrithvi Natraj
- Close Loop Control SystemUploaded byleanhdu
- KLM Intro Process Control Rev 3Uploaded byFA Ay
- Minxia Zhuang - Optimum Cascade PID Controller Design for SISO SystemsUploaded byCarlos Bellatin
- Tugas Pengendalian Proses Contohsoal&PenyelesaianUploaded byNadya Larasati Krd
- anssUploaded byHasin Haroon
- 499 Proje SlaytUploaded byZeynal Abidin Şabaş
- DELTA_IA-TC_DTB_OM_EN_20100420.pdfUploaded bybundzsy
- Instrumentation TextbookUploaded byFUUUU
- 3 Zone Furnace ControllerUploaded bySouvik Ghosh
- EG243_10(1)Uploaded byHamzahSafari
- Testing of Concrete Under Closed-Loop ControlUploaded byAgustin Gana
- control technologyUploaded byMoro Adams
- Assessing and Dealing With Defect and VariationUploaded byBright Francis Anthonio
- 04-MathematicalReference TRNSYSUploaded byasefsfs
- Water Flow ControlUploaded byMA'laMusthofa
- grafcetECC95Uploaded byValkure Omega
- điều khiển tầngUploaded byHải Nguyễn Công
- Section 7.2 - I2CNewMarch27Uploaded byAndy Wo
- 91842v00_NN10_FA_PIDUploaded byPrem Kumar Nepal
- 2. Basics of Process Control SystemsUploaded byinterestingese
- Arduino PID Library Luminosity ControlUploaded byDarko Rendulić
- Assignment.pdfUploaded byRaymond
- man536Uploaded byVu Le
- Iceece Formatting TemplateUploaded byVaibbhav Godse
- implementation of i2c usinf fpgaUploaded byAshokSiri
- ANYmal - A Highly Mobile and Dynamic Quadrupedal RobotUploaded bySonny Boy P. Aniceto Jr.
- Regulator PID SchneiderUploaded bySorin Bode
- PS2 verilogUploaded bylizhi0007
- SM-TC4-M1Uploaded byJorge Guerrero

- A Cautionary Tale for International Development Students Pacific StandardUploaded byshivimshr
- The History and Antiquity of Kasi or VaranasiUploaded byshivimshr
- ScrutonOnMorality.pdfUploaded byshivimshr
- Aashad Ka Ek Din by Mohan RakeshUploaded byAuchityaKumarSingh
- Bharatanatyam and Teaching Maths Through ArtsUploaded byshivimshr
- Why Hawkins thinks philisophy is dead.pdfUploaded byshivimshr
- Analog DesignUploaded byshivimshr
- Plato SymposiumbenardeteUploaded bypollux23
- The Ones Who Walk Away From OmelasUploaded byAlexandre Alves
- The Importance of Being Earnest by Oscar WildeUploaded byBooks
- ESD ProcessorsUploaded byshivimshr

- Enneagram in Psychological Assessment.pdfUploaded byo8o0o_o0o8o2533
- Retroreflective Sheetings Used for Sign FacesUploaded byЈован Македонски Дулев
- Translation in English Language TeachingUploaded byBarbara May
- Theological Seminary 6th December, GRII, Stephen Tong (Summary, Haven't Checked Yet by the Priest)Uploaded byLuneBelle
- Word FormationUploaded byGeorge Gergius
- 2 prepositions lesson planUploaded byapi-279690289
- Blackboard Collaborate Uploading PowerPoint Presentations Into LTIUploaded bycuatromudas
- KONA - What's New or DifferentUploaded bybanjah2002
- LyricsUploaded byAeryll Jasmin
- BRKSPG-2904 ASR-9000 IOS-XR Hardware Architecture, QOS, EVC, IOS-XR Configuration and TroubleshootingUploaded byandresfcl83
- math chat smp 6- attend to precisionUploaded byapi-353255943
- pll_1584Uploaded byswooshcmk
- Gen Papyr 2465 Bioreactor by Sivakumar in Biotech j v 1 Iss 12 Pp 1419 1427 y 2006Uploaded byDannis Yuda Kusuma
- ijaerv11n3_04.pdfUploaded byAbhishek Ram
- Ryan Falconer V12 Vp39776 - CopyUploaded byragerover
- 1636-organic-world-2014Uploaded byapi-325293396
- Iris RecognitionUploaded byakthechamp
- UNDERSTANDING SUBSTANCES & THEIR USES.pdfUploaded bymajd
- Joanne Mattern Milton Hershey. Hersheys Chocolate CreatorUploaded byDavid Peña Triviño
- BLOQUEADORES SOLARES DURANTE LA CONDUCCIÒN VEHICULARUploaded byCDBH
- A68I-450 DELUXE_20160529Uploaded byJhanCarlosMontalvoSarmiento
- Ee Mock Test 3 Jan 2010 Q&AUploaded byJiena Zou
- Hebrew AUploaded byprofessorstrange
- Star Wars - D&D 5th Edition Conversion (PF)Uploaded byfedorable1
- TEL: Launch of PLDT CapitalUploaded byBusinessWorld
- capstone case studyUploaded byapi-426413696
- Imperator Gary L. Stewart: Installation and Article (1987)Uploaded bysauron385
- placement-freshersworld-com(2).pdfUploaded byAnil Kumar Gorantala
- UK Ministry of Justice 2011 Compendium of Re Offending Statistics and AnalysisUploaded byFrancisco Estrada
- OpenFOAM Designer 1.0 - Quick GuideUploaded byegv2000