Monday, April 25, 2016

Cubby Buddies Week 4

Week 4 was all about building the cubby and Cubby Buddy.  Materials we used for the cubby and Cubby Buddy were:
  • Wood (11/16 in)
  • Drawer Slides (2 pieces)
  • Nails (2 in, 1/4 in)
  • L shaped support (2 pieces)
Once we got the wood, Magnolia, Vivian and I immediately started cutting wood and drilling and screwing pieces together.

However, our first problem was the sizing of the wood.  The cut pieces of wood we received from Home Depot was smaller than our actual measurements.  Because of this, we had to rescale our cubby and Cubby Buddy based on the sizes of wood we were provided with.  Below are measurements of the new cubby and Cubby Buddy sizes.


In order to cut our wood planks into smaller pieces for the Cubby Buddy, we used a table saw in the wood shop.  With different sized and shaped pieces of wood, there were many different ways of cutting the wood: standard sliding wood past the blade, using a metal guider for pieces longer than wide, and using another object to push the piece past the blade.

The first task we did after cutting was attaching the drawer slides.  With just Magnolia and I, we were both just beginning to learn how to use the a drill.  Connecting the drawer slides was extremely difficult as we had to use 1/4 in nails and drill them through specific holes.  Once we attached the drawer slides to both the cubby itself and the side of the Cubby Buddy, we began connecting all sides of the cubby together.  With two inch nails, this task proved much easier.  The one thing we had to keep in mind while drilling was not to splint the wood.

The next day, Magnolia, Vivian and I met to finish installing the L supports for the insides of the Cubby Buddy and the tops and bottom of the cubby and Cubby Buddy.  Using a scrap piece of wood, Vivian drilled a handle onto the Cubby Buddy.  The handle stretches the length of the Cubby Buddy and is about an inch long, small but large enough for a child's hand or foot to reach under and hook onto.












Here is our finished product of a cubby and installed Cubby Buddy.  Next to the wooden model is our cardboard model.

We have not yet included the LED lights reminding kids to push the Cubby Buddy back in, or the button determining whether the Cubby Buddy is pushed in or pulled out.

On Friday, all CSC groups met with Becky.  While presenting our idea, we noticed when the Cubby Buddy is pulled out, it is 11/16 of an inch off the ground.  With the weight of a children on it, the drawer slides could easily bend and weaken.  Amy suggested attaching a sheet of delrin onto the bottom of the Cubby Buddy that would act as feet.  While in the CSC, we also noticed the cubbies on a carpet surface, and understood that delrin, rather than wood, would slide better on carpet.

Our second issue was the button placement.  Our original idea was to place the button on the side near the end of the cubby.  When the cubby was pulled out, the button would un-press, and when pushed back in, would press again.  However, we realized that once the button was unpressed, the Cubby Buddy would only hit the side of the button and would not push back in.

Our last issue was the possibility of items stuck in the back of the Cubby Buddy.  The depth of our Cubby Buddy is about an inch shorter than the depth of the cubby.  This increases the chances of items in the back blocking the cubby from going all the way in.  We will put wooden pieces in the back on the cubby to decrease the likelihood of that.

The next step for our Cubby Buddy is to install lights and the button.  We will drill holes in the cubby for wires and tape them along the corner.  The breadboard and power source will be placed on the top of the cubby.

Tuesday, April 19, 2016

Cubby Buddies Week 3

Week three marked the beginning of a cardboard prototype and research for a final model.

We created a rough cardboard prototype of the cubby itself but cut out close to exact measurements for the cubby buddy.  We put together the bottom cubby and middle cubby for the coats and added handles for precaution.

Larry suggested L-shaped metal supports for the insides of the Cubby Buddy which we found online for about $2 apiece.  We included cardboard cutouts of them in our prototype in the bottom right picture.

In our cubby prototype, we have included the supports, handle for kids to pull the cubby out, and the drawer slide on the sides of the Cubby Buddy.

Our initial idea for the handles were for them to look like those on the cubby.  Upon further discussion, we concluded oval shaped holes in the cubby would be safer for fear of the kids running into the handles.

In the middle picture below, we played out the pieces of the cubby and Cubby Buddy in SolidWorks to calculate the total area of wood needed for the entire cubby and Cubby Buddy.


We are putting lights behind a picture to put on the back of the coat block of the cubby.  The picture shows a person kicking the cubby.  When talking to Becky, she suggested having the children kick the cubby back since they are top heavy and it will be easier and safer for them.  This shows that the children they are allowed to use their feet and can be rough with the cubby.


To further the process with the lights, we wrote a simple code and connected LED lights onto a breadboard and an Arduino.  We used a red, green, and blue LED and found that the Blue shone with the largest radius.

In the video, beneath my finger is a button.  When the button is pressed, the lights do not flash, but when the button is not pressed, the lights start flashing.  The lights were set up to imitate what our final version with the picture would look like.  When the cubby is pushed all the way in, the button would be pressed, but once the child pulls the Cubby Buddy out slightly, the lights would start flashing to inform and remind the kid to push the Cubby Buddy back in.





















