Tuesday, May 10, 2016

The Final Blog Post :'(

Project Name: M.C. Time

Partner: The amazing, talented, and hilarious Jennifer Chien 

Description of the Project: 

For our final project, we worked with Becky from the Child Study Center to create a device that could help children understand how much time is left throughout their activity and day and how much time and activities have passed already without having to constantly ask their teacher about it. M.C. Time (Marble Clock Time) is a device that uses marbles to represent time. The marbles at the top of the device show the amount of time that is remaining in the day and activity and the marbles at the bottom show the amount of time has passed for the current activity and the day.

Highlights of Week 1: Brainstorming


We took inspiration from a video of a musical marble machine that we watched in class and decided to use marbles to represent time. We initially thought of using different sized marbles to represent different blocks of time (small marble = 1 min, medium marble = 5 min, large marble = 10 min, etc), then having them released one activity at a time, a weight sensor senses the weight of the marbles, a program would convert the weight of the marbles to actual time and the device would delay for that amount of time before the next activity's marbles would be released. We decided that it would be much easier to just use same sized marbles and have them be released one at a time. And in order to distinguish marbles for one activity from another activity, we decided to use different colored marbles. We initially thought of using just a large tube at the top of the device to hold the marbles for the day and have a cup like container with separations for each activity to catch the marbles as they were released. We also first thought of having a marble releasing mechanism that was like in this drawing:

But as we began creating our first prototype, we found that a a conveyor-belt-like mechanism  powered by a motor could be created using the Legos from the cabinet. And so we ended week 1 with this prototype:


Highlights of Week 2: Planning and Prototyping

Many things changed from our prototype from week 1. We changed our long tube at the top of the device to instead be a row of tubes with one tube representing one activity. Instead of one container to hold all of the released marbles, we also decided to use a row of tubes. We also changed our sensor from a weight sensor to a color sensor and then finally a light sensor. The light sensor would be placed underneath a tube on top of the releasing mechanism portion and it would sense if there was a marble still in the tube or not. We also thought of potentially having the light sensor on the side of the tubes and on top of the releasing mechanism.


We also planned what we wanted the code to do:


We finalized our materials order to a 6 foot clear PVC tube and a bag of different colored marbles.

Highlights of Week 3: More Prototyping

This was the week we realized things were easier planned than done.

We finalized our releasing mechanism. We found T-shaped Lego pieces that we could attach to the conveyor belt track. These pieces separated the marbles and when we placed a thin Lego across the structure, only one marble was able to be released. We decided to have the light sensor placed parallel to the tracks and right on top of them. We found that when a tube of marbles were released, 6 marbles would be in the structure but they were not sensed by the light sensor since the light sensor sat higher than their positions. In the code, we then wrote that when the light sensor sensed that there was nothing in front of it, release six more marbles before moving the tube holders.


Our materials came in so we were able to test if the light sensor would be able to distinguish between a clear empty tube and the lighter color white and yellow marbles. We found that there was a very small difference between white marbles (light sensor reading 93/94), yellow marbles (91/92), and a clear tube (95). Sometimes the white marbles would be read to have a value of 95 so we decided we wouldn't use the white marbles.



One of our biggest problem during week 3 was the realization that the Bricktronics shield only had 2 ports for motors. Our initial plan was to have three motors: one for the top tubes, one for the releasing mechanism, and one for the bottom tubes. We tried to work around having just two motors by trying to figure out how to use one motor for the top and bottom tubes. We thought of using a gear train to connect the two portions but this proved to be too difficult to even execute. We built a structure that would hold the top and the bottom tubes. It seemed to work but then we tried using servo motors instead but they did not provide enough power to move the entire track the length we needed it to. We then got desperate and tried using one of the sensor ports and writing in the code that the sensor port was connected to a motor. This did not work. And then we used the Internet and found that there were larger Bricktronics shield that could hold more than two motors. We then proceeded to walk around the room and we found a Mega Bricktronics Shield. But then we realized we could use a very long axle to connect the top and bottom tubes.


