Lab 10: Performance Test 3 Code & Energy Optimization

Lab 10: Performance Test 3 – Code & Energy Optimization

Manan Kedia

Asad Idris

Kaixin Luo

Backwards Looking Summary

In the last two labs, the team approached the final stages of the project and began tweaking the finer details that made the AEV run efficiently and consistently. The team first tested out two different coding scenarios to identify which code works best now that the final design had been chosen. The first code was the teams current code which had been under development since the project started. This showed consistent runs but was still not as efficient as the team liked. The team first started by installing the servo and writing a code for it. The servo would be used for both coding scenarios as a test run on the first quarter of the track had proved to be successful in stopping the AEV consistently. However, in the past few labs the team faced a lot of hurdles which caused the team to struggle for time. A lot of time was taken to decide on an appropriate permanent position for the servo and how the brake would be implemented. The first few implementations were unsuccessful and the team finally made the breakthrough. The first code was uploaded into the AEV but it didn’t run successfully. This was due to the servo not reaching its coded angle which caused the whole code to reset. This was fixed and another test run was undertaken. The AEV once again ran unsuccessfully. The AEV would just stop running after the servo code was activated and no further codes would be run. The team kept making runs while trying to figure out the problem. Finally, after many failed runs the team realised the problem was in the code. Due to the Arduinos built in program the motors had to be reinitialized after the servo was activated. The two-line code acted as a buffer and had to be written every time the servo was activated.

motorSpeed(4,0);

goFor(0.5);

During the test runs the one of the propellers kept flying off the motor and caused even more time to be wasted as we had to restart the run. The team solved this by hot gluing the propellers to the motor. Unexpectedly this cause an increase in efficiency as the motor wasn’t running loose inside the propeller. Once that problem was solved the team started making consistent runs and was one of the few groups to complete successfully and consistently the MCR. This is the phase diagrams from the completed runs. The unexpected efficiency increase can be seen between the two phase diagrams.

Figure 1

The big peaks are where the motor is running and the little peaks are where the servo activated. The energy used was reduced by almost 60J. However, the team decided to pursue an even more efficient design. This is how the second coding scenario was introduced. This code used small bursts of high power instead of sustained power to power the AEV. It was hypothesized that this pulse thrust method would further reduce energy usage as the motors would only be run a shorter time. This code had not yet been test as the team was out of time.

The main takeaways from these labs were to be more prepared for the potential hurdles so that the team wouldn’t struggle for time and can make more test runs. Also, the team realized that no matter how much planning goes into a design or code. Sometimes real world tests show completely different results which is why test runs are so important.

Forwards looking plan.

With all the complications faced in the previous labs. The team was not able to complete the required tests. The teams plan is to test the current code against the pulse thrust code, which maybe more efficient, to see which one proves to be more efficient and then finalise a code for the AEV. The servo mechanism has been implemented but the team still must decide if this is an appropriate permanent location. Overall the team is progressing on schedule. Some team members came up with ideas that include using a fan as upward thrust to apparent weight of AEV while running, to use ducted propellers to reduce turbulence at the tip and have more efficient forward thrust, and to reduce power to one propeller when the AEV is turning to utilise torque vectoring to keep the AEV more stable in turns. But these ideas would only be tested if time permits as the project is now in its final stages. The team also needs to start working on the final draft report and update the project portfolio.

Appendix

Current Code

//First Quater

reverse(4);

motorSpeed(4,60); //both MOTORS SET TO 50% POWER

goToAbsolutePosition(105); //Last code continued until AEV reaches 105 marks

brake(4); //Brake all motors

goToAbsolutePosition(353);// Coast towards light gate

rotateServo(100.00); //Servo activated to stop AEV

goFor(2); //Stopped at gate for 7 seconds

rotateServo(00.00);// brakes released;

motorSpeed(4,0);

goFor(0.5);

goFor(6);

//Second Quarter

motorSpeed(4,60); //bOTH MOTORS SET TO 60% POWER for 4 seconds

goToAbsolutePosition(455);//Last code continued until AEV reaches 125 marks

brake(4);

goToAbsolutePosition(791);// Coast towards light gate

rotateServo(100.00); //Servo activated to stop AEV

goFor(2); //Stopped at gate for 7 seconds

rotateServo(00.00);// brakes released;

motorSpeed(4,0);

goFor(0.5);

goFor(4);

//Third Quater

reverse(4); //Reverse all motors;

motorSpeed(4,70); // Both motors set to 60% for 5 seconds

goToAbsolutePosition(600); //

brake(4); //Brake all motors and coast

goToAbsolutePosition(444); //coast to 450 marks

rotateServo(100.00); // brakes applied

goFor(2); //stay at gate

rotateServo(00.00); // brakes released

motorSpeed(4,0);

goFor(0.5);

goFor(6);

//Final Quater

motorSpeed(4,70); //

goToAbsolutePosition(175);

brake(4);

goToAbsolutePosition(10); //coast to 450 marks

rotateServo(100.00); // brakes applied

goFor(2); //stay at gate

rotateServo(00.00); // brakes released

Pulse Thrust code

//First Quarter

reverse(4);

motorSpeed(4,70); //both MOTORS SET TO 70% POWER

goToAbsolutePosition(75); //Last code continued until AEV reaches 75 marks

brake(4);

goToAbsolutePosition(150);

motorSpeed(4,70); //both MOTORS SET TO 70% POWER

goToAbsolutePosition(250); //Last code continued until AEV reaches 250 marks

brake(4); //Brake all motors

goToAbsolutePosition(353);// Coast towards light gate

rotateServo(100.00); //Servo activated to stop AEV

goFor(2); //Stopped at gate for 7 seconds

rotateServo(00.00);// brakes released;

motorSpeed(4,0);

goFor(0.5);

goFor(6);

Code Under Testing

//Second Quarter

motorSpeed(4,70); //bOTH MOTORS SET TO 70% POWER goToAbsolutePosition(370);//Last code continued until AEV reaches 370 marks

motorSpeed(4,70); //bOTH MOTORS SET TO 70% POWER goToAbsolutePosition(370);//Last code continued until AEV reaches 370 marks

brake(4);

goToAbsolutePosition(791);// Coast towards light gate

rotateServo(100.00); //Servo activated to stop AEV

goFor(2); //Stopped at gate for 7 seconds

rotateServo(00.00);// brakes released;

motorSpeed(4,0);

goFor(0.5);

goFor(4);

//Third Quater

reverse(4); //Reverse all motors;

motorSpeed(4,70); // Both motors set to 60% for 5 seconds

goToAbsolutePosition(600); //

brake(4); //Brake all motors and coast

goToAbsolutePosition(444); //coast to 450 marks

rotateServo(100.00); // brakes applied

goFor(2); //stay at gate

rotateServo(00.00); // brakes released

motorSpeed(4,0);

goFor(0.5);

goFor(6);

//Final Quater

motorSpeed(4,70); //

goToAbsolutePosition(175);

brake(4);

goToAbsolutePosition(10); //coast to 450 marks

rotateServo(100.00); // brakes applied

goFor(2); //stay at gate

rotateServo(00.00); // brakes released