AEV Project Codes

Code Explanation

Code Function Example
celerate(m,p1,p2,t); Acccelerates/decelerates motor(s) “m” from start speed (%) “p1” to end speed (%) “p2” over a duration of “t” seconds celerate(4,15,25,3); Accelerates all motors from 15% to 25% power in 3 seconds
motorSpeed(m,p); Sets motor(s) “m” at percent power “p” motorSpeed(2,22); sets motor 2 speed to 22% power
goFor(t); Runs the motor(s) at the set state for “t” seconds goFor(10); Runs the motor(s) at their set state 10 seconds
brake(m); Cuts the power to the AEV motor(s) “m” brake(1); Cuts power to motor 1
reverse(m); Reverses the motor(s) “m” polarity reverse(2); reverse the polarity of motor 2
goToRelativePosition(n); Continues the prior command for “n” marks from the vehicle’s current location and can be positive or negative (forward or backward) vehicle movement motorSpeed(4,22); goToRelativePosition(15); All motors set to 22% and they will run at that power until the AEV reaches 15 marks from current position
goToAbsolutePosition(n); Continues the prior comand for “n” marks relative to the overall starting position of the AEV motorSpeed(4,22); goToAbsolutePosition(100); All motors set to 22% and they will run at that power until the AEV reaches 100 marks from its starting position

Research and Development Lab One Code:

celerate(1,0,15,2.5); accelerate motor one from start to 15% power in 2.5 seconds

motorSpeed(1,15); run motor one at a constant speed (15% power) for 1 second

goFor(1); go for 1 seconds

brake(1); brake motor 1

celerate(2,0,27,4); accelerate motor two from start to 27%  power in 4 seconds

motorSpeed(2,27); run motor two at a constant speed (27% power) for 2.7 seconds

goFor(2.7); go for 2.7 seconds

celerate(2,27,15,1); run motor two at a constant at a constant speed (27% power) for 2.7 seconds

brake(2); brake motor two

reverse(2); reverse the direction of only motor 2

celerate(4,0,31,2); accelerate all motors from start to 31% power in 2 seconds

motorSpeed(4,35); run all motors at a constant speed of 35% power for 1 second

goFor(1); go for one second

brake(2); brake motor 2

motorSpeed(1,35); brake motor two but keep motor one running at a constant speed (35%) for 3 seconds

goFor(3); go for three seconds

brake(4);brake motor 4

goFor(1); go for one second

reverse(1); reverse the direction of motor 1

celerate(1,0,19,2); accelerate motor one from start to 19% power in two seconds

motorSpeed(2,35);run motor two at 35%  power simultaneously running motor one at 19% power for 2 seconds

motorSpeed(4,19); simultaneously running motor one at 19% power for 2 seconds

goFor(2); go for two seconds

celerate(4,19,0,3); decelerate both motors to 0% power in 3 seconds

brake(4); brake all motors

Research and Development Lab Two Code:

motorSpeed(4,25); run all motors at a constant speed (25% power)

goFor(2); go for two seconds

motorSpeed(4,20); run all motors at a constant speed (20% power)

goToAbsolutePosition(12);  moves 12 spots from the original starting position

reverse(4); reverse the direction of all motors

motorSpeed(4,30); run all motors at a constant speed (30% power)

goFor(1.5); go for 1.5 seconds

brake(4); brake all motors

Research and Development Lab Four Code:

reverse(4); reverse the polarity of all motors

celerate(4,0,25,3); accelerate all motors to 25% power for three seconds

motorSpeed(4,25); run all motors at 25% power

goFor(1); go for one second

celerate(4,25,20,2); decelerate all motors to 20% power for two seconds

reverse(4); reverse polarity of all motors

motorSpeed(4,25);  run all motors at 25% power

goFor(2); for two seconds

brake(4); cut power to all motors

Advanced Research and Development Lab 1: Energy Analysis Code

motorSpeed(4,30); run all motors at 30 percent power

goFor(4); run for 4 seconds

motorSpeed(4,0); run all motors at zero percent power

goFor(10); run for 10 seconds

Advanced Research and Development Lab 2: Motor Quantity Code:

reverse(4); reverse polarity of all motors

celerate(4,0,25,3); accelerate all motors from zero to 25 percent power in three seconds

motorSpeed(4,25);  run all motors at 25 percent power

goFor(5); run for 5 seconds

celerate;(4,25,20,2); decelerate from 25 percent power to 20 percent power in two seconds

reverse(4);  reverse the polarity of all motors

motorSpeed(4,25);  run all motors at 25 percent power

goFor(5); run for five seconds

brake(4);  brake all motors

Performance Test One Code:

reverse(4); reverses all motors

celerate(4,0,38,2); accelerates all motors to a given percentage in two seconds

goFor(4); Goes for 4 seconds

brake(4); brakes all motors

reverse(4); reverses all motors

motorSpeed(4,35); Runs all motors to 35 percent power

goFor(2); Runs for 2 seconds

brake(4); Brakes all motors

goFor(7); Runs for 7 seconds

reverse(4); Reverses all motors

celerate(4,0,30,2); Accelerates all motors to 30 percent in two seconds

goFor(2); Runs for 2 seconds

brake(4); Brakes all motors

Performance Test Two Code:

reverse(4); reverses all motors

celerate(4,0,40,2); accelerates all motors to a given percentage in two seconds

goFor(5.3); goes for 5.3 seconds

brake(4); brakes all motors

reverse(4); reverses all motors

motorSpeed(4,33); runs all motors to 33 percent power

goFor(2); runs for 2 seconds

brake(4); brakes all motors

goFor(7); runs for 7 seconds

reverse(4); reverses all motors

celerate(4,0,38,2); accelerates all motors to 38 percent in two seconds

motorSpeed(4,38); runs all motors to 38 percent power

goFor(4); runs for 4 seconds

brake(4); brakes all motors

goFor(12); runs for 12 seconds

reverse(4); reverse all motors

motorSpeed(4,50); runs all motors at 50 percent power

goFor(5); runs for 5 seconds

brake(4); brake all motors

goFor(9); run for 9 seconds

motorSpeed(4,40); runs all motors at 40 percent power

goFor(3.2); runs for 3.2 seconds

Final Performance Test Code:

reverse(4); reverses all motors

celerate(4,0,40,2); accelerates all motors to a given percentage in two seconds

goToAbsolutePosition(258); moves AEV to mark 258 on the track

brake(4); brakes all motors

reverse(4); reverses all motors

motorSpeed(4,34); runs all motors to 35 percent power

goFor(1.5); runs for 2 seconds

brake(4); brakes all motors

goFor(7); runs for 7 seconds

reverse(4); reverses all motors

celerate(4,0,38,2); accelerates all motors to 30 percent in two seconds

motorSpeed(4,38); runs all motors at 38 percent power

goToRelativePosition(146); moves AEV to mark 146 on the track

brake(4); brakes all motors

goFor(12); runs for 12 seconds

reverse(4); reverses all motors

motorSpeed(4,50); sets all motors to 30 percent power

goFor(3.45); goes for 3.45 seconds

goToRelativePosition(-134); takes AEV to mark 134 in the opposite direction

brake(4); brakes all motors

goFor(12); goes for 9 seconds

motorSpeed(4,50);  sets all motors to 40 percent power

goToRelativePosition(-100); takes AEV to mark 100 in the opposite direction

brake(4); brakes all motors

goFor(2); goes for two seconds

reverse(4); reverses the polarity of all motors

motorSpeed(4,50); sets all motors to fifty percent power

goFor(1); goes for one second

brake(4); brakes all motors