Wednesday, May 8, 2013

Matlab 3, Thermal Systems Part 2

So in part 1 we simulated coffee cooling, and now we are going to actually test it.

Deliverables


1: experimentally measured heating curve 


First we found Rth and C (correct calculations at the bottom of the page)

 We found our values [ C=5.7 J/K an Rth=19.23 K/W) and then solved for Tau, which equaled 109.6 seconds. As expected this was about 62.3 % of our asymptotic value. 
so looking at the graph, it is 2/3s done heating at 110 seconds

other variables:

Tair = 317 K      T (300) -= 442K
Though our graph only goes until 300 [the time we wanted] matlab actually measures until 311 seconds



Deliverable
2: Simulated heating curve




Here is the simulated graph. Our graphs have similar shapes except the simulation more perfect. The original graph has a few seconds delay before the heat has an effect on the 'coffee'. Also our final temp was 433K in the simulation vs 442K in the actual test

3: Bang-­‐Bang control



So here we used Bang-Bang control to control the temperature. Instead of the temperature rising or falling and overshooting, we used bang-bang control to more or less keep the temp constant. We added an If-Else statement telling the system to add power if the temperature is below 340K and to set power to 0 if the temperature is above 340K. In our graph, our temperature started above 340K so it decreased until it hit 340K- though technically below 340K. Bang-Bang control has the tendency to overshoot its target, especially if it has high levels of power, so even if the system turned to 0 power at 340K, the residual power would affect the temperature. This creates the up-and-down zig-zag- it bounces up and then at a slower rate cools. 



Monday, May 6, 2013

MatLab 2, Thermal Systems Part 1

Deliverables:
Questions 1&2, the .m files and resultant graphs for the four temperature controllers assigned on page 9, and your responses to the questions about those controllers.

Question 1 How does the cooling behavior change if we vary the parameters Rth and C? Figure this out using intuition and the above equations, and then vary these parameters in your program to confirm your conclusions.

As Rth and C increase, dT will decrease. This means that the higher the Rth value and/or the C value are, the slower the coffer will cool.



Red circles = Rth, cyan=  C


Question 2 Calculate a good value for P if we want our coffee to heat up to the
Starbucks ideal 84°C?







P is the value of the thermal energy provided by the heater. Our coffee begins at 84°C (357K) and we want it to stay there. So what we want is for the P value to compensate the natural cooling of the coffee (a change in temp of 0°C). 


Coffee cooling graphs for different values of P.
A low P won't be able to hold up the temperature. A high P will overshoot and increase in temp. 


Bang-Bang Control
Bang-bang control is a very common approach for thermostats. Why is bang-bang control appropriate for many thermal systems? When might it be insufficient?

Then we used Bang-Bang control to heat the coffee to 375K. We added thermal energy until the coffee reached 375 (or a tiny bit higher) and we turn off the heat. It keeps zig-zagging up and down as a real thermostat would. Even thought we have a range of temperatures, the coffee stays near its target temp. In a different context where the temperature would need to be constant, bang-bang control would not be sufficient- proportional control would be needed.




Proportional Control
How does this approach compare to bang-bang control?

Here we have added proportional control equations: 
error = T - 357 (temp - target)
P[ower] = error *gain
If T is less than target, the power is added. If T is greater than target, P = 0.  
 This graph has a sharper incline and reached the target quicker and is smoother rather than bumpy. 



mfiles:
https://drive.google.com/folderview?id=0B450xdb5jDgEQjVERjBvakdvRlE&usp=sharing&tid=0B450xdb5jDgEWWhwcDN0eUpTSEU

Wednesday, May 1, 2013

Matlab Day 1

Wednesday we started learning how to use Matlab (which stands for matrix laboratory as I learned from Wikipedia). I had done some programming in high school (I don't remember what it was called, Basic or something, I don't know). This was actually a pretty interesting class. We got through the first four chapters in class -the author of the text book made the reading easy and fun. 


 Here we just plugged in the program to find the nth Fibonacci number




Here we have a script with cars moving from lot A to lot B and vise versa. Intially we had a 'a' where there is currently a 'c'. This did not work because it was getting confused with the new and old value. Here 'c' is the updated value of 'a'



Then we graphed it, putting the script in loop. A is the red circles and B is the blue diamonds.

Then we moved back to the Fibonacci sequence, making it recursive instead of using an equation- so apply what we learned in the car exercise.


then we graphed it



Tuesday, April 30, 2013

More Disney

I love this Imagineering book, its so cool!
I'll scan in my notes later, but here are some pages from the book
Epcot- idea and in progress


Building Epcot


Creating the Spaceship Earth Ride

Quote by Walt Disney

Gardens

What is an Imagineer?

Evolution of a ride- from concept art to actualization




Its all in the details

more deatials

They created (I don't have the book with me now but I think) over 500 new typefaces! I actually love typography and I think this is super cool!


Pico 5

Today we had to go back an revise some of our programs

new follow

if else

drive straight

drive straight 2

follow the light

light

Thursday, April 11, 2013

Pico Blocks Day 4

So Friday we just continued  the list of stuff we were assigned Wednesday. 

We revisited the program in which the car drives forward when the delrin is over 15 and moves backward when it is less than 15 away but this time using proportional control. 




Counter for motor A



Here we are working on getting motor A to always be set to 50 using bang-bang control. This one would over shoot and end up twitching. 



Here we are working on getting motor A to always be set to 50 using proportional control. This way when it nears 50 it will stop completely. 




Testing with different values, and it still works!

Then we tried getting one wheel to follow the other. Here wheel B is following wheel A



This the final version. It is essentially the same as the code above but without the waituntil's because picoblocks don't like waiting. 


Going a certain distance by counting the ticks around the wheel



Same thing but with a sensor that must read greater than 15


Driving in a straight line

Pico Day 3

We learned the difference between bang-bang control and proportional control. Bang-bang is one way or the other, proportional has some wiggle room. 
We had four tasks to complete today: 


 Original Bang Bang Control 'Follow the Delrin'



 Using proportional control, we got rid of the spazzing. The car slows down as the value get closer to 15 and then it comes to a complete stop.



Here we have created variables that we can set to a value or use in an equation


 Trying to redo our line follow with variables so that the changing values of the tape and Masonite (due to the different times of day or light)


  Fiddling with values

Here we are counting wheel A. If the count is greater than or less than 50, it will turn until it reads 50, but it stops.


We moved motor on into the forever loop so that it will always readjust.