For this experiment the AEV was tested with another code, and using the tools within MATLAB and excel two graphs were made to show power consumption vs time and distance. MATLAB is a coding program that is used to analyze the results of this lab, and then exported to Excel to make the graphs look better. This will help better visualize all data collected from future labs and tests. Two graphs were made, power vs time and distance with an explanation of what the AEV is doing below, each one with the code below and all explanations.
Power vs Time graph
As seen in the graph, the first .25 seconds has a spike of power, because the vehicle is reversing its motors, this is because the way the motors were setup on the vehicle the motors pushed the opposite direction the team wanted it to go. With the motors corrected to turn the other direction the AEV is able to accelerate, this is shown by the constant increase in power in the graph over time as the motors build up to the speed needed. Then around 2.8 seconds the line goes flat and stays flat for about two seconds, this is because the motors are told to maintain a constant speed for the two seconds. Then from four to about 5.5 seconds on the graph the line is flat, but it is lower than the original flat part. This is caused by the motors dropping down to a lower speed almost instantly and maintaining that speed fora few seconds. Then there is a spike in energy from telling the motors to reverse again so the AEV can be stopped when the motors are turned on. With the motors rotating the opposite direction to stop the AEV the motors push at a constant speed until it reaches about the 8 second mark. Afterwards, the motors are stopped with the brake command and the AEV is stopped completely.
Power vs distance graph
Explaining the distance graph is going to be similar to the previous graph. In this graph the initial spike of reversing the motors is not noticeable due to the recording only happening when movement is noticed. The small initial slope between 0 and 0.1 meters is when the motors are accelerating, this slope is much smaller than the time graph because the AEV does not move as much. Once the motors have reached the constant speed though the AEV is moving with a almost constant power usage line. From 0.1 to 0.3 meters the motors are both running at 25% power, then the speed is reduced to 20%. However, with the AEV already moving reducing the speed does not affect the distance as much as it would if it were going from a stand still. Then the spike is from the motors reversing to slow down the vehicle. This graph shows how when slowing down the AEV the vehicle does not stop immediately though, with the vehicle still traveling from 1.3 to 1.8 meters. Then the motors are stopped completely with the vehicle at rest. This graph visually represents what is going on when the AEV is trying to slow down with the propellers and how slow it can be at doing so, this will be taken into consideration when making codes from that point on.
Code Used:
Refer here for information on command functions.
Code |
Explanation |
reverse(4);
celerate(4,0,25,3); |
Reverse all motors so they are rotating the opposite direction, and then accelerate all motors from 0% to 25% in 3 seconds. |
motorSpeed(4,25);
goFor(1); |
Run all the motors at 25% for one second. |
motorSpeed(4,20);
goFor(2); |
After the one second run all the motors at 20% for two seconds. |
reverse(4);
motorSpeed(4,25); goFor(2); |
Reverse all motors again to make sure the motors will slow down the AEV by pushing air the opposite direction. Run the motors at 25% for two seconds to make sure the AEV isn’t moving. |
brake(4); | Turn off all motors. |