Jump to content

User:Dstaub/robotcar

From Wikiversity

This is designed for a person working on a project for 4 weeks as part of a 3 credit class. Please copy this form to your user page. Then delete everything in italics when filling out this form.

Week0 Activities

[edit | edit source]

problem/project Goal

[edit | edit source]

To design and build a prototype robot car that is autonomous using a toy power wheels car.

My First Task

[edit | edit source]

As a team our first concern was the steering system. My first task was researching previous experiments similar to ours. I kept an extra eye out for how others had modified the power wheels steering system because this project typically revolves around toy RC cars which already have remote steering.

Week1 Activities

[edit | edit source]

Summary of actual work over first weekend

[edit | edit source]

During my research I found this video that had given me an idea on ways we could possibly steer the power wheels. In the video this team uses an iPhone to wirelessly control a full sized car. Now it's not autonomous but the video briefly shows a power wheels the team had modified using a bike gear and chain for the steering. Later this week on Friday 9/21/2012 I brought my example of using the bike chain and gear to Chris as we met in the engineering room. We both brainstormed ideas and so far have settled on using the bike chain and gear.

Week1 Narrative

[edit | edit source]

Over this first weekend for the team I did my own research on similar projects done in the past looking for different ways to control the car. The majority of examples I could find used an IR or Infrared sensor controlled by an arduino or similar micro controller like the example here. I also kept an eye out for ways to steer the power wheels electronically.

My Second Task

[edit | edit source]

Present the research I have done to the rest of the group and reach an agreement on the actual method of steering our power wheels.

Week2 Activities

[edit | edit source]

Summary of actual work over second weekend

[edit | edit source]

This week our group obtained a steering motor and finally settled on how we are going to steer this vehicle. I made a simple mount for the steering now all we need is the actual power wheels car to take more measurements from and we will be able look at how we are going to use the arduino for steering.

Week2 Narrative

[edit | edit source]

9/24/2012 After meeting with the group on Monday we received info from our instructor that the school had purchased a power wheels for us and should be here next class. The power wheels car we are to receive has a 12v battery and two speeds 2.5 mph and 5 mph. This presented a problem, Chris had explained how the motor we planned on using required far more voltage than our power wheels could apply. To solve this we began searching online as well as the class for a 12 volt motor strong enough to turn the steering wheel. Mark had found a power window motor on Craigslist that ran off of 12volts. By next class Mark will pick up the power window motor and hopefully our motor problem will be solved.

9/26/2012 Today Mark brought the motor that we purchased from Craigs List and we began testing it to see if it worked properly. We used a wall outlet converter that output 12v and the motor moved perfectly with enough torque too. We tried pushing against the swing arm but the motor kept pushing it. We will plan on meeting this Friday but until then I will take the motor home and try to make some sort of mounting for the motor for the power wheels.

9/27/2012 Today I made a simple mount for the motor

The longer 2x4 attached to the motor mount is meant to support the motor off the floor or seat of the power wheel. When we get the power wheels I will simply attach this setup to the steering wheel of the power wheels.

My Third task

[edit | edit source]

This third week we hope to finally have the actual vehicle to start actual assembly of the steering system. Also I hope to research and find coding for the arduino as to how to control the steering system.

Week3 Activities

[edit | edit source]

Summary of actual work over third weekend

[edit | edit source]

This third week we finally got the power wheels! Most work was focused on the steering of the car and researching code and different types of sensors to steer the car. Since this power wheels is new we would like to keep it like that so any modification we plan on making to the car itself we must first demonstrate in another form.

Week3 Narrative

[edit | edit source]