The other really big problem we had was figuring out how to hold the tubes to the structure. We decided to use the same conveyor belt idea that we used in the marble releasing mechanism but instead have the tracks perpendicular to floor. We then thought of gluing Velcro to the tracks and tubes. This would then allow for easy removal and replacement of the tubes. We thought it was going to be pretty easy to glue the Velcro to the tracks but we spent hours and it still did not work by the end of week 3. We first glued a large strip of Velcro all around the tracks but when we turned the motor on to see how it worked, the tracks would just pop off. We found that this is because the separation between tracks would get smaller as it rounded the gears and so having the Velcro glued to the tracks put too much stress on them. We then tried gluing the Velcro but not having it completely flush to the tracks to provide the tracks with some room. This also did not work. We then tried just gluing small pieces of the Velcro to the tracks but this only worked for a few runs.


We also created a little funnel out of a paper water cup that will allow a released marble to go directly into a tube. And we created a basic code where if the light sensor sensed that a marble was in front of it, turn the motor to release a marble and if light sensor did not sense a marble, release six more marbles and then power the motor that turns the tube holder belts.

Highlights of Week 4: Iterating and Tweaking


We figured out how to successfully attach the Velcro to the tracks! We first thought of using Under Armour headbands that Jennifer found in the room and just have them around Lego wheels. But they kept slipping off so we decided to sew the headbands to the tracks. This took a whopping three hours just to do. But those three hours paid off since they worked great! The tracks were able to go around the gears with no problems. We decided to have two bands to hold the top and bottom parts of the tubes which provided more stability.

Because the tubes kept getting stuck to the bumps of the Lego platforms, we also created a a rectangular piece of Delrin that sits below the the tubes which provides a frictionless plane for the tubes to slide on.

For creating the pause and fast forward buttons, we found that the buttons had to be continuously pushed in order for it to be deemed as on/pushed but we wanted to have the button only pushed once and have the device pause or fast forward. The ever amazing Jennifer found a code that counts the number of times a button is pushed and compares the current state of the button to its precious state. For the fast forward button, when it is pressed, a marble would be released. And for the pause button, when it is pressed, both motors would be set to 0 and there would be a delay equivalent to the delay we had for the marble releasing.







We instead used boxes to hold up the structure because the plastic containers we used before curved a lot which made it difficult to stabilize the structure. The cardboard boxes were much straighter and provided a complete flat surface for the Legos to sit on. We also made a little Lego support for the light sensor/marble release part.














Because Becky said that since the whole structure was very interesting and distracting and she wanted it to be less conspicuous, we just decided to make a large white board with cutouts to show only the important parts. The cutouts showed only the tubes at the top and bottom and hid the rest of the device. And we cut out arrows to emphasize the tubes for the current activity.




Highlights of Week 5: Tweaking and Finalizing

We decided against using one funnel since it gave us a lower chance of having the marbles go into the tubes. Instead we decided to make little funnels for each tube at the bottom. We first tried this idea out by making a little funnel using foil and it worked great. It was kind of time consuming creating one cone out of foil and since we had to make five identical ones, we decided to cut up paper cones that we found in the room.



We realized that the delay/pause button could not be pressed while it was already in the pause loop so instead we changed the code to just have the delay for specific amount of time instead of the time equivalent to one marble.

We then had to find the perfect position for the tubes. We glued little pieces of tape to the Velcro to indicate where exactly a tube should be placed. We had a very hard time positioning the tubes. We found that the motor controlling the tubes did not perfectly move the same distance for each turn. The motor tended to work great for the first two tubes. Sometimes it would work great for the third also but by the fourth tube the motor would not turn the tracks all the way and would have to turn twice to get the fourth tube to line up to the hole of the releasing structure. And sometimes it would be very nice to us and work perfectly fine.




We were thinking that the motor was not consistent due to not getting enough power from the batteries. We tried new batteries and had to adjust the powers we set the motor to be but it still did not work perfectly. We then thought it might just be the amount of strain the weight of the marbles and tubes placed on the motor. It could also be because of where we placed the motor. It sat on top of the bottom tubes and did not have very much support holding it but it was the only place where it would not get in the way of the moving tubes. The inconsistent motor and position of the tubes were a consistent problem even til the public exhibition. But luckily during our presentation, the tubes were able to line up correctly but this was probably because we only placed one marble in each tube so there was less weight for the motor to push.



Final Design and Improvements:


