Progression of Code

Propeller test code:  2/27/2019

//Reverses polarity of the propellers so it runs in the correct direction
reverse(4);
//Accelerates the AEV over 2 seconds
celerate(4,0,20,2);
//Goes to the 75th mark
goToAbsolutePosition(75);
//Increases the speed and maintains it until it reaches the 150th mark and then brakes
motorSpeed(4,35);
goToAbsolutePosition(150);
brake(4);
//Waits for 10 seconds prior to reversing the polarity again
goFor(10);
reverse(4);
//Maintains the AEV at a constant speed back to the 75th mark
motorSpeed(4,35);
goToAbsolutePosition(75);
//Decelerates the AEV to a letter speed until it reaches the original starting place and then brakes
celerate(4,35,20,2);
goToAbsolutePosition(0);
brake(4);

This code was too complicated so it was simplified so the faster method could be easily determined. Furthermore, the above code did not initially work. This was due to an error in the past reflective sensors but that error was unknown at the time.

 

Propeller test code:  3/7/2019

//Reverse the polarity so it runs in the correct push direction
reverse(4);
//Gradually increases the speed of the AEV over 3 seconds and maintains the speed for 3 more seconds
celerate(4,0,30,3);
motorSpeed(4,30);
goFor(3);
//Gradually decreases the motor speed over 2 seconds until they stop completely
celerate(4,30,0,2);
brake(4);

Pull uses same code but comments out the first reverse command.

 

Propeller Test Code: 3/19/019

//Reverse the polarity so it runs in the correct direction

reverse(4);

//Gradually increases the speed of the AEV over 3 seconds and maintains the speed for 3 more seconds

celerate(4,0,30,3);

motorSpeed(4,30);

goFor(3);

//Reverse polarity so propellers can be used to brake

reverse(4);

//Runs propellers at constant speed for 1 second to test how well each propeller brakes

motorSpeed(4,25);

goFor(1);

//Cuts all motors to stop the AEV

brake(4);

 

Battery Test Code 4/2/19:

//Reverse the polarity so it runs in the correct push direction

reverse(4);

//Gradually increases the speed of the AEV over 3 seconds and maintains the speed for 3 more seconds

celerate(4,0,30,3);

motorSpeed(4,30);

goFor(3);

//Gradually decreases the motor speed over 3 seconds until they stop completely

celerate(4,30,0,3);

brake(4);

 

 

Performance Test 1 Code: HI 308 3/7/2019

//Run at a constant motor speed until the AEV reaches the 100th mark
motorSpeed(4,30);
goToAbsolutePosition(100);
//While in motion, cut off the motors
brake(4);
//Keep the motors off for 10 seconds so it can roll into the gate and wait for it to open
goFor(10);
//Run at a constant motor speed for 6 seconds to move through the gate and then brake again
motorSpeed(4,20);
goFor(6);
brake(4);

 

Performance Test 2 Code: HI 308 3/26/2019

 

//Reverse polarity so AEV runs in push orientation

reverse(4);

//Run at constant speed until the 172nd mark

motorSpeed(4,30);

goToAbsolutePosition(172);

//Brake for 1 second

brake(4);

goFor(1);

//Reverse polarity again so propellers are in pull orientation, opposite of motion

reverse(4);

//Run propellers at a constant speed for 2 seconds to slow down the AEV quickly

motorSpeed(4,20);

goFor(2);

//Cut off the motors for 8 seconds until the gate opens

brake(4);

goFor(8);

//Reverse polarity so its in push and can move forward again

reverse(4);

motorSpeed(4,30);

//Run at constant speed for 160 marks

goToRelativePosition(160);

//Reverse polarity again to brake with propellers

reverse(4);

//Run propellers at constant speed for 3 seconds to slow down the AEV

motorSpeed(4,30);

goFor(3);

//Cut off motors for 6 seconds while caboose attaches

brake(4);

goFor(6);

