Week 10 marked the preparation for the second performance test. In order to successfully complete the test, the AEV had to stop at the gate for 7 seconds and pass through once it opened similar to Test 1. The AEV then had to continue to magnetically pick up the caboose on the other end of the track, and pause for five seconds.
To begin, a test code was written to make sure the AEV could reach the caboose. Pictured below is a mapped out plan of the distance required to travel, as well as the initial prototype code.
Performance Test 2: Prototype Code 1
//reverse all motors to ensure correct direction of movement
reverse(4);
//initialize servo to correct direction
rotateServo(10);
//run all motors until vehicle reaches gate
motorSpeed(4,35);
goToAbsolutePosition(280);
//stop all motors and rotate brake to active position until gate opens
brake(4);
rotateServo(48);
goFor(7);
//return servo to rest position, run motor through gate and stop all motors
rotateServo(10);
//AEV goes to caboose, stops 5 seconds, coasts into caboose then stops
motorSpeed(4,35);
goToAbsolutePosition(575);
brake(4);
rotateServo(48);
goFor(5);
motorSpeed(4,30);
goFor(1);
brake(4);
After several trial runs, the team addressed the three main issues: servo stability, braking distance, and magnetic connection failure. To modify the servo, a support bracket was placed at the bottom of the aluminum casing to increase tension. The servo arm was also coded to rotate an additional 2 degrees to create more stress with the rail. The braking distance was adjusted so the AEV traveled an additional 17 marks; the vehicle had stopped short in every trial run. Lastly, it was determined the AEV could not connect to the caboose because the magnet was placement was too low and did not reach. An additional bracket was screwed vertically onto the existing bracket for additional height, allowing for the proper connection. Demonstrated below are all of the modifications made to the code.
Performance Test 2: Prototype Code 2
//reverse all motors to ensure correct direction of movement
reverse(4);
//initialize servo to correct direction
rotateServo(10);
//run all motors until vehicle reaches gate
motorSpeed(4,35);
goToAbsolutePosition(282);
//stop all motors and rotate brake to active position until gate opens
brake(4);
rotateServo(50);
goFor(7);
//return servo to rest position, run motor through gate and stop all motors
rotateServo(10);
//AEV goes to caboose, stops 5 seconds, coasts into caboose then stops
motorSpeed(4,35);
goToAbsolutePosition(592);
brake(4);
rotateServo(50);
goFor(5);
rotateServo(10);
motorSpeed(4,30);
goFor(1);
brake(4);
The second prototype code was a success. The AEV not only properly braked in front of the gate but also continued to the caboose correctly, braking precisely in front of it with perfect connection. The code also reduced power usage from the first prototype code and traveled to a more precise marks position than the first, making it the more ideal of the two codes.
Some modifications were made from the second prototype code. Coastal braking was also used on the back half of the code, saving energy and lowering the risk of powering into the caboose. Lastly, the code had a goFor command appended to the end to ensure the AEV would move out of the gate following connection to the caboose.
Final Performance Test 2 Code
//reverse all motors to ensure correct direction of movement
reverse(4);
//initialize servo to correct direction
rotateServo(10);
//run all motors until vehicle reaches gate
motorSpeed(4,35);
//goToAbsolutePosition(282);
goToAbsolutePosition(284);
//stop all motors and rotate brake to active position until gate opens
brake(4);
rotateServo(50);
goFor(7);
//return servo to rest position, run motor through gate and stop all motors
rotateServo(10);
//AEV goes to caboose, stops 5 seconds, coasts into caboose then stops
motorSpeed(4,30);
goFor(4);
brake(4);
motorSpeed(4,0);
goToAbsolutePosition(625);
rotateServo(50);
goFor(2);
rotateServo(10);
motorSpeed(4,30);
goFor(1);
brake(4);
goFor(6);
reverse(4);
motorSpeed(4,30);
goFor(4);
brake(4);
Results
The final test was a success. The AEV braked properly in front of the gate and coasted down the hill with ease. Furthermore, the AEV braked precisely when it was connecting to the caboose, demonstrating a well-refined code. Using coastal braking also saved energy, leading to a lower cost for the design and a more efficient vehicle.
Distance v. Time
The distance vs time plot demonstrates the success of the performance test. The AEV stopped for 7 and 5 seconds before the gate and caboose respectively, as demonstrated by the lines of zero slope. Furthermore, the vehicle spent approximately 33 seconds completing the trial, helping the team stay on track for a final run of 65 to 70 seconds.
Power vs Time
The power vs time plot showed that 128 J total were used in the second performance test. The power increased from the first as was expected, but the power did not double (the first test utilized 78 J). This was due to the coastal braking commands, as demonstrated by the areas of zero power output on the plot.
Velocity vs Time
The AEV moved fastest before and after the gate, and used minimal speed when coasting down the track. The lower speeds after 20 seconds was integral to an effective performance; had the AEV been going faster, it would have attached to the caboose too hard and experienced recoil.
Voltage vs Time
The second performance test generated a similar voltage plot to the first test. The voltage spiked after 7 seconds due to the use of the servo brake but did not spike as high again due to coastal braking. A slight jump is seen around the 22 second mark; this is likely due to the motors re-engaging after turning off for a period of time.
Performance Tests 1 and 2 Comparison
Pictured above is a comparison between the energy usage of the first two performance tests. Although the second test lasted twice as long and went twice as far, twice as much energy was not used. 128 J were used compared to the 78 J of the first two tests. The usage of coastal braking on the back end of the track likely lead to this result, further demonstrating the AEV’s ability to minimize energy usage.





