Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul."— Presentation transcript:

1 Lego Robot Construction Project

2 Adam, Roger, Lu, Riana, Paul

3 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.

4  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

5 void 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)) /* 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); }

6 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 }

7  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

8

9  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. ChallengesSuccesses

10

11  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.

12  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.

13  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(); }

14 Trial # Sensor Reading (before separation) Sensor Reading (after separation) Ramp UP time (s) Time separation (s) Ramp DOWN time (s) oilwater 1200120200101 220070150104 320070150105 420040180204 520070130205 Motor Power (%) t2 t t1 100 Conclusion: With longer ramp up time and separation time, the oil and water will be separated more clearly.

15  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…


Download ppt "Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul."

Similar presentations


Ads by Google