Erin Halseth, Will Gottschalk, Briana Warschun, and Michaella Gaines ECE Final Report Erin Halseth, Will Gottschalk, Briana Warschun, and Michaella Gaines
Purpose Program a robot that could follow a black line and stop when the line came to an end Sense the difference between the colors on ground Make a U-turn and to run through the path again and stop.
Resources Handyboard Ac adapter Serial connection cables Board connection cable 2 LEGO motors and finders 2 light sensors Kit of LEGOS Handyboard Serial Interface board
/*Programmers: Briana Warschun, Will Gottschalk, Michaella Gaines, Erin Halseth. The robot is to follow a black curved path, make a U-turn, and return back to the starting point and stop. */ while(x==1) } } sleep(2.0); motor(3,-100); motor(1,5); void main() sleep(1.5); { ao(); int sensor2, sensor3, flag=1, x=0, y=0; while(start_button()==0); //program waits until the start button is pressed to run program x=0; y=1; while(y==1) while(flag==1) { sensor2=analog(2); sensor3=analog(3); sensor3=analog(3); if(sensor2<200 && sensor3<200) //when both sensors see white both motors move forward at 35% power { motor(1,35); motor(3,35); motor(3,35); } if(sensor2>200 && sensor3<200) //when sensor 2 sees black and sensor 3 sees white, turns towards the left if(sensor2>200 && sensor3<200) //when sensor 2 sees black and sensor 3 sees white, turns towards the left { motor(3,80); motor(3,80); motor(1,-25); sleep(0.1); //sleeps for 0.1 seconds sleep(0.1); //sleeps for 0.1 seconds } } else if(sensor3>200 && sensor2<200) //when sensor 2 sees white and sensor 3 sees black, turns towards the right { motor(1,80); motor(3,-25); motor(1,80); sleep(0.1); //sleeps for 0.1 seconds } sleep(0.1); //sleeps for 0.1 seconds } else if(sensor2>200 && sensor3>200) //when both sensors see black, stops for 2 seconds before making a U-turn, then terminates { printf("\n sen2 %d sen3%d",analog(2),analog(3)); ao(); printf("\n sen2 %d sen3 %d",analog(2),analog(3)); flag=0; ao(); x=1; y=0; else printf("\n sen2 %d sen3 %d",analog(2),analog(3)); } printf("\n sen2 %d sen3%d",analog(2),analog(3)); }
Procedures to Implement the Robot Design Team Wheels Low to ground Wide sensors Light weight Two people per job Both jobs at same time
Challenges Equipment malfunction Program Weight of robot Design
Biomedical Experiment Discussion Centrifuge Separate fluids
while (!start_button()); //wait for start button to be pressed Sensor void main () { while (!start_button()); //wait for start button to be pressed while (1) { printf("?\n sen3 %d?", analog (3)); //read the output from analog port 3 sleep(0.4); } Motor void main () { int a, b, c; //declare integers a, b, and c while (start_button() ==0); //wait for start button to be pressed for ( a=0; a<=100; a=a+10) //ramp up in intervals of 10 until 100 { motor (1,a); sleep (0.5); } sleep (5.0); for (b=0; b<=100; b=b+10) //ramp down in intervals of 10 until 0 { c=100-b; motor (1,c); }
Centrifuge
Turn time needed= 5 seconds Results
Results Motor Power Time (seconds)
Conclusion Relationship between robot design and program Teamwork Improvements necessary Appearance