User:Mmuhlbock/enes100/Robotcarp3

Write problem/project Goal
What is your wording of the overall problem/project goal?

My First Task
What are you going to do for the team this first weekend?

Summary of actual work over first weekend
Worked on the motor timing, and getting the Motor to run off of the Arduino and monster moto sheild and essentially get us back to where we left off at the end of project one which proved to be more difficult then anticipated.

Monday
Today to help with our future programming needs the motor needed to be timed for a full range of motion from one stop to the other. By doing this we can take the timing values and and use them in the Arduino sketch to determine how long it takes to make a full right turn and then how long it takes the motor to return to center. Did this by connecting the motor directly to our power source then and using a timer to the the amount of time it took for the gear to hit one of our stoppers.Doing three trials in both directions we came out with a pretty even data set. Below is the data we collected for the timing in both directions

So we determined that the motor is slightly faster in the counter clockwise direction as opposed to the clockwise direction. This difference comes out to be about .2 seconds. Might need a more accurate means of measuring the timing to get a better number but for now I think this will do.

Wednesday
Trying to get the motor to run the way we had it running at the end of project 1 prooved to be more difficult than anticipated. using the same set-up that i had at the end of project 1 and using the example code found on the spark fun website. The code up loaded fine but then the motor initially only moved in one direction when the motor should go back and forth the same amount of time in both directions. This set us into troubleshooting mode first trying a different code from the Arduino example sketrch library called motor test. After running this sketch the motor still only moved in on direction. Then trying seversal different wiring combinations and having the moto sheild let out a high pitch sound we still couldnt figure out the problem.

Friday
Meeting up on friday in the engineering room. Using a different smaller dc motor we tested the code hooked up to the arduino and motor sheild again this yeild the same result of the motor only spinning in one direction and no the other. After a few other possible problem areas we tried to replace different parts of our system then we finally tried a different monster moto sheild uploaded the code and it finally worked moving the motor in both directions, doing what we call the windsheild wiper.

Below is the code that was used

My Second Task
Second task will be to reconfigure the example code we have into a code that tells the motor to go in a given direction then return to center then go in the opposite direction and return to center.

Summary of actual work over second weekend
This week I worked with the motor Go sketch to figure out a way to get the motor to stop and then have the switch directions. Then I created an outline for the motor to drive the robot car in a square path all that is required to complete it is to fill in the delay amounts with timing data that will need to be collected this coming up week.

Week2 Narrative
This week my primary objective was to refine our general code into a code that does what we want. What we want is for the motor to go a certain direction stop then turn back in the opposite direction so the motor could be used to turn a steering wheel one way then turn it back the other to re-straighten the wheel so the car could travel in a straight path once again.

I started by coming up with a few lines of code that i thought might make the motor stop for a desired amount of time and then go again the code I Tried is below

This section of code was to be placed into the void loop. It was supposed to put the motor in motion in a clockwise direction for half a second stop it for 4 seconds then run it again for another half a second in the clockwise direction. Instead this code made the motor spin in the clockwise direction for 4 and half seconds then clockwise for half a second. From here I took a closer look at the code and since its an example code from the Monster Moto Shield site it has a lot of explanations about exactly whats going on. After doing this i saw there were a couple of defined functions that weren't being used. One of which was was defined as BREAKGND so I decided to use the and try to use it in my code using a couple different combinations the on that finally worked was.

This ended up working for me and this make the motor stop for 1 second before starting again with the new direction so then using this i went ahead and made a basic outline of a sketch so that the car could theoretically travel in a square direction. But since i don't know the timing the car takes to turn the wheel and make a 90 degree turn so I just plugged in semi-random values but they could be in the ball park of the actual number.

The below is what will need to be plugged into the VoidLoop section of the code

Now theoretically this code will have the car travel for 5 seconds in a straight line turn on the motor for 1/10th of a second ten stops there for one second the turns back in the opposite direction for another 1/10th of a second to get the motor back in the centered direction then it stops moving for five seconds and this is when the is able to travel in a straight path.

All this testing was done on a small DC motor because Lucas needed the actual motor to make some modifications to it

Video
HERE is the video of the program actuating the motor

My Third Task
My next task will be to collect timing data for the big wheels car that we have. Such data points will include amount of time to travel 10 meters, amount of time for the motor to turn all the way, amount of time to make a 90 degree turn. There could be several other values that we will need to to be taken as well. Once collected i will be able to plug them into my sketch and then we should be able to start testing on the actually car assuming that we get it working off the car.

Summary of actual work over third weekend
This week I made a couple adjustments to my code which included adjusting the delay amounts corresponding to data we took on the car. Added definitions to varible amounts that will be used for the delays so i can easily change these values without having to go through the code and finding all the values I need to change. Lastly I added a command that has the motor find the center point everytime the arduino is reset.

