Electronics 10 mcupp
Tuesday, February 11, 2014
Firefighting Competition!
Unfortunately, after several attempts I was unable to upload a video of our robot in action at the competition this past weekend so here is a picture of the robot at the competition (not very exciting I know). However, a video of the robot finding and extinguishing a flame will be shown in our final presentation. Johnny5 performed very well during the first run as he extinguished the flame in the second room he explored. In fact, the robot ran better than ever, and our hopes were high. The second run did not go so well...I initially thought it was a power issue, but I now think it must have been because of the unreliability of the encoders.
Tying It All Together
This is a picture of the last real exercise we were to complete before beginning to test the robot on the field. It actually consisted of two parts. The first part was to simply to have to robot drive forward until the line sensor detected the line of tape and have it scan for the flame. The second was to have the robot detect the flame and then drive toward it and stop about 6 inches from the flame using the ultrasonic sensors.
This is a Gantt chart showing all the tasks that needed to be completed before the robot was ready to compete in the actual competition. There are some mechanical things that needed to be done, but the majority of the time was actually spent testing, fine tuning the code, and more testing.
This is a Gantt chart showing all the tasks that needed to be completed before the robot was ready to compete in the actual competition. There are some mechanical things that needed to be done, but the majority of the time was actually spent testing, fine tuning the code, and more testing.
This is a picture of our robot that I took the morning of the competition. It is complete with everything it needed to navigate all four rooms of the maze, find the flame and extinguish it including a line sensor, flame sensor, ultrasonic sensors, encoders, and a CPU fan. One cannot see from the picture, but there is also a voltage regulator running from the battery to the VEXduino.
Thursday, January 30, 2014
Building Sensors
The picture shown above is that of the simple flame sensor constructed for our robot by my
partner. It is an infrared phototransistor in series with a 10K ohm resistor(or the equivalent to anyway). It works much like a normal NPN transistor except that in this case the base current is controlled by the amount of infrared light it detects.
This is a picture of the line detector that I constructed last night. The key component of this device is the TCRT5000 infrared emitter and detector package. The two positive leads of this component are attached to two wires spliced into one lead which will connect to power. The two negative leads are also spliced together as shown except that the emitter is in series with a 220 ohm resistor and the detector is in series with a 12K ohm resistor and also has a lead that attaches to an analog pin on the Arduino. This device is capable of detecting the difference in color of black and white surfaces.
Wednesday, January 29, 2014
Using Encoders
The first thing we did during this class period was to mount a set of encoders onto the VEX Small Bot and write a simple code to track them. Once the code was written and the encoders were attached to the VEXduino, we could observe the encoder counts increasing in the global variables window as the wheels turned.
Once it was determined that the encoders were working properly, we had to write a code that would cause the robot to drive forward exactly 12 inches or one square floor tile. Some values which stemmed from the diameter of the wheel were used to determine a coefficient that would be used in the code. That coefficient had to be played around with a little bit, but eventually the robot did travel forward exactly 12 inches.
Tuesday, January 28, 2014
VEX Programming and the VEXduino Board
The above picture shows the VEXduino board attached to a VEX Small Bot, which will be used in our final project. The board was constructed by my partner Kevin while I essentially sat around and waited for RobotC to download. A simple test was done to determine everything was in working order. In this test, a program was downloaded to the board that caused the servo to alternate from its initial position of 0 degrees to 180 degrees.
After it was determined that the VEXduino board was working properly and mounted to the robot in a way in which it would not short out, we were to create a code in RobotC that would allow the robot to maneuver a maze that was constructed out in the hallway. After some trial and error, I wrote a code that allowed the robot to do so, but then I accidentally deleted it...I rewrote it with a few changes to the turning commands, and the robot made it through the maze quite well. It was not perfect, but it did end up in the desired finishing position.
Servos and Signal Conditioning
In this exercise, a VEX Servo was powered by a 5V power supply and connected to the Arduino. A simple code was written and the Arduino was programmed to cause the servo to move from its 0 degrees position to its 180 degress position with a short delay in between the movement.
This exercise was essentially an extension of the previously discussed exercise. Instead of having a simple program control the position of the servo, a potentiometer was placed into the circuit to give the user more control over the servo's position. The position of the servo moved accordingly to the position of the potentiometer.
Music and Advanced Programming
This exercise was actually rather useful in preparing for my first project. This circuit shown above is an LDR in series with a piezo sounder. The design is similar to an electronic instrument called the Theramin. It was programmed to play a certain tone depending on the value that the LDR was receiving from its environment. What is not shown in this post is the second exercise of this handout. In this exercise, the LDR was removed, and an LED was placed in series with the piezo sounder instead. The arduino was programmed to play a short tune and the LED flashed along with the notes being played.
Subscribe to:
Posts (Atom)