Lab10 Performance Test 3 Lab Report

Memo
Date:
To:
From:
Subject:
November 22, 2015
Inst. John Schrock & GTA Jin Yang
Sally Zhou, Nikhila Cooduvalli, Wei Zhi Tan, Ryan Stutzman
Lab 10- Performance Test 3
Introduction
The purpose of performance test 3 was to achieve maximum energy efficiency. Variables such as design
of AEV, propeller type, and arduino code, led to various changes which allowed groups to increase
energy efficiency. The group focused mainly on the arduino code to increase energy efficiency. By
studying the phases on the energy graphs generated from previous lab data, the group identified the
most efficient commands and modified the code accordingly. The strategy of the modifications and the
result of the modifications will be discussed with graphical data.
Results & Discussion
With the help of previous labs, Group J was able to program their AEV to complete the mission
highlighted in the Mission Concept Review. The MCR required the AEV to complete the track in less than
2.5 minutes while bringing back an R2-D2 caboose. More specifically, the vehicle was to start from the
gate, travel around the track to the next gate and wait 8 seconds for it to open. Once that gate opened,
the AEV was to continue down the track, pick up the R2-D2 caboose and wait an additional 5 seconds
before moving back to the gate and the ending position. With these constraints in mind, the Group was
able to successfully write a program to complete the mission.
In order to make the most efficient vehicle, the group had to modify their code between the previous
lab and lab 10 in order to account for additional stopping time between picking up the caboose and
going back to the track. The members misread the MCR and had forgotten to include this stoppage time.
Once they realized their mistake, they added a goFor(5) command, figure 4, which enabled their vehicle
to wait 5 seconds after picking up the caboose.
Since the main focus of lab 10 was to optimize energy, the group used their working code and compared
various commands in order to see which ones required the least amount of energy. For example, once
their AEV had picked up the caboose, they used a celerate command which set the AEV to 50% power.
Since using 50% power throughout would use a very large amount of power, the group followed the
celerate command by a motorSpeed command that decreased the power to 35%. This can be seen in
the appended code, figure 4. This ensured the AEV had enough power to start moving with the caboose
in tow. Once it had enough momentum going, it was able to decrease power but continue moving to the
absolute position indicated in the code. Another way the group decreased the amount of energy was to
decrease the braking power but increase the amount of time it took to brake. The group was able to
recognize that the brake required more energy when the vehicle was moving at 35% for 1 second than a
brake of 25% for 2 seconds. Another programming strategy the group employed was to use trial and
error in order to minimize energy. Initially, the group had an idea of which commands would require
more energy, but through the use of multiple tests they were able to determine which combination of
motorSpeed, absolute position, and brake were the most efficient in completing the task.
While the AEV was running on the track, it appeared to be fairly balanced throughout. The AEV had a
good speed while traveling around the bends and did not attempt to fly off the track. The group was
slightly concerned that 50% power, while towing the caboose back to the gate, would be too high and
cause the AEV to fall off the track. However, this was not an issue and also did not use a large amount of
energy. Similarly, the group was concerned that a brake less than 25%, seen in figure 4 line 44, would
not be sufficient, but they were able to see that it was enough to slow down the vehicle. Overall, the
AEV did not undergo any significant changes between runs which allowed the group to predict the
outcome of various changes in commands.
While the group was focused on making the AEV more energy efficient, they never thought about
comparing the energy usage to the previous run while making their optimizations. This never happened
until the group completed optimizing the energy usage. Figure 1 below shows the energy usage over
time of the AEV after the optimizations have been completed.
FIgure 1: Power vs. Time graph
After looking at Figure 1, the group noticed that there weren’t as many peaks as the last run. The peaks
on the graph are caused by using the motorSpeed() command without using the celerate() command
immediately prior to it. As it can be seen in Figure 4, this is only done while braking the AEV. The group
knew this so they tried to minimize the braking as much as possible by cutting power sooner and letting
the AEV coast further. With the AEV coasting further, this also let the group turn down the power for the
braking since the AEV will already have slowed down from coasting a further distance.
FIgure 3: Phase breakdown of AEV run
Figure 3 shows the phase breakdown of the group’s most recent AEV run after optimizing the energy
usage. As the graph shows phases 3, 5, and 15 are the largest phases on the graph. These are all phases
after the brake() command was issued. This means that these phases are where the AEV is coasting
around the track. These long phases where the AEV is coasting were not in the previous runs of the AEV
for this group.
The previous energy usage for Group J was 250 Joules. As shown in Table 1, the total Energy usage for
Group J’s optimized run was 207 Joules. Compared to the previous run, the optimizations that Group J
did to the AEV worked quite well. The group was able to use approximately 43 Joules less than previous
runs. These optimizations were done by increasing the times that the AEV coasted around the track.
With coasting around the track more, the group was able to turn the power of the braking down as well
which saved even more energy.
Potential errors for Group J on this optimization run are very few. There is the potential error of not
optimizing the AEV as much as possible. The group was able to optimize the code, however they never
thought about trying to optimize the hardware of the AEV. For example they could have tried adding
more weight to give the AEV more momentum and, therefore, allowing the AEV to coast further. The
group also didn’t try doing anything with propellers or motors and changing their configuration at all.
Maybe if the group flipped the propellers, there could have been a difference in performance and then
also in efficiency.
During performance test 3, battery and track variation were the main cause of this re-evaluation of
coding. The team had to continually re-write and make several trial runs to make an accurate set of
coding for each of the tracks. The team came up with the idea of creating two sets of code for each of
the different tracks. The inconsistency in battery charge and in batteries being avaliable lead to
inconsistent runs and continual trial runs. To gauge this problem, the group tried to acquire the same
battery that has a black mark on it initially every test to maximize the accuracy of each runs. When the
battery runs out of power, which causes the coding to become too inconsistent, the team will try to get
a fresh and newly charged battery from the TA.
Recommendations & Conclusion
There are several methods to resolve the errors can be recommended for the group. One of the errors
that occurred during the lab was that the battery and track variation being the main cause of this reevaluation of coding. During the lab, the group had to continually re‐write and make several trial of runs
to make an accurate set of coding. Hence, the team suggests that every teams should be provided with
the exact same battery they used every lab and make sure they are fully charged. This is because
different batteries provide slightly different power. It derails the process and is usually the main cause of
this re‐evaluation of coding. By using the same batteries every test runs, every team will have have more
consistent runs every time during the lab and it is able to prevent accidents for example, the AEV goes
too fast and hit the caboose or gate while damaging them from happening. Besides that, the tracks in
three different lab have different length. The group also have to re‐code according to the track we use
on that day. The group suggests the lab to be carried out at the same lab every time in order to save
time and allow the team to maximise the efficiency of the code they are running.
In conclusion, by studying the energy usage of various commands and trial and error, the group
generated a code that used minimum energy needed to complete the mission with required criterias.
With trial data, the group concluded the most efficient commands were motorSpeed(),
goToAbsolutePosition(), and brake(). The celerate() command, an inefficient command, was utilized only
for the AEV to gain momentum to move forward. The group used motorSpeed() which used the least
amount of energy for the AEV to continue moving. Lastly, the usage of brake() allowed the AEV to coast
along the track without using any energy. By using similar strategies throughout the mission, the group
maximized efficiency and decreased the total energy needed to 207 Joules.
Appendix
FIgure 2: Power vs. Distance graph
Table 1: Raw AEV Data
Marks
Time (wheel
(ms) counts)
Time
(s)
Current Voltage Distance Position Speed
(A)
(V)
(m)
(m)
(m/s)
Input
Power
(W)
Incremental
Energy (J)
Total
Energy
(J)
1501
1
1.501
0.7921
7.6172
0.0124
-0.0124 0.2064
6.0338
0.3531
3.7205
1561
1
1.561
0.896
7.6025
0.0124
-0.0124
0
6.8119
0.3854
4.1059
1621
1
1.621
0.87
7.6025
0.0124
-0.0124
0
6.6145
0.4028
4.5087
1681
2
1.681
0.8311
7.6025
0.0248
0 0.2064
6.3183
0.388
4.8967
1741
2
1.741
0.9999
7.6025
0.0248
0
0
7.6017
0.4176
5.3143
1801
3
1.801
0.9869
7.5879
0.0371
0.0124 0.2064
7.4886
0.4527
5.767
1861
3
1.861
1.0518
7.5732
0.0371
0.0124
0
7.9658
0.4636
6.2306
1921
4
1.921
1.1168
7.5732
0.0495
0.0248 0.2064
8.4575
0.4927
6.7233
1981
5
1.981
1.1427
7.5586
0.0619
0.0371 0.2064
8.6375
0.5129
7.2361
2041
6
2.041
1.3375
7.5439
0.0743
0.0495 0.2064 10.0902
0.5618
7.798
2101
7
2.101
1.2856
7.5439
0.0867
0.0619 0.2064
9.6983
0.5937
8.3916
2161
8
2.161
1.2336
7.5439
0.0991
0.0743 0.2064
9.3065
0.5701
8.9618
2221
9
2.221
1.2596
7.5439
0.1114
0.0867 0.2064
9.5024
0.5643
9.526
2281
10
2.281
1.2856
7.5439
0.1238
0.0991 0.2064
9.6983
0.576
10.1021
2341
12
2.341
1.3505
7.5439
0.1486
0.1238 0.4127 10.1881
0.5966
10.6987
2401
13
2.401
1.2596
7.5586
0.161
0.1362 0.2064
9.5209
0.5913
11.2899
2461
15
2.461
1.3375
7.5439
0.1857
0.161 0.4127 10.0902
0.5883
11.8783
2521
17
2.521
1.2986
7.5586
0.2105
0.1857 0.4127
9.8153
0.5972
12.4754
2581
19
2.581
1.2856
7.5439
0.2353
0.2105 0.4127
9.6983
0.5854
13.0608
2641
21
2.641
1.2596
7.5586
0.26
0.2353 0.4127
9.5209
0.5766
13.6374
2701
23
2.701
1.3505
7.5439
0.2848
0.26 0.4128 10.1881
0.5913
14.2287
2761
25
2.761
1.2726
7.5439
0.3096
0.2848 0.4127
9.6004
0.5937
14.8223
2821
27
2.821
1.3635
7.5439
0.3343
0.3096 0.4128 10.2861
0.5966
15.4189
2881
30
2.881
1.2726
7.5439
0.3715
0.3467 0.6191
9.6004
0.5966
16.0155
2941
32
2.941
1.2466
7.5439
0.3962
0.3715 0.4127
9.4044
0.5701
16.5857
3001
35
3.001
1.3245
7.5586
0.4334
0.4086 0.6191 10.0116
0.5825
17.1682
3061
37
3.061
1.2726
7.5439
0.4582
0.4334 0.4127
9.6004
0.5884
17.7565
3121
40
3.121
1.2856
7.5439
0.4953
0.4705 0.6191
9.6983
0.579
18.3355
3181
43
3.181
1.3505
7.5439
0.5324
0.5077 0.6191 10.1881
0.5966
18.9321
58863
1614 58.863
1.4024
7.8369 19.9854
0.3962 0.2064 10.9909
0.6656 199.9649
58923
1616 58.923
1.4284
7.8369 20.0101
0.3715 0.4127 11.1944
0.6656 200.6304
58983
1618 58.983
1.4154
7.8369 20.0349
0.3467 0.4128 11.0926
0.6686 201.2991
59043
1619 59.043
1.4284
7.8369 20.0473
0.3343 0.2064 11.1944
0.6686 201.9677
59103
1620 59.103
1.4024
7.8369 20.0596
0.3219 0.2064 10.9909
0.6656 202.6332
59163
1622 59.163
1.4544
7.8369 20.0844
0.2972 0.4128 11.3979
0.6717 203.3049
59223
1623 59.223
1.4154
7.8369 20.0968
0.2848 0.2064 11.0926
0.6747 203.9796
59283
1624 59.283
1.4414
7.8369 20.1092
0.2724 0.2064 11.2962
0.6717 204.6513
59343
1625 59.343
1.4154
7.8369 20.1216
0.26 0.2064 11.0926
0.6717 205.3229
59403
1626 59.403
1.3895
7.8369 20.1339
0.2476 0.2064 10.8891
0.6595 205.9824
59463
1627 59.463
1.3895
7.8369 20.1463
0.2353 0.2064 10.8891
0.6533 206.6357
59523
1627 59.523
1.4154
7.8369 20.1463
0.2353
0.6595 207.2952
59583
1628 59.583
0
8.0859 20.1587
0.2229 0.2064
59643
1628 59.643
0.013
8.0859 20.1587
0.2229
0
0.105
0.0032 207.6311
59703
1629 59.703
0.013
8.0859 20.1711
0.2105 0.2064
0.105
0.0063 207.6374
59763
1629 59.763
0
8.0859 20.1711
0.2105
0
0
0.0032 207.6406
59823
1630 59.823
0.013
8.0859 20.1835
0.1981 0.2064
0.105
0.0032 207.6437
59883
1630 59.883
0
8.0859 20.1835
0.1981
0
0.0032 207.6469
0 11.0926
0
0
0.3328
207.628
reverse(4);
//===================================================
//
GO TO GATE
//===================================================
// accelerate all motors from start to 35% power in 2 seconds
celerate(4,0,35,2);
// Run all motors at a constant speed (35% power)
motorSpeed(4,35);
goToAbsolutePosition(50);
motorSpeed(4,15);
// Travel a distance of 13.5 feet
goToAbsolutePosition(280);
brake(4);
goToAbsolutePosition(365);
// Reverse all motors
reverse(4);
// All motors at 25% power
motorSpeed(4,25);
// For 1 sec
goFor(1);
// Brake all motors
brake(4);
//===================================================
//
WAIT FOR GATE TO OPEN
//===================================================
goFor(8);
//===================================================
//
GO TO END TO PICK UP CABOOSE
//===================================================
// Make the motors go forward again
reverse(4);
// accelerate all motors from start to 35% power in 2 seconds
celerate(4,0,35,2);
// Run all motors at a constant speed (35% power)
motorSpeed(4,35);
goToAbsolutePosition(430);
motorSpeed(4,15);
// Travel a distance of 13.5 feet
goToAbsolutePosition(725);
brake(4);
goToAbsolutePosition(790);
// Reverse all motors
reverse(4);
// All motors at 23% power
motorSpeed(4,23);
// For 1 sec
goFor(1);
// Brake all motors
brake(4);
goFor(5);
//===================================================
//
GO BACK TO GATE AFTER CABOOSE PICK UP
//===================================================
// accelerate all motors from start to 50% power in 2 seconds
celerate(4,0,50,2);
// Run all motors at a constant speed (50% power)
motorSpeed(4,50);
goToAbsolutePosition(740);
motorSpeed(4,30);
// Travel a distance of 13.5 feet
goToAbsolutePosition(570);
brake(4);
goToAbsolutePosition(500);
// Reverse all motors
reverse(4);
// All motors at 30% power
motorSpeed(4,30);
// For 1 sec
goFor(1);
// Brake all motors
brake(4);
//===================================================
//
WAIT FOR GATE TO OPEN
//===================================================
goFor(8);
//===================================================
// GO BACK TO START FROM GATE WITH PACKAGE
//===================================================
// Reverse all motors
reverse(4);
// accelerate all motors from start to 50% power in 2 seconds
celerate(4,0,50,2);
goToRelativePosition(-50);
motorSpeed(4,35);
// Travel a distance of 13.5 feet
goToAbsolutePosition(150);
brake(4);
goToAbsolutePosition(90);
// Reverse all motors
reverse(4);
// All motors at 40% power
motorSpeed(4,40);
// For 1 sec
goFor(2);
// Brake all motors
brake(4);
Figure 4: AEV Arduino Code to Complete Mission