Operational Objectives

During Performance Test 2, the focus was one the code. The two codes below were tested.

 

Code 1

reverse(1); // sets motor one in reverse
motorSpeed(4, 40); // sets both motors to speed 40
goFor(1.75); // keeps above command for 1.75 seconds
celerate(4,40,10,1.78); // decelerates both motors from 40 to 10 in 1.7 seconds
reverse(4); // sets both motors in reverse
motorSpeed(4, 50); // sets both motors to 50 percent power
goFor(0.9); // keeps current command for 0.9 seconds
brake(4); // stop both motors
motorSpeed(4, 0); // sets both motors to speed 0
goFor(7); // keeps above command for 7 seconds
reverse(4); // sets both motors in reverse
motorSpeed(4, 30); // sets both motors to 30 speed
goFor(3); // keeps above command for 3 seconds
celerate(4,30,10,.85); // has the motors slow from 30 to 10 in .85 seconds
reverse(4); // reverses both motors
motorSpeed(4, 0); // sets both motors to 0 speed
goFor(9.5); // keeps above command for 9.5 seconds
motorSpeed(4,50); // sets both motors to 50 speed
goFor(4.9); // keeps above command for 4.9 seconds

Code 2

reverse(1); // sets motor one in reverse
motorSpeed(4, 40); // sets both motors to speed 40
goToAbsolutePosition(176); // keeps above command for 30 marks
motorSpeed(4, 0);
goToRelativePosition(82);
reverse(4); // sets both motors in reverse
motorSpeed(4, 50); // sets both motors to 50 percent power
goFor(1); // keeps current command for 0.9 seconds
brake(4); // stop both motors
motorSpeed(4, 0); // sets both motors to 0 percent power
goFor(7.2); // keeps above command for 7.2 seconds
reverse(4); // reverses both motors
motorSpeed(4, 30); // sets both motors to 30 percent power
goToRelativePosition(94); // keeps above command for 94 marks
motorSpeed(4, 0); // sets both motors to 0 percent power
goFor(1.2); // keeps above command for 1.2 seconds
brake(4); // brakes both motors
goFor(10.1); // keeps both motors at 0 percent for another 10.1 seconds
reverse(4); // reverses both motors
motorSpeed(4, 50); // sets both motors to 50 percent power
goToRelativePosition(-180); // keeps above command for 180 marks (in reverse)

 

The time vs. power graph for the second code can be found below. It was observed that the second code was more beneficial for consistency.