Intro. To Arduino

“The AEV Controller is a custom-made automatic controller and performance recorder system featuring an off-the-shelf Arduino Nano microcontroller and two motor chips. This system was designed to be light weight (~43 grams), small for product design (1.2” x 3.7” x 0.625”), and to make use of a simple microcontroller with easy to use software.

AEV Controller and Arduino

For more details on the motherboard layout and external parts and assembly see the AEV Controller & Arduino User Manual. The Arduino Nano is considered the heart of the AEV controller and will be used to control motor speeds, the time or distance the motors run for, and recording system data. The Arduino Nano microcontroller uses the open source Arduino Integrated Development Editor (IDE).” (Preliminary R&D Lab Manual pg. 4).

Below are the basic function calls for controlling the motors via the Arduino:

Source: Preliminary R&D Lab Manual pg. 5

Basic Examples of Arduino Code:

1.Run motor one at a constant speed (23% power) for 2.5 second.
       motorSpeed(1,23);
       goFor(2.5);
2.Accelerate motor one from start to 15% power in 2.5 seconds.
       celerate(1,0,15,2.5);
3.Run motor one at a constant speed (15% power) for 1 second.
       motorSpeed(1,15);
       goFor(1);
4.Brake motor one.
       brake(1);
       goFor(4);
5.Accelerate motor two from start to 27% power in 4 seconds.
       celerate(2,0,27,4);
6.Run motor two at a constant speed (27% power) for 2.7 seconds.
       motorSpeed(2,27);
       goFor(2.7);
7.Decelerate motor two to 15% power in 1 second.
       celerate(2,27,15,1);
8.Brake motor two.
       brake(2);
9.Reverse the direction of only motor 2.
       reverse(2);
10.Accelerate all motors from start to 31% power in 2 seconds.
       celerate(4,0,31,2);
11.Run all motors at a constant speed of 35% power for 1 second.
       motorSpeed(4,35);
       goFor(1);
12.Brake motor two but keep motor one running at a constant speed (35% power) for 3 seconds.
       brake(2);
       motorSpeed(1,35);
       goFor(3);
13.Brake all motors for 1 second.
       brake(4);
       goFor(1);
14.Reverse the direction of motor one.
       reverse(1);
15.Accelerate motor one from start to 19% power over 2 seconds.
       celerate(1,0,19,2);
16.Run motor two at 35% power while simultaneously running motor one at 19% power for 2 seconds.
       motorSpeed(2,35);
       motorSpeed(1,19);
       goFor(2);
17.Run both motors at a constant speed (19% power) for 2 seconds.
       motorSpeed(4,19);
       goFor(2);
18.Decelerate both motors to 0% power in 3 seconds.
       celerate(4,19,0,3);
19.Brake all motors.
       brake(4);