Monday
Monday was spent collecting data on the power wheels car that we are using. This timing data will be used in our code since we are making a predetermined path these numbers will help us get a ball park estimate of what delay values will need to be plugged into the code so we can make a square and then eventually a figure eight. First we collected data of the speed of the power wheel in a straight line using a heavy object to press on the gas pedal. After about four trials we determined the speed to be around 3.8 feet/sec. Later on we discovered that this speed was already given to us in the owners manual but they give a speed of 3.6 feet/sec. I think there speed is slightly lower than ours because theres was with a child in the car and ours was without. Other data we took includes the turning radius but we couldn't really quantify how big it was but we found out it was bigger than expected so i will estimate a value for the delay of the turn and then when we get the motor affixed to the car we will fine tune the number by process of trial and error.

Wednesday
Today was spent adjusting the code so there were defined variables at the beginning of the sketch so when changing the values of the variable you wouldn't have to go through the code and find all the values you need to change. Below is the definition section of the code that I added


 * 1) The LE value is the amount of time the motor will run left
 * 2) The RI value is the amount of time the motor will run right
 * 3) The ST value is the amount of time the motor will remain in the centered position therefore driving the car in a straight line
 * 4) The PA value is the amount of time the motor will stop in the middle of a turn before driving the motor back in the opposite direction to make the car straighten out again
 * 5) The SP value is the speed the motor is running at

Friday
Friday was spent writing a centering function so that when ever the Arduino is reset the motor would find the desired starting point for the motor. This was done by adding a section of code to the setup function. The logic behind it is, it takes the motor about 2.7 seconds to travel to each extreme of the gear on the motor so wrote a function that would drive the motor 2.7 seconds in the clockwise direction and then 1.35 secs in the counter clockwise direction. So that no matter what point the motor starts at its gonna go 2.7 sec clockwise and then its gonna hit a physical stop on the gear then it is programed to go half way back and that is the center point this value was found through trial and error i first thought it would be 1.35 sec but it ended up being 1.41 sec. This is all shown in a video below along with the motor running the normal turning function afterwards. below is exactly what it looks like in the code aswell.

Video
| Motor Centering

My Fourth task
Next tasks will include designing another path for the car to follow such as a figure eight and then once the motor is on the steering wheel get exact numbers for the ddelay values needed for the car to travel 20 meters then make a 90 degree turn and then straightening back out again for another 20 meter straight away.

Summary of actual work over fourth weekend
This week was spent fabricating a frame to mount the steering motor to the steering wheel. Using Lukas's and Chris's designs my primary task was actually fabricating the frame with Lukas while Chris worked on the bracket to mount the motor to the car. Also me and Chris came up with a simple solution to pushing down on the throttle to make the power wheel move while the program for the steering is operating. Also I tried to get the universal 12 volt battery I found in the room charge by taking to a battery specialty store.

Monday
Gathered materials required to build our mount design. Materials include 1/2" ply wood, a couple different brackets that will be used to mount the actual frame to the car so that is can be removed easily, also wood screws were used. Then we made all the necessary cuts for our frame, screwed them all together and the frame was complete I then had to make some adjustments to the brackets to make them fit on to the modular platform. this required drilling a new hole in one of the brackets, which proved to be more difficult than anticipated as the bracket was made out of some pretty heavy steel. so i ended up starting by drilling a small hole through it and increasing the size of the drill bit with successive attempts which worked much better than just trying to do it with one large bit. Then I mounted the brackets to the box and then to the car. Picture below



Wednesday
We worked on the angular piece of the frame the part that actually supports the motor against the steering wheel using a heavy duty hinge on the underside of this piece allowed us some tolerance for error in our design and made it much easier to mount this piece. Then Chris used a series of zip ties, neoprene foam, and cross brackets to affix the motor to the wheel then we tested the motor running while the motor was mounted to the wheel. Video | Here and a close up | Here. Also in these videos you can see how exactly the motor put on the wheel. Chris and I also came up with a way of pushing down the throttle which is hard to describe but can be seen in this | Video.

Thursday
Thursday I spent my time trying to get the 12 volt universal battery found in the room charged. I took it to Battery Plus, a battery specialty store in Columbia, they told me the battery had been dead for a really long time and that they wouldn't be able to charge it for me. They had several other 12 volt battery options but non in our price range that would have provided a sufficient amount of amperage for a decent run time for the car. So in the end we weren't able to test the car remotely. But as stated in our next step section on our team page I think we have a long way and that the next team to pick this project up has a solid idea of where to start ie. remote power source and adjusting the timing of the code after testing.