Evolution of Design (N)

Programming Basics

Code used in pR&D Scenario 1:

celerate(1,0,15,2.5); //Accelerate motor one
goFor(1); //Run at 15% for 1 second
brake(1); //Brake motor one
celerate(2,0,27,4); //Accelerate motor 2
goFor(2.7); //Run at 25% for 2.7 seconds
celerate(2,27,15,1); //Decelerate motor 1
brake(2); //Brake motor two
reverse(2); //Reverse direction of motor two
celerate(4,0,31,2); //Accelerate all motors
motorSpeed(4,35);
goFor(1); //Run at 35% for 1 second
brake(2); //Brake motor two
goFor(3); //Run motor one for three seconds
brake(4);
goFor(1); //Brake all motors for 1 second
reverse(1); //Reverse direction of motor one
celerate(1,0,19,2); //Accelerate motor 1
motorSpeed(2,35);
goFor(2); //Run motor two and motor one at different speeds
motorSpeed(4,19);
goFor(2); //Run both motors at 19% for 2 seconds
celerate(4,19,0,2); //Decelerate both motors to 0%
brake(4); //Brake all motors

Code used in pR&D Scenario 2:

motorSpeed(4,25);
goFor(2); //Run both motors at 25% for 2 seconds
motorSpeed(4,20);
goToAbsolutePosition(295); //Runs motors at 20% and travels 12 feet
reverse(4); //Reverse motors
motorSpeed(4,20);
goFor(1.5); //Run motors at 30% for 1.5 seconds
brake(4); //Brakes all motors

Code used in pR&D Scenario 4:

celerate(4,0,25,3); //Accelerates all motors to 25% in 3 seconds
goFor(1); //Runs motors at constant speed for 1 second
motorSpeed(4,20);  //Sets motor 2 speed to 20% power
goFor(2); //Runs motors at 20% for 2 seconds
reverse(4); //Reverses all motors
motorSpeed(4,25):
goFor(2); //Runs motors at 25% for 2 seconds
brake(4); //Brakes all

reflectanceSensorTest();

Battery Testing:

celerate(4,0,40,2);  //Accelerates all motor from 0% to 40% power in 2 seconds
motorSpeed(4,40); //Sets motor 2 speed to 40% power
goFor(2); //Runs the motor(s) at their initialized state for 2 seconds
brake(4); //Cuts the power to all motors
reverse(4); //Reverses polarity of all motor
celerate(4,0,35,1);
goFor(1); //Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

Battery Testing second verion code:

celerate(4,0,40,2);  //Accelerates all motor from 0% to 40% power in 2 seconds
motorSpeed(4,40); //Sets motor 2 speed to 40% power
goToRelativePosition(-100); //Run AEV to reach -100 marks from its current position.
brake(4); //Cuts the power to all motors
reverse(4); //Reverses polarity of all motor
celerate(4,0,35,1);
goFor(1); //Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

MOTOR CONFIGURATION 1,2,3,4 code:

celerate(4,0,40,2); //Accelerates all motor from 0% to 40% power in 2 seconds
motorSpeed(4,40); //Sets motor 2 speed to 40% power
goFor(2); //Runs the motor(s) at their initialized state for 2 seconds
brake(4); //Cuts the power to all motors
reverse(4); //Reverses polarity of all motor
celerate(4,0,35,1); //Accelerates all motor from 0% to 35% power in 2 seconds
goFor(1); //Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

MOTOR CONFIGURATION 5 new code:

reverse(1); //Reverses polarity of motor 1
celerate(4,0,40,2);  //Accelerates all motor from 0% to 40% power in 2 seconds
motorSpeed(4,40); //Sets motor 2 speed to 40% power
goFor(2);//Runs the motor(s) at their initialized state for 2 seconds
brake(4); //Cuts the power to all motors
reverse(4); //Reverses polarity of all motor
celerate(4,0,35,1);  //Accelerates all motor from 0% to 35% power in 2 seconds
goFor(1); //Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

Designs Examined:

Design 1:

Design 1 data:

Design 2:

Design 2 chart:

Explanation for why we choose to go with design 2 goes here

As can be seen in the graphs, even though both the AEV designs ran for the same time, the power consumed by the designs was different. The second design had a much lower power consumption than the first design, depicting a much higher efficiency which is why it was chosen.

PERFORMANCE TEST 1

celerate(4,0,30,2);   //Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,30);   //Sets all motor speed to 30% power
goToRelativePosition(165); //Run AEV to reach 165 marks from its current position.
brake(4);//Cuts the power to all motors
reverse(4);//Reverses polarity of all motor
celerate(4,0,30,1);//Accelerates all motor from 0% to 30% power in 1 seconds
goFor(1);//Runs the motor(s) at their initialized state for 1 seconds
brake(4);//Cuts the power to all motors

 

motorSpeed(4,0); //Sets all motor speed to 0% power
goFor(7); //Runs the motor(s) at their initialized state for 7 seconds

