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.
Wednesday, February 13, 2013
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.
//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
//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
{
}
}
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 !!*//
#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
void turnonfan(){
while(SensorValue(fan) == 0) //Loop while robot's bumper/touch sensor isn't pressed in
{
wait1Msec(1);//Do nothing
}
}
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
}
}
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;
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);
void goToFlame()
{
while(SensorValue[flameSensor]<120)
{
turnLeft(5);
pause(1);
}
pause(1);
}
pause(1);
}
//Function to make the robot go forward 20cm using the encoder
void goforward(int gowheels)
{
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);
{
motor[port3] = 95;
motor[port2] = 95;
}
pause(1);
}
void flameCheck()
{
SensorValue[rightEncoder]=0; //encoder value for ONE full rotations
{
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();
//}
{
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);
}
{
while(SensorValue[sonarSensor]>distance||SensorValue[sonarSensor]<0)
{
goforward(1);
}
pause(1);
}
void backIntoWall()
{
SensorValue[leftEncoder] = 0; //Initialize encoder; set count to "0"
{
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();
}
{
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();
}
{
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);
}
{
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.
Subscribe to:
Comments (Atom)



