- In performance test two, two codes have been prepared for the same mission using the same design from performance test one. The two sets of codes are provided below:
goFor(5);//Run all motors at a constant speed (25% power) for 5 seconds
-
In code one, goToAbsolutePosition() was used, and in code two, motorSpeed() and goFor() were used. The differences between the two codes are highlighted in red.
- goToAbsolutePosition() can easily be measured and calculated before running tests, which can save significant amounts of time during the lab, but the reflectance sensor is not accurate if the battery is not warmed up enough. Also, Team K observed that the lighting differences between rooms can also affect the reflectance sensors.
- motorSpeed() and goFor() commands needs to be tested for several times before being correctly implemented in the code.
- For the power used by AEV, motorSpeed() and goFor() can be used to save more energy than goToAbsolutePosition(). The plots of Power vs. Distance and Power vs. Time are provided below.
Figure 1: power vs. distance
Figure 2: power vs. time
Blue line: goToAbsolutePosition()
Red line: motorSpeed()+goFor()
- As shown by the plots, the goToAbsolutePosition() used more energy than the motorSpeed() and goFor() functions in the acceleration process. This was seen more prominently when the AEV arrived at the first gate sensor and used power braking to stop.
- In conclusion, each of these commands will all be used in future testing, because both of them have their own advantages and disadvantages. For the descending slope on the track, coasting will be used to save power for AEV. Power braking will be used for when the AEV is reaching the first sensor of the gate, connecting the caboose, and stopping at the original position, so the AEV can land at an accurate position and recoils can be avoided.