Wednesday, February 13, 2013

Session 16

I am glad that our group is getting  our presentation going for tomorrows final examination. I want to determine how well of a job we have done in these 6 weeks. So far, the amout of experience gained by both Robert and I has been imense. We both hope to continue to grow and look foward to tomorrows presentation.

Session 11

Today was the day we had worked on how to implement a flame sensor. The flame sensor took us the whole night to calibrate and built correctly into our VEX implementations. This sensor will be a keystone to our success in the upcoming competition.

Tuesday, February 12, 2013

Robotics CSU Long Beach Competiton

The competition at Cal State Long Beach was fun to attend. It was the first of a kind for my person. I had fun riding my byclicle all the way to the event. One key point was my partner deciding to carry all our competition materials. We did some more testing in the university. This left us with an unresponsive robot that unfortunately did not perform as well as it should have.

 
The code for the robot was as follows:
 
#pragma config(Sensor, in1,    flameSensor,    sensorReflection)
#pragma config(Sensor, in2,    leftEncoder,    sensorRotation)
#pragma config(Sensor, in3,    rightEncoder,   sensorRotation)
#pragma config(Sensor, in4,    sonarSensor,    sensorSONAR, int1)
#pragma config(Sensor, in5,    fan,            sensorDigitalIn)
#pragma config(Sensor, in9,    Switch,         sensorTouch)
#pragma config(Sensor, in10,   fan,            sensorDigitalIn)
#pragma config(Motor,  port2,           leftMotor,     tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port3,           rightMotor,    tmotorServoContinuousRotation, openLoop,reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
//This function activates the fan from digital input
void turnonfan(){
 while(SensorValue(fan) == 0)  //Loop while robot's bumper/touch sensor isn't pressed in
{
  wait1Msec(1);//Do nothing
 }
}

//This function activates the robot with a bumber switch
void waitforStart(){
 while(SensorValue(Switch) == 0)  //Loop while robot's bumper/touch sensor isn't pressed in
{
  wait1Msec(1);//Do nothing
 }
}

//Function to make the robot turn in place right90 degrees using the encoder (85)
void turnRight(int turnwheels, int turnspeed)
{
 SensorValue[rightEncoder] = 0;    //Reset encoder
  motor[port2] = turnspeed;  //robot turns slowly
  motor[port3] = -turnspeed;
 while(SensorValue[rightEncoder] < turnwheels)//Wheels go until value is reached
 {
 }
}
void turnAround()
{
 SensorValue[rightEncoder] = 0;    //Reset encoder
  motor[port2] = 63;  //robot turns slowly
  motor[port3] =  -63;
 while(SensorValue[rightEncoder] < 170)//Wheels go until value is reached
 {
 }
}
//Function to make the robot turn in place 90 degrees using the encoder (85)
void turnLeft(int turnwheels)
{
 SensorValue[rightEncoder] = 0;    //Reset encoder
 motor[port2] =  -63;  //robot turns slowly
 motor[port3] =   63;
 while(SensorValue[rightEncoder] < turnwheels)//Wheels go until value is reached
 {
 }
}
//Function to make the robot stop
void pause(int waitTime)
{
 SensorValue[rightEncoder] = 0;    //Reset encoder
  motor[port3] = 0;
  motor[port2] = 0;
 wait1Msec(waitTime);
}
void goToFlame()
{
 while(SensorValue[flameSensor]<120)
 {
  turnLeft(5);
  pause(1);
 }
  pause(1);
}
//Function to make the robot go forward 20cm using the encoder
void goforward(int gowheels)
{
 SensorValue[rightEncoder] = 0;       //Initialize encoder; set count to "0"
 while(SensorValue[rightEncoder] < gowheels)//Wheels go until value is reached
 {
  motor[port3] = 95;
  motor[port2] = 95;
 }
 pause(1);
}
void flameCheck()
{
 SensorValue[rightEncoder]=0; //encoder value for ONE full rotations
 while((SensorValue[flameSensor]<110)&&SensorValue[rightEncoder]<91)//first read value in range
 {
  wait10Msec(1);
  turnRight(1,100);          //takes 1st step to the right
 }
  pause(1000);
}
//void goToLine() //searches for a line(value of Zero) and haults movement
//{
// while(SensorValue[lineSensor]!=0)
// {
//    gofoward(2);
//  }
//  Stop();
//}
void goToWall(int distance)  //goes to wall to specified distance away from it
{
 while(SensorValue[sonarSensor]>distance||SensorValue[sonarSensor]<0)
 {
    goforward(1);
  }
  pause(1);
}
void backIntoWall()
{
 SensorValue[leftEncoder] = 0;       //Initialize encoder; set count to "0"
 while(SensorValue[leftEncoder] < 180)//Wheels go until value is reached
 {
  motor[port3] = -127;
  motor[port2] = -127;
 }
 pause(1);
}
void searchRoom1()
{
pause(1000); //pause at home base
goToWall(8);
turnRight(70,100); //90 degress
goToWall(11); //enter first room
flameCheck();  // 1 full rotation
backIntoWall(); //straightens robot
}
void searchRoom2()
{
goToWall(5); //EXIT ROOM 1
turnLeft(70); //90 degress
goforward(172); //need to place robot infront of entrance(69)45cm
turnRight(70,100); //90 degress
backIntoWall();
goToWall(5); //enter room
flameCheck();
backIntoWall();
}
void searchRoom3()
{
goToWall(5); //EXIT ROOM 2
turnRight(70,100); //90 degress
goforward(244); //adjacent of 3rd room hallway(69)45cm
turnLeft(70); //90 degress
goToWall(5);
turnRight(70,100); //90 degress
goToWall(5); //ENTER ROOM 3
flameCheck();
backIntoWall();
}
void SearchRoom4()
{
goToWall(5); //EXIT ROOM 3
turnLeft(70); //90 degress
goforward(244); //necessary distance to be infront of room 4(NEED TO CALCULATE CORRECT DISTANCE)
turnLeft(70); //90 degress
goToWall(5); //ENTER ROOM 4
flameCheck();
}
 
