Wednesday, February 16, 2011

the powerpoint day

on tuesday february 15th we all just sat in class and enjoyed a very enthusiastic talk by professor mason about presentation so now we have to duplicate what he did and present our vex bot to the class in 10 to 15 minutes
may god help us because i havent even finished half of it because i was so much behind on all my blog entries that im doing the last of them now which is exactly 50 minutes to class :D

This is not one of the 18 days blog entries

This is not one of the 18 days blog entries this is kind of an explanatory blog to say why my last few entries does not have videos or pictures
i tried sending files from my iphone via email but for some reason it keeps failing
i promise to upload the images and movies  as soon as i fix the issue

Vex Competition Day

so finally on the highly anticipated competition day i arrived at the college campus at 10 and started wandering around until my teammate showed up and we started doing some last minute programing which in my idea only made the bot worse anyhow on our turn it was an embarrassment and a failure or maybe not since the only groups who actually had a bot up to bar were the Andy's group and also brian and Mitchels group because they all have had prior experience in the field because of being part of the robotic club but still that is not the only reason i found Brian and Mitchels Bot design very interesting and i know for a fact that specially Brian is very creative and dedicated and as for andy he is a hard worker and dedicated person who wont leave his goal until he reaches it.  as for our robot if i am being honest both me and ben coming late class hurt us a little bit and also my lack of experience in programing.

last tuesday before the vex competition

on last tuesday before the vex competition i mostly worked on programing the infrared sensor and the line sensors.  after doing so all day i combined the code for both and tested it on the bot and heres the result

note that at this point only one of my line sensors was working the other one i later realized at this time shorted because the soldering joints on the back of the sensor had torn the tape that i had put on it apart and were touching the metal parts of the bot and thats why at the end of the film our bot gets stuck on the line

More programing for Sonar

so on thursday after fixing the issue with the sonar not reading any value i practiced with the sonar system and i realized that the range for the sensor was not very far so when the object was too far the sensor would read the value of -1 which just made the programing harder since i had to tell the bot to also consider this case as the object being too far so go forward.
anyhow after me complaining a lot about the sonar sensor and how it is ineffective professor mason probably got tired and gave our group an infrared sensor which works 10 times better at least in my idea and that also proved that nagging could actually work. :D

more work on Vex Bot

so after finishing my line sensor on tuesday we decided to make another line sensor for the bot and it took me about an hour and half to do so this time around and after finishing up the sensor i started programing and instaling the sonar sensor on our bot but me and also other people faced some difficulty getting any values from the sonar into the programming anyways because of lack of time on that day professor mason suggested to continue working on the programing the day after.

line Sensor

On first tuesday of february while Ben was working on the color sensor all day i was struggling with the line sensor but eventually i mastered it and you can see the result below


the purpose of the line sensor as its mentioned in the name is to sense the line and tell the bot to turn and does not pass the line.

First Programming session for the robot

even though i missed the class on that day i think i have to post a blog to get credit for not showing up :D
anyways as i was informed on that day everybody worked on programming for their bot that we made in one of earlier classes. the purpose was to make the bot travel through a maze with minimum error which included not hitting or passing lines and also getting as close as possible to the finishing square in the maze.
even though i wasnt in class i asked about the programming later from my partner, ben, for the robotic competition.

January 27 and the Chip 555

on thursday january 27 we worked with a very interesting chip, chip 555 timer.
we used the chip in some various settings. What the chip does is basically controlling the output signals when the values change for capacitors and resistors. first we made a board that by control of the chip made a LED flash periodically.  Then we used the chip to control the sound coming out of this speaker.

and after that we connected our boards to an oscilloscope to see the difference in amplitude and and wavelength of a signal when we change the values of capacitors or resistors.
 

Tuesday, February 15, 2011

Catching up

so this blog entry is for tuesday January 25th
on that day I started working on my toy project and what i did was taking apart the Fish i had and figuring out what wire does what and eventually which wires controlled motors

so after taking the thing apart i found two different sets of motors one that controlled the jaw and one for the body.
next my task will be to take control over their movements.

Thursday, February 10, 2011

Last day before last day of class before the bot's competition

