Code and Variables

Preliminary Advanced Research and Design

Scenario 1

Scenario 1 Code

Scenario 1 code

The above code is the implementation of the example scenario given in Exercise 1 of the Preliminary Research and Development Manual. The purpose of this exercise was to familiarize the team with the basics of programming the Arduino. The scenario covers a variety of commands that control the motors.

The scenario covers basic motor instructions such as accelerating and braking as well as more advanced instructions such as reversing the direction of the motors and running motors at different speeds simultaneously.

Lab 3

Lab 3 Code

This was code executed during the first on-track test of the AEV. Using the Data Extraction tool, the team created graphical models of the performance of the AEV while it utilized this code. While the code executed to completion with expected results, the one of the propellers fell off which may have compromised the results gathered from the test.

Advanced Research and Design

Servo Motor Testing:

Code A

Code B

Code C

Code D

With the performance test approaching, Watts Scientific Group C has been focused on putting the finishing touch on the physical design of the AEV in conjunction with developing a new servo brake. After calibrating the servo to an angle of 0 degrees, attaching it to the arm of the AEV, and attaching a “brake pad”  (glue tac) to the servo arm, Code A was used on a test rail to ensure that the pad made contact with the rail. Following that, the AEV with an updated body design was tested on a rail with Code B. Simply reversing the direction of the motors to slow down was not enough to cancel out the forward acceleration of the AEV, especially over a long distance. Therefore, the team concluded that it would be best to implement a solution which incorporated the servo as an assistance to stop the AEV, such as in Code C or Code D.

Further tweaks still need to be done before the performance test, but Group C is on track for an efficient AEV.

Code adjustments after Performance Tests

After Performance Test 2

Code used for AR&D 3 testing.

During the battery testings, the AEV was programmed with the code above to conduct Group C’s research.

Final Performance Test

The code listed above is the final code used during the final performance test which safely sent the AEV across the track, collected the caboose, and stopped at the end of the track.