The data analysis portion of the first development phase served as an introduction to collecting data from the AEV. A MATLAB program was provided to Team B that would extract data that the Arduino collects during a test run. The code shown below was then tested and data was collected so the team could become familiar with the data extraction process.
The data collected and the code can be seen below.
Arduino Code For Data Analysis
Code | Comments |
---|---|
celerate(4,0,25,3); | //accelerate both motors from 0% to 25% power over 3 seconds |
motorSpeed(4,25); | //keep both motors running at 25% power |
goFor(1); | //continue current settings for 1 second |
motorSpeed(4,20); | //set both motors to run at 20% power |
goFor(2); | //continue current settings for 2 seconds |
reverse(4); | //reverse the rotation of both motors |
motorSpeed(4,25); | //set both motors to 25% |
goFor(2); | //continue current settings for 2 seconds |
brake(4); | //brake all motors |
All code commands are explained in the Arduino Code Glossary.
Graph comparing the Power used by the motors vs. the time recorded during the test run
For the power vs time graph shown above, the curve takes a gradual incline for 3 seconds as it reaches the required power. This is shown in the code in line 1 when the AEV accelerates to 25% power. The graph then levels out as the AEV continued at the current power for the proceeding one second. Then while looking at the code, line 3 updates the AEV by decreasing the motor power and continues for 2 more seconds. This is shown in the graph by the flat line from 4 seconds to 6 seconds. The graph then takes a sudden spike back up to the previous power for another 2 seconds before dropping off to zero as the motors were shut off, as seen in line 6 of the code. The large spike in the graph seen at 6 seconds was caused by the “reverse(4);” line in the code when the AEV reverses the direction of its motors.
Graph comparing the Power used by the motors vs. the distance the AEV traveled during the test run
The power v Distance graph shows a short, steep slope at the very beginning where there is little movement because the motors are only just starting to accelerate with correlation to the code (shown above) in line 1. Then the line flattens out as the power stays constant and causes the AEV to advance on its position as seen in line 2. The curve then takes a massive drop as the code details that the motor speed had been decrease in line 3 and continues advancing on its current position. The graph has a sudden spike at 0.6 meters as the motors were reversed as seen in line 6 of the code. Finally, there is a quick drop off as the line drops all the way down to 0 because the brakes were applied to the motors in correlation to line 9 of the code and comes to a halt.
The data analysis tool will be used in future tests to assess the power consumption of the teams different AEV desings. This will allow the team to choose the most energy efficient design and achieve their goal.