CODE

Lab Week One Code:

celerate(1,0,15,2.5);
motorSpeed(1,15);
goFor(1);
brake(1);
celerate(2,0,27,4);
motorSpeed(2,27);
goFor(2.7);
celerate(2,27,15,1);
brake(2);
reverse(2);
celerate(4,0,31,2);
motorSpeed(4,35);
goFor(1);
brake(2);
motorSpeed(1,35);
goFor(3);
brake(4);
goFor(1);
reverse(1);
celerate(1,0,19,2);
motorSpeed(2,35);
goFor(2);
motorSpeed(1,19);
goFor(2);
motorSpeed(4,19);
goFor(2);
celerate(4,19,0,3);
brake(4);

Reflectance Sensor Test Code (Week Two): 

reflectanceSensorTest();

No coding for lab week 3, conceptual sketching and AEV design addressed instead.

Lab Week 4 Code (the same code was used for aR&D #1- Motor Configuration)

celerate(4,0,45,3);
motorSpeed(4,35);
goFor(2.5);
motorSpeed(4,30);
goFor(3);
reverse(4);
motorSpeed(4,35);
goFor(3.5);
brake(4);

aR&D #2 Code- Propeller Configuration: 

Code for orange colored propellers:

reverse(1);
motorSpeed(1,30);
motorSpeed(2,30);
goToAbsolutePosition(400);
reverse(4);
motorSpeed(4,30);
goToAbsolutePosition(200);

  • The reason two codes were used for propeller configuartion testing was due to the low torque the grey propellers give off. When tested with the orange propeller code, the grey propeller did not move, indicating more power needed to be given in order for the grey propeller to move.

Performance Test One

reverse(4);
celerate(4,0,30,3);
motorSpeed(4,35);
goToAbsolutePosition(-170);
reverse(4);
celerate(4,0,40,.5);
goFor(2.45);
brake(4);
goFor(7);
reverse(4);
celerate(4,0,32,2);

This code tells Motor 4 to cellerate with 30 power for 3 seconds. Then motor speed for all motors is increased to 35. The AEV is then told to go to the absolute position of =170 on the rail. The AEV is then told to reverse all motors with an acceleration of 40 power for .5 seconds. THis action is ran for 2.45 seconds. The AEV is then made to brake all mtoors for 7 seconds. Then the AEV reverses all motors with 32% power for 2 seconds.

Performance Test Two

reverse(4);
celerate(4,0,30,3);
motorSpeed(4,35);
goToAbsolutePosition(-170);
reverse(4);
celerate(4,0,40,.5);
goFor(2.45);
brake(4);
goFor(7);
reverse(4);
celerate(4,0,32,2);       Refer to Performance Test 1 for code instructions

motorSpeed(4,10);
goFor(2);
brake(4);
goFor(9);
reverse(4);
celerate(4,0,35,2);
motorSpeed(4,20);
goFor(3);

AFter the AEV passes the gate, it sets all motors to 10% power for 2 seconds. All motors are made to break for 9 seconds. The AEV then reverses all motors with 35% power for 2 seconds. All motors are then set to motorspeed 20% for 3 seconds.

 

Final Performance Test

reverse(4);
celerate(4,0,30,2);
motorSpeed(4,54);
goToAbsolutePosition(-125);

reverse(4);
celerate(4,0,50,.5);
goFor(1);
brake(4);
goFor(6);

reverse(4);
celerate(4,0,38,2);
motorSpeed(4,40);
goFor(2.1);
reverse(4);
celerate(4,0,45,.5);
goFor(.9);
brake(4);
goFor(4);

celerate(4,0,35,2);
motorSpeed(4,60);
goFor(2.7);
reverse(4);
celerate(4,0,75,.5);
goFor(1);
brake(4);
goFor(6.5);

reverse(4);
celerate(4,0,40,2);
motorSpeed(4,50);
goToAbsolutePosition(-205);
brake(4);
goFor(1);
reverse(4);
celerate(4,0,65,.1);
goFor(1);

For the final test run the same code is used for the first two steps of the run. On the final return the AEV is made to reverse all motors with 40% power for 2 seconds. The motor speed is then set to 50 for all motors. The AEV is made to go to Absolute position -205. All motors are then made to brake for 1 second. All motors are then reversed and then celerated to 65 for .1 second. This action is ran for 1 second.