Performance Test Two

  • 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:

Performance Test 2 Code 1 
celerate(4,0,25,3);//Accelerate all motors from start to  25% in 3 seconds.
motorSpeed(4,25);
goToAbsolutePosition(244);//Run all motors at a constant speed (25% power) for 2 second and using the goToAbsolutePosition function travel a total distance of 244 marks.
reverse(4);//Reverse all motors.
motorSpeed(4,25);
goFor(2);//Run all motors at a constant speed (25% power) for 2 second.
brake(4);//Brake all motors
goFor(6);//For 6 seconds
reverse(4);//Reverse all motors
celerate(4,0,25,3);//Accelerate all motors from start to  25% in 3 seconds.
motorSpeed(4,25);
goFor(2);//Run all motors at a constant speed (25% power) for 2 second
brake(4);//Brake all motors
goFor(13);//For 13 seconds
reverse (4);//Reverse all motors
celerate(4,0,50,3);//Accelerate all motors from start to  50% in 3 seconds.
motorSpeed(4,50);//Run all motors at a constant speed (50% power)
goFor(2);//For 2 seconds

Performance Test 2 Code 2 
celerate(4,0,25,3);//Accelerate all motors from start to  25% in 3 seconds.
motorSpeed(4,25);
goFor(5);//Run all motors at a constant speed (25% power) for 5 seconds
reverse(4);//Reverse all motors.
motorSpeed(4,18);
goFor(2);//Run all motors at a constant speed (18% power) for 2 second.
brake(4);//Brake all motors
goFor(6);//For 6 seconds
reverse(4);//Reverse all motors
celerate(4,0,25,3);//Accelerate all motors from start to  25% in 3 seconds.
motorSpeed(4,25);
goFor(2);//Run all motors at a constant speed (25% power) for 2 second
brake(4);//Brake all motors
goFor(13);//For 13 seconds
reverse (4);//Reverse all motors
celerate(4,0,50,3);//Accelerate all motors from start to  50% in 3 seconds.
motorSpeed(4,50);//Run all motors at a constant speed (50% power)
goFor(2);//For 2 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.