Lab 4 – External Sensors

 

The purpose of the lab was to gain knowledge of the external sensor technology, along with the function calls needed when programming. This was accomplished through learning the function calls for the sensors, and by becoming familiarized with the external hardware components and troubleshooting techniques. The background behind the lab was to increase engineering students’ knowledge of Arduino coding, commands within the program, and how they affect the AEV. These tools can be applied to the final vehicle, which will complete the Jurassic Park test. This lab educated the students with understanding sensor technology, as well as methods to troubleshoot issues in an experiment.

This AEV was able to move to a more precise location with consistent speed, in comparison to last week’s Lab 3 AEV test run. This was due to the “gotoRelativePosition()” command being used. The command allowed the vehicle to reach a more accurate destination by using the readings from the sensors, rather than completing tasks according to a set time interval. By using judgment of distance, the AEV knew exactly where it was in relation to the point of origin. In Lab 3, when commands based on time were used, the vehicle knew how long it had been traveling, but because the vehicle completed this with different speeds, it had no reference of how far it was from the starting point.

The knowledge gained in this lab will help to construct a preliminary code to complete the scenario stated in the Mission Concept Review, as the external sensors make the AEV’s run more precise. During Lab 3, the AEV was running on a sample code that was based off of time increments. While this was decent for the sample, this method would not be as successful. Using distance to complete tasks is superior, because the track’s length is a known distance that will not change. The “goToRelativePosition” and “goToAbsolutePosition” commands are recommended, because they are able to count marks from the point they are activated, and observe how far the vehicle has moved from its starting point. Distances travelled while using the time increment method may change due to alterations in the vehicle’s speed. This would not occur by using the distance commands; the AEV would continue to maneuver through any variability to complete the task, whereas the time commands have no way of tracking the vehicle’s position.

Few errors were made in this lab. Due to an error from previous labs, it was known to check the position of the AEV propellers, as to confirm they were set up in the correct orientation. In addition, “reset” codes were implemented to prepare the engines via the sample code (see Appendix). The first time the code was initiated, it did not start, but this was fixed by re-uploading the code. In addition, a systematic error was noticed in the track’s level. In some areas, it was more raised than other parts, affecting the AEV’s ability to run smoothly. Reviewing the progression of this project, the engineering team has improved in recognizing and preventing potential errors, as well as troubleshooting issues that arise within the lab procedures.

The ultimate goal of this lab was to get more practice with Arduino coding, learn how to use the two position codes, and get more experience with the AEV vehicle and the track. This was achieved by coding the Arduino to complete the sample tasks given, and by observing the AEV’s behavior. It was found that the vehicle now came closer to the first gate then it had in previous labs. This was due to its ability to determine distance using the new commands. These findings will be used to write the code for the final Jurassic Park test.

 

Appendix:

 

Arduino Sample Code:

// “Reset” the engines

brake(4);

reverse(4);

// 1. Run all motors at a constant speed of 25% power for 2 seconds

motorSpeed(4,25);

goFor(2);

// 2. Run all motors at a constant speed of 20% and using the goToAbsolutePosition function travel a total distance of 13.5 feet (from the starting point)

motorSpeed(4,20);

goToAbsolutePosition(333);

// 3. Reverse the motors

reverse(4);

// 4. Run all motors at a constant speed of 30% power for 1 second

motorSpeed(4,30);

goFor(1);

// 5. Brake all motors

brake(4);

 

Reflective Test:

reflectanceSensorTest();

 

Leave a Reply

Your email address will not be published. Required fields are marked *