Final Performance Test

The final performance test the team was tasked with completing the entire mission of the project. This test, like performance test 2, built on the previous tests. The additional requirements this test had compared to the second performance test is to carry the caboose to the gate, wait 7 second until it is raised, go through the gate, and come to a gentle rest on the other end without bouncing back. The team used their previous code and built upon it, adjusting the code along the way, until they came up with the final working code.

Final Code:

celerate(4,0,40,2); //accelerate all motors from 0% to 40% power in 2 seconds

goToRelativePosition(144); //power the motors until the AEV has moved 144 marks on the track relative to current position

reverse(4); //reverse all motors

goFor(1); //power motors for 1 second

celerate(4,40,0,2); //decelerate all motors from 40% to 0% power in 2 seconds

goFor(7); //have the AEV wait for 7 seconds at the gate

reverse(4); //reverse all motors

celerate(4,0,30,2); //accelerate all motors from 0% to 30% power in 2 seconds to pass through the gate

goToRelativePosition(60); //power the motors until the AEV has moved 60 marks on the track relative to current position

celerate(4,30,0,2); //decelerate all motors from 30% to 0% power in 2 seconds

goFor(8); //let the AEV go for 8 seconds with no power to the motors to allow it to coast to the caboose and connect while waiting at the end for 5 seconds

reverse(4); //reverse all motors

celerate(4,0,50,2); //accelerate all motors from 0% to 50% in 2 seconds

goToRelativePosition(-224); //power the motors until the AEV has travelled -224 marks towards the initial position relative to its current position

reverse(4); //reverse all motors

goFor(1); //power motors for 1 seconds

celerate(4,50,0,2); //decelerate all motors from 50% to 0% power in 2 seconds

goFor(6); //have the AEV coast in and wait at the gate for 7 seconds

reverse(4); //reverse all motors

celerate(4,0,50,2); //accelerate all motors from 0% to 50% power in 2 seconds

goToRelativePosition(-62); //power the motors until the AEV has travelled -62 marks towards the initial position relative to is current position

goFor(2); //power motors for 2 seconds

reverse(4); //reverse all motors

goFor(1); //power motors for 1 second

celerate(4,50,0,2); //decelerate all motors from 50% to 0% power in 2 seconds and coast to the end point of the track