I'd really like to improve the mechanism of the tube holders. Given more time, I would love to try using perhaps two separate motors for the top and the bottom belts and see if that would work better. I would also like to try using one long tube for the marbles at the top and using a color sensor. I wish we could've had more time to try either of these approaches. It would also be really nice to have a more aesthetically pleasing board perhaps made out of Delrin or wood but both of those would cost much more money.



Overall I am extremely proud of us and our final design. Even though it does not perfectly work the way we wanted it to, I'm still so proud of what we made. We put in so many hours to make this device. We tackled so many problems. We created a machine that sensed its surroundings using a light sensor and buttons, was controlled by an Arduino and Bricktronics shield via bang-bang control, had a marble releasing mechanism and tube shifting mechanism using motors, and helped children understand the concept of time. And if we don't factor in the cost of the Legos, Arduino, and Bricktronics shield, it only cost us about $30 to make.



Sunday, April 24, 2016

Final Project Part III: Prototyping Week 2


This week we spent hours iterating and iterating and iterating.

Our ordered materials came in! And with our order of marbles in, we were finally able to test out if the marble releasing mechanism we built worked. We found that it only worked if the marble fell to the side of the track and then the marble would be held steady between a wall of legos on one side and the track on the other. But once the tracks were turned, the marbles all just fell out. We had to figure out a way to only have one marble be released at a time. We found these t shaped lego pieces in the lego cabinet which we found to work great as separators between marbles. Since there were only 10 t-shaped pieces, we shortened our track. We found that the best spacing between each t-shaped lego was to have two small links. This allowed for only one marble to fit in the space. We found that we did not a have a problem with the marbles falling to the side of the chain because there was not enough space between the lego wall and chain for the marble to fall through. When the marbles fell onto the track, they tended to stack on top of each other. In order to allow for only one marble to be released, we placed a thin lego across the tracks to prevent more than one marble from being released.









We made many iterations of the part surrounding the tracks but after hours of work, we ended up with these two that both worked well. The one on the left is stair like on the inside while the one on the right is more like a chimney.


With our tube finally here, we cut the 6 foot long tube into 12 6 inch long tubes. We first measured and marked the huge tube using a ruler and an erasable marker and then cut it using the power saw. Nearly all of the tubes were about the same height except for one which was clearly not as tall as the rest but we probably do not need all of 12 of the tubes so we're all good.

With the tubes and marbles finally here, we finally tested if the light sensor would be able to distinguish between an empty tube and a tube with marbles. With the more colored marbles, the light sensor worked great but it was a bit iffy with the yellow and white marbles. I found that the light sensor found a clear tube to have a value of 95, white marbles in the tube to be a value of 93/94, and yellow marbles to be around 91/92. The red, blue, green, and black marbles all came in at a much lower value. Since a clear tube had a light sensor value of 95, we said that if the light sensor value is greater than or equal to 95, turn on motor 1 but if it is less than 95 turn on motor 2 and motor 3.Once we installed the light sensor to the marble releasing mechanism though the values changed and we found that a value of 75 worked much better.



A major problem we encountered this week was us realizing that the bricktronics shield only had two ports for motors. So we had to try to figure out a way for one motor to move both the top and bottom tube holders. This really stumped us. First we thought of using a chain of gears climbing up but that idea was never executed since it just seemed to be too complicated. We then thought of building a contraption that would have the two top and bottom platforms to be connected to each other. We tried building this idea and it seemed like it would work but then we thought of using 3 servo motors. We tried coding the motors to move from position 0 to position 30 pause for 1 second and then move from position 31 to 60 and so forth until it reached position 180 and then it would go back to 0. This worked but not very well. It barely moved the tracks. We then thought about perhaps connecting a motor to a sensor port and writing in the code that motor 3 was in a sensor port. This did not work. We looked up if there were bricktronics that could hold more than 2 motor ports and we found that those were available. I thought that we would have one in the room so I went hunting for it and found it on the table in the back. But while we were asking Amy if we could use it, we also realized that we could connect the top and bottom tubes using a really long stick. After hours of thinking and building we finally found an answer!