task main()
{
 waitforStart();
 //searchRoom1();
 //searchRoom2();
 //searchRoom3();
turnRight(20,75);
}

Session 15

Today we performed our last testing for our robot implementation of running the four different rooms. It seems like our code has the correct logic behind it, but it is unable to find a harmony with its physical components. Myself and Robert have therefore taken to making alot of minor testings to catch our changing values and implement good successful code for competition.

Session 14

Today we got a sonar sensor. We had some difficulties implementing this sensor because it short circuted once we turned it on and it made direct contact with the metallic portions of our VEX bot. Professor Mason had to give us another new sensor to replace the faulty one. Nowe we have a sensor implementation that reads very accurate values to use for competition.

Session 13

The main challenge for today was running a maze based on distance values. Our robot did not perform as well as it should have and my partner and I will continue to work on improving our future performances.

Wednesday, February 6, 2013

Session 12

Today we have begun to brainstorm on possible strategies to estinguish the flame in the competition. Our main focus is getting a fan implemented into our robot. We decided as a team that a mechanical fan would be the most appropriate and have therefore found that we must build a circuit to power it on top of our VEX robot.

Wednesday, January 30, 2013

Session 10

 
Today we had the opportunity to use a flame and line sensor. These integrations were added to our VEX robot and with a bit more of programming will allow us implement them in to our competition task. It has been difficult getting our sensor values to read a close flame in the range of it stopping once approaching it. We must make this sensor value work better for our robot.

Tuesday, January 29, 2013

Toy Hacking

This is a picture of the toy that I will be hacking for Project 1.
 
My stuffed angel bear has a built in motor, and small set of speakers. I have hacked and soldered the wires of the motor of the animal. The small sound device inside has also been stripped in order to have the programmable music of the "Kurby Theme Song"
 
 
The "Kurby Theme Song" Plays after a push button has been pushed. This then has an input in a MSPS430 and allows for an output pin for the music. Correspondily, the push button also works to allow for the flow of electricity parallel to existing music into a HBride as illustrated in the video below. Therefore, the robot dances to its own beat.
 
 
and stop dancing when there is a pause(empty note).

Saturday, January 26, 2013

Session 9


My partner Bob and I had a difficult time building the physical aspects of our robot and did not have enough time to program it completely. Yet, the experience was motivative to do more (=

Thursday, January 24, 2013

Session 8

Today I was working on the bi-dectional control for the motor of my robot. I found that this avenue would not be advantegeous for me to persue any further at this moment in time because I can use the HBridge, a much easier way to manipulate the toy's motor.

Session 7


MPSP430 Music light show reacted to the beat of the music as it would turn on with it and off otherwise.


Testing the HBridge was a good method to make the motor of the robot move. This will be interesting to implement into my final product.

Session 6


 
In this class session we explored the ability of transistors to cheaply and effectively deliver a certain amount of current through a circuit.

 
Using the correct type of transistor has its perks, for example, and amplified light bulp at its correct and intense state of eminescence.

Thursday, January 17, 2013

Session 5

 
MPSP430 Flashing LED ran on a program type by me. It was neat seeing the colors run in sequence.
 
 

The LED Flashing Band was also interesting because it provided for a more sophisticated program to make this increment in speed possible with a increasing loop.

Wednesday, January 16, 2013

Session 4

 
Today I finished working with the circuits of my switches. This resulted in alternating LED red and green implements on the breadboard.
 

 
I finalized the day by semi-contructing the bottom base of the square bot. It was frustrating but fun at the same time.

Tuesday, January 15, 2013

Session 3

The amout of resistance determined how much electricity was recerived by the LED's, and therefore how intense their light was in the dark.

 
Another thing that was done today were the use of two double throw switches to alternatively turn on and off a light switch (=

Thursday, January 10, 2013

Session 2

The first thing I did this thursday was build a series of lights with varying and increasing resistances. This breadboard shows the way light intensity decreases with an increase of resistance.

Another fun thing I did today was use a Voltmeter. This device is intended to measure the voltage, so I used it to measure the wall socket.

Additionally, the Voltmeter has another neat fuction to work as a resistance measure. I set and attached a resistor to measure its resistance up to 2.946*10^3 ohms
 

Wednesday, January 9, 2013

Session 1

This was the bottom side of a breadboard that I built today using resistors and some capacitors. They are soldered on the opposite side.

This side of the breadboard I soldered shows the lead pools. They are of a conical shape and fully cover the copper base.

A continuous wire was assembled from two linear portions of cut and stripped wire. The final product was a loop with shrinking plastic for safe handling. 

We build a 5V power supply as our final project for the 1st day of class. It was tested and it had a good current at the end of the tip.