Thursday, December 12, 2013

SUMMARY OF THE HAMMERHEAD:

The Hammerhead is a small RC car measuring about 1' x 8".  It is controlled by a simple IR remote with very basic buttons.  The car can stop, go forward, left, right, and backward, and with each direction the LED on the top of the car changes to a different color.  In addition to all of this, there are three various horns that the car has, controlled by the "A", "B", and "C" buttons on the remote.  The car is currently run by 3 9V batteries, two controlling the motors and one controlling the Arduino, LED, and Piezzo Buzzer.

We are all very proud of the finished car and it was great seeing all of our hard work turn into something so cool.  In total, about 30 man hours were put into building this car, however many of those hours were spent troubleshooting problems that could have been avoided.  We learned alot about coding and the design process from this project and it was a great learning experience.

Without further ado, the HAMMERHEAD!









Thursday, December 12, 2013

Today we finished our car! We made some pretty cool additions to the car, one of which is the piezzo buzzer, seen below.

The buzzer is the circular black piece in the upper right corner of the breadboard, and it allowed us to make some horns for our car.  Right now, we programmed the General Lee's car horn from The Dukes of Hazzard to sound when "A" is pressed and The Imperial Death March from Star Wars when "B" is pressed.  Coding these was fairly difficult however.  We used the SIK Guide's Circuit 11 for the piezzo buzzer as a starting point, and then had to look up the notes for these two melodies online.  Once we had the musical notes for the two melodies, we had to guess and check the beats that they were supposed to be played at in order to get them to sound well. Our friend Josh Zubricki helped us alot with this part.  In the end, I think we nailed the two melodies and got them to sound really well.  
Putting these two horns into our original code however was very hard.  We needed to get the help from our computer programming friend, Josh Smolinski, to try to help us.  Apparently, the arduino board has two timers that allow different functions and things happen.  The IRemote library that we downloaded was using the same timer as the piezzo buzzer so the code would not compile.  We had to go into the program files and change the timers that each was using so that they were not running on the same one.  Once we did this, it was fairly easy to integrate the buzzer code into the original one.  A copy of our final code is given below. 


We also fixed our problem with the wheels not spinning at the same speeds.  We took a potentiometer and connected it to the left motor (the one that was spinning faster) so that we could control the amount of voltage going to that motor.  By doing this we were able to slow down that motor to about the same speed as the other motor.
In addition to doing this, we also got some 22 gauge wire and replaced some of the obnoxiously long jumper cables underneath with the H-bridge and a couple on the above breadboard so that it looks nicer and is less messy.

We also wrote our final paper for the project.  Altogether we worked for about 5 hours today which was a lot more than any of us were planning on working on it.

We made decide to set up another melody to play when the "C" button is pressed tomorrow morning before we show off the final car, but other than that we are completely done with the project!

Tuesday, December 10, 2013

Tuesday, December 10

Today all four of us got together and began building the final car.  We got our 3D parts today, images shown below.


The L bracket fit very tightly onto the front of the motor and we cannot take it off without it potentially breaking. The other bracket slides on nicely, however the holes on the two pins do not line up the way we wanted them to, so we might need to drill through one of the brackets to fit a bolt through it.

We were able to slide a zip tie through the screw holes so we were able to at least get the car built and running.  The following image is of the car that we built.

We used two breadboards, one for the IR remote and the RGB led on the top of the car and then a separate breadboard for the H-bridge underneath.  There are three 9V batteries connected to the car, one running the Arduino board and two for the motors.  A video of the car running is given below.


Right now, the left motor is spinning a little faster than the right one so the car does not go straight forward or backward.  We are going to bring the car to Prof. Thompson tomorrow to see if there is anything that he can do to help us get it to drive straight.  The batteries are pretty low right now so the car is not running at full power in the video.

The following images are the drawings of the two brackets and the car frame that we got cut and printed.



In total we worked for about 3 hours.

Sunday, December 8, 2013

Sunday, December 8

Last week, Angelo and myself got together to work on some Arduino problems that we were encountering.  The new motors that we got require more power than the 5V that the Arduino board supplies, so we needed to set up an H-bridge so that we would be able to power the motors using a 9V battery instead.  We needed to Google how to setup an H-bridge because we were unsure as to which pins did what, and we found a pretty good picture that tells which pins go where on the H-bridge.  This picture can be found at http://dtostillwell.com/?p=251.  After setting it up we tested it on smaller motors and it worked well. The onlyy problem that we faced was that the H-bridge requires a lot of wires and the jumpers that we use are too long.  It creates a mess on the breadboard, as you can see in the following picture.

