Lab 4: External Sensors

The purpose of this lab was to test the external sensors for the AEV. The external sensors are meant to track the movement of the device on the track so that the information could be compared to the power needed to move at that speed. Initially, the sensors were attached to the team’s AEV design with sip-ties to ensure stability. From there, a new code was written in order to run the AEV on the track with the correct specifications. While constructing the device, it became apparent that the propellers would only be efficient in one direction. This created cause for concern as the final test requires the vehicle to move in both directions using the least amount of energy.

Before the new code could be tested on the track, the external sensors needed to be tested. To do this, the desktop was connected to the Arduino and the testing code (provided) was loaded onto the device. When the wheels started spinning, the sensors recorded the amount of times the reflective piece passed through the slot.


The original recordings of sensor activity:

External Sensors Initial Testing

Once the external sensors were recording the information properly, the written code was transferred onto the device. Right before the vehicle was going to be tested with the new code, the team realized that the wheels were placed on the wrong side of the arm. If the AEV ran in this form it would collide with the supports for the hanging rail. After the team rearranged the vehicle, it was tested on the track. The team made the observation that when the design had the weight of the battery (the heaviest part) at the front of the vehicle, a lot more power was required to move it.


Arduino Code for Lab 4:

motorSpeed(4,25);
     goFor(2);  //Runs motors at 25% for 2 sec
     
     motorSpeed(4,20);
     goToRelativePosition(394);  //Sends AEV 16 feet from starting position.
     
     reverse(4);    //Reverses motors
     
     motorSpeed(4,30);
     goFor(1.5);    //Runs motors at 30% speed for 1.5 seconds
     
     brake(4);    //brakes motors
With this code, the vehicle ran continuously and didn’t stop at the 16 ft. mark that was designated by the code. To debug the problem, the team checked the external sensor again to make sure that they were reading the marks correctly, which they were not. The sensors were not recording any data while the wheels were spinning. The team fixed this by testing the device with a new set of external sensors.

The team ran out of time before a test could be performed with the AEV on the hanging test track. However, the program was tested at the desk by meerly spinning the wheels for until the sensors counted the number of marks that are equivalent to 16ft. At the desk, the sensors and program ran as expected. The team decided that the rest of the build would be continues with the new and full-powered sensors.


Lab 4 Executive Summary:

Lab 4 Executive Summary