Top Banner
Lego Robot Construction Project
15

Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Dec 28, 2015

Download

Documents

Kathlyn Stokes
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: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Lego Robot Construction Project

Page 2: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Group Picture!

Adam, Roger, Lu, Riana, Paul

Page 3: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Objectives for Robot

• Learn the basics of the Interactive C program.

• Learn how processors and sensors work within the Interactive C program.

• Design a code that would allow the robot perform the following tasks:• Follow a path set down by thick black tape.• At the end of the path, make a u-turn and

return to its starting position.

Page 4: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Parts List

1 handyboard RJ-11 Cable Serial Port interface C AdapterSerial Port

cable (25 pin to 9 pin)

2 large wheels 2 small wheels Computer running

Interactive C 8.0 Lego pieces 2 motors 2 analog light

sensors

Page 5: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Programvoid main () {         int lap; /* create a counter to count how many times the the robot has completed the course*/    int rightsensor; // creates variable for the right sensor    int leftsensor; // creates variable for the left sensor    while (start_button ()==0) {}  /*while start button is not pushed, do nothing*/    while (1) // one infinite loop {        leftsensor=analog(5); // defines left sensor as analog 5        rightsensor=analog(6); // defines right senor as analog 6        if ((leftsensor < 150) && (rightsensor < 150)) /* if neither sensor is touching black lines, the robot moves forward*/          {             motor(1,15);              motor(3,15);         }         else if ((leftsensor < 150) && (rightsensor >= 150)) /* if the left sensor reads white and the right sensor reads black, the robot will turn right*/ {                motor (1,100);            motor (3,-100);             }        else if ((leftsensor >= 150) && (rightsensor < 150)) /* if the left sensor reads black and the right sensor reads white, the robot will turn left*/ {                  motor (1,-100);             motor (3,100);  }        

Page 6: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Program Continued

else // if both sensors read black {             if (lap <1) /*if the robot has only completed 1 lap, then it will turn around and do follow the track for its second lap*/ {                      lap = 0;              ao ();                 sleep (2.0);                 motor (1,-50);                 motor (3,50);                 sleep (1.25);                lap++;            }            else // if the robot has completed the course, it will shut off {                 ao ();                 break;            }        }    }    ao ();  //all motors will shut off}

Page 7: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Procedures to Implement the Robot

Build body Wheels or tread? We chose a high

starting speed but had to adjust it

We assigned jobs according to talent-worked out well

Order of creation Body and program

created Test runs made Corrections made to

program for efficiency

Page 8: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Some Sample Robots (cont)

Page 9: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Challenges and Successes The lack of Gears - without gears there is less torque, therefore turns are harder. Friction - the friction forced our wheel off. Program - we had to cover all possibilities that the sensor could read. Motor Strength - without gears we had to constantly test the speed. If the strength was too

weak, the robot did not turn. If it were to strong, it flew off the S curve.

Completed the S curve without gears. Completed the course with full speed. Created three successful codes, in which one implemented a break statement. Built a sturdy robot that had the head of R2D2.

Challenges Successes

Page 10: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

BIOMEDICAL EXPERIMENT

Centrifuge

Page 11: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Objectives of The Centrifuge

Creating a centrifuge to accelerate the separation of oil from water.

How?- Put the substance in circular motion in order for the centrifugal force to separate oil from water more quickly.

Using the skills obtained from this project to apply to real life situations.

- The separation of proteins and DNA - Sedimentation of cells and viruses -Separation of certain substances for

purification purposes.

Page 12: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

About Centrifuge

a device that separates liquids based on their density

driven by an electric motor

puts an object in rotation around a fixed axis, applying a force perpendicular to the axis.

Page 13: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Code void main() { int speed = 0; float separation_time=4.0 ; float ramp_time= 0.1 printf ("\nPress start to

being?"); while (start_button() == 0)

{} // read value of oil + water

mixed up while (stop_button()==0) { printf ("\n mixed up

value=%d", analog (20)); sleep(0.2); }

• // ramp up motor• while (speed < 100)• {• // turn on motor at ?speed?• motor(1, speed);• // sleep for ramp_time• sleep(ramp_time);• // increment speed variable• speed = speed + 1;• }• • // full speed ahead!• sleep ( separation_time );• • // ramp motor down• while (speed > 0)• {• // do the reverse of ramp up loop• motor(1, speed);• sleep(ramp_time);• speed = speed - 1;• }• ao();• }

Page 14: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Results and analysisTrial

#Sensor Reading

(before separation)

Sensor Reading (after separation)

Ramp UP time (s)

Time separation

(s)

Ramp DOWN

time (s)

oil water

1 200 120 200 10 1 10

2 200 70 150 10 4 10

3 200 70 150 10 5 10

4 200 40 180 20 4 20

5 200 70 130 20 5 20

Motor Power (%)

t2 tt1

100

Conclusion:

With longer ramp up time and separation time, the oil and water will be separated more clearly.

Page 15: Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.

Conclusion:

We tested the sensor for each change in environment so that our robot would remain on the right path.

We used a break statement to end the nearest while loop and to successful complete two laps.

We played with the adjustment of the speeds of the motors to successful turn as smooth as possible.

We wanted to add gears to increase torque and make the turns easier. We wanted to use a code without a break statement.

What we’ve learned…

What we wanted to add…