//Run at max speed for 4 seconds the going opposite way from before to leave with the caboose

motorSpeed(4,50);

goFor(4);

//Cut the motors to stop

brake(4);

 

Final Performance Test Code 4/4-9/2019

//HI 308

//Reverses polarity so AEV is in push orientation

reverse(4);

//Run at maximum motor speed until the 160th mark

motorSpeed(4,50);

goToAbsolutePosition(160);

//Reverses the polarity and run the motor for 1.72 seconds to brake

reverse(4);

motorSpeed(4,50);

goFor(1.72);

//Stop AEV motors for 7.3 seconds to wait for the gate to open

brake(4);

goFor(7.3);

//Reverse polarity again to run forward in push orientation

reverse(4);

//Run at maximum motorspeed for 105 marks

motorSpeed(4,50);

goToRelativePosition(105);

//Cut the motors for 1 second and reverse polarity of the blades

brake(4);

goFor(1);

reverse(4);

//Run the motors at maximum power for 1.5 seconds to brake for the caboose

motorSpeed(4,50)

goFor(1.5);

//Cut the motors for 5 seconds to wait with the caboose attached

brake(4);

goFor(5);

//Run the AEV at maximum motorspeed in the pull direction for 235 marks

motorSpeed(4,50);

goToRelativePosition(-235);

//Reverse the polarity and run the motors at maximum speed for 1.5 seconds to brake for the gate

reverse(4);

motorSpeed(4,50);

goFor(1.5);

//Cut the motors for 6.8 seconds to wait for the gate

brake(4);

goFor(6.8);

//Reverse the polarity so that it is in the correct pull orientation and run at maximum motor speed for 130 marks

reverse(4);

motorSpeed(4,50);

goToRelativePosition(-130);

//Cut the motor for 1.8 seconds

brake(4);

goFor(1.8);

//Reverse the orientation and run at a high motors peed for 1.8 seconds to stop at then end of the track

reverse(4);

motorSpeed(4,45);

goFor(1.8);

//Code did not work correctly, the AEV did not run test correctly

 

Final Performance Test Code 4/10/2019

//HI 224

//Reverses polarity so AEV is in push orientation

reverse(4);

//Run at maximum motor speed until mark 155.5

motorSpeed(4,50);

goToAbsolutePosition(155.5);

//Reverses the polarity and run the motor at maximum speed for 2 seconds to brake

reverse(4);

motorSpeed(4,50);

goFor(2);

//Cut the motors for 6.6 seconds to wait for the gate to open

brake(4);

goFor(6.6);

//Reverses polarity of blades to run in correct push orientation and run at maximum motor speed for 106 marks

reverse(4);

motorSpeed(4,50);

goToRelativePosition(106);

//Cut the motors for 0.6 seconds while rolling down the ramp

brake(4);

goFor(.6);

//Reverse the polarity of the blades and run at maximum speed for 1.5 seconds to brake and attack to the caboose

reverse(4);

motorSpeed(4,50);

goFor(1.5);

//Cut the motor for 5 seconds while attached to the caboose

brake(4);

goFor(5);

//Run at maximum power in the pull orientation for 267 marks

motorSpeed(4,50);

goToRelativePosition(-267);

//Reverse the orientation and run at maximum motor speed for 1 second to brake in front of the gate

reverse(4);

motorSpeed(4,50);

goFor(1);

//Cut motors for 6.5 seconds waiting for the gate to open

brake(4);

goFor(6.5);

//Reverse the polarity so that it is in the correct pull orientation and run at maximum motor speed for 130 marks

reverse(4);

motorSpeed(4,50);

goToRelativePosition(-130);

//Cut the motors for 3.7 seconds while the AEV is rolling down the ramp

brake(4);

goFor(3.7);

//Reverse the orientation and run at a high motor speed for 1.2 seconds to stop the AEV at the end of the track to complete the test

reverse(4);

motorSpeed(4,45);

goFor(1.2);

//Test worked to completion