Performance Test Code

/*Performance Test 1 */

 //Moving Forward to gate
celerate(4,0,80,1); //Accelerate all motors to 80% in 1 second
motorSpeed(4,80);

goToRelativePosition(198);

  //Run AEV ~96 inches (~8 ft)
motorSpeed(4,45);

goToRelativePosition(100);

//Go at 45% for ~48 inches (~ 4 ft)
brake(4);

rotateServo(35)

//Cut power to all motors and rotate servo 35 degrees to brake
brake(4);

goFor(7);

//Waiting for 7 seconds
rotateServo(0); //Disengage Servo Brake
celerate(4,0,70,1); //Accelerate all motors to 70% in 1 second
motorSpeed(4,70);

goToRelativePosition(197);

//Go past gate for ~96 inches (~8 ft)
motorSpeed(4,50);

goToRelativePosition(124);

//Go at 50% for ~ 60 inches (~ 5 ft) to reach loading zone
brake(4);

rotateServo(35);

brake(4);

goFor(5);

rotateServo(0);

//Brake all motors, engage servo brake, and wait 5 seconds

 /*Performance Test 2 */

//Moving Forward to gate
motorSpeed(4,42);

goToRelativePosition(198);

//Run 42% AEV ~96 inches (~8 ft)

//Goes from start to top of incline

motorSpeed(4,17);

goToRelativePosition(92);

//Go at 17% for ~45 inches (~ under 4 ft)

//Goes to gate

brake(4);

rotateServo(45);

 //Cut power to all motors and rotate servo 45 degrees to brake
brake(4);

goFor(7);

//Waiting for 7 seconds
rotateServo(0); //Disengage Servo Brake
/Going past gate
motorSpeed(4,40);

goToRelativePosition(98);

//Go past gate for ~48 inches (~4 ft) at 40%

//Goes from gate to top of incline

motorSpeed(4,18);

goToRelativePosition(98);

//Go down incline ~48 inches (~4 ft) at 18% speed

 

motorSpeed(4,18);

goToRelativePosition(119);

//Go at 18% for ~ 58 inches (~ under 5 ft) to reach loading zone
//Reaching loading zone
brake(4);

rotateServo(45);

goFor(5);

rotateServo(0);

//Brake all motors, engage servo brake, and wait 5 seconds
//Exiting Loading Zone
reverse(4); //Reverse
motorSpeed(4,75);

goToRelativePosition(-172);

//Motor 75% for 84 inches (~ 7 ft)
motorSpeed(4,45);

goToRelativePosition(-90);

//Motor 45% for ~ 44 inches (~ over 4 ft)
brake(4);

rotateServo(45);

//Brake motors and engage servo

/*Final Performance

Test */

 //Moving Forward to gate
motorSpeed(4,50); GoToRelativePosition(206); //Run 50% AEV ~96 inches

//Goes from start to top of incline

motorSpeed(4,18);

goToRelativePosition(84);

//Go at 18% for ~40 in

//Goes to gate

brake(4);

rotateServo(45);

//Cut power to all motors and rotate servo to brake
brake(4);

goFor(7);

//Waiting for 7 seconds
rotateServo(0); //Disengage Servo Brake
//Going past gate
motorSpeed(4,50); goToRelativePosition(98); //Go past gate for ~48 inches (~4 ft) at 50%

//Goes from gate to top of incline

motorSpeed(4,25);

goToRelativePosition(98);

//Go down incline ~48 inches (~4 ft) 25%
motorSpeed(4,25);  goToRelativePosition(114); //Go at 25% for ~ 60 inches to reach loading zone
  //Reaching loading zone
Brake(4); rotateServo(45);

goFor(5);

rotateServo(0);

//Brake all motors, engage servo brake, and wait 5 seconds
//Exiting Loading Zone
reverse(4); //Reverse
motorSpeed(4,80);

goToRelativePosition(-200);

//Motor 80% for ~ 80 in
motorSpeed(4,37);

goToRelativePosition(-72);

//Motor 37% for ~ 45 inches
//Stopping at gate again
rotateServo(45); //Brake motors and engage servo
goFor(7.2);

rotateServo(0);

//Disengage servo
//Exiting Gate
motorSpeed(4,80);  goToRelativePosition(-110); //Go at 80% for ~48 in
//Going down incline
brake(4);  goToRelativePosition(-98); //Down 48 in at no power
motorSpeed(4,40);

goToRelativePosition(-120);

//40% for ~62 in
//Reaching Loading Zone
brake(4);

rotateServo(45);

//Brake all motors and engage servo