In addition to using an Arduino, Magnolia, Vivian and I learned to solder wire together using a soldering iron and some led.  We soldered a mini robot that when a battery was inserted, LED lights acting as eyes would begin blinking rainbow colors.

At the end of this week, we came to a conclusion that although our project does not contain a lot of feedback and control, our project is just as time consuming with all the physical building of the cubby and Cubby Buddy.   Our project is more on the side of mechanical engineering.




Thursday, April 14, 2016

MATLAB: Thermal Systems Part 2


Heating Curve:


Using a given code in class, test_thermal.m, we ran our code producing the graph on the right.

Our graph ran for 300 seconds and paused every half second to plot the graph.

1: Calculating The Physical Constants

Using test_thermal.m from above, we took the slope at the beginning of the curve and the initial and final temperature to calculate the time constant: t = Rth*C.

  • Rth = (deltaT / P) = ((R * deltaT) / V^2)
    • used: change in temperature, voltage
    • Rth = 6.9
  • C = (P / slope) = (V^2 / (R * slope))
    • used: voltage, resistance, slope
    • C = 16.2
  • t = 112.1
Our calculated time constant was 112.1 seconds and the temperature at that time should be 334.4 K.  The actual temperature from the graph above at 112.1 seconds is 338.6 K, which was a bit higher than expected, although still approximately 63.2% of the final asymptotic value.


2: Simulation

We modified the heatsim.m code by putting in our calculated values from above and resulted with the graph to the right.

The generated graph had a very similar curve to the our experimentally measured results from the initial test_thermal.m graph.



3: Bang-Bang Control

Magnolia, Vivian and I modified test_thermal.m to contain bang bang control with a target temperature of 340 K.

Compared to the behavior of last bang bang simulation, this simulation reached a close 340 K through smooth increase.  In Thermal 1, our bang bang started and stayed at 0 for a bit, immediately increased with no warning and once goal temperature was reached, began dropping and increasing in little segments.






Above shows the code and the graph produced from the graph.  Below shows the values of the temperatures at the plateau of the graph.


4: Proportional Control


error = target state - present state
setpower = Kp x (target - T)

We modified a second test_thermal.m code to include proportional control.  We ran the code for three different proportional gains: 0.05, 0.2, 0.5.  The smaller the proportional constant, the smaller the increase in temperature.  The larger the proportional constant, the more significant the increase in temperature of a system.


The proportional constant cannot be too big or it will act like bang bang control and will basically be on full power from the beginning and will stay on full power until when the target temperature is reached.
The optimal proportional gain constant is between 0.2 and 0.5 for the target temperature can be reached while using the power efficiently.









Reflection:

This activity allowed us to see the differences between simulations and actual experiments.  Although the numbers and graphs produced were very similar, differences were ubiquitous.  There are many limitations due to the natural nature of Earth causing the difference between actual and theoretical data.

Examples of thermal systems can be seen in many things we do everyday including heaters and air conditioners.  Having some control over them is important in creating and designing safe devices.




























































Tuesday, April 12, 2016

Cubby Buddies Week 1 & 2

Task:

Magnolia, Vivian and I are to create an object for kids to easier reach the top shelf of their cubbies.  We are to incorporate feedback and control into our final design.


Cubby Buddy:


After taking measurements from the cubby at the Children's Study Center, we decided to make a pull out stool at the bottom of the cubby while keeping the space large and un-touching the shoes and boots below.

To the right is a drawing with measurements of the cubby sizes.

Issues:

Safety is the main issue we need to keep in mind while designing this cubby.  When the kids pull out their cubby, having it out is not safe with others walking around in the hall.  We also need to ensure they will be safe when using the Cubby Buddy.

We also need to take in mind maximizing space when creating this Cubby Buddy.  With a pull out device, it can easily become too bulky.

With 37 cubbies in the Children's Study Center, minimizing cost will be a struggle.  Although for this project we are only creating one final Cubby Buddy model, if this were to be used in the Children's Study Center, we would need to keep the cost down.


How It Works:


Handles:

Kids are allowed to pull out the cubby by themselves.  There will be a curve shaped handle that will go across the entire length of the cubby.






For safety precautions, we added handle bars to the side of the cubby for the children to hold on to while stepping on top of the cubby.  By analyzing the average children height, we will determine where exactly and how many sets of handle bars to put on the cubby.


Sliding & Locking Mechanism:


A wheel will be attached to the end of each side of the Cubby Buddy and will slide with the guide of a track connected to the side of the cubby.

When the cubby is pulled all the way out, the weight of the child on the cubby will keep the cubby from sliding back in on its own.

However, when the cubby is pushed back in, our initial idea was to have an elastic plastic shaped with half circles for the wheels to slide and lock into place when pushed all the way in.

