In Performance Test 2, we developed two codes to test and determine which one was the most energy efficient. Both of the codes would complete the same task, however, one was written with celerate and motorSpeed commands for moving the AEV and the other was written with only motorSpeed commands. Their task was an addition to Performance Test 1, where the AEV needed to get to the gate, stop, then pick up the load without recoiling. To account for the recoil, a power brake was added to both codes so that there would be a soft connection between the AEV and load. The code using only motorSpeed commands was more energy efficient, however, it could not accomplish the task as well as the other code. This was most likely due to varying light levels and power levels in the battery. We decided to use the code that used both celerate and motorSpeed because it performed better than the only motorSpeed code. The major findings from this test was that keeping the battery at a specific power level is crucial to getting consistent results as well as trying to test in areas where the light levels were fairly consistent. Below is both codes used as well as the data collected during both tests.
Figure 1: Motorspeed Only Power Consumption
The motorSpeed only code used about 105 Joules of energy during the test runs. While power consumption is very high at times of starting from a stop, having the instant power allowed for less energy usage. This is due to not having to slowly reach the desired power usage. Having a slow climb to power uses more energy because it needs to slowly spin up the motors where instantaneous power uses only the energy required for the specified power.
Figure 2: Celerate and Motorspeed Power Consumption
The celerate and motorSpeed code used about 107 Joules of energy during the test runs. The slow climb to the desired power used a lot of energy. This slow climb used most of the energy towards spinning up the motors to the requested power output. The one perk to using this code was that it allowed for a soft launch where the other code had hard launches which is not ideal for a real world application.
[The following code is written for the “Performance Test Two” section for the AEV project]
[Performance Test Two celerate/motorspeed code] (8.14V-8.16V)
reverse(4);
celerate (4,0,20,0.25); goToRelativePosition(100);
|
//Acceleration at the start of the test. Accelerates all motors from 0 to 20% power in 1 second. AEV moves towards bottom of incline. |
celerate (4,20,40,.25);
goToRelativePosition (70);
|
//Going up the first incline. Accelerates all motors from 20 to 40% power in 0.25 seconds. AEV moves to top of incline. |
celerate (4,40,25,.25);
goToRelativePosition(45);
|
//From the incline to the gate. Accelerates all motors from 40 to 20% power in 0.25 seconds. AEV moves towards gate. |
reverse(4);
|
//Reverse motors for the power brake |
motorSpeed(4,33);
goFor(1);
|
//Power brake. All motors are set to 30% for 1 second. |
motorSpeed(4,0);
goFor(7);
|
//7 second pause at the gate. All motors are set to 0% power for 7 seconds. |
reverse(4);
celerate (4,0,35,.25); goToRelativePosition(45);
|
//Getting the AEV through gate. All motors are reversed and accelerated from 0 to 35% power for 0.25 seconds. AEV moves just past gate. |
motorSpeed(4,0);
goToRelativePosition(280);
|
//Coasting to the end. All motors are set to 0% power. AEV coasts towards load |
reverse(4);
|
//All motors are reversed. |
motorSpeed(4,25);
goFor(.845);
|
//Power brake. All motors are set at 25% power for 0.845 seconds. |
motorSpeed(4,0);
goFor(5);
|
//All motors are set 0% power for 5 seconds. The AEV has stopped and picked up the load. |
[The following code is written for the “Performance Test Two” section for the AEV project]
[Performance Test Two motor speed only code](8.2V-8.24V)
reverse(4);
motorSpeed (4,20); goToRelativePosition(125);
|
//Acceleration at the start of the test. All motors are reversed and set at 20% power until the AEV reaches the base of the incline. |
motorSpeed (4,40);
goToRelativePosition (95);
|
//Going up the first incline. All motors are set at 40% power until the AEV reaches the top of the incline. |
motorSpeed (4,20);
goToRelativePosition(81);
|
//From the incline to the gate. All motors are set at 20% power until the AEV reaches the gate. |
reverse(4);
|
//Reverse motors for the power brake |
motorSpeed(4,30);
goFor(1);
|
//Power brake. All motors are set at 30% power for 1 second. |
motorSpeed(4,0);
goFor(7);
|
//7 second pause at the gate. All motors are set at 0% power for 7 seconds. |
reverse(4);
motorSpeed(4,35); goToRelativePosition(55);
|
//Getting the AEV through the gate. All motors are reversed and set at 35% power until it gets through the gate. |
motorSpeed(4,0);
goToRelativePosition(196);
|
//Coasting to the end. All motors are set at 0% power until the AEV approaches the load. |
reverse(4);
|
//All motors are reversed. |
motorSpeed(4,25);
goFor(.85);
|
//Power Brake. All motors are set at 25% power for 0.85 seconds. |
motorSpeed(4,0);
goFor(5);
|
//All motors are set at 0% power for 5 seconds. The AEV has stopped and picked up the load. |