Você está na página 1de 87

Motion Control Of Firebird-V Robot

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

IIT Bombay
October 16, 2012

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

1/1

Agenda for Discussion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

2/1

Various Motion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Various Motion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Various Motion

Forward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Backward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Backward

Various Motion

Forward

Backward

Various Motion

Left

Forward

Backward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Backward

Left

Various Motion

Left

Forward

Backward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Left

Backward

Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion

Forward

Left

Backward

Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

3/1

Various Motion (Contd..)

Various Motion (Contd..)

Various Motion (Contd..)

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Soft-Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Soft-Right

Various Motion (Contd..)

Soft-Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Soft-Right

Soft-Left

Various Motion (Contd..)

Soft-Right

Soft-Left

Various Motion (Contd..)

Soft-Right

Soft-Left

Various Motion (Contd..)

Backward Left

Soft-Right

Soft-Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Soft-Right

Soft-Left

Backward Left

Various Motion (Contd..)

Backward Left

Soft-Right

Soft-Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Backward Left

Soft-Right

Backward Right

Soft-Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Various Motion (Contd..)

Backward Left

Soft-Right

Backward Right

Soft-Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

4/1

Direction Control of DC Motor

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

5/1

Direction Control of DC Motor

Anti-Clockwise Motion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

5/1

Direction Control of DC Motor

Anti-Clockwise Motion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

5/1

Direction Control of DC Motor

Anti-Clockwise Motion

Clockwise Motion

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

5/1

L293D IC

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

6/1

L293D IC

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

6/1

Motor Pin Connection

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

Four Pins for Direction control is connected at PORT A

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

Four Pins for Direction control is connected at PORT A

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

Four Pins for Direction control is connected at PORT A


a. PA0 - Left Motor Control
b. PA1 - Left Motor Control

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

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

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

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

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

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

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

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

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

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

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


a. PL3 - Left Channel Enable

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

7/1

Motor Pin Connection

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

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/1

Motor Pin Connection

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

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/1

Logic Table

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Direction

PA(0)
LB

PA(1)
LF

PA(2)
RF

PA(3)
RB

Forward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Direction
Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

www.e-yantra.org

PA(3)
RB
0

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Direction
Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

www.e-yantra.org

PA(3)
RB
0

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Direction
Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Direction

Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Direction

Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Direction

Soft Left

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Direction

Soft Right

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Soft Right

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Soft Right

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Soft Right

Direction

Stop

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Soft Right

Stop

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Logic Table

Forward

PA(0)
LB
0

PA(1)
LF
1

PA(2)
RF
1

PA(3)
RB
0

Backward

Left

Right

Soft Left

Soft Right

Stop

Direction

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

8/1

Syntax for C-Program

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

9/1

Syntax for C-Program


#include

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

9/1

Syntax for C-Program


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

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

9/1

Syntax for C-Program


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

Pin Configuration

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

9/1

Syntax for C-Program


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

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

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

9/1

Syntax for C-Program

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program


Main-Program

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program


Main-Program
int main (void)
{
motion_pin_config ();
while(1)
{
forward();
_delay_ms(1000);
stop();
_delay_ms(1000);
}
}

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program


Main-Program
int main (void)
{
motion_pin_config ();
while(1)
{
forward();
_delay_ms(1000);
stop();
_delay_ms(1000);
}
}
Functions

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program


Main-Program
int main (void)
{
motion_pin_config ();
while(1)
{
forward();
_delay_ms(1000);
stop();
_delay_ms(1000);
}
}
Functions
void forward (void)
{
PORTC = 0x06;
}

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program


Main-Program
int main (void)
{
motion_pin_config ();
while(1)
{
forward();
_delay_ms(1000);
stop();
_delay_ms(1000);
}
}
Functions
void forward (void)
{
PORTC = 0x06;
}
void stop (void)
{
PORTC = 0x00;
}
www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

10/1

Syntax for C-Program

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function


1

Backward();

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function


1

Backward();

Right();

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function


1

Backward();

Right();

Left();

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function


1

Backward();

Right();

Left();

Soft Right();

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Syntax for C-Program

Define All related motion functions and include in main function


1

Backward();

Right();

Left();

Soft Right();

Soft Left();

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

11/1

Thank You!
Post your queries on: http://qa.e-yantra.org/

www.e-yantra.org

Firebird ATmega2560 Robotics Research Platform

12/1

Você também pode gostar