Wednesday, February 16, 2011

Countdown to the last day 2/15

Today would serve to be one of the final days in class. Our instructed covered how to make a professional presentation. Our team would have to make a presentation about the robot we entered into the competition. He covered things we should and should not do while presenting. The major points we to repeat important points several times to send the message. As far as the visual presentation, the main points were to keep the fonts large and a high contrast in color to the background for viewers to read. Our presentation will need to be about 15 minutes long and contain a few set points. The required topics to be cover were to have a title slide with group members names, the date, and location, an introduction slide which shows all topics being covered, build, programming, a video demo, testing, conclusion, and suggestions.

Final Presentation 2/16

Today each group presented their robots. Below is our groups powerpoint presentation.












Vex Bot Competition 2/12

Today is the big competition. There was a total of 10 teams competing. This competition was held on the second floor in the Engineering building on the Cal State Fullerton campus. The exhibition began with an introduction by a member from the Robotics of Southern California Club. The day of the competition we still had to remove the pauses in our code. We borrow a classmates laptop to download the revised code to our robot, but the robot was not responding to the program. At the very last second we have to reprogram the robot from scratch which included downloading the master files.
During our first run, our robot did not straighten out after the first scan or after the first can was rejected. After a quick restart, the same problem occurred. The target can was just out of the scanning area. For our third attempt, the cans were moved and we ran out of time.
Out of the 10 groups, our team placed in 4th. While our robot did not have its best performance this day, it did have a decent showing.

Vex Bot Last Chance 2/11

Today will be our last day to complete our robot. We will need to make any final changes to our code and robot before the end of the day. We believe that the components of the robot are sufficient to complete all tasks required to complete the objective. At the end of the day, theoretically, our robot will be able to navigate the entire field to locate a can as well as place the can into the corresponding color zone. Below is a video of our robot starting from the green zone searching for a blue can. The first can the robot encounters is a green can. The robot knows this is the wrong color so it rejects the can and continues searching for the blue can. The blue can is the second can is comes across. The robot then attempts to center itself and proceed across the field to the blue zone. At the end, the line sensor was unable to detect the first black line but does catch the second. The color sensor had already crossed the blue section so the robot knew it was in the blue section and dropped the can.


Video Coming Soon



Tomorrow we will test our robot in a tournament of about 10 entries. Stay tuned for results.

Vex Bot Part 5 2/10

Today was supposed to be the last day for us to complete our robot. At the end of the day we were only able to have our robot find a can, determine the color and reject wrong color cans. In the video below, the robot is looking for a blue can. When the robot finds the green can it drops it behind but it just so happens to start in the green zone so it looks as if the robot was programmed to take the green can to the green zone. This was just luck. As you can see, we still need to work on the turning of the robot so it ends up facing the same direction as it started.

With this code, the only way we would be able to complete the project would be if the can we were searching for was in line with the ending color. We still need to add code to tell the robot which zone it starts and where the ending zone is in relation to its starting position.
Our instructor surprised us with an extra day to work on our robot before we needed to compete. We will need to add the mapping properties to our code tomorrow.

Friday, February 11, 2011

Vex Bot Part 4 2/9

Today we tackled the mission of determining the can color and what to do when the wrong color is detected. In the video, the robot is looking for a red can. It finds a green can and attempts to remove the can from its path. After watching the robot in action, we see that the robot is not turning around enough when dropping the can. This will need to be changed in the code. Also the robot is continuing to drop the can so we need to get out of that loop to proceed with the search of the correct can.

For additional accuracy, we will have the color sensor read the can at least two times to confirm the correct color. Once both readings are the same then the robot will be able to continue its mission.

In this test you will see the robot find a green can a reject it. As you can see if the can is not directly in the center of the arms, the sonar value will never read the limit for the arms to close. We will add a function that will close the arms a little each time to force the can into the sonars range. We also added the black line detection in the trial. At the end of the video you can see the robot get stuck once the line sensor is over the black tape line. We will have to write some code to tell what the robot to do when the black line is reached.

Vex Bot Update 2/8

Today we changed how the robot turns to scan for the can. It will still pause between scans but when returning to the center, it will be smooth. Below is a short video of our robot detecting a can and the color sensor is reading blue. We both agreed that after the can is detected to approach the can a little faster. Our next step will be to have the robot read the output of the color sensor so it knows if the can is the desired color.



