Evolution of Code

Glossary of Code Used

celerate(m, p1, p2, t)
-Accelerates or decelerates motors m from start speed p1 to end speed p2 in t seconds.
motorSpeed(m, p)
-Sets motor m to percent power p.
goFor(t)
-Runs the motor at its current settings for t seconds.
brake(m)
-Brakes motor m.
reverse(m)
-Runs motor m in reverse.
goToRelativePosition(n)
-Moves the vehicle n marks from its current position.
goToAbsolutePosition(n)
-Continues the previous command and moves the vehicle n marks from the overall starting distance of the AEV

Reference

[1] Ohio State University Fundamentals of Engineering Program. “Preliminary Research and Design”.

https://osu.box.com/s/diy2i8qb3l86ngb4f9j5x7geajy3epup

 

Final Performance Test Code

First Performance Test Code

motorSpeed(4,25);
goToRelativePosition(235);
brake(4);
goFor(0.5);
reverse(4);
motorSpeed(4,20);
goFor(2.5);
brake(4);
goFor(7);
reverse(4);
motorSpeed(4,20);
goToRelativePosition(225);
brake(4);
goFor(0.5);
reverse(4);
motorSpeed(4,25);
goFor(2);
brake(4);
goFor(10);
motorSpeed(4,35);
goToRelativePosition(50);
brake(4);

Second Performance Test Code

motorSpeed(4,25);
goToRelativePosition(235);
brake(4);
goFor(0.5);
reverse(4);
motorSpeed(4,20);
goFor(2.5);
brake(4);
goFor(7);
reverse(4);
motorSpeed(4,20);
goToRelativePosition(225);
brake(4);
goFor(0.5);
reverse(4);
motorSpeed(4,25);
goFor(2);
brake(4);
goFor(10);
motorSpeed(4,35);
goToRelativePosition(50);
brake(4);

Code Used for Advanced R&D Tests

This is the code currently used for testing our AEV vehicle.

celerate(4, 0, 25, 3);
 goFor(1);
 motorSpeed(4, 20);
 goFor(2);
 reverse(4);
 motorSpeed(4, 25);
 goFor(2);
 brake(4);

 

Lab 1 Code

  // Motor1
//Accelerates the motor 1 to 15% in 2.5 seconds
celerate(1,0,15,2.5);
// Motor 1 is run at constant 15% power for 1 secomd
goFor(1);
// Motor 1 is braked
brake(1);
// Motor 2
// Accelerates motor 2 to 27% power in 4 seconds
celerate(2,0,27,4);
// Motor 2 is run at constant 27% power for 2.7 seconds
goFor(2.7);
//Decelerates motor 2 to 15% power in 1 second
celerate(2,27,15,1);
// Brakes Motor 2
brake(2);
//Reverses Motor 2
reverse(2);
// All Motors
// Accelerates all Motors to 31% in 2 seconds
celerate(4,0,31,2);
//Accelerates all Motors to 35% power in 1 second
celerate(4,31,35,1);
// All Motors are run at 35% for 1 second
goFor(1);
// Motor 1 is continued to run at 35% power
brake(2);
//Motor 2 is braked
// This is continued for 3 seconds
goFor(3);
//Brakes all motors for 1 seconds
brake(4);
goFor(1);
//reverses direction of motor 1
reverse(1);
//Accelerates Motor 1
celerate(1,0,19,2);
//Both Motors are set at 19% power for 2 seconds
motorSpeed(1,35);
motorSpeed(2,19);
goFor(2);
motorSpeed(1,19);
goFor(2);
//Decelerates both motors to 0% power in 3 seconds
celerate(4,19,0,3);
// Brakes all Motors
brake(4);
// Run motor one at a constant speed (23% power) for 2.5 second.
motorSpeed(1,23);
goFor(2.5);
// Brake motor one.
brake(1);

 

Lab 2 Code

//Creates a constant for converting mark to inches 

const float mark = 0.4875;

motorSpeed(4, 25);
 goFor(2);
 motorSpeed(4, 20);

//Creates integer d for distance
 int d = 12;

int dMarks = d *0.4875;
 goToAbsolutePosition(dMarks);
 reverse(4);
 motorSpeed(4, 30);
 goFor(1.5);
 brake(4);