10/03/12 Today the Power Wheels was assembled and ready to go! First thing we did was find out the range of motion of the steering wheel vs our motor. The steering wheel had a range of about 46 degrees while our motor had a range closer to 90 degrees. To keep the motor from over steering the wheel we plan on putting in some kind of physical stop to the motor so that it cannot physically turn the wheel more than the steering wheel can rotate. Chris suggested filling in points on the motors gear track with epoxy so that it cannot move past a certain point. Mark suggested simply cutting the gear track so the motor cannot no matter what move past but this presents a problem. With the tracks removed the gear that drives the motor will simply run off the gear track. So yes it will stop but it will be unable to move in the other direction unless physically pushed back in place. So with that Chris is going to fill in the gear track with either an epoxy or fashion some sort of other mechanical stop for the steering motor. In the mean time I had researched some preferred sensors used by other groups doing similar projects and the ones that seemed to work well used a ultra sonic sensor or a sonar sensor because most seem to have a higher range than a typical IR sensor. Sonar sensors tend to have a range between 3-5 meters depending on the model while IR are within 1 meter unless its an expensive one. The sonic sonar sensors are cheap so I will order one online today and hopefully have it by Friday to begin testing code.

10/05/12 Success we have the Ultra sonic Sensor! Now today we are focusing on the coding itself to see if we can get an accurate distance reading from the sensor. Looking online we found multiple codes others had used to calculate distance however we settled for the following code because it worked best for us. It accurately could detect up to about 2.5 meters wich was represented by 200 in the arduino program. It does get a little hazy when faced infront of multiple small objects such as the table legs and chair legs of the class room but we only plan on using the car infront of solid flat surfaces so we are not concerned to much about that at this time.


My Fourth task

[edit | edit source]

Our fourth week we plan on combining these three elements; the car, the steering motor and the sensor into a working prototype before actually fitting it to the car itself. We hope to get the programing down to when the sensor reads that its about 1 meter away from something it turns the motor in the left/ right position for the steering wheel for a set amount of seconds and then returning back to standard straight position

Week4 Activities

[edit | edit source]

Summary of actual work over fourth weekend

[edit | edit source]

This last week I focused mainly on the steering programing using the arduino, moto sheild and the sonic senor we purchased. I mainly did research and just played around with the codes I found in the actual arduino program.

Week4 Narrative

[edit | edit source]

Over this 4th weekend I mainly researched any code I could find regarding our HR-S04 sensor the arduino and a monster moto sheild. The first useful code I found was here This code will display the given distance between the sensor and the wall when you are in serial mode in the arduino program.


/*
HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 13 Trig to Arduino pin 12
*/
  1. define trigPin 13
  2. define echoPin 12

void setup() {

 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);

}

void loop() {

 long duration, distance;
 digitalWrite(trigPin, LOW);  // Added this line
 delayMicroseconds(2); // Added this line
 digitalWrite(trigPin, HIGH);

// delayMicroseconds(1000); - Removed this line

 delayMicroseconds(10); // Added this line
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;
 if (distance >= 200 || distance <= 0){
   Serial.println("Out of range");
 }
 else {
   Serial.print(distance);
   Serial.println(" cm");
 }
 delay(500);

}

Now all I need to figure out is how to get the arduino to send a command to the motor to turn once the sensor detects it is a certain distance away from an obstacle. After searching more I found this site here of a project needing the sensor to turn a servo motor 90 degrees. We ended up using this code from the web site...

  1. define trigPin 12
  2. define echoPin 13
  3. include <Servo.h>

Servo myservo;

void setup() {

 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
 myservo.attach(9);
  

}

void loop() {

int duration, distance,pos=0,i;
 digitalWrite(trigPin, LOW);  
 delayMicroseconds(2); 
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;
  Serial.print(distance);
  Serial.println(" cm");
 if(distance<5)
 {
   myservo.write(180);
 }
 else{
   myservo.write(0);
 }
   
 delay(100);

}

10/12/12 I met the group on friday and presented the codes I had found to the group while mark and I tried to make them work with our setup.

IMPORTANT COPY AND PASTE THE CODE FROM THE EDIT WINDOW

Complete Team Page

[edit | edit source]

Robot car/Howard Community College/Fall2012/P2-501-CDMN