NOTE: This lab could not be completed by this group before the time of Website Update 2 due to technical difficulties. The data shown here is sample data (except for the code) that will be used to complete the questions.
Deliverables:
1.) Power vs. Distance and Power vs. Time Plots:
Power vs. Distance:
Power vs. Time:
2.) Explanations of Data from Plots:
Note: Since these are sample data graphs, they do not relate to the code. Observations are still made in reference to the programming in general however.
Power vs. Distance:
The initial spike at the beginning was from the motors starting up. The areas of a smooth trend were from the AEV moving at a constant speed executed by motorSpeed(m,p); function. The sudden drop at around 2.5 meters was caused by power being shut off to the motors from the break(m); function. In this case both motors were shut off. Areas of upward trend were from the AEV accelerating from the celerate(m,p1,p2,t); function with p1<p2 (if p1>p2, the AEV would be decelerating and cause a downward trend to appear in the plot). The large spike near the end was from the reverse(m); function causing the motors to reverse polarity. The last stretch of constant power was from another motorSpeed(m,p); function being executed.
Power vs. Time:
The Power vs. Time plot can be described the same as the Power vs. Distance plot for all sections except the beginning. Instead of a initial spike, the plot showed an upward trend like the accelerating areas. The difference was because when the motors start up, the AEV is not moving, causing a spike in the distance plot, but time was passing so it caused a upward trend in the time plot.
3.) Code Associated with Lab 4:
celerate(4,0,25,3); %% Accelerates all motors from 0% to 25% power in 3 seconds
motorSpeed(4,25);
goFor(1); %% Runs all motors at 25% power for 1 second
motorSpeed(4,20);
goFor(2); %% Runs all motors at 20% power for 2 seconds
reverse(4); %% Reverses all motors
motorSpeed(4,25);
goFor(2); %% Runs all motors at 25% power for 2 seconds (in reversed direction)
brake(4); %% Stops all motors