Whole day on wednesday as my partner Ben was working on the color sensor and its issues I worked on the programing
even though i did not have exact values i just did a layout with approximate numbers so i can replace the numbers after the testing of our bot
this is the code that i wrote


#pragma config(Sensor, in1,    RightLineSensor,     sensorLineFollower)
#pragma config(Sensor, in2,    LeftLineSensor,      sensorLineFollower)
#pragma config(Sensor, in4,    Infrared,            sensorReflection)
#pragma config(Sensor, in5,    ColorSensor,         sensorReflection)
#pragma config(Sensor, in6,    CheckSwitch,         sensorTouch)
#pragma config(Motor,  port1,           LeftMotor,     tmotorNormal, openLoop)
#pragma config(Motor,  port2,           RightMotor,    tmotorNormal, openLoop)
#pragma config(Motor,  port3,           Servo,         tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//




void goforward(int dist)
{
   motor[port2] = 50;
      motor[port1] = 50;
      wait10Msec(time);
    }




task main()
{
  while (true)
  {
  int test1 = SensorValue(LeftLineSensor);
  int test2 = SensorValue(RightLineSensor);
  int test3 = SensorValue[Infrared];
  int test4 = SensorValue[ColorSensor];
  //Code for checking the color of the floor
      // 1-




  //Maneuver Code






    //If the the bot does not hit a black line
  if((SensorValue(RightLineSensor) < 800) && _
  (SensorValue(LeftLineSensor) < 800) && _
    //or if it does not get too close to a can
  (SensorValue(Infrared) < 300) ))
{
 // go forward for 2 sec
goforward(150);
      //
      motor[port2] = 0;
      motor[port1] = 0;
      wait10Msec(100);
      int max_dist_val = 0 ;
      int dist_val1 ;
      int dist_val2 ;
      int index;
      for (int i=0;i<60:i++)
      {
        motor[port2] = 30;
        motor[port1] = -30;
        wait10Msec(100);
        dist_val1 = SensorValue (Infrared);
          if (dist_val1 > 300)
            {motor[port2] = 0;
             motor[port1] = 0;
             wait10Msec(100);
             do
             {motor[port2] = 30;
              motor[port1] = 30;
              while (




             i=60;}
          if (dist_val1 > max_dist_val)
           {
            max_dist_val = dist_val1;
            index = i;
           }
      }
      for (int i=0;i<60:i++)
      {
        motor[port2] = -30;
        motor[port1] = 30;
        wait10Msec(100);
        dist_val2 = SensorValue (Infrared);
        if (abs(dist_val2 - max_dist_val) < 30)
        {
           motor[port2] = 0;
           motor[port1] = 0;
           wait10Msec(100)
           i=60;
        }
        else
        {index = i;
        }


      }
      wait10Msec(100);
}




else if (SensorValue(RightLineSensor) > 800)
{
 motor[port2] = -44;
      motor[port1] = -44;
 wait10Msec(100);
 motor[port1] =-40;
      motor[port2] = 40;
      wait10Msec(100);
    }


    else if (SensorValue(LefttLineSensor) > 800)
{
 motor[port2] = -44;
      motor[port1] = -44;
 wait10Msec(100);
 motor[port1] = 40;
      motor[port2] = -40;
      wait10Msec(100);
    }






}
the first part of the code is mainly declaring all the variables 
the first if statement includes most of the codes 
in that part the car turns around and saves all the values received from the infrared and then moves toward the highest value which is the closest object
the last two if statements avoid passing over the black lines

The come back

hello everyone
i mean (myself and professor mason probably)
ok so after about two weeks of procrastinating now i have to do all the blogs that i have missed since last blog update
so here we go
on tuesday february 8th me and my partner ben mainly worked on the arm structure of the bot
and we eventually came up with this design
in this design instead of adding an arm to grasp the can we just hold the can inside
and the reason that we decided to do this is because this way we wont hit the can with the extended arms and drop and also it is simpler coding to just detect the can and moving towards it rather than stoping at a certain distance from it and holding with an arm
to detect wether the can is inside the bot we added a switch in front of where the battery is
this way when the can pushes the switch's button the bot will realize that it has the can and it will continue to put that can in the matching color zone.
the part with the curved bars is like a revolving door that can hold the can from getting out of the bot and also it can be used to kick out the unwanted cans.