Sunday, March 28, 2010

LogoChip Challenge #5

For this challenge, we created a shadow detector. We used the Getting Started guide to remind us how to wire a photocell. The photocell is a light sensor and our first program was to turn on the motor whenever the photocell detected a shadow.

Our first program turned the motor on as soon as the photocell detected a shadow and the motor remained in motion. This is a picture our program:


The second program turned the motor only if the photocell is in a shadow. This is a picture of our program:

Our third program detected shadow edges and with that we were able to count the number of fingers that passed above the photocell.
Here is a picture of our program:

This was a bit tricky because had to figure out the right limits to set the sensors at. We had to adjust the sensitivity of the photocell so that it detect our fingers. We had to do a lot of experimentation. We ended up turning the lights off and using a flashlight, which made it much easier to differentiate shadows.
This is a video of the first program we made for this challenge:

LogoChip Challenge #4

For this challenge, we wired a transistor to power a Lego Motor. This means that the current for powering the motor is supplied directly from the battery pack and that it will give us control over how powerful we want to motor to be.
We needed an extra battery pack and we had to solder on headers so we could connect it to the Logochip. This was the second time I had soldered and it was great practice to solder the header on the battery pack.
Esther and I had to carefully wire in the transistor and the extra battery pack into the breadboard because if we did it incorrectly we could fry our Logochip. This was a pretty tedious process because we had to make sure all the wires were connected to the right three pins in the transistor and on Logochip.
We used the setpower command on PicoBlocks to control the power of the Motor and we were able to give the motor more power. We than created a program that slowly ramped up the motor up to its maximum speed and slowly back to zero.
This is what the program looked like:
To create this program we used the Introduction Packet on Logochips to help us. In the Introduction Packet, there were directions to make a light brigther and dimmer. We adjusted this program by figuring how many times we needed to repeat the program in order for the motor to reach its maximum power and its lowest power. We first created two blocks: one that would make the motor go faster and the other go slower. Then we combined the two blocks and that was our program.

We were also able to hook up the LogoChip with the oscilloscope and we could see the pulse of the motor and how the wavelengths shortened as the motor ramped up.
This is an image of the oscilloscope:
This is a video of motor running under our program:

Friday, March 26, 2010

LogoChip Challenge #3

For this challenge, Esther and I needed to construct a program that counts the number of times we pressed a switch and that every fifth time we pressed the switch, the light would flash.'

We first had to come up with a program that would count how many times we pressed the switch. Here is the program that we came up with.
Then we came up a program that would make the light flash every fifth time we pressed the switch. In order to achieve this, we reset the count back to zero after the fifth count so that the program would make the light flash at every multiple of five. Here is the program that we came up with:

LogoChip Challenge #2

For this challenge, Esther and I had to use a toggle program on PicoChips. The toggle program acts like a switch and changes the state of the motor to its opposite state. For example, if the motor is running and then if I press on the toggle program, the motor will stop, and vice and versa. However, when we used the toggle program on the motor, it didn't work all the time. There is something called a switch bounce which makes it unpredictable to what the motor will do. This is an example of how problems occur when working with both a program on a computer and the physical world. There is a 50% chance that the motor will remain in its original state or toggle. Our challenge was to create a program that would avoid the switch bounce and make the motor toggle 100% of the time.

Here is what we came up with:
We put mwait blocks in between certain commands, so that the program would skip over the switch bounces.


Thursday, March 25, 2010

LogoChip Challenge #1

Partner: Esther Nam

For the first challenge, Esther and I completed the Getting Started with LogoChips tutorial to familiarize ourselves with this new program.

We learned how to read a schematic drawing. We learned the different symbols, such as the ground, switch, and resistor symbols. It takes a little time to get used to, but it is an effective and clear way to depict what is going on. For example, we had to read a schematic drawing in order to connect a tri-color LED with the Logo Chip. Here is the drawing below:


And by following the diagram, we came up with this:

And with using the Pico Chip program we were able to create different colors by varying the power through the three different power outputs. This was one of the things we had to do to complete the tutorial. Another thing that we did was to control a motor. To turn on the motor we had to remember that current flows from high to low. Therefore, we had to set the two outputs that the motor was connected at different settings in order for the motor to turn on. For the motor to turn off, we had to set the two outputs to low. We then created a program so that the motor would turn one way and then another way. In doing so, we set one output to high and the other to low for the motor to go one way and then switched the settings so that the motor would turn the opposite way. This is what the program looked like.
This is what it looked on the logo chip:


We had a lot of difficulties getting through the manual because Esther and I were completely new to this. We were unfamiliar with how to connect various wires, sensors, etc. into LogoChips and it took some time to figure out what was going on. The schematic drawings really helped our understanding because it clearly showed us how the current was flowing. We also came up with problem when trying to create some of these programs because we had not connected the two sides of the high and low power sources on the breadboard. We had simply forgotten to place those two wires and because of that we weren't able to run some of our programs. This one of our many attempts at debugging and it really showed us that we had to be careful when wiring and to double check all of them.


Working with the motor was one of the last steps on the tutorial, and once we were finished with the whole tutorial we had worked with various types of sensors and with different programming skills on Pico Chips: we were ready for the next challenges.

Thursday, March 11, 2010

