iii. Arduino Code

 

April 12th, 2019

The code for the final performance test was created:

reverse(4);

 motorSpeed(4,39);

 goToRelativePosition(-198);

celerate(4,35,0,0.15);

reverse(4);

celerate(4,55,0,0.15);

reverse(4);

brake(4);

goFor(10);

motorSpeed(4,35);

goToRelativePosition(-121);

celerate(4,39,0,0.25);

reverse(4);

celerate(4,15,0,0.85);

brake(4);

goFor(10.25);

motorSpeed(4,66.75);

goToRelativePosition(260);

reverse(4);

motorSpeed(4,35);

celerate(4,35,0,0.15);

motorSpeed(4,58);

goToRelativePosition(-120);

motorSpeed(4,56);

celerate(4,56,0,0.15);

motorSpeed(4,45);

celerate(4,45,0,0.15);

motorSpeed(4,56);

celerate(4,56,0,0.15);

This code is different than the code beforehand because it was necessary to create a code that allowed the AEV to travel back through the gate with the caboose included. It also added a break that was needed to go from the stopped position at the gate to the loading dock at the other end of the track.

March 25th, 2019

Code for power breaking testing as part of the last research the team needed to require

reverse(4);

motorSpeed(4,30);

goToRelativePosition(-50);

reverse(4);

motorSpeed(4,45);

celerate(4,45,0,0.15);

(Speed in the second to last line was altered in first part of testing. In second part of testing the last two line “the deceleration loop” were repeated different amounts of times.)

March 18th, 2019

The final code to pass performance test 2 in room 308 in Hitchcock Hall was created.

reverse(4);

motorSpeed(4,40);

goToRelativePosition(-148);

celerate(4,40,0,1);

brake(4);

goFor(9);

motorSpeed(4,40);

goFor(2);

brake(4);

This code was different than March 8th because it required a code for stopping and connecting to the caboose at the other end of the track.

March 8th, 2019

During this lab, the team prioritized preparing for the performance test over completing the propeller configuration testing. The code used for the testing was:

reverse(4);

motorSpeed(4,40);

goFor(6.0);

celerate(4,40,0,1);

brake(4);

goFor(7);

motorSpeed(4,40);

goFor(2);

brake(4);

This code successfully completed the first performance test.

March 1st-6th, 2019

For the battery power testing part of the advanced research and development the following code was used:

motorSpeed(4,20);

goFor(15);

brake(4);

The time the motors were told to go for was altered in 15 second intervals to test how much power was used for each interval.

 

For the propeller configuration testing the code used was:

motorSpeed(4,15);

goFor(2);

brake(4);

The motor speed was increased in increments of 5 until it was at 50.

 

February 1st, 2019 – February 22nd, 2019

The first code used on Ardino that we used was reflectanceSensorTest(); to ensure that the sensors were functioning.

Afterwards, we used the following line of code:

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

No changes were made to the code after the initial creation of it.  

The code instructs the AEV to accelerate to 25% power in three seconds, then continue that speed for 1 second. It then sets the speed to 20% power for 2 seconds. The AEV is then instructed to reverse at 25% power for 2 seconds, after which it should brake.

This code was also used to test the functionality of the final AEV prototype design.

For the weeks of the 15th and the 22nd, the power of this code was altered periodically to see how much power was required to make the AEV begin to move.