AEV Controller Command Glossary
Demand | Arduino Function | Reasoning |
1 | celerate(1,0,15,2.5); | Celerate forces motor 1 to start from 0 power to 13% over 2.5 seconds by using the Celerate command function |
2 | goFor(1); | goFor causes the motor to run at the percent power that the motor was already at. The 1 made it run at the constant power for 1 second |
3 | brake(1); | Using the brake call, motor one will brake |
4 | celerate(2,0,27,4); | Using the celerate call, motor 2 will accelerate from 0 to 27% power over |
5 | goFor(2.7); | Cause the motor to run at a constant speed for 2.7 seconds using command call goFor. |
6 | celerate(2,27,15,1); | Using celerate, the initial power is higher than the final power causing the motor to decelerate. |
7 | brake(2); | Brake will cause motor 2 to stop |
8 | reverse(2); | Using the reverse command, motor two will reverse its direction. |
9 | celerate(4,0,31,2); | Using celerate, the number motor is “4” to select all motors causing them to accelerate from rest to 31% power over the two seconds. |
10 | motorSpeed(4,35); | Using command motorSpeed, the motors “4” will increase in power to 35%. |
11 | goFor(1); | The command of motorSpeed will “goFor” 1 second which is called to do in step 10. |
12 | brake(2); | Using brake, motor 2 will be stopped while motor 1 continues to run. |
13 | motorSpeed(2,35); | The motorSpeed function will force motor 2 to run at 35% power. |
14 | motorSpeed(1,19); | Using motorSpeed, motor 1 will then accelerate to 19% power due to it already starting at rest. |
15 | goFor(2); | Motors run for 2 seconds. |
16 | motorSpeed(4,19); | All motors then run at 19% causing motor 2 to decelerate. |
17 | goFor(2); | Both motors run for 2 seconds at 19% power. |
18 | celerate(4,19,0,3); | All motors decelerate from 19% to 0% over 3 seconds. |
19 | brake(4); | Once the motors decelerate to 0% they are stopped using the break “4” for all motors. |
Basic Function Calls
Function Call | Function | Example |
celerate(m,p1,p2,t); |
Accelerates or decelerates motor(s) m from start speed (%) p1 to end speed (%) p2 over a duration of t seconds | celerate(1,20,45,2);
Accelerates motor 1 from 20% to 45% power in 2 seconds |
motorSpeed(m,p); |
Initializes motor(s) m at percent power p |
motorSpeed(2,16);
Sets motor 2 speed to 16% power |
goFor(t); |
Runs the motor(s) at their initialized state for t seconds |
goFor(5);
Runs the motor(s) at their initialized state for 5 seconds |
brake(m); |
Brakes motor(s) m. Note: This does NOT brake the AEV, just stops the motors from spinning | brake(4);
Cuts the power to all motors |
reverse(m); |
Reverses the polarity of motor(s) m |
reverse(1);
Reverses polarity of motor 1 |
goToRelativePosition(n); |
Continues the previous command for n marks from the vehicle’s current position. n can be positive or negative, with positive meaning the vehicle is moving forward, negative meaning the vehicle is moving backward | motorSpeed(4,20);
goToRelativePosition(30);
All motors are set to 20% power, and they will continue to run at 20% power until the AEV reaches 30 marks from its current position |
goToAbsolutePosition(n); |
Continues the previous command for n marks relative to the overall starting position of the AEV |
motorSpeed(4,20);
goToAbsolutePosition(300);
All motors are set to 20% power, and they will continue to run at 20% power until the AEV reaches 300 marks from its starting position |