Exercise 4 Code & Graphs

Figure 1: Power (Watts) v. Time (Seconds)

Figure 1 displays the results from the Design Analysis Tool exercise. The graph shows the change in power transmitted to the motors of the AEV over time. First, as the power outputted to the motors accelerated both the motors at 25% power from t = 0 to t = 3 seconds which the slope of the graph increased as well. Then, the AEV maintain the motor speed at 25% power for 1 second, therefore, the power input remained constant from t = 3 to t = 4 seconds.  Next, the AEV decreased the motor speed from 25% power to 20% power which caused the power input to decrease from t = 4 to t = 6 seconds.  Additionally, the slope sharply increased around four seconds, which may have been due to a time gap in coding causing the motors to rest for a small time interval. As the AEV switched direction around six seconds, the power energy input increased drastically to switch the power of the motors to the opposite direction. And the motors then run at 25% constant power for from t = 6 to t = 8 seconds. The power input decreased to zero at approximately eight seconds causing the AEV to come to a stop.

Figure 2: Power (Watts) v. Distance (Meters)

Figure 2 shows a similar shape to that of Figure 1. The slope represents impulse, or the change in momentum under ideal conditions. Equation 1 below calculates how the electric energy was converted to the kinetic energy of motor. Equation 2 shows the slope is actually the impulse.When the AEV accelerates from rest to 25% power within the first few seconds, the slope increases sharply.  As the motor reaches the power constant of 25%, the slope of the graph also becomes constant, displaying the AEV moving at a constant speed. As the power decreases to 20% for 20 seconds, the momentum decreases and the distance increases. The momentum drastically increases when the direction changes around 0.1 meters, and finally decreases as the AEV brakes and comes to a rest at approximately 0.2 meters.

This exercise showed us the relationship power has with distance and time as we further code our AEV, keeping in mind that energy and time both affect the cost of our Final Performance Test Run.

Code

// Accelerate motor one from start to 15% power in 2.5 seconds
celerate(4,0,25,3);

// Run all motors at a constant speed (25% power) for 1 second.
motorSpeed(4,25);
goFor(1);

// Run all motors at 20% power for 2 seconds.
motorSpeed(4,20);
goFor(2);

//Reverse all motors.
reverse(4);

//Run all motors at a constant speed (25% power) for 2 second.
motorSpeed(4,25);
goFor(2);

// Brake all motors.
brake(4);