Exercise 1
//step 1
celerate(1,0,15,2.5);
//step 2
motorSpeed(1,15);
goFor(1);
//step 3
brake(1);
//step 4
celerate(2,0,27,4);
//step 5
motorSpeed(2,27);
goFor(2.7);
//step 6
motorspeed(2,15);
goFor(1);
//step 7
brake(2);
//step 8
reverse(2);
//step 9
celerate(4,0,31,2);
//step 10
motorSpeed(4,35);
gofor(1);
//step 11
brake(2);
motorSpeed(1,35);
goFor(3);
//step 12
brake(4);
goFor(1);
//step 13
reverse(1);
//step 14
celerate(1,0,19,2);
//step 15
motorSpeed(2,35);
motorSpeed(1,19);
goFor(2);
//step 16
motorSpeed(4,19);
goFor(2);
//step 17
celerate(4,19,0,3);
//step 18
brake(4);
Exercise 2
//step 1
motorSpeed(4,25);
goFor(2);
//step 2
motorSpeed(4,20);
goToAbsolutePosition(70.2);
//step 3
reverse(4);
//step 4
motorSpeed(4,30);
goFor(1.5);
//step 5
brake(4);
Exercise 4
//step 1
celerate(4,0,35,3);
//step 2
motorSpeed(4,35);
goFor(1);
//step 3
motorSpeed(4,35);
goFor(2);
//step 4
reverse(4);
//step 5
motorSpeed(4,35);
goFor(2);
//step 6
brake(4);
//The motor speeds tested were 35 and 45. The first trial made the AEV travel 2-3 inches. The second trial went a little over double that.
Battery Test
reverse(4);
celerate(4,0,50,3);
motorSpeed(4,50);
goFor(2);
motorSpeed(4,50);
goFor(3);
reverse(4);
motorSpeed(4,50);
goFor(2);
brake(4);
Track Comparison
reverse(4);
motorSpeed(4,50);
goToAbsolutePosition(-250);
reverse(4);
celerate(4,50,0,1);
Performance Test 1 (Lab room)
reverse(4);
motorSpeed(4,50);
goToAbsolutePosition(208);
reverse(4);
celerate(4,50,0,1);
motorSpeed(4,0);
//coasts until behind the stop sign and then waits for 9 after motors are turned off (to make up for coast time)
goFor(9);
reverse(4);
motorSpeed(4,50);
goToAbsolutePosition(407);
reverse(4);
celerate(4,50,0,1);
goFor(9);
motorSpeed(4,65);
goFor(2);
Performance Test 2 (Lab room)
reverse(4);
motorSpeed(4,50);
goToAbsolutePosition(208);
reverse(4);
celerate(4,50,0,1);
motorSpeed(4,0);
//coasts until behind the stop sign and then waits for 9 after motors are turned off (to make up for coast time)
goFor(9);
reverse(4);
motorSpeed(4,50);
goToAbsolutePosition(407);
reverse(4);
celerate(4,50,0,1);
goFor(10);
//after the above code, the caboose gets attached and waits for 5 seconds.
//the code should end here because we have set absolute position afterwards
//the code below was used to just move the caboose for pt2
motorSpeed(4,65);
goFor(6);
Final Performance Test
reverse(4);
motorSpeed(4,27);
//started AEV on the far end of track
goToAbsolutePosition(206);
reverse(4);
celerate(4,20,0,1);
motorSpeed(4,0);
//coasts until behind the stop sign and then waits for 9 after motors are //turned off (to make up for coast time)
goFor(9);
reverse(4);
motorSpeed(4,27);
goToAbsolutePosition(413);
reverse(4);
//coasted to caboose and connected
celerate(4,20,0,1);
goFor(10);
//after the above code, the caboose gets attached and waits for 5 seconds. //(Still occurs with shell)
motorSpeed(4,55);
goToAbsolutePosition(480);
reverse(4);
celerate(4,20,0,1);
//coasts until behind the stop sign and then waits for 9 after motors are turned off (to make up for coast time)
goFor(9);
reverse(4);
motorSpeed(4,55);
//have aev and caboose safely stop before hitting end of track
goToAbsolutePosition(185);
reverse(4);
celerate(4,20,0,1);
motorSpeed(4,0);