rover project

11
ROVER PROJECT #1: Maneuvering the Rover Andrew Brouillete, Michael Hernandez, and Bach Nguyen Report by: Bach Nguyen CSIT Department Southeastern Louisiana University Hammond, LA 70401 Contact Number: 985-662-2106 Contact Email: [email protected]

Upload: bach-nguyen

Post on 13-Apr-2017

54 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ROVER PROJECT

ROVER PROJECT #1: Maneuvering the Rover

Andrew Brouillete, Michael Hernandez, and Bach Nguyen

Report by: Bach Nguyen

CSIT Department

Southeastern Louisiana University

Hammond, LA 70401

Contact Number: 985-662-2106

Contact Email: [email protected]

Page 2: ROVER PROJECT

ABSTRACT:

This project is done to demonstrate our understanding of using the DFRobot V1.2 Motor

Shield. By controlling the signal from the Arduino to the motor shield we were able to maneuver

it in 4 directions. Here is the list of directions: backward, forward, left and right.

INTRODUCTION

At the most basic level, electric motors exist to convert electrical energy into mechanical

energy. This is done by way of two interacting magnetic fields -- one stationary, and another

attached to a part that can move. A number of types of electric motors exist, but most BEAMbots

use DC motors1 in some form or another. DC motors have the potential for very high torque

capabilities (although this is generally a function of the physical size of the motor), are easy to

miniaturize, and can be "throttled" via adjusting their supply voltage. DC motors are also not

only the simplest, but the oldest electric motors. The basic principles of electromagnetic

induction were discovered in the early 1800's by Oersted, Gauss, and Faraday. By 1820, Hans

Christian Oersted and Andre Marie Ampere had discovered that an electric current produces a

magnetic field. The next 15 years saw a flurry of Cross-Atlantic experimentation and innovation,

leading finally to a simple DC rotary motor. A number of men were involved in the work, so

proper credit for the first DC motor is really a function of just how broadly you choose to define

the word "motor."(Seale 1)

BACKGROUND:

Because of these reasons, the dc motor is chosen to use to drive a set of mechanical gear

that is connected to the wheel. This particular set of rover from DFRobot has 4 wheels which are

drive by 4 dc motors.

PROJECT GOALS:

Page 3: ROVER PROJECT

The goal of this project are to get familiar with the control system of a 4 wheel drives

rover using. We set up the rover to move forward, backward, turn left and turn right depends on

which function is called in the main function of the Arduino. Also we attempted to do the 8

figure with the rover.

METHODOLOGY

By utilize these following materials we were able to complete the rover and make it

move:

DFRobot 4 Wheel Drives Kit

DFRobot Arduino Uno

DFRobot Motor Shield V 1.2

9 V power supply

We choose to do a tank control mode for the turning since there are no mechanic part of the

rover that let us maneuver it using the default setup. To use the tank control mode of the rover

we connect the left side motors of the rover to the first 2 slots in the motor shield connector and

the right side to the last 2 slots of the motor shield. To make sure the wire stay connected and not

compromise the power connection between the shield and the motors we twist the wires together

to make one single input to the slot. Below is the picture of the finish product should look like.

Page 4: ROVER PROJECT

Here is the code and the description for the functionalities of the rover.

int E1 = 5;

int M1 = 4;

int E2 = 6;

int M2 = 7;

int i = 0;

int j = 0;

void setup()

{

pinMode(M1, OUTPUT);

pinMode(M2, OUTPUT);

}

void loop()

{

figure8();

Page 5: ROVER PROJECT

}

void figure8(){

forward();

for(i = 0; i < 4;i++){

forward();

left();

if (i == 3){

forward();

for(j = 0; j < 4 ; j++){

forward();

right();

}

}

}

i = 0 ;

j = 0 ;

}

void forward(){

digitalWrite(M1,HIGH); //clockwise turn right

digitalWrite(M2, HIGH);

analogWrite(E1, 220); //PWM Speed Control

analogWrite(E2, 220); //PWM Speed Contro

delay(1000);

Page 6: ROVER PROJECT

}

void backward(){

digitalWrite(M1,LOW); //clockwise turn right

digitalWrite(M2, LOW);

analogWrite(E1, 220); //PWM Speed Contro

analogWrite(E2, 220); //PWM Speed Control

delay(1000);

}

void right(){

digitalWrite(M1,HIGH); //clockwise turn right

digitalWrite(M2, LOW);

analogWrite(E1, 200); //PWM Speed Control

analogWrite(E2, 230); //PWM Speed Control

delay(1000);

}

void left(){

digitalWrite(M1,LOW); //counter clockwise turn left

digitalWrite(M2, HIGH);

analogWrite(E1, 230); //PWM Speed Control

analogWrite(E2, 200); //PWM Speed Control

delay(1000);

Page 7: ROVER PROJECT

}

In this code, for each function with the entitled with direction are made of 2 set of function to

control motor set 1 and motor set 2. To be able to move forward, both of the set has to have a

high signal going through it. For it to go backward, the 2 set of motor is set to both receive a low

digital Input from the Arduino. To turn right the first set must be write high with speed slower

than set 2 with low signal and higher speed due to the lack in traction of the tires. To turn left the

same thing is done but opposite with turning right. For the figure 8 we use a counter in a for loop

to control the number of turns the rover make to create a circle of that direction then we add

another counter to stop it from going the other way then start going the other way to complete the

letter 8. To get the traction of the tires are really bad we decided to wrap wires around the wheels

like the picture below.

Page 8: ROVER PROJECT

RESULTS

After countless time of recalibration, we finally were able to successfully made the 8

figure even though there are few minor bugs like the traction would not let the rover turns or the

batteries went dead because huge power drainage. So it took us a really long time to get a good

reading on how to modify the turns.

CONCLUSIONS:

We completed the project with a lot of minor setbacks whether it’s the traction of the tires in

which we have to nets wire segments for the wheel to rollover or replacing the batteries that’s powering

the whole system.

Page 9: ROVER PROJECT

REFERENCES

Seale, Eric. "DC Motors -- Background and History." DC Motors -- Background and

History. Solarbotics Websites, n.d. Web. 10 May 2016.

"Motor Shield V 1.2." - Robot Wiki. N.p., n.d. Web. 10 May 2016.