Presentation by WASI QAZI on line following bots at RoboClub in WIT Solapur....
Description
LINE FOLLOWER ROBOT USING Micro-Controllers
WALCHAND INSTITUTE OF TECHNOLOGY,SOLAPUR Robo Club BY WASI QAZI
Introduction
What is a uC ? In simple words -- a single chip Computer
Introduction Computer
uC
• uP
• uP
• RAM • HDD • Clock • Ports (Serial/USB) • Ports (Parallel) • Mic/Headphone Jack (ADC/ DAC) • Power Supply Unit • Reset • Mother-board
• Flash Memory • EEPROM • Clock Unit • SPI / UART Controllers • Digital I/O Ports • ADC • Power Supply Unit • Reset • IC
THE BLOCK DIAGRAM Clock 12Mhz
Main Power Supply
Motor Power Supply
Left Motor Microcontroller
Priority Encoder
HEX Inverter
H - Bridge DC Motor Control
Analog Comparators
NOR Gate
Sensor Array
Right Motor
Threshold Voltage
Sensors • A sensor is a device which measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument. • They are used to provide feedback from the external environment
Principle of Operation WHITE surface Maximum reflection T1 is turned ON Vout is LOW BLACK surface Minimum or No Reflection T1 is turned OFF Vout is HIGH
R1< R2
ADC BY OP-AMP:
G N D
+5v
Line Follower : Design The bot has two IR sensors facing downwards (towards the floor). Sleft
Sright
The separation between the sensors is such that in normal (correct) position of the bot , both the sensors are on white surface. ie separation > strip width The bot is driven by two wheel differential drive ie the two back wheels are driven by independent motors.
Line Follower : Algo
Sleft
When the bot is in correct pos, both sensors are on white & read LOW. The robot should move forward in this case. Sright
Sleft
Sright
Movement
LOW
LOW
Forward
Line Follower : Algo Sleft
When the bot is over line from right side, left sensor is on white & reads LOW whereas right sensor is on black & reads HIGH The robot should take a right turn in this case to come back in correct pos.
Sright
Sleft
Sright
Movement
LOW
HIGH
Right Turn
Line Follower : Algo S left
When the bot is over line from left side, right sensor is on white & reads LOW whereas left sensor is on black & reads HIGH The robot should take a left turn in this case to come back in correct pos.
Speed Grades 0 - 8 MHz 16K Bytes of In-System Self-programmable Flash program memory 512 Bytes EEPROM Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode 8-channel, 10-bit ADC Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator
Pin diagram
Block Daigram
Simplified Diagram
4 8bit Parallel Input-Output ports through which you can i/p or o/p digital data.
Power Supply
Port Architecture
uC
P O R T A
D D R A
P I N A
External world
Complete Program A program to o/p 33 (hex) on PortD and configure and read pins 2 and 7 of Port A #include void main( ) { unsigned int x,y; DDRD=0xFF; DDRA=0b01111011; PORTD=0x33; x=PINA.2; y=PINA.7; }
// all pins o/p // pin 7 & 2 i/p rest immaterial
L298N Motor Driver
Similarly other 2 o/p are connected /disconnected by I/p 3 & I/P 4 All the O/p’s operate independently, ie if all I/p 1-I/p 4 are 1, all O/p1 – O/p4 will be connected to +VPP L298 can provide 1A current / Output channel , therefore total of 4A. But heat sinks should be installed for such high currents . VPP can be anything in the range 2V- 46V , therefore any motor can be driven even though Atmega provides only 0/5 V.
A T M E G A
4 Outputs
4 Inputs
MOTOR DRIVER
MOTOR
Working of Motor Driver +VPP
O/p 1
I/p 1 ( O/p from uC)
O/p 2
I/p 2
O/p 3
I/p 3
O/p 4
If uC send ‘1’ to I/p 1, O/p is conn touC + VPP If send ‘0’ to I/p 1, O/p is conn to GND
I/p 4
GND
Working of Motor Driver +VPP
O/p 1
I/p 1 ( O/p from uC)
O/p 2
I/p 2
O/p 3
I/p 3
O/p 4
If uC send ‘1’ to I/p 2, O/p is conn touC + VPP If send ‘0’ to I/p 1, O/p is conn to GND
I/p 4
GND
Working of Motor
H-BRIDGE MOTOR CONTROL
H-BRIDGE MOTOR CONTROL
H-BRIDGE MOTOR CONTROL
H-BRIDGE USING TRANSISTOR
Motor Connection for Clockwise: +VPP
O/p 1
I/p 1 ( O/p from uC)
O/p 2
I/p 2
O/p 3
I/p 3
O/p 4
If uC send ‘1’ to I/p 2, O/p is conn touC + VPP If send ‘0’ to I/p 1, O/p is conn to GND
I/p 4
GND
Motor Connection for Anti-Clockwise: +VPP
O/p 1
I/p 1 ( O/p from uC)
O/p 2
I/p 2
O/p 3
I/p 3
O/p 4
If uC send ‘1’ to I/p 2, O/p is conn touC + VPP If send ‘0’ to I/p 1, O/p is conn to GND
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.