We found that as the marbles were emptied from the tubes and into the marble releasing mechanism, 6 marbles would fall into the structure but they would be below the light sensor so the sensor could not sense that they were there and it would read that there was an empty tube, stop and the other motor that shifts the tubes would turn on. We fixed this by writing in the code that we would run the function releasemarble (makes the motor turn on for half second to turn the track and let one marble out) 6 times and then shift the tubes whenever the light sensor sensed that there were no marbles in front of it.

We then had to tackle the problem of how to attach the tubes to the tracks. We found velcro strips in the room and decided that we would hot glue them to the tracks and the tubes. This seemed like a fairly easy idea but we found out that this was totally not the case. We spent about 3 hours trying to successfully execute this idea and it's still in the works.



We first hot glued the the whole strip to the tracks but once we tried having the tracks run, it broke! We found that this was because the tracks became shorter as it curved on the gear. We thought that perhaps first gluing the tracks on flat on the table would work but it did not. We also tried gluing the velcro on the tracks but having a bit of extra velcro so that hopefully as the track curved on the gears there'd be enough velcro on the straight parts that it wouldn't break. This idea worked for one run and then broke. We then figured that gluing little sections of velcro would be the best. This worked the best out of all of our ideas but it still beaks so hopefully next week we can figure out how to fix this problem.

We also made a little funnel made out of paper cones so that the marbles being released could go straight into the tube down below it.

As we ran the tracks with the tubes connected to them we found that the tubes' bottom would get stuck on the raised parts of the lego so to fix this temporarily we placed paper on top of the lego platform.




Next week, we have to figure out a a different way to attach the tubes to the tracks. We're thinking of either just directly using the velcro strips as the track going around the gears but we'd have to create friction for it so that it would actually turn with the gears. We're also thinking of using headbands and sewing it to the tracks and then gluing the velcro strips on top of the headband.

We also have to create the platform out of delrin so that it would be smooth and the tubes won't catch on it. Since the tubes are wobbly by themselves, we were thinking of moving the tracks higher so that the velcro could be higher and also maybe creating a structure that will work similarly to the paper in the video holding the tubes upright. We also have to add two buttons to the whole thing somewhere and write a code that says that if one of the buttons is pressed, there'd be a delay of 5 min and if the other button is pressed, it would fast forward 5 min.

Monday, April 18, 2016

Final Project Part II: Prototyping Week 1



Initial prototype


sketches of initial prototype

We started off week two with this prototype and with the idea of having a long tube hold the marbles from the top and then empty out into a clear container that will have dividers. The container at the bottom would rotate every time an activity ended. We initially planned to use a weight sensor to sense the weight of each marble and write a program that converts the number of marbles into the number of minutes an activity was but then we realized we could also use a color sensor to sense when a new activity was. The color sensor was more than $40 though which would nearly be our whole budget. With more thinking, we realized that we could probably just use a light sensor to sense when a marble was in the tube or not. This then led us to change our long tube on the top plan and instead have separate tubes for each activity.







So we thought of two ways the tubes on the top and bottom of the machine would be. One would be to have the two layers attached by beams so that when one moved, the other would be pulled along. We also thought of them going opposite directions and they'd be attached separately to a different motor.












We then had to figure out where we we wanted to place the light sensor. We couldn't place it on top of the tubes looking down since it would sense the machine underneath the tube.  We decided that having the sensor below the tube might work well. But the light sensor could not be right underneath the tube because of its shape so we thought of positioning it a little to the side and make steps for the marbles to roll down on to the light sensor and then the releasing mechanism.




























We also thought of perhaps placing the light sensor horizontally to the side but still underneath the tubes so that it would sense when the tube has been empty of marbles, the tubes above would shift one over so that the next tube could be emptied. The tubes on the top would be standing on top of a platform so that the marbles would be held inside of the tubes but once the tubes shifted to the space above the marble releasing part, the marbles would be able to drop down on the releasing mechanism.














 And then Jennifer wrote out a plan of how our code will be.




















So this week, we were finally able to finalize our material orders to the 6 foot long clear PVC pipe and a bag of marbles. We will also need three motors, an arduino, and bricktronics shield for the the mechanism that shifts the tubes. Next week, we plan on tailoring the marble releasing mechanism to the marbles we ordered, build the mechanism that shifts the tubes, and write up the code.