reverse(4); //Reverses polarity of all motor
celerate(4,0,30,2); //Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,30); //Sets all motor speed to 30% power
goFor(2); //Runs the motor(s) at their initialized state for 2 seconds
brake(4);  //Cuts the power to all motors

 

PERFORMANCE TEST 2

celerate(4,0,33,2);//Accelerates all motor from 0% to 33% power in 2 seconds
motorSpeed(4,33); //Sets all motor speed to 33% power
goToRelativePosition(175); //Run AEV to reach 175 marks from its current position.
brake(4); //Cuts the power to all motors
reverse(4);//Reverses polarity of all motor
celerate(4,0,50,1);//Accelerates all motor from 0% to 50% power in 1 seconds
goFor(1); //Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(7);//Runs the motor(s) at their initialized state for 7 seconds

reverse(4);//Reverses polarity of all motor
celerate(4,0,30,2);//Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,30); //Sets all motor speed to 30% power
goFor(2);//Runs the motor(s) at their initialized state for 2 seconds
brake(4); //Cuts the power to all motors

 

PERFORMANCE TEST 3

celerate(4,0,33,2);//Accelerates all motor from 0% to 33% power in 2 seconds
motorSpeed(4,33);//Sets all motor speed to 33% power
goToRelativePosition(175); //Run AEV to reach 175 marks from its current position.
brake(4); //Cuts the power to all motors
reverse(4); //Reverses polarity of all motor
celerate(4,0,50,1);//Accelerates all motor from 0% to 50% power in 1 seconds
goFor(1);//Runs the motor(s) at their initialized state for 1 seconds
brake(4); //Cuts the power to all motors

motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(7);//Runs the motor(s) at their initialized state for 7 seconds

reverse(4); //Reverses polarity of all motor
celerate(4,0,30,2);//Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,30);//Sets all motor speed to 30% power
goFor(2);//Runs the motor(s) at their initialized state for 2 seconds
brake(4); //Cuts the power to all motors

motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(11); //Runs the motor(s) at their initialized state for 11 seconds

reverse(4); //Reverses polarity of all motor
celerate(4,0,99,2);//Accelerates all motor from 0% to 99% power in 2 seconds
motorSpeed(4,33);//Sets all motor speed to 33% power
goToRelativePosition(-50); //Run AEV to reach -50 marks from its current position.
brake(4); //Cuts the power to all motors

 

PERFORMANCE TEST 4

reverse(4); //Reverses polarity of all motor
celerate(4,0,50,2);//Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,50);//Sets all motor speed to 50% power
goToRelativePosition(184); //Run AEV to reach 184 marks from its current position.

motorSpeed(4,0);//Sets all motor speed to 0% power
goToRelativePosition(100);  //Run AEV to reach 100 marks from its current position.
brake(4);  //Cuts the power to all motors

rotateServo(56); //Rotate servo to 56 degree.
motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(3); //Runs the motor(s) at their initialized state for 3 seconds
rotateServo(15); //Rotate servo to 15 degree.

motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(3);//Runs the motor(s) at their initialized state for 3 seconds

celerate(4,0,45,2);//Accelerates all motor from 0% to 45% power in 2 seconds
motorSpeed(4,50);//Sets all motor speed to 50% power
goToRelativePosition(83);//Run AEV to reach 83 marks from its current position.
brake(4);  //Cuts the power to all motors

goToRelativePosition(240);//Run AEV to reach 240 marks from its current position.
rotateServo(55);//Rotate servo to 55 degree.
motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(2);// Runs the motor(s) at their initialized state for 2 seconds
rotateServo(15); //Rotate servo to 15 degree.

motorSpeed(4,0); //Sets all motor speed to 0% power
goFor(2);//Runs the motor(s) at their initialized state for 2 seconds

 

reverse(4); //Reverses polarity of all motor
celerate(4,0,55,2); //Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,55);//Sets all motor speed to 55% power
goToRelativePosition(-147); //Run AEV to reach -147 marks from its current position.
motorSpeed(4,0);//Sets all motor speed to 0% power
goToRelativePosition(-129);//Run AEV to reach -129 marks from its current position.
brake(4); //Cuts the power to all motors

rotateServo(52); //Rotate servo to 52 degree.
motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(3);//Runs the motor(s) at their initialized state for 3 seconds
rotateServo(15); //Rotate servo to 15 degree.

motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(4); //Runs the motor(s) at their initialized state for 4 seconds

celerate(4,0,50,2);//Accelerates all motor from 0% to 30% power in 2 seconds
motorSpeed(4,50); //Sets all motor speed to 50% power
goToRelativePosition(-177);//Run AEV to reach -177 marks from its current position.
motorSpeed(4,0);//Sets all motor speed to 0% power
goToRelativePosition(-145);//Run AEV to reach -145 marks from its current position.
brake(4); //Cuts the power to all motors

rotateServo(54); //Rotate servo to 54 degree.
motorSpeed(4,0);//Sets all motor speed to 0% power
goFor(3); //Runs the motor(s) at their initialized state for 3 seconds
rotateServo(15); //Rotate servo to 15 degree.