Walking Robot- Final Stages

After assembling our robot, we hooked it up to a battery pack through a breadboard. This was the first time that we would see our design walk and we were all very excited and the robot did walk! We were glad to see that the motion we came up with our Lego modules worked properly. The only problem was that the legs kept falling off because they were fitted tightly enough on the rods. Even though we re-printed circle pieces with tight holes, the leg aspect of the robot was still fragile and they kept falling off the rods. Therefore, we decided to add tight bushings in between all the pieces to secure them in place. The only problem with that was that if we had bushings on the rods behind the circle pieces, the bushings would hit the bottom piece. So we decided to design a new bottom piece that was skinner and would allow the rotating motion.
Below is a picture of our robot hooked up to a battery pack:
Here is a picture showing our new bottom piece. If you look closely, you can see the two long gaps running along the length of the bottom piece. This gave us more room to work with and allowed us to put as many bushings as we wanted to make the legs more stable.

After finding a solution for the legs, we wanted to sauter the wires on our motor and also sauter a switch so that it would be easier to turn the robot on. We also wouldn't have to carry a breadbox and wouldn't have to worry about the wires falling out of place. The sautering process was very quick and pretty easy and once it was done, we could fit all the wires, the battery pack, and the switch into the robot's body. So once we turned on the switch, the robot was free to roam off on its own.
Here is a picture of the final product:
Here is a picture of the switch:
Here is a video of the robot walking before I added in the switch, so Esther is holding the wires, battery pack and breadboard. It just shows that the motion works and that the legs are stable after all our adjustments.

Monday, March 8, 2010

Walking Robot- Assembly

Today, we made the the legs of the robot. It was a very long process and press fitting took a lot more work than I expected it to. We first drilled holes in the leg pieces: the connectors, the legs, and the feet. The holes are tight fits because the music wire will tightly connect two pieces together. This was a tricky process because we had to figure out exactly where we had to drill the holes , if not the music wire wouldn't go through the two pieces. It was challenging to make precise measurement on such small dimensions. It was also hard to make sure that the pieces were perfectly straight when we were press fitting them. Putting the wire in the holes was also a long process because I had to find the right tool to cut the music wire and find the right method to press fit the wire into two pieces. Unfortunately, the press fitting didn't go as well because the pieces weren't perfectly straight. This means that we probably switched some of the leg pieces so the holes didn't match up properly. This process definitely made me reconsider the way I connect pieces. Even though the pieces weren't perfectly straight, when they were attached to the wheels the legs functioned properly. This is a picture of the leg after all the press fitting and when we attached it to the body.


Friday, March 5, 2010

Walking Robot- Week 3 continued

Once we placed the motor in the robot, we found that the metal shaft was too small and that the wheels touched the bottom piece and were unable to rotate. Therefore, we decided print out new pieces and make the design smaller in width. We shortened the width of the bottom piece and the length between the two sides. This is a picture showing how the motor could not work in this first model. This is a picture of when we assembled the smaller pieces. As you can see, the wheels just stick out from the side and are able to rotate freely.
This is a picture of the robot after we connected the side pieces and the wheels. We first used heat staking to connect the sides pieces into the front. This was a long process because we had to do 12 (6 on each side). We had to heat stake with the motor inside the body because when the sides were permanently attached, we wouldn't have a way to fit the motor and the shaft within it. Then, we placed the bottom piece and it fit very tightly and didn't fall off. We then attached the wheels and the connector pieces to them. With the new dimensions the motion worked!
However, there was one problem. The holes intended to connect the wheel and the connector pieces were made for a loose fit, but it didn't work very well because either the connector pieces wasn't completely parallel to the side pieces or the rod kept falling off. Therefore, we decided to make new wheel pieces with the outside holes to be tight fits. This is a picture of how the rods were falling off.

Tuesday, March 2, 2010

Walking Robot- Week 3



Today, we assembled our robot in SolidWorks. This was very helpful because we found out that we had to make a couple of adjustments.
-We found that many of our pieces could be smaller, which would decrease the amount of delrin we would use. For example, our front and back pieces were slightly too wide and a lot of plastic was sticking out on the sides. So we decided to make the widths shorter. By better matching the width of the front/ back pieces with the length between the two side pieces, the robot also looked a lot better.
-We also made an adjustment to our side pieces. They seemed a bit too long and we wanted the motor and the battery to fit perfectly inside the robot. Therefore, we decreased the size of the side piece by 6mm.
-When assembling the parts, we found that our bottom piece had the completely wrong dimensions. The length was much shorter and the width was much to long. So we made the adjustments and continued assembling the robot.

This is a picture of the assembly:
The legs and feet are connected to the robot with press fits, so were not able to show this on SolidWorks, but we placed the pieces in their intended locations.
After making the assembly we made a drawing of all the pieces we need so we could start printing out the pieces. Here is a picture of the drawing:
Then we proceeded in printing out the pieces. Because we had a lot of pieces, the printing took a long time. Here is a picture of the laser printer at work:


During class, we also assembled our motor. The only problem with it is that the shaft is not as long as we wanted it to be. We also need a single shaft, not two, since we want the circles to rotate at the same time. Professor Berg ordered some new pieces, so hopefully they would work with our design.