Archive | May, 2012

Final robot

4 May

O

Advertisements

The change

4 May

The shield that we built did not work, instead we replaced it with a breadboard and jumper cables which took 45 minutes to make.

The sheild:

Breadboard:

Our code to draw fau

3 May
int pingPin=12;
long duration, cm;
float IR1;
float IR2;
void forward()
{
 analogWrite(11,100);
 analogWrite(10,95);
 digitalWrite(7,HIGH);
 digitalWrite(6,LOW);
 digitalWrite(9,HIGH);
 digitalWrite(8,LOW);
}
void rotateR()
{
 digitalWrite(7,HIGH);
 digitalWrite(6,LOW);
 digitalWrite(9,LOW);
 digitalWrite(8,HIGH);
 analogWrite(11,95);
 analogWrite(10,100);
}
void angleR(int degree)
{
 rotateR();
 delay(degree*(256/36));
 stop();
}
void rotateL()
{
 analogWrite(11,125);
 analogWrite(10,125);
 digitalWrite(6,HIGH);
 digitalWrite(7,LOW);
 digitalWrite(8,LOW);
 digitalWrite(9,HIGH);
}
void angleL(int degree)
{
 rotateL();
 delay(degree*(256/36));
 stop();
}
void stop()
{
 digitalWrite(6,HIGH);
 digitalWrite(7,HIGH);
 digitalWrite(8,HIGH);
 digitalWrite(9,HIGH);
 digitalWrite(11,LOW);
 digitalWrite(10,LOW);
}
void setup()
{
 pinMode(6,OUTPUT);
 pinMode(7,OUTPUT);
 pinMode(8,OUTPUT);
 pinMode(9,OUTPUT);
 pinMode(10,OUTPUT);
 pinMode(11,OUTPUT);
}
void ping()
{
 pinMode(pingPin, OUTPUT);
 digitalWrite(pingPin, LOW);
 delayMicroseconds(2);
 digitalWrite(pingPin, HIGH);
 delayMicroseconds(5);
 digitalWrite(pingPin, LOW);
}
void loop()
{
//forward();
//delay(3500);
//angleL(125);
//forward();
//delay(2500);
//stop();
//delay(8000);
 //forward();
 //delay(2000);
 //stop();
delay(1000);
forward();
delay(4000);
angleL(130);
forward();
delay(3500);
angleL(140);
forward();
delay(4000);
stop();
delay(5000);
//delay(1000);
//forward();
//delay(3500);
//stop();
//delay(3000);
}

Hardware

3 May

Our group, Robopower, has been working on building a robot for the past four months. A few weeks ago we finally finished it. Our goal is to get our robot to write FAU.  The robot has various parts to it, and each has to be properly tested in order to make sure the robot can function as a whole and move according to the program. Our robot consists of 3 sensors – 2 IR sensors and 1 ultrasound sensor. The IR sensors are on the left and right side of the robot and the ultrasound sensor is in the front. The first component we tested was the IR sensors. We set up a reflector wall at the end of a sheet of paper and set the robot at the opposite end of the paper. We measured the distance from the wall to the robot and recorded the analog output numbers. We moved the wall closer to the robot by 1 cm and repeated the same action as above. We recorded our information and analyzed the numbers in the graphs shown below.

When the robot was 4 cm away from the reflector wall, the analog numbers decreased and randomized. Therefore, the optimum usage of the IR sensor is when the robot is more than 4 cm away from the reflector walls.The diameter of the wheels is about 6.5 cm. Therefore the circumference is 6.5π which estimates to about 20.42 cm. We can use this information to figure out the distance that the robot has traveled after one full wheel turn. We believe that the robot moves 20.42 cm in one wheel PWM rotation. To test the PWM pulses, we devised a code that would send 10 pulses in order to make a full rotation, using the motor pins 6, 7, 8 and 9. We realized that ten pulses were not adequate enough to make one full wheel rotation. We kept increasing the number by increments of 10. Unfortunately, we did not have enough time to finish testing the PWM pulses. We will continue testing them in class on Thursday. Although the Ultra sound sensor  is pretty much reliable we will also conduct a sanity check, much like we tested the IR.To recapitulate,  we must test each part of our robot to make sure that they work because the job can only be done properly if all the parts work together, correctly. We have tested the IR sensors and we found that the optimum usage is 4cm, we are also in the process of testing the PWM and ultra sound sensors.

Algorithm

3 May

Group Robopower AlgorithmBelow is a algorithm of approximately how our group will draw FAUCalibrate IR sensors. Move robot 10cm away from wall then check the output, repeat but gradually add 5cm until you get to 20 cm To draw the F:Draw vertical line (20 cm, 0 degrees, north)            Move 1/4th turn            Check US sensor            Check IR sensors Adjust (if needed) use PWM to change the speed of the wheels to make robot turn to desired position.             Repeat until 20cm            Check sensors to make sure you are at (20 cm, 0 degrees, north)Rotate(90 degrees)Draw horizontal line(10 cm, 0 degrees, east)            Move 1/4th distance            Check US sensor            Check IR sensors Adjust (if needed)            Repeat until 10cm            Check sensors to make sure you are at (10 cm, 0 degrees, east)
Draw horizontal line(10 cm, 0 degrees, east)            Repeat the above To draw the A:Draw vertical line (20 cm, 0 degrees, north)Rotate (90 degrees)Draw horizontal line (10 cm, 0 degrees, east)Rotate (90 degrees)Draw vertical line (20 cm, 0 degrees, south)To draw the U:Draw vertical line (20 cm, 0 degrees, south)Rotate(90 degrees)Draw horizontal line(10 cm, 0 degrees, east)Rotate (90 degrees)Draw vertical line(20 cm, 0 degrees, north)

Group Robopower: Methods

3 May

Our group is drawing FAU for our project. We have come up with a way to draw this without taking big steps. We will divide and conquer this task into small steps in order to accurately draw FAU. To complete this task, we need to have our robot draw a horizontal line, vertical line, and make a 90 degree turn.

            To draw the F, we need to be able to draw a vertical line first to the North. Then, make a 90 degree angle turn and draw a horizontal line to the East. After, we pick up our robot, and place it halfway between the first line we drew and point it to the East. Then, we draw a horizontal line to the East.

            To draw the A, we need to draw a vertical line to the north and make a 90 degree turn. After, we need to draw a horizontal line to the east and also make a 90 degree angle turn again. Then, we need to draw a vertical line to the south. Lastly, we will pick up our robot and place it halfway between the first line we drew, and draw a horizontal line to the east. To draw the U, we would first start in the north, unlike how we started to draw the other letters. We would draw a vertical line southward and make a 90 degree angle turn. After, we would draw a horizontal line to the east and make another 90 degree angle turn. Lastly, we would draw a vertical line northward. Below is a diagram of this process and is numbered to make it a bit clearer.

 

Our new design

3 May

We decided to think over our design to draw FAU, the universty that we are representing.