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.

Wednesday, January 26, 2011

The end for the fish

so all day yesterday we worked on our project
here's the code that i used: (in red is the code and in blue is the explanation)
main:
        readadc 4,b0                                      'get data from analog receiver"        if b0 > 210 then dying                          'if there is light live (do the codes for slow)        if b0 < 200 and b0 >160 then struggle  
'if the recieved number is
                                                                    between 160 and 200 do the codes for struggle if b0 < 160 then dead                                  'if the value of b0 is less than 160 do the codes for deadgoto main        'go back to main
dying:
 high 1       'fish heads move up
 high 2      'the fissh moth opens
 pause 1000      'wait 1 second
 low 1       'the head falls down
 low 2       'mouth closes
 pause 1000     
goto main

struggle:       'if the value of b0 is between 160 or 200
 high 1       'i make the motors to work faster
 high 2
 pause 90
 low 1
 low 2
 pause 90
goto main

dead:        'if the receiver does not receive enough light
 low 1       '- i shut down all the motors
 low 2
goto main

The toy project, still!!!

so the main focus again in class was working on our toy project but to do so we had to learn a bit more about transistors and the micro controller so we did another experiment with our bread board.
we had to use a 2N3904 transistor to light a 200 mA incandescent bulb.
we cannot light the bulb directly since it would cause the processor to overload and consequently shut down.  But still the 2N3904 transistor cannot handle high mA currents required to light the bulb and it gets hot so instead we used a TIP41 which handles currents up to 6mA.
the codethat i used to light the bulb was
main:
         high 1
         pause 500
         low 1
         pause 500
goto main

(sorry my dear fans but i forgot to take a picture)
then i messed with my toy some more and i got the motors under my control.
and with this code:
main:
         high 1
         pause 100
         low 1
         pause 100
goto main

here's what it does:

Thursday, January 20, 2011

Micro controllers and how it enhances your playing time with your toy :D

ok so i really liked this last class meeting since we finally, after successfully building our own serial connection, got to do something with computers which i know a lot more than i do know about circuits and electronic boards :D
so we built a circuit diagram with micro controller and a LED and wrote a program with programing editor v5.3.2 to make the LED flash periodically.

and here is the code line that we used
main:
         high 1
         pause 1000
         low 1
         pause 1000
goto main

these lines of codes just shows how simple and straight forward it is to work with this program ( maybe not!!! we'll see :D)
high means to turn the 1 which here is the LED light on
and pause 1000 means wait 1 second and low means to turn the LED off
after this we did a little bit more complicated program with loops and an analog sensor and one extra LED on the board here is the result


 what happens here is the analog sensor senses the change in lightness and darkness of the suronding environment and as it senses more darkness it tells the micro controller to let less current flow into the LEDs

Transistors and logic probe and me

so for last class meeting we learned about transistors and how to use them in our breadboards
what transistors do is that they control the flow of electricity so to understand them better we created the following board

the LED is receiving voltage from two path but first path is blocked by the transistor but when the button is pushed it tells the transistor to let the current pass and then the LED lights
After this we incorporated the same idea again but instead of a switch we used our finger tips to allow the transistor's base pin to let the current pass through the collector and emitting pins
the next mission was to built our own logic probe which one of the most useful troubleshooting devices like a multimeter.
since i ran a little bit of time even though i finished my logic probe i did not take a picture from it but the next class meeting i will take a picture and post for all of u my devoted fans :D

Tuesday, January 18, 2011

Getting to serious Stuff yaaaay

ok so last class meeting we did a lot of electronic stuff and played with switches, LEDs, relays and boards
first we made a simple board with switches and LEDs just to learn how to connect a LED to a switch and here is the result of my attempt
after mastering the first assignment we used a relay and a switch to light one LED and then the other when when the button on the switch was pushed and there is the result


then the goal was to learn how to use relays and a switch to make two LEDs flash on and off periodically. I accomplished the mission successfully as you can see in the following picture:

and finally after doing one more setup with the board and the relay to see what happens when the relay oscillate very fast (if we pushed the switch button it made the relay to oscillate real fast which produced a buzzing sound) we finally got to build a robot.
we built the robot however from a guide just to get familiar with the concept but it was exciting to know that we are getting closer to the serious materials.

Wednesday, January 12, 2011

My second Xperiment in ELECT 10

so we hit the second day
i still havent given up lol :D
so today we learned a lot about  continuity testing, voltage testing, resistance testing and after mastering those we did all those test on our modified adaptors.
and then after making sure that there was no continuity on our adaptor and that our adaptor passes 5V
we connected it to a breadboard with a LED and a resistor on it and here is the beautiful result :D
and then to see the result of higher or lower resistance on the brightness of a LED i made this board on which each LED has a different resistor behind it and the furthest has the least resistance and here is the result
clearly the higher the resistance the dimmer the LED will be.
and then we calculated the least possible amount of resistance that we can put on the way of A LED
using the V=R*I
and finally we received our very amazing magic box to build our very own robot yaaaaaaaaay

Tuesday, January 11, 2011

My first Xperiment in ELECT 10

Hey
how's everybody
well at least I know you will see this Professor Mason
so I'm not writing to myself :D
for the experiment the clueless me was told how to solder circuits and other stuff to a board and also how to solder two wire together after stripping them.


After doing the practice with soldering i took a picture of my board and the two wires that i soldered.
Then i took a AC adapter and i chopped off the little plug at the end of its wire
then i soldered wires to both positive and negative ends of the adapter wire