Objective:
- Become familiar with the automatic control system hardware components.
- Setup the AEV software.
- Program the basic function calls in controlling the AEV.
- Be able to upload programs on the Arduino and test.
- Become familiar with troubleshooting techniques.
Arduino Code:
//Accelerate motor one from start to 15% power in 2.5 seconds
ccelerate(1,0.15.2.5);
//Run motor one at a constant speed (15% power for 1 second
motorSpeed(1,15);
goFor(1);
// Brake motor one.
brake(1);
//Accelerate motor two from start to 27% power in 4 seconds.
ccelerate(2,0.27.4);
//Run motor two at a constant speed (27% power) for 2.7 seconds.
motorSpeed(2,27);
goFor(2.7);
//Decelerate motor two to 15% power in 1 second.
ccelerate(0,27.15.1);
//Brake motor two.
brake(2);
//Reverse the direction of only motor 2.
reverse(2);
//Accelerate all motors from start to 31% power in 2 seconds.
ccelerate(4,0.31.2);
//Run all motors at a constant speed of 35% power for 1 second.
motorSpeed(4,35);
goFor(1);
//Brake motor two but keep motor one running at a constant speed (35% power) for 3 seconds
brake(2);
motorSpeed(1,35);
goFor(3);
//Brake all motors for 1 second.
motorSpeed(4,0);
goFor(1);
//Reverse the direction of motor one.
reverse(1);
//Accelerate motor one from start to 19% power over 2 seconds
ccelerate(1,0,19,2);
//Run motor two at 35% power while simultaneously running motor one 19% power for 2 seconds.
motorSpeed(2,35);
goFor(2);
motorSpeed(1,19);
goFor(2);
// Run both motors at a constant speed (19% power) for 2 seconds.
motorSpeed(4,19);
goFor(2);
//Decelerate both motors to 0% power in 3 seconds.
ccelerate(4,19,0,3);
//Brake all motors.
brake(4);
Questions:
- Comment on the performance of the electric motors (i.e., in scenario 1 line 1, did the propeller begin to rotate at the start of the program or was there Resistance observed in the motor to rotate the propeller at low speeds?).
The propeller began to rotate at the start of the program at a higher speed which was fixed by changing the data output in the code to rotate the propellers at a lower speed.