Top Banner
http:// students.iitk.ac.in/ roboclub
31

Http://students.iitk.ac.in/roboclub. Main Components: Sensors Micro controller Motor drivers Chasis.

Dec 22, 2015

Download

Documents

Bathsheba Allen
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

http://students.iitk.ac.in/roboclub

Page 2: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Main Components: Sensors Micro controller Motor drivers Chasis

LINE FOLLOWING ROBOT

Page 3: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

SENSORS

Page 4: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

How IR Led sensors work??

On the basis of variation in reflection property of Different Colours

Page 5: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

MICRO CONTROLLERS

Atmega

Page 6: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Difficulties with Atmega

• Software is not User Friendly

• Many softwares required :• CVAVR – Editor and Compiler• AVR Studio – Transfer code to Atmega

• External Programmer required

So is there a better solution

Page 7: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

ARDUINO – Open Source Platform

Page 8: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

What is Arduino??• Open-source physical computing platform.

• Physical Input / Output board (I/O) with programmable Integrated Circuit (IC)

• Contains Atmega series Micro controller

Page 9: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Why Arduino ??• Easy to use

• Provides a number of libraries to program the microcontroller easily

• Hardware platform already has the power and reset circuitry setup

• Hardware provides circuitry to program and communicate with the microcontroller over USB

• Arduino has a great community of users that you can get help from

Page 10: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Getting Started

• Check out: http://arduino.cc/en/Guide/HomePage1. Download & install the Arduino environment

(IDE)2. Connect the board to your computer via the

USB cable3. If needed, install the drivers.4. Launch the Arduino IDE5. Select your board6. Select your serial port7. Open the blink example8. Upload the program

Page 11: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Arduino IDE

See: http://arduino.cc/en/Guide/Environment for more information

Page 12: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Try It: Connect the USB Cable

Page 13: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Select Serial Port and Board

Page 14: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Page 15: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

A Little Bit About Programming

• Code is case sensitive

• Statements are commands and must end with a semi-colon

• Comments follow a // or begin with /* and end with */

• loop and setup

Page 16: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Our First Program

Page 17: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Terminology

Page 18: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Digital I/0

pinMode(pin, mode)Sets pin to either INPUT or OUTPUT

digitalRead(pin)Reads HIGH or LOW from a pin

digitalWrite(pin, value)Writes HIGH or LOW to a pin

Page 19: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

MOTOR DRIVER

Page 20: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Why MOTOR DRIVER ???

• Micro controllers (Atmega ,Arduino) require 5-10 mA while motors require 150 mA and above so Motor Driver is used .

• For driving motor at different rpm by using PWM

Page 21: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

H-Bridge

An electronic circuit that enables a voltage to be applied across a load in either direction.

Page 22: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

What is PWM ??

Known as Pulse Width Modulation

Simple method of obtaining analog output of any value between 0 and 5V

Page 23: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

• Suppose we need 3V for our device at aspecified pin.

We supply 5V on it for (3/5)* 100 % = 60% of the time period and 0V for the remainingtime period

The average voltage at the pin for a timeperiod becomes 3V

If this step is repeated very fast (T is verysmall), then the output behaves as a analogsignal of 3V.

Page 24: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Page 25: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Page 26: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Programming for Motor Driver in Arduino

Page 27: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

ALGORITHM

BLOCK DIAGRAM

Page 28: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

Both the sensors detect the line then both motors rotate at same pwm.Hence the bot moves forward .

When the right sensor detects the line , left motor is given more speed .Hence the bot moves towars right.

When the left sensor detects the line , right motor is given more speed.Hence the bot moves towards left.

Line following using 2 sensors

Page 29: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Page 30: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.

PWM of Left motor=MEAN PWM –(kp*deviation)

PWM of Right motor=MEAN PWM +(kp*deviation)

Kp – Constant of ProportionalityDerived experimentally

Page 31: Http://students.iitk.ac.in/roboclub.  Main Components:  Sensors  Micro controller  Motor drivers  Chasis.