Performance Test 2 – Code (Lab 9)

Situation

Lab 9 was the performance test 2 phase where the team focused on using the desired AEV Design 2 while testing two separate code solutions. Thus, two distinct codes were developed by the team during this lab. This was done to compare and figure out which code gave the most consistent results. The main difference between the first and second code was that the second code used short bursts of energy and then coasted while the first code ran the motor continuously until the desired position was reached. A third code was also developed by one of the team members. This code used “if’ statements to command the run.

CODE 1 was developed on a principal of speed while CODE 2 was founded more in energy efficiency concerns. The 3 code failed to even move forward. It was discovered that arduino codes require some predetermined parameter in order to run. “If” statements do not do this and thus the code was discarded. CODE 1 initially was designed to complete the mission accurately and consistently all in a short period of time. The AEV was expected to reach destination quickly and stop at the points it needed to. On the other hand, CODE 2 uses periods of drifting to reduce energy used during movement and when stopping. At the end of this lab Team G decided to use a code that had mark parameters to get started and move forward, and time parameters to stop the AEV at certain point. The team also decided to schedule testing of the energy benefits  of including drifting in the CODE 1. If the testing proved beneficial the team would incorporate drifting into CODE 1 combining its speed and consistency with energy efficiency.   

Takeaways

  • “If” statements do not work well in the arduino code.
  • There are enough variations in the different tracks that changes in the code are necessary when on the different tracks.