For performance test 2, the group tested two sets of Arduino code. The first code was based on time, while the second code was based on position. Both codes are shown below. The goals of the tests were to increase consistency and number of consecutive successful test runs. After having the AEV complete the first half of the mission using the code based on time, the group decided that using time as a parameter was decreasing consistency rather than increasing it. While using time as a parameter the number of consecutive successful test runs also decreased. The group decided to continue developing the code based on position for this reason.
Arduino Code
/*Code based on time*/
motorSpeed(1,34);
reverse(2);
motorSpeed(2,34);
goFor(5);
brake(4);
goFor(2); // time coasting
reverse(4);
motorSpeed(4,30);
goFor(.5); //time in reverse
brake(4);
goFor(9); //gate to open
reverse(4);
motorSpeed(1,30);
motorSpeed(2,30);
goFor(6.6);
brake(4);
goFor(8);
reverse(4);
motorSpeed(1,65);
motorSpeed(2,65);
goFor(5.5);
brake(4);
goFor(12);
motorSpeed(1,60);
motorSpeed(2,60);
goFor(7.5);
brake(4);
/*Code based on Position*/
motorSpeed(1,34);
reverse(2);
motorSpeed(2,34);
goToAbsolutePosition(253); //brake to first gate
brake(4);
goFor(2); // time coasting
reverse(4);
motorSpeed(4,30);
goFor(.5); //time in reverse
brake(4);
goFor(8); //gate to open
reverse(4);
motorSpeed(1,35);
motorSpeed(2,35);
goToRelativePosition(260);
brake(4);
goFor(8);
reverse(4);
motorSpeed(1,60);
motorSpeed(2,60);
goToRelativePosition(-170);
brake(4);
goFor(11);
motorSpeed(1,60);
motorSpeed(2,60);
goToRelativePosition(-193);
brake(4);