User:BlackforAesthetics/ENES100/Project1

Project Preference
1. Mobile Robot Hallway Navigation

2. Autonomous Power Wheel

3. BioVest

Problem Statement
Design/Implement control software that enables an existing robot to navigate the CL building hallway.

Project Plan
Briefly describe your group's plan for the next 4 weeks, including major tasks that will be completed each week.

Week 1 Narrative
For Week 1 of our project, my task was to research the different sensors that we could possibly use for our mobile robot. After some searching I found that there are four sensors that could be attached to the robot that would be of use to us.

1. Touch Sensor: detects a bump, press, or release.

2. Ultrasonic Sensor: measure distance from the sensor in the direction it is facing.

3. Compass: useful for keeping the robot oriented in the correct direction (N,S,E,W) despite having to do several turns.

4. Light Sensor: detects the light level in one direction on a scale of 0-100, 0 being very dark, and 100 being very bright.

Week 2 Narrative
For this week, my task was to find a way to maneuver the robot according to the degrees of an attached compass sensor. In order to do this, I had to first learn how the compass sensor works.

When connected, the sensor (pictured below) will read the magnetic heading of the compass and output it as a number between 0 and 359. A value of 0 represents North, 90 is East, 180 is South, and 270 is West. Just to verify that the robot could follow the compass, I worked on creating a code in MatLab that would make the robot move in a single direction (west). Initial tests were somewhat unsuccessful, possibly to due conflicting commands within the code. Further testing will be done to optimize the potential of using a compass in conjunction with other sensors.

Week 3 Narrative
For this week, I needed to further optimize the use of the ultrasonic sensors that were on the robot. In addition, another sensor was added on the left side for a total of 3 ultrasonic sensors.

With another ultrasonic sensor, the robot is now able to detect objects in three directions. Because of this, the code had to also be altered. Instead of following allowing the left wall of the hallway, the third sensors makes it easier to be centered as it is going down the hallway. After discussing with my group members, I decided that the code we will use will make the robot stay a specified distance from each of the hallway walls. Since the sensors can measure distance accurately, the two on each side of the robot will be used to make sure that it does not drift too far to one side or the other. The front sensor will still be used to avoid objects mainly directly in front, but will also be useful if the robot is turned too much to the side and gets too close to a wall.

Week 4 Narrative
For week 4, I need to make sure that our robot was able to actually navigate through the hallway on its own. With the previous code, our robot was able to move through the hallway, but would get stuck after a couple of feet or so. After implementing commands for enabling the robot to reverse after encountering an obstacle in the front, I needed to make sure that the code worked, and if not, adjust it so that it would.

Prior to Friday, our robot was able to detect obstacles using all three sensors, but what it did when detecting these obstacles needed to be adjusted. After adjusting the code and getting rid of unnecessary commands, I began to receive some errors when trying to run the code. In order to make our robot back up for a specific amount of time, the variable A had to be added, which would store the value/amount of time for which the robot reverse. When I changed the data type from auto to double, I would get this error concerning another function, "lmotor." I am unsure why this occurred, because I had never had a problem with this part of the code.

Unsure as to why this happened, I tried rearranging the variables, "lmotor" and "rmotor," but to no avail. Even after removing the "A" parameter and using the code without a back-up command, the ultrasonic sensors were not responding properly. Only the front sensor would detect walls, but very inconsistently. Unfortunately, I could not get the robot to move though the hallway. Considering the fact that the code had no issues prior to Friday, it seems that there was some software issue that could not be resolved.