Tuesday, May 10, 2016

Final Proj: MC TIME (*sniffles* I DON'T WANT TO GO)


Partner: Katrina Montales


Original pitch:

Our goal: Help the children (ages 2 - 6) visualize how much time is left or has elapsed in an activity.

Benefit: Kids are able to understand how long is left without bothering the teacher. Conceptualize time and translate a concrete image of an amount of marbles to the abstract idea of time.

Original plan for marble releasing mechanism
Mechanism: A motor and Arduino/bricktonics shield controlled marble releasing mechanism. Our original plan was along the lines of this. However, when we started working with the legos we had, we found a track that we could use gears to regulate the release of one marble.

Sensing/Feedback/Control: We plan on using a weight sensor under the marble collector cup to tell the Arduino how much weight is in the cup and calculate how much time until the next marble should be released.










First prototype: So we never had a fully functional first prototype...we divided our problem into many subtasks and tackled them apart and then together.

Task 1: Come up with some sort of mechanism that releases only one marble. We started by using the lego tracks and small t-shaped pieces. One of the main problems tackled with this task was creating a slot and opening hole large enough for only one marble to be released. (We encountered some problems with variability in the size of different marbles, ie the blue and black marbles were slightly larger.)












Task 2: Find a way to keep the marbles sorted for easy resetting at the end of the day. Given the particular Arduino and Bricktonics shield we were accustomed to working with, we were limited to two motors, thus we had the axel for the top and bottom marble holders connect to the same motor.

Marble holders/tubes were at a 1-to-1 ratio, so to remain sorted by color regardless of whether the activity has elapsed or not. (Red marbles at the top will funnel into a tube at the bottom, still sorted)

Task 3a: Modify the track so that it can be flexible and rigid enough to attach the velcro without getting deformed. We solved by sewing the under armor headbands to the lego track. We also added a second track to each rotational piece, to allow for more control in moving and support for each marble tube (rather than only having only one velcro attachment at the bottom).


(top)





Task 3b: Use Solidworks to model a cutout of a piece of Delrin to be placed under the marble holders to reduce the friction the marble holders have as they are rotated around.
(bottom)








Task 4: Get the pause and fast forward button to work. In the end, the pause button ended up being a set time delay (since, due to the way the delay function works, the arduino effectively freezes for the specified amount of time, and is not checking for a change in other variables.) The fast forward button works, by sensing if there has been a change in the states of the bottom (high or low voltage) and if it has, incrementing a counter that runs the release of one marble. So, the number of times you have pressed the fast forward button is how many marbles will be released.

Code used for checking if the status of a button has changed: here!


Final Code for the demo behavior(shorter delays) of our final prototype:








Task 5: Put it all together! Last couple (okay, maybe a lot) of iterations to get to the final product!!

One of the last couple of things we had to work on was the attaching a funnel to where the marbles are released and into the marble tubes at the bottom. After many attempts to attach one (and talking to Amy and Xi Xi), we decided we needed to find a better way to consistently get the marbles into the tubes. After some brainstorming, our plan of action was to try reducing variability in where the velcro attaches the tubes and to have smaller funnels on top of each individual marble tube.


We started the same way we did with all problem solutions: wandering around the room and looking for a new way to increase the likelihood of the marble making it into the tube. First we started with aluminum foil (which XiXi commented was a bit frail), and ended with paper funnels. After fighting to attach the larger upper funnel, we tried losing it all together. We remade the individual funnels so that they were taller and more likely to catch the marbles, and hot glued them to the individual marble tubes.

The other thing we worked on was trying to reduce the variability in where the marble tubes were placed back onto our device (try and ensure it attaches to the same place every time), so we tried to reduce the size of the velcro patches on the under-armor head bands. However, as we did a lot of testing, the batteries in the battery pack powering the Arduino and the two motors started to run down. This created a lot of variability in how much the marble holders turned with each rotation. In addition, the weight of the marbles in the marble tubes created problems with how much our poor one motor could turn both the top and bottom gears. In short, we had some trouble with getting the motor to turn both the top and bottom marble tubes a consistent amount, so occasionally marble doesn't make it into the marble tube. No matter how much fine-tuning and adjustments we made to the amount of time and speed the marble holder motor should turn could completely remove the problems we were encountering.

Although this was our final project, it still has many ways that it could have been improved. Given the time frame and how much time Katrina and I did put into this project (at least 65 hours!), I couldn't be more proud of how it turned out (flaws and all). There is and always will be room for improvement. Overall, we were able to stay well under our budget of $50 for outside materials, we only ordered the plastic tubing and the marbles, coming to a grand total of $32.61 however, you must keep in mind we didn't spend money on the Arduino, delrin, motors, legos, and light sensor. If we were going to make a MC Time 2.0, we could try working with a color sensor(costs about $40 so for v1 we decided to work around this constraint) and maybe one long flexible tube at the top, that way the second motor would only have to deal with rotating the marble tubes at the bottom. That marble timer would be a bit more complex in that it would be actively sorting the marbles rather than maintaining the sorted marbles, however it might have a lot less problems overall. 
(final poster)
Final Product Pitch:

Our goal: Help the children (ages 2 - 6) visualize how much time is left or has elapsed in an activity.

Benefit: Kids are able to understand how long is left without bothering the teacher. Conceptualize time and translate a concrete image of an amount of marbles to the abstract idea of time.

Mechanism: A motor and Arduino/bricktonics shield to control the marble releasing mechanism gears and a track. In addition, we used a second motor to control the mechanism for rotating the marble holders.

Sensing/Feedback/Control: We used a light sensor under to tell the Arduino whether there were marbles that still needed to be released in the current activity. We also used sensing in checking the status of the button. Our entire device used bang-bang control, either a marble needed to be released or not, the marble holders needed to be rotated or not.


Here are some final close-ups on our project. The final picture includes the cardboard cover that reduces the distraction and attention to the device. The two arrows point to the current activity being run through. The marbles in the top window show the activities that have not occurred, the bottom show the sorted activities that have elapsed.




      

           

                           



Thank you for reading! I really enjoyed the blogging process and I hope you enjoyed reading my blog! Maybe I'll start up another one someday!

I wish I could say that no Katrinas or Jennifers were harmed in the marking of this project, but that would be a lie. Hot glue is very hot.

Friday, April 29, 2016

Final Project Week 4

Partner: (the ahhhmazing) Katrina Montales

This week we worked on fixing the belts. The space between the lego chains would change as the belt went around the gear. So we tried attaching smaller pieces of velcro. However, just having one velcro piece attached at the bottom did not provide enough support for moving the marble holders. As an alternative solution, we found some Under Armor headbands. They kept slipping off of the pieces from the inside of the lego wheels, so we tried sewing them to the lego tracks (ps: sewing takes a long time, I spent about 3 hours sewing...). In addition, we tried adding a second track to support the upper half of the marble holders.


Next, we worked on cutting out a Delrin piece to reduce the friction the marble holders have with the platform they sit on. This was pretty simple because of the extensive Solidworks experience I had from the windlass project. The delrin piece for the top has a hole for the marbles to be loaded into, and bottom doesn't have it.


Just like when I tackle a large problem in computer science, break it down into small sub-problems. First I set up the basic circuit to work with the button and the LED. I wrote code so that when the button was pressed, the LED would light up.


Next, I found code online that would count the number of times the button has been pressed (basically by maintaining a variable that we can compare the current state of the button to to see if the state has changed). The result is shown in the serial, a little something like this:










Putting it all together:
I inserted the working parts into our code for the normal functioning of the marble releaser (behavior determined by the reading on the light sensor). We have two buttons each using very similar code and a while loop. For the fast-forward button, I set to run while the number of button pushes is above 0, run the code for releasing one marble, and then decrement the button pushes counter. For the delay button, practically the same code except that we set the motors to speed of 0, and then delay for a single marbles units of time.

Lastly, we worked on fine tuning all of the separate parts so that they work well together (thinks like tweaking the light sensor). In addition, at our meeting with our client, Becky, at the child studies center, she mentioned that our entire contraption was a bit distracting, so we constructed a main board for the children to look at (and only see the tubes and marbles). Here is a video of our contraption working for the most part (we just need to tweak how much motor two rotates to load in the new marbles, right now it is a bit too much, and finalize the attachment of the funnel.) Wish us the best of luck on our presentation!






Friday, April 22, 2016

Final Project Week 3 (Iterate, iterate, iterWAIT-- IT WORKS!)

Partner: Katrina Montales

This week we worked on prototyping (lots and lots of iteration).

The first problem we tackled was creating the mechanism to release only one marble! After many iterations, we found a lego piece that could be attached to the track to separate the marbles. However, we could only find 10 and ordering the T pieces would take some time (and money!) so we decided to work with what we got. With the limitation of 10 T-pieces, we needed to create a track that was short enough to only use ten, but large enough to fit around the gears used to turn the track. We tried 8 and 24-toothed gears and had the most success with the 24toothed gears. In addition, we had to find the optimal amount of space between the T-pieces that was also compatible with the separation in the gears(so the chain didn't go slack in the middle). The ideal distance was to have one chain link between each T piece, however this loop did not work well with the gears, so we went with two chains between each T piece. In order to only release one marble at a time, we set a top bar that would push any marbles above the bottom one (to be released) into the next holder in the chain. Note, this works almost 100% of the time. Since the grey T pieces are removable, they also rotate, so if we were to place very heavy marbles or more than 15 marbles to be all loaded simultaneously, the T pieces may rotate and release more than one marble at a time.
initial prototypes (not all documented)
the top bar (red) prevents multiple marbles from being released at once

Top view (where marbles will be loaded)
The next material we dealt with was the rigid clear tube! Using a ruler, we divided our 6 foot tube into 10, 6 inch long pieces. Using a power-saw we cut the tube. The first one was a little bit shorter than we wanted it to be (difficulty maneuvering the 6 foot tube), but practice makes perfect and by the end, we were cutting spot on! In the end, we were left with 10 tubes, 5 for each activity during the day, and 5 for recollecting the marbles to be reset at the end of the day.










Next, we experimented with various different structures for holding and releasing the marble. One of the ideas I experimented with was pieces of lego that stuck out, reducing the force of all of the marbles directly on the rotating track.

In the end, we had a structure similar to that of a tube that allowed the marbles to stack up. But the lego pieces in front and back prevents more than one marble from being released at a time.


Another problem we ran into was that the Arduino and Bricktonics Shield only had two ports for motors, so we had to brainstorm a way to have the top and bottom rotating mechanisms for the marble tubes powered by the same motor. (see solution in the video)































Next, we worked on the arduino code for turning the motors. Let motor 1 be the one powering the releasing mechanism and motor 2 be the one powering the rotating track (that holds the tubes of marbles). In english, the code says: when the light sensor senses there are marbles there, then rotate motor 1. If the light value is higher (meaning no marbles are sensed), then rotate motor 2.

One of the (many) problems we ran into was the that there were still marbles that needed to be released after the light sensor had sensed that there was no more marbles, so we set the code to: after it senses the higher light value, then rotate motor 1 six times (the number of undetected marbles) before rotating motor 2.

Another problem we came across was that there was a difference in the light value that was sensed when there was nothing above the marble tube and when there was the empty tube, so we had to adjust the code to account for that, but still now it is a bit finnicky about when it wants to turn.





In the video: you will see the light sensor sensing no marbles above it, so motor1 turns six times before rotating the bottom and top platform. 

Lastly, we spent a (surprisingly) long time trying to attach the velcro to the track for the marble tubes. This was because the spaces between the chain (when the chain is in contract with the gear) is larger than when the chain is not in contact with the gear. Thus, we found out the hard way that gluing (with a hot glue gun) just one long piece of velcro around the track was not going to work. After multiple iterations, we found success in gluing separate small pieces of velcro to the track. 



A final(ish) video of our semi-working prototype (we found that we needed paper over the legos to smooth and reduce the friction of the bottom of the tubes against them.) The first time we tested this all together, the marble tube that was releasing the marbles (hypothetically) shifted over, but got caught on the ledge. Since the gear chain was held tightly around the gears, it snapped and both the chain and attached tubes fell off (and into my lap!), so in the video, I am holding a paper band around the tubes in hopes of keeping them more balanced for the sake of testing. 



Reflection: Overall, the design process (note: we aren't done yet!) has been long and full of bumps, however it really is fun to try and solve new ways around these problems. A lot of engineering has been working at building something until it works. Sometimes it is easier to step away from a problem for a little bit (let it stew in your mind) and then come back at it from a fresh angle. Katrina and I spent about 14 hours in the engineering lab hacking at this project and I am glad it is starting to shape up. Notes for improvement for next time, we need to implement two buttons each with very similar functions 1) press the button how many marbles you want to delay 2) press the button how many times you wish to fast forward. In addition, we know that the marble tube structure isn't all too stable, so we were thinking that raising the rotating mechanism to attach to the middle of the tube might be a more effective way to keep the structure balanced and functioning.