Tuesday, February 8, 2011

Vex Bot II 2/3

Today we added a pair of arms to our robot. The arms will be used to grasp a can and carry it to the correct color goal. The arms are powered by a servo. We also programmed the robot to scan for a can in the field and once the can is within grasping distance the arms will close around the can. Below is a picture and a short video of the robot grabbing the can.





Line Sensor and Color Sensor 2/1

Today in class we built two circuits, a line sensor and a color sensor. We will use these two sensors on our robot to detect the boundaries of the arena as well as to determine the color of the can and the color of the goal we need to drop the can. This first picture is the schematic of the line sensor we built and the second picture is the finished product.
 

 In these next pictures we see the color sensor schematic and finished product.



Thursday, January 27, 2011

First Vex Robot Programming 1/27

Today we wrote code for our first two programs controlling the Vex robot. Both programs were to guide the robot through a maze in the hall way. The first program was done by motor speed control and timing. The second program included input from wheel encoders. After the first attempt without the sensors, it was obvious that speed was a major factor because the wheels did not have a good grip on the floor. With this in mind, my second program had a much slower speed. Here is the result of the second attempt.

Servos, Signal Conditioning,Oscilloscopes, and 555 Timer 1/27

Today in lab I learned about a popular chip, the 555 timer. This chip allows us to generate different output signals by simply changing the values of resistors and capacitor. In the below circuit you can see the chip in action. I have connected a speaker to the output and the result was a buzzing sound from the speaker. With the twist of the potentiometer, the frequency output by the speaker was changed.


As you can see in the picture below, when the resistance of the potentiometer is changed the frequency as well as the duty cycle is affected.

For the second circuit, we used an op amp to condition an audio signal output from the computer. We first used the oscilloscope to see the signal being generated by the computer.

Similar to the previous circuit, when the potentiometer is turned, the output is affected. This time the amplitude of the signal was amplified. As you can see in the below picture, the tops and bottoms are now flat because of the limited power being input to the op amp chip.

Wednesday, January 26, 2011

Toy Hacking 101 Part 2

Today I finished up the toy. This is a video of the toy singing and dancing after the circuit was reinstalled into the frame. The toy also is able to be reprogrammed by pushing a momentary switch located in the battery panel.


Here is a video of the toy with the mechanical and electrical parts stuffed back inside. The only connections needed are the Tx, Rx, and Ground for the serial connection and power and ground for the extra battery power. 

Thursday, January 20, 2011

Toy Hacking 101

This session I will be taking a stuffed duck that has two motors, one to flap its wings and one to open the bill, and a speaker, and I will be taking control of each of these components. Here we see the initial deconstruction step of the animal. The skin was removed from the skeleton.
After further dismantling, we see exactly where the motors and speaker are connected to the main board. Soon these wires will be snipped off and the board removed.


Here is a short video of my progress.

Microcontroller Interfacing 1/20

Today I learned how to interface our microcontroller with transistors initially to light a Christmas light and ultimately a motor. We need to use transistors because our microcontroller is limited to only 50mA per channel.
In the first circuit you can see the light shining bright with the help from our transistor. Our transistor acts as a current multiplier. With the small current sent out from our microcontroller 8mA, we were able to get 200mA through our light because the transistor has a gain of 25.


Today I also was able to disassemble a mechanical stuffed animal and control its motors using the PIC. Here you see the skinned animal.
No animals were hurt during this experiment.
Here we see the inner workings of the animal. I will be removing the circuit board and replacing it with my own. After the project is complete, this duck will communicate with a computer through its serial port, and will allow the user to select a song to which the duck will sing and dance.
 Here is a video of the PIC controlling the motor.


Introduction to Microcontrollers 1/19

Today we were introduced to the PicAXE 08M microcontroller. This first program I wrote was a basic one that would switch an LED on and off. After some tweaking of the program and taking advantage of the multiple outputs, I was able to have the PIC flash 3 LEDs. The picture shows the initial setup and code. There is a short video of the LEDs in action.



The next circuit for the day included a microswitch as an input to the PIC and 1 LED. When the button was pressed, the LED would light. In the circuit below, the switch was swapped for a light dependent resistor(LDR). The LDR shows a higher resistance with less light. The code for this circuit included 2 IF statements. If the LDR was in the light then the red LED was lit. If the LDR was in darkness, The green LED was lit. If the LDR was in the shade, not too dark or too light, neither LED would be lit. As you can see in the photos below, the first shows the LDR in the direct light.

 In the next pictures, the LDR is half covered making both LED dark, and the last picture has the LDR completely covered making the green LED bright.


