Photo

Photo

Monday, April 18, 2016

Final Project Week 3

We spent this past week creating a cardboard prototype of our final product and doing some research to figure out what sort of materials we needed to buy.

After doing a bit of math, mental deconstruction, and the help of Solid Works, we were able to calculate the amount of plywood that we would need for our project. We had to first decide how each piece would fit into another – does this piece go on top or does this other piece. Once we figured out all the details, we were able to conclude that one sheet of 4ft x 8ft would be enough. This is great because one sheet costs about $26.50 and we didn't want to blow our whole budget on wood. There is a very small margin of error when it comes to our wood usage, so hopefully, once
we get our hands on the plywood, the cutting will go smoothly! *knocks on wood to be safe*

In addition to the wood, we needed to buy some drawer rails. In our previous posts, we talked about how we were planning to use wheels, but after consulting Amy, she told us that drawer slides would be much easier to use. We managed to find some on Amazon that were relatively cheap – around $9 for a pair.

We also added some support pieces after consulting with Larry. After a brief discussion about our plan, Larry suggested that for added support, we should add some L brackets to the underside of our design. We thought that this was great advice and was able to find some for about $2 a piece.

When we brought up the idea of a handle to Amy, she shared with us the idea of having a hole instead of a handle. By creating a hand hole (where we've labeled handle), the children can easily open the cubby without the fear of running into them on a daily basis. Plus this lowers the initial estimated cost of our cubby.

Our initial plan includes having hand holds on the cubby for the kids to grab onto for balance when they step onto the cubby buddy. Becky was very excited about our idea, however, we are having second thoughts about having handles for fear that the kids might run into them. We are planning to include some handles in our prototype, but will definitely bring up our concerns with Becky during our Pilot Day.

We also managed to write up a working Arduino code for the
flashing LEDs. When the button is pressed, the drawer is pushed in, the LEDs should be off. When the button is unpressed, the drawer is not pushed in, the LEDs should be blinking.

It is a fairly simple code, but since we haven't worked with Arduino in a few weeks, it took a little bit of a refresher to remember how the wires lined up. With the help of our old blog posts, we were able to figure out the connections with no problem.


Here's a video of our blinking LED code:

Since we're using an Arduino board for our project, we needed to learn how to solder our wires and board together. Vivian, Rachel, and I already have a little experience with soldering from Physics 108, but we thought a refresher would be very helpful.

Soldering is the process of creating an electrical connection between two electronic parts. Using a soldering iron to heat up the pieces to be connected, we then bring a piece of conductive wire near the pieces. This wire will than melt and connect our two parts. As the melted piece of wire contains lead, it is better to err on the side of caution and avoid breathing in any fumes.


After Amy's demo of the soldering process, we were able to put together a small either robot or spaceship with blinking lights. I chose the robot!

All-in-all, I feel that our group is in a good place. The biggest challenge will definitely be getting the boards cut and assembled in time for Friday's pilot day.



Friday, April 15, 2016

Thermal Systems Part 2

For the second half of our thermal systems work in MATLAB, we got to test out our coffee simulation in real life with simple 50 ohm heater, a thermal reservoir, and a temperature sensor. After some initial setup of the MATLAB program, we are ready to begin.

Deliverable 1:

For the first deliverable, we were given a code to run and examine. By examining the graph the program produced of the rise in temperature of the heater and using a few equations we've learned about and used in part one, we were able to solve for the Rth(resistance) and C(capacitance) that would allow us to simulate a similar scenario. 

By estimating the initial slope and using our handy dandy equations, we found values of 6.9 and 16.2 for Rth and C repectively. Given the equation to the right, we calculated a theoretical time constant of 112.1 s. At time 112.1 s, the temperature of the system was 338.6. K

The time constant is defined as the time the system takes to reach 63.2% of it's final value. So, in order to calculate the actual constant, we found the total temperature change and calculated 63.2% of that. Added that number to the original temperature of the system and we calculated a temperature of 333.4 K. This tells us that our theoretical time constant is a little bit larger than the actual time constant.



Deliverable 2:

When we recreated our simulation of the heating coffee and compared it to the more realistic scenario with the heater, we founded that both graphs were very similar. The graph from deliverable 1 is scaled a little differently, but when you zoom in closer it has a very similar curve to the one we find in deliverable 2. The most apparent difference is that the room temperature from our simulation does not match up with the actual initial temperature of the heater. We also found that while our simulated version gets a temperature of ~335, in our deliverable 1, we only managed to raise our temperature to ~327 K.





Deliverable 3:



Here's a close up of the section of temperature values at the plateau

as we can see from the right side of the graph the bang bang is being implemented
Our simulated bang bang graph

Deliverable 4:

When the proportional gain is small, the system is unable to reach the control set point because it is increasing temperature at a such a small rate, the it reaches an asymptotic state long before the temperature can reach the goal of 340K. When the proportional gain is larger, the temperature rises very quickly in the beginning and plateaus. This suggests to us that the optimal gain is a Kp value around 0.2 in which the temperature more gradually reaches the goal of 340K.






Kp = 0.5 – reaches 340K really quickly

Kp = 0.2 – gradually reaches 340K
Kp = 0.05 – never reaches 340K

Overall, we found that working with circuits on the MATLAB was pretty neat, but it was not without it's challenges. In comparison to the simulations, the actual heating took a lot more time to produce really similar results. Unlike in the simulations, every time we ran the program we had to wait for the heater to run for the time determined AND the time necessary for the mechanism to cool down. This was especially frustrating when in the midst of debugging. But, all in all, this was an interesting exercise in coding and the various methods of heating an object (bang bang v. proportional).



Monday, April 11, 2016

Final Project Week 2

For our detailed proposal, we hashed out a few of our ideas of how our step-cubby/Cubby Buddy would work. Here are a few of the slides we included in our powerpoint.

Sketches of our concept and measurements
The various things we wanted to keep in mind with our project was to make sure that our product was safe, cost efficient, space efficient, and easy to use.

Our basic concept is that our cubby buddy would have two side panels and a top panel. It would not have a bottom panel, so that anything placed in the bottom cubby, usually shoes, can still be stored without hindrance. Our cubby buddy would also have wheels that would allow it to easily slide back and forth in a grooved path.

As such, we added a few details to our initial proposal. We wanted to make sure that the cubby wouldn't fall out by itself, so we took inspiration from a buckle and wanted to crete a simple locking mechanism.

We took further inspiration from around the lab decided to give our design a handle similar to the one on our tool drawer cabinet.

We also wanted to position our lights so that it would be easy for the kids to see/notice. Since the kids aren't very tall yet, it seemed like a good idea for us to place some lights under the top shelf.

We also decided to add handles that the kids could use to pull themselves up and for stability purposes. Safety is key.

After our presentation, Becky gave us her feedback. She suggested that we create some sort of sign that would help associate the colors with the sort of reaction we want to elicit from the kids.

She also told us that since children are born a little more top heavy, if we could make a design that would allow the kids to kick the drawer back into place, that would both be safer and more enjoyable for the kids. We should then somehow include a picture of a foot to indicate that the kids were allowed to kick the drawer close.

After talking in Xi Xi, we decided that for spacial reasonings, it probably won't be smart to use a force sensor. Instead, we came to the conclusion that it might be more ideal to use either a photosensor, an encoder, or ultrasonic sensor to sense the movement of the cubby away from it's resting position. This would therefore replace the force plate in our initial feedback and control system. This then simplifies our control portion of the system. Whenever the cubby buddy is in use a red led would blink repeatedly.

We also decided that we would definitely need to construct our own cubby for this project and as such we will mainly be using wood and nails/screws for our project. We will also need to buy four wheels for the feet of our cubby buddy.

Once we have our cubby built, using the measurements we took while at the CSC, we should have a better idea of any more changes we want to make!

In other news... baseball season has started and the SF Giants are at 5-2. Here's a clip of Hunter Pence's opening day grand slam against the LA Dodgers' Pedro Baez.




Sunday, April 10, 2016

Final Project Week 1

For our final project, Rachel, Vivian, and I wanted to work with the Child Study Center. A few ideas we had included, creating a step for the kid's cubbies, a sensor to measure the depth of the water, and an apparatus that helps to makes it more fun for kids to wash their hands.

Step-Cubby:



For our step-cubby idea, we wanted to created a device that is fitted into a cubby and will make it much easier for the kids at the CSC to reach the higher shelves of the cubby. The step-cubby would be pulled out by the child and they would be able to step on top of it. There would be a force plate on top of the step-cubby that would be able to sense when the child stepped off. Once the child has stepped off and the force sensor senses no force for a given number of seconds, the cubby will push itself back in.


Water Level Sensor:



At the CSC the kids have this small table filled with water and sand. Because of the nature of kids playing with water, the teachers at the CSC find themselves needing to repeatedly check to see if the pool/table needs to be refilled. Our concept is a device that is able to sense the the varying levels of water that will be able to notify teachers in the CSC when the water is at a level that requires filling.


Musical/ Light-Up Sink:



Our third idea is a solution to the problem of getting kids to wash their hands. This idea was inspired by the existing music playing toothbrush. The sink would have light sensors that would allow the system to sense the presence of a hand. From there a song would begin playing and a green light would turn on. After a predetermined amount of seconds, the light will turn yellow, which will prompt the child to apply soap. After a second predetermined time, the light will turn back to green and prompt the child to rinse after. Finally, after enough time has passed the light will turn red and the song will turn off, telling the child they have now sufficiently washed their hands.

Post Initial Pitch:

After our initial pitch to the class and after a discussion with Amy, we decided to go with our step-cubby idea. We also decided that it would be safer for the feedback and control to NOT push the step-cubby back by itself, in case of malfunction. Instead, we came to the conclusion that the force plate should instead control a set of lights. When the child stepped on the cubby a green light would turn on. When the child stepped off, a red light would blink on and off to reming the child to push the step cubby back into place.


Tuesday, April 5, 2016

Thermal Systems Part 1


To start off this assignment, Amy gave us a brief presentation of Newton's Law of Cooling and the math and physics behind thermal systems. We were then tasked with using MATLAB to examine and update a simulation of a cup of coffee being either heated or cooled. For this assignment, I worked with Rachel and Vivian who are also my final project partners.

Exercise 1

We were given the first code, which depicts the cooling of coffee. We were than told to determine how varying the parameters Rth and C would effect the program. Looking at the equation for Newton's Law of Cooling (to the right), we see that both Rth and C are inversely proportional to dT, the corresponding temperature rise. This suggests that as Rth and/or C decrease dT increases. Likewise, as Rth and/or C increase dT decreases. We tested this out by lowering Rth from .85 to .15, increasing Rth from .85 to 10, lowering C from 1k to 5, and increasing C from 1k to 1M. As we anticipated, when we decreased the value of either Rth or C, dT increased more quickly and the coffee reached it's desired temperature more quickly. When we increased either Rth or C, dT increases a much slower rate, so you can't even see the whole image on our graphs! You'd have to lengthen the tmax, duration of the simulation, in order to see when the coffee finally cools to air temperature.



Rth = .85; C = 1000
Rth = 10; C = 1,000
Rth = .15; C = 1,000

Rth = .85; C = 50
Rth = .85; C = 1,000,000


Exercise 2

In this next exercise, instead of cooling the cup of coffee, we explored the scenario of heating up a cup of coffee from room temperature. To do this we used a slight variation of the previous equation. Because we are now increasing the temperature of the cup we need to add thermal energy at a constant rate P. To determine a good value for P, we needed to use MATLAB. To do this we needed to isolate P onto one side of the equation and since the difference between the initial temperature and the temperature of the coffee is zero, we set dT/dt to zero. When we typed this equation into MATLAB, the program spit out an answer of roughly 75.














Exercise 2b

For the continuation of this problem, we were given the program for the heating of a cup of coffee and asked to deduce the thermal parameters of C and Rth when looking at a plot of the data.

In order to find Rth, we looked at the equation P = ΔT / Rth. By isolating Rth, we were left with ΔT / P on the other side. Plugging in the values for ΔT (357-293) and Rth (75), we calculated a Rth of .84. 

In order to find C, we looked at the special circumstance of t = 0. When t = 0, for a short duration of dt, we have the equation dT/dt = P/C because we can assume the difference between the temperature of the cup and the temperature of the surroundings is negligible/really close to zero. Isolating C, we get P/(dt/dT). dt/dT is also known as the slope of the equation and can be determined by eyeballing the slope at t=0. The slope, therefore, will vary person by person. I personally think it looks like it is approximately, 20 / 250. This then gives me a value of approximately 950 for C.











Exercise 3

In our next exercise, we need to create a code that raises the temperature of the coffee to the desired temperature and maintain it there. To do this, we repurposed the equations above. We turned the two statements into if/else loops and put it within a greater while loop. We also needed to increase the value of P, because a P value of 75 doesn't heat up the coffee very quickly and in order for bang bang to work, we need a scenario in which there is some over and under shooting.

This gave us our desired result. When the coffee's temperature is below 357 degrees K, the if code will be initiated and the heater will turn on. When the temperature of the coffee was greater than the desired value of 357 degrees K, the else statement command would be initiated (i.e. the heater would be turned off and the coffee will cool down). This gave us our expected zig zag type plot. As a result, the cup of coffee never stays at 357 degrees, but jumps back and forth between being a little warmer and a little cooler.




time (s) v. temperature (K) graph
a zoomed in section of the graph



Exercise 4

This next exercise is a variation on #3. Instead of using Bang Bang control, we need to create a coding use proportional control to reach and maintain the coffee's desired temperature.

To start with, we repurposed the while loop from the heating up of the coffee. We decided to make the power of the heater proportional to the difference in temperature of the room and desired, 357 degrees K. We know that when the temperature difference is 0 or when t = 0, that the heater should be on a high power and when the temperature difference reaches 84 degrees, the heater should be on low power. So we estimated appropriate power levels and plugged them into a equation for the slope of a line. After some trial and error regarding the appropriate power levels, we decided on using 200 as the max power and 75 as the minimum. This gave us a maintained temperature 0.13 K away from the desired temperature!

















Exercise 5a


For the next exercise, we needed to rewrite our bang bang control supposing there was a delay between the time the coffee reaches a given temperature and when the sensor records the temperature.
This delay made it so that our original graph gets shifted to the right.














Exercise 5b

For second part of this exercise, we needed to rewrite our proportional control supposing there was a delay.

The delay made it so that the heater didn't not turn off until well after the temperature of the cup of coffee exceeded that of the goal temperature. Therefore, this gave us an overshoot curve that you can see in our graph.











Other delays that we would expect from our thermodynamic system would include the time needed for the heater to go from x degree to y degree. This delay would have less of an impact on the proportional control code, than it would from the bang bang control, since the bang bang control, assumes the power can go from zero to maximum instantaneously.