User:Iahmed2/ENES100/Project 3

Project Preference
1. Autonomous Power Wheel

2. BioVest

3.

Problem Statement
''In one or two sentences, describe the project that your group will be working on. Identify what CDIO phase (Conceive, Design, Implement, or Operate) your group will complete in this project cycle.''

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
My task for this week was to work on the ping ultrasonic range sensor. So, I took an Arduino, a sensor, and a bread board home so I could work on using the code that was already written for it in the library. But, I didn't know how the sensor the worked, so I took sometime to research what the sensor does and how to plug it to the Arduino.

I found that there is one "ear" on the sensor that sends out a signal until the waves hit an object. After the waves hit the object, the waves bounce back, which he other "ear" receives.

After, creating the circuit, I uploaded the code to the Arduino and watched the serial monitor while putting my hand in front of the Arduino, but the serial monitor only read "0 in, 0cm". So, I thought there was something wrong with the code. I changed the numbers in the code from 9600 to 960, 2 to 20, and 5 to 50. This resulted in the serial monitor reading different symbols. I then, I looked on YouTube to see if anyone had a tutorial on how to use the ultrasonic sensor. I found a tutorial that also showed the code to work the ultrasonic sensor. Next, I copied the code the video showed, which resulted in the serial monitor to give me numbers after the code was uploaded.

/Original code/

/Second code/



Week 2 Narrative
Our goal for this week was to get the power wheel to drive perfectly for the predetermined path that we planned. Our plan was to get the power wheel to turn right, drive straight, and then turn left, which demonstrates that the power wheel is capable of turning and driving. This was the code we used to drive the vehicle, but during testing, we ran into some problems with the code. The code affected the turn of the drive according to what timings we put in the code. For example, the original code we had was to turn for 7 seconds and then drive for 3.5 seconds, but after the turn the car was not angled to 90 degrees as it should have been, so it drove off the sidewalk. Also, we changed the drive to to drive in 1st gear and not second gear, which makes it easier to go after the power wheel. So, my task during the test runs was to record the timings and the result.

While we were testing, we also noticed that the back wheels spun before taking off because there was no friction and this affected the drive because time was wasted during this time, which led to the power wheel turning in a shorter amount of time. As a result, the power wheel as angled toward the grass. To fix this, we put a doormat under the back wheels of the car, which provided the drive with better results. https://www.youtube.com/watch?v=2a6_Pu9uJX4&feature=youtu.be

Week 3 Narrative
My task this week was to do a CAD and ortho drawing for the sensor mount that we were going to build (/Ortho drawing/). But before we could start building, Professor Edelen told us to change the length of the mount because if the mount is that low, then something might hit the mount or the sensor would just sense grass as a result of it being too low. So, we changed the length from 8 inches to 7 inches. which would move the sensor to be 1.5 inches down from the lowest screw holes. After getting the drawing approved we build and attached the mount (picture).

One of the other goals for this project phase was to fix the code to work with the sensor. The ultimate goal is to get the power to stop when it senses the object and then resume driving when the object has cleared. So, Jehms and I worked on the code of the ultrasonic sensor separately before adding it to the actual code. Professor Edelen said to replace the delays in the actual code with "for" and "while" codes. so, the code runs in the for loop when the object is more than 100 meters away and then it jumps into the while loop when the object is less than 100 cm away. After, getting this part of the code to work, we worked on the elapsed time of the code. Even though, the serial monitor gave us readings on the elapsed time, we couldn't figure out what the elapsed time was actually doing.

Another goal that I worked on was to mount the ultra sonic ping sensor and then wiring it up to the motor shield. First I attached the sensor pins to 4 wired pins, which were then attached to four long wires. Since the four long wired were all the same, I labeled each of the wires with the color of wire they attached to on the wired pin.

Week 4 Narrative
My task this week was to work on the code for the ultrasonic sensor with Jhems. But the problem we were running into was that the code was told to give a reading for the elapsed time on the serial monitor, but the start time and the elapsed time were not matching. We drew a flow chart according to what we wanted the code to do, so that we could do back to the code and see what isn't happening.

After troubleshooting with Professor Edelen. We found that the cause of our frustration over the code was caused by an extra semicolon in the code. After we uploaded the code of just the ultrasonic sensor, we saw that the serial monitor gave us numbers for the start and elapsed time that actually made sense. After quickly testing the code, we wrote another code for the power wheel to drive straight, but the delays were substituted with the ultrasonic code.

After a few test runs, we ran into problems again: 1) the sensor would sometimes wouldn't sense the object until the object was right in front or it wouldn't sense at all, 2) the power wheel would stop in the middle of the drive without sensing anything, and 3) when the object moved out of the way, the sensor would sense the object again and then retract the gas pedal again. The first problem we fixed by Changing the distances in the code form 150 cm to 200 cm. The second problem was occurring because the sensor was tilted toward the ground, so we moved the sensor to sense straight. The problem was caused when the object was moving away and the sensor would sense that object and stop again. We fixed this by changing the first distance to 250 cm and leaving the second distance at 200 cm, this way the object has more room to move before the sensor senses it again.

One of the lasts things we didn't figure out was how to get the power wheel to restart the drive after the object has moved. The power wheel has to start driving where it left off in the code.