Second Idea: there will be two wheels, one wheel which will not be able to move much at the end of the cubby keeping it in place.








Lights:

For our feedback and control, we will 1. use an ultrasonic sensor at the back of the cubby to sense how far the cubby has been pulled out.  2. We will use a button on top of the Cubby Buddy, and when stepped on, green LED lights attached to the edge of the cubby and below the board of the main cubby will turn green.  Once the kid steps off the button, after a given second or two with the unpunished button, red LEDs will turn on behind a picture informing the kids to push the cubby back in.  We incorporated visuals as they might be too young to understand why green generally means go and red means stop.

In the picture to the right, the kid's height is exaggerated to show where the lights would be put.













































Monday, April 4, 2016

MATLAB: Thermal Systems

Task:

In this exercise, we will be looking Newton's Law of Cooling in relations to the change in temperature of a cup of coffee.

Newton's Law of Cooling: dE/dt = -k(T-Tair)
     - the negative sign in front of the constant k indicates energy leaving a system

Effort and Flow: R = deltaV/I = "effort"/"flow"
     - change in voltage over current equals resistance

Using Newton's Law of Cooling and voltage across objects with a current I, we can rewrite an equation for Rth, thermal resistance, and the change in energy of a system during a change in time, dt.

1: Changing Rth and C

How does the cooling behavior change if we vary the parameters Rth and C?
dT = ((T-Tair)/(RthC))*dt

  • dT: change in temperature
  • T: initial coffee temperature
  • Tair: ambient temperature
  • Rth: thermal resistance
  • C: heat capacity
  • dt: time step



If either Rth or C are increased, dT will increase because they are both inversely proportional to dT.

This is what the code looks like of the equation above from time = 0 to the maximum 1500 seconds.

To the left are two graphs of decreasing Rth and C.  Decreasing either one of the other, or both, results in a quicker decrease in temperature.

The picture on top is of decreasing Rth.

The picture below is of decreasing C.  In that graph, C is decreased more than Rth was in the graph above giving the graph a quicker decrease in temperature.
















Let's take a look of what would happen if Rth and C are increased.

The graph to the right above is of increasing Rth while the one below is of increasing C.  Again, C is increased more.

By increasing Rth and C, the drop in temperature becomes more gradual, to a point where the decrease in relation to time seems very linear.

2: Adding a Heater

Calculate a good value for P if we want our coffee to heat up to the Starbucks ideal 84 degree Celsius, using the Rth form the MATLAB script.

dT = dE/C = ((P/C) - ((T-Tair)/(RthC)))*dt

  • P: power/speed


Magnolia, Vivian and I rewrote the equation above for P.  We coded it in our script and set constants for the other values.  Using MATLAB, P was calculated to be 75.

3: Temperature Controller - Bang Bang

Write a script using bang bang control to reach and maintain the desired temperature of 84 degrees Celsius.  Why is bang-bang control appropriate for many thermal systems and when might it be insufficient?

Bang-bang control ensures the temperature is at the said temperature because bang-bang continuously turns on and off to reach and maintain goal temp.  However, it is insufficient because with only two settings of on and off, it can be both annoying and impractical.
































Code reads:
If temperature is less than 357 Kelvins, the energy going in the system (heater) is power times the time step.  The energy going out the system is ((T-Tair)/Rth)*dt.  The resulting energy of the system the energy coming in minus the energy coming out.  But if the temperature is equal to or greater than 357 Kelvins, no energy is going in and will begin to lose heat but needs to maintain the desired temperature.



This is what the graph looks like of the coffee reaching the desired temperature and maintaining that temperature using bang bang.  Because this is bang-bang control, once the desired temperature is reached, the temperature continuously drops and goes up to maintain that temperature.

The graph below is a zoomed in picture of the graph above to show the changing temperature.















4: Temperature Controller - PID

Create a program that uses proportional control to reach and maintain the desired temperature.  How does this approach compare to bang-bang control?

Like always, PID is a lot smoother than bang-bang.  Using what we learned from using proportional control to control our SciBorg a week ago, we used the same equation to integrate it into our MATLAB program for this problem.





























Code reads:
The temperature difference is the goal (final equilibrium rate) minus the ambient temperature.  With trial and error, we multiplied the temperature difference with 25/17 and added B, our gain constant.  Those two equations make up the PID control.  In our terminal, our temperature difference was calculated to be 0.1321.


Using proportional control, this much smoother graph of reaching the desired temperature was created.

A continuous drop and increase in temperature is no longer apparent now that bang-bang is not used.







5: Delay

Modify the program so that there is a delay time between when the coffee reaches the given temperature and when the temperature sensor records that temperature.































Code reads:
We set the value of n, and if that value minus delay, which we set a value for above in the code is greater than 0, then we used PID control to reach the desired temperature while adding in the delay time.  Otherwise, the power is 0, which will be seen in the first ~400 seconds on the graph to the right.  If the power supplied by the heater is greater than vmax (max speed), then the power is set to be the max speed.