Wednesday, January 19, 2011

Transistor switching and building a logic probe 1/18/2011

Today we will be experimenting with transistors. In our first circuit, we will be using the transistor as a switch. The transistor has a collector, base and emitter. In the first picture, on the left side you can see the circuit we will be building. The top connection will be the collector, the middle will be the base and the bottom will be the emitter. From the picture you can see that the base is functions like a gate where it controls the current flowing from collector to emitter. The gate is opened by flowing current through the base. 
The second circuit we removed the R2 resistor and used our fingertip to complete the circuit to the base.
As you can see my finger acts as a resistor and allows current to flow through the base which opens the gate to flow current from collector to emitter.
The next experiment with transistors will be to create a logic probe. 


Saturday, January 15, 2011

Switches, relays and construction of my robot 1/13/11

Today we experimented with switches and relays. In our first experiment we had two switches in series with our LED where both switches has to be in position 1 or in position 2 for the LED to be lit. In the second experiment only one switch was used and the other was replaced by a relay. With the relay we are using today, there will always be a path for our current to flow through one of the LEDs. When the switch is open, the power is flowing through the green LED as shown in the picture. 
The green component is a monetary switch. The black component is our relay.


 I was having a little trouble having the relay stay in the board so I had to hold it in with my finger. The next figure shows the same circuit with the monetary button being depressed to close the relay and change the path of current to flow to the red LED.

In the last circuit for the day, we made an oscillator. We did this by adding a capacitor in parallel with our relay. When this circuit is running and the button is pressed, the LEDs will flash one at a time. Also you can hear the inner workings of the relays switching between contacts. This sound is similar to a buzzing sound. A quick note to remember is that the larger the capacitor the slower the rate at which the relay switches.
The black cylindrical component is our capacitor.

 Here is a couple photos of our completed robot fitted with a front and rear bumper buttons. Also the battery pack up top will be exchanged for a rechargeable battery.

Wednesday, January 12, 2011

Basic electrical tools and compenents 1/12/11

Today we were introduced to the multimeter. We first set the meter to read resistance so we could check for continuity. If their was a low resistance between the two probes we had continuity. After checking several points from our circuit we soldered yesterday we checked our power supplies which we had made yesterday as well. If there was continuity, there was something wrong and it shouldn't be plugged in. If we were reading an open circuit or high resistance we were safe to plug it in. Once we plugged in our supply we read the output voltage. About 5.1 volts was average for our 5V regulated supply. Next we created our first circuit. We connected a 467 ohm resistor and LED light in series and connected it to our supply. After we added two more circuits in parrallel with the first also one resistor and LED but with 1K ohms and 10K ohms respectively. The results shown below confirm our calculations and the lower the resistance the brighter the light.
Lowest resistance on top.

So if the lower the resistance the brighter the LED, then why not put the LED directly to the power source? Wouldn't this give us the brightest possible output?

The answer, NO. If the LED does not have any resistance to impede the current, it will burn out. From the data sheet, the voltage drop across our LED will range from about 1.85-2.5V. Our power supply is giving a constant 5.1V. This means that the voltage across our resistor will be anywhere from 2.5-3.15V. Also from the data sheet, the suggested max current for our LED is 30mA. So after rearranging Ohm's law V=IR to V/I=R. 3.15V/0.030A = 105 Ohms for our high and 2.5V/0.030A = 83 Ohms for our low end. Here is the result with an 83 Ohm resistor.
Very bright!
The voltage measured across the resistor was just about 3V. V/R=I so 3V/83Ohms = 0.036A or 36mA which is a tad bit over the data sheet. I didn't let the LED stay on for too long.

Next we were introduced to a magical resistor AKA potentiometer AKA pot. This new component can vary its resistance with the turn of the knob. I measured this pot to be a 2K Ohm pot which means its resistance can anywhere between 0 and 2000 Ohms. The picture below shows the circuit with the pot in series with a 467 Ohm resistor in series with the LED with the pot at its highest resistance. As you can see, the LED is very dim.
 Here is the same circuit, but with the pot set to its lowest resistance. Much brighter!