After deciding the final design from Performance Test 1, Performance Test 2 was conducted. Just as before with Performance Test 1, the AEV starts from the initial position, approaches the gate, pauses, then goes through the gate. However, this test required a smooth connection with the caboose that will hold the passengers.
Smooth connection with the caboose requires the AEV to not recoil, and to gradually approach and connect to the load. This guarantees safety for the vehicle as to not cause damage to the body of the AEV, and protect the caboose to prevent harming passengers. To make a smooth connection with the caboose in the most energy efficient way possible, multiple codes were used to achieve maximum efficiency and safety. One utilized acceleration to allow the motors to operate from an initial set power to the desired power output over a set period of time (celerate function), while the other made the motor immediately operate at the desired level of power (motorSpeed function).
After analyzing the data from each code, it was concluded that the motorSpeed function consumes less energy than the celerate function. Speculations on why this is includes the fact that since the motors are running for an extended period of time using the celerate function, and the power variation does not differ as much as initially thought, so the celerate command ends up using more energy. Another speculation would be that using motorSpeed gives the vehicle more inertia and allows for more coasting. Because coasting uses no power in the motors, energy is saved in the process.
Figure 1: Acceleration and Motor Speed Code Data
For the celerate() and motorSpeed() code, the total energy consumed for the run was about 72.2 J. The code starts off at motorSpeed when approaching the gate, proceeds to coast, then stops for 8 seconds to allow the gate to open. After the gate opens, the AEV then accelerates from 0 to 40% power in 2 seconds, then coasts for the remaining duration of the run, using the servo at a specified distance to slow the vehicle before making contact with the caboose.
Figure 2: Motor Speed Only Data
For the motorSpeed() only code, the total energy consumed for the run was a little over 66 J. The code used in this scenario starts out exactly the same as the celerate() motorSpeed() code, up until after the gate opens. Once the gate opens, the AEV starts out immediately at 45% power and continues for a duration of 4 seconds. The vehicle then coasts until it reaches a specified distance on the track, to which it activates the servo brake, then makes contact with the caboose.
Program used for the second Performance Test that uses the motorSpeed() command. The AEV goes to the gate, pauses, continues through the gate, and connects with the caboose.
reverse(4); | // reverse motors because of backward configuration |
rotateServo(20); | // deactivate brake |
motorSpeed(4,50); goFor(2); |
// Start the motors and run them until we are close to the gate |
motorSpeed(4,35); goFor(1); motorSpeed(4,20); goFor(1); brake(4); |
// slow down as we approach the gate |
goToAbsolutePosition(315); | // coast, then stop at the gate: //Distance TO GATE: |
rotateServo(0); | // rotate servo for brake |
goFor(8); | // Wait for gate to open |
rotateServo(20); | // unapply brake |
motorSpeed(4,45); goFor(1.75); brake(4); |
// Start the motors and get close to the caboose |
goToAbsolutePosition(654); | // coast, then stop at the caboose to connect //DISTANCE TO CABOOSE: |
rotateServo(0); goFor(0.275); rotateServo(20); |
// rotate servo for brake |
goFor(5); | // “AEV pauses for 5 seconds” |
Program used for the second Performance Test that uses the celerate() and motorSpeed() command. The AEV goes to the gate, pauses, continues through the gate, and connects with the caboose.
reverse(4); | // reverse motors because of backward configuration |
rotateServo(20); | // deactivate brake |
motorSpeed(4,50);
goFor(2); |
// Start the motors and run them until we are close to the gate |
motorSpeed(4,35);
goFor(2); brake(4); |
// slow down as we approach the gate |
goToAbsolutePosition(313); | // coast, then stop at the gate |
rotateServo(0); | // rotate servo for brake |
goFor(8); | // Wait for gate to open |
rotateServo(20); | // unapply brake |
celerate(4,0,40,2);
motorSpeed(4,40); goFor(2.5);brake(4); |
// Start the motors and get close to the caboose |
goToAbsolutePosition(656); | // coast, then stop at the caboose to connect |
rotateServo(0);
goFor(0.265); rotateServo(20); |
// rotate servo for brake |