You are on page 1of 12

Outline

Basic Movements of Robot


Motor Interfacing on Firebird

Motion Control Of Firebird-V Robot

e-Yantra Team
Embedded Real-Time Systems Lab
Indian Institute of Technology-Bombay

IIT Bombay

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 1/12


Outline
Basic Movements of Robot
Motor Interfacing on Firebird

Agenda for Discussion

1 Basic Movements of Robot


Motion of Robot
Understanding L293D IC

2 Motor Interfacing on Firebird


Pin connections
Logic Table
Writing C-Code

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 2/12


Outline
Motion of Robot
Basic Movements of Robot
Understanding L293D IC
Motor Interfacing on Firebird

Various Motions

Forward Left

Backward Right

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 3/12


Outline
Motion of Robot
Basic Movements of Robot
Understanding L293D IC
Motor Interfacing on Firebird

Various Motions (Contd..)

Soft-Right Backward Left

Soft-Left Backward Right

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 4/12


Outline
Motion of Robot
Basic Movements of Robot
Understanding L293D IC
Motor Interfacing on Firebird

Direction Control of DC Motor

Anti-Clockwise Motion
Clockwise Motion

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 5/12


Outline
Motion of Robot
Basic Movements of Robot
Understanding L293D IC
Motor Interfacing on Firebird

L293D IC (Contd..)

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 6/12


Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Motor Pin Connection

1 Four Pins for Direction control is connected at PORT A

a. PA0 - Left Motor Control

b. PA1 - Left Motor Control

c. PA2 - Right Motor Control

d. PA3 - Right Motor Control

2 Two Pins for Enabling Motor Driver IC is connected at PORT L

a. PL3 - Left Channel Enable

b. PL4 - Right Channel Enable

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 7/12


Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Logic Table

Direction PA(3) PA(2) PA(1) PA(0) HEX Value


RB RF LF LB
Forward 0 1 1 0 0x06
Backward 1 0 0 1 0x09
Left 0 1 0 1 0x05
Right 1 0 1 0 0x0A
Soft Left 0 1 0 0 0x04
Soft Right 0 0 1 0 0x02
Stop 0 0 0 0 0x00

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 8/12


Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Syntax for C-Program


#include
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>

Main-Program
int main (void)
{
motion_pin_config ();
while(1)
{
forward();
_delay_ms();
stop();
_delay_ms();
}
}
www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 9/12
Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Syntax for C-Program (Contd..)


Pin Configuration
void motion_pin_config (void)
{
DDRA = 0x0F; // Output Port
PORTA = 0x00; // Initially motor stop
DDRL = // Enable Pin
PORTL = // Initially low
}

Functions
void forward (void)
{
PORTA = 0x06;
}

void stop (void)


{
PORTA = 0x00;
}

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 10/12


Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Syntax for C-Program (Contd..)

Define All related motion functions and include in main function

1 Backward();

2 Right();

3 Left();

4 Soft Right();

5 Soft Left();

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 11/12


Outline Pin connections
Basic Movements of Robot Logic Table
Motor Interfacing on Firebird Writing C-Code

Thank You!

www.e-yantra.org Firebird ATmega2560 Robotics Research Platform 12/12

You might also like