The IR sensor on the breadboard was being blocked by these wires which made it very difficult to control everything with the remote.  Because of this we are thinking of cutting some of the wires smaller or just separating the H-bridge and the IR and RGB onto two separate breadboards.

 Luckily we do not have to change our code from the one previously written because the H-bridge still allows the motors to be run using "digitalWrite" commands.

We also received our car frame that was laser cut using 1/8 inch plastic.  It came out really well and all of our bolts can fit into the holes nicely.
We are still waiting for our motor brackets which we should be able to pick up from the lab tomorrow.  We attempted to make the car Wednesday using zip-ties instead of the brackets however every time the direction changed on the motors, they slipped and would not stay straight.  Once we have the motors, we will post a picture of the finished car and a video of it driving with the remote.

It took about an hour to get the H-bridge working for both motors and about 1.5 hours to make the car on Wednesday. 

Friday, November 29, 2013

Friday, November 29
Tuesday, we wrote the code for our car that integrates an IR remote, two motors, and the RGB led light. The code will allow a user to drive the car using the IR remote, and with each different direction that the car goes, a different color light is lit. A copy of the code is given below.
The motors that we are using are gear motors with two wires that can connect directly into digital PWM pins of the arduino board.  One of the wires allows the motor to spin clockwise, and the other wire allows for counter clockwise rotation.  Because of this, coding our car was alot easier to do than we originally thought.  An H-bridge was also not necessary because of the simplicity of the motor pins.  We used the IR library that Prof. Sullivan posted to the Design Lab blog, which made setting up and using the IR remote very easy.  The RGB led was integrated into the code to help tell what is going on when a button is pressed. With the way the code is written now, the led glows green when going forward, red when going backward, blue when it turns left, purple when it turns right, and white when it is not moving.
A video of the code uploaded to the arduino board with the motors and led attached is below.



This final code might be slightly altered if we decide to change how the car is going to turn. The way it is now, to turn either left or right, the corresponding wheel will spin while the other is stopped. We also are thinking of ways to integrate the "A", "B", and "C" buttons into the car.  Right now we are thinking of doing pre-set paths that the car will follow.

We also sent in our parts for 3D printing and laser cutting.  We needed to print 4 parts, two of our L-brackets and two of the motor brackets.  Images of these two final models submitted are below.



The code took about an hour to write and add comments. We should have our new motors and our printed and laser cut parts altogether by early next week so that we can begin building the working model.

Tuesday, November 26, 2013

Tuesday, November 26

Yesterday, all four of us met and worked on SolidWorks and a motor test.  We made a test car out of cardboard and our wheels, casters, and motors. The following video is a short clip of the car going straight.



From this test we determined that the motors that we bought are not going to have enough torque to drive the car.  The motors get stuck and need a push to get spinning when starting from rest.  Because of this we ordered new motors which should have more than enough torque and RPMs to drive the car. 
Because of the new motors, we had to update our SolidWorks brackets that we made previously to fit these newer, bigger motors.  They have the same basic shape only bigger.
Today, we tried to work on the code for the car however my arduino board is currently having some problems which made it unable to be used.  We will start working on the code shortly.
We worked for about 3 hours yesterday and an hour today.

Tuesday, November 19, 2013

Tuesday, November 19

Today all four of us met in the lab room and worked on the solid models of the parts.  We decided on the ball casters for the front wheels and made one on SolidWorks.
https://www.dropbox.com/s/q7aq4veq5j4vort/Ball%20Caster%20Body.SLDPRT
https://www.dropbox.com/s/g4dg0sy6fo3873d/Sphere%20Ball.SLDPRT

We also made the main frame of the car.  There are still some minor additions we have to make in terms screw holes, but for the most part it is complete.
https://www.dropbox.com/s/flr4sbwwle2xeq7/Car%20Frame.SLDPRT
An L-bracket was then made that will connect the motor bracket and the end of the motor near the D shaft.  We made it the same width as the motor bracket so that the screw holes will line up for both brackets.
With this all the solid models were complete so that we could assemble them all into the final car. The link to the zip file containing the assembled car and an image can be found below.
A motion study on the car showing the motion of the wheels will be added later.  

We also ordered our back wheels and the ball casters from Pololu which should be in by next week.  Our motors, H-bridge and IR remote came in yesterday so we will begin working on the code for the car this weekend. 

In total we worked for about 2 hours today on all of these parts and assembling them.