In this lab, the main task was to operate the model AEV using the Arduino functions. We had to build the sample AEV before coming to this lab. After installing the functions into the Arduino nano, we needed to test the AEV on the test track located in the Engineering room. Brandon typed out the functions and downloaded it onto the Arduino Nano and then Jacob, Cameron, and Payne all went to the test track to test the AEV out and make sure that it worked. Then after we tested it, we realized that there wasn’t enough power to move the AEV, so we increased our power of the motors to make sure it moved.
We learned that the original code for the AEV to move didn’t have enough power going to the motors to actually get it to move on the test track. So we went into the coding and increased the percent of the power that we need to use. For the testing that we have done, we have never had the battery at full charge. For the next tests, we need to make sure that the battery is at full charge so that we can have an accurate measurement of how much power is needed to move the AEV.
Code Used:
Refer here for information on command functions.
Code | Explanation |
celerate(1,0,15,2.5);
motorSpeed(1,15); goFor(1); brake(1); |
Accelerates motor 1 from start to 15% power in 2.5 seconds. Sets motor 1 at 15% power. Runs the motor for 1 second. Then brakes motor 1. |
celerate(2,0,27,4);
motorSpeed(2,27); goFor(2.7); brake(2); |
Accelerate motor 2 from start to 27% power in 4 seconds. Sets motor 2 at 27% power. Runs motor for 2.7 seconds. Then brakes motor 2. |
reverse(2); | Reverse the direction of motor 2 |
celerate(4,0,31,2);
motorSpeed(4,35); goFor(1); brake(2); |
Accelerate all motors from start to 31% power in 2 seconds. Sets all motors at 35% power. Runs motors for 1 second. Then brakes motor 2 |
motorSpeed(1,35);
goFor(3); brake(4); |
Sets motor 1 at 35% power. Runs motors for 3 seconds. Then brakes all motors |
goFor(1); | Pauses for 1 second |
reverse(1); | Reverse motor 1 |
celerate(1,0,19,2);
motorSpeed(2,35); motorSpeed(1,19); goFor(2); |
Accelerate motor 1 from start to 19% power in 2 seconds. Sets motor 2 at 35% power. Sets motor 1 at 19% power. Runs motors for 2 seconds. |
motorSpeed(4,19);
goFor(2); celerate(4,19,0,3); brake(4); |
Accelerate all motors from 19% power to 0% power in 3 seconds. Then brake all motors |