Saturday, May 11, 2013

Final Project: delrin pieces

The next step in our project is creating the final pieces. Hannah created a solid works model of how we wanted our vehicle to look like while tried fixing the balance. We decided to use pegs and notches since that would be the simplest way of attaching the parts. Before we printed out all our part in notches, we needed to make sure we had the measurements right. After printing the test piece and getting the measurements right (the hole is .o1 cm smaller in length and width than the notch), we got to work. We decided to use the .495 cm delrin because it would be durable but not too thick that it would add weight. 


Above is our initial design. I drew this out because it was simple to create and put together, and we hoped to balance it out with weights later. Balancing with weights wasn't a good design idea so we manipulated the cardboard and lego models to find a structure with a good balance. We ended up moving one of our sides in more to save space and  so that it would be off-centered and balance on its own. We tested this out with the lego model and it worked.

We decided not to bend delrin since that would be difficult to connect and have all the pieces fit. There is a back behind the command board to hold it in. We also want to use a dovetail joint to attach the back piece  and pegs and notches on the other pieces. The horizontal pieces will have notches and the vertical pieces will have pegs at their ends. 

There is also the hook piece. This will cove the wheel- for aesthetics- and to hold the curtain rings. It will be a few mm above the pole as to not interfere with it. 


The pieces will be printed tomorrow. Hopefully they will fit and we will begin to move on to details- revising the code, building the stand, and fixing the balance. 








Friday, May 10, 2013

Final Project: works-like/ looks like model

 Here is our program: 

We have two sensors- one reading exterior light and one reading interior light. If the sensor reads normal light, it does nothing. If it reads light, the car drives 'this way' to open the curtain. If it reads darkness is drives 'that way' and closes the curtain. The time is set by motor on/off- we have found that 25 is the perfect time length of time. The only problem was that if the curtain was open, it would open again if it read sunlight again. Professor Berg showed us how to set open? so that if the curtain is open, it will not open again. The program knows only to open if the sensor read light AND if the curtain is currently closed. Writing the program was surprisingly straight forward. We will modify it later as we see fit. 

Next is our model
So we flipped the wheels back to over the rod and put the board under the rod. Our design right now has the wheels centered and the motor on the side. We are having problems with balancing the device so I'm sure our design is going to evolve. We have already went through a few iterations of trying to place the board on the top with the wheels under the rod. With that design, we tried to put the board in place where it would balance against the motor. With our current design I think what we want to do is move the board in the opposite direction of the motor a bit more so that we don't have to add artificial weight. Our final design will have a wall on the other side of the model and hooks for the curtain rings. We will also mess around with the exact location of the pieces with legos limit where we can put the walls. 

When we presented our model in class, it worked! The program ran smoothly and the lego model held together well. The only problem is balance. We are going to have to tweak this a lot. But it still moves even if the car is tipped over. 

Final Project: test 1-2 critical elements

We decided to go with opening a curtain with two wheels that drive along a curtain rod. 
Our critical elements were testing the light sensors and getting readings and then to build the frame of the vehicle. We used legos to build our initial frame. We built two walls and placed the wheels in between them. We started off with the pico motor and a gear train but then realized that the NXT motor would be much easier since we wouldn't have to adjust the speed or torque. 


 

We created a rounded (or stepped with the legos) base to hold the rod. The two wheels drive over the rod, the friction allowing them to grip and drive across the rod. The motor is only on one wheel, the other wheel does not have a motor attached to it but it allows the for better balance. This is just the basic skeleton, so when we build the works-like model we will have a better look. We created 'cradle' to hold the broom handle/ rod rather than a rectangular box. We thought that this would hold the rod better. Also we have the wheels over the rod since that we know for sure there will be contact between the wheels and the rod. The only problem is balance. The motor on the side makes the vehicle roll over. We have the device flipped over and the command board is on the top - we were afraid to go this at first since we thought that gravity would pull the wheels down and they wouldn't touch the rod. Before creating out final lego form, we thought about what our final delrin design would look like. It would be a delrin box with a divider between the motor and the wheels and another compartment for the board. We are going to try to curve delrin around the rod so it doesn't move around. 





The we tested the light sensors. It was cloudy so we got readings for cloudy light. We will test it again in the sun light. We also got sensor readings for ambient indoor light and the florescent lamp- these are the number we will likely use in our program.

Wednesday, May 8, 2013

Final Project: brainstorming, research, define goal, Pugh chart

Hannah and I are working together again for the final project. Our project is to create a device that will open a window shade in the morning and close it at night. 

We began by brainstorming what we wanted to do and what our options are 
Some of the things we had to look into were the type of curtain, when we wanted the curtain to open and close, what the sensors would read, and what types of mechanisms would work for the different types of curtains.




In the end we decided to go with a traditional curtain on a rod, even though the dorm rooms do not have this curtain. The shades provided by the college are barely possible for a human to open (my roommate has broken ours twice). This shade is the type that you need to pull down a bit before it springs up. Another option was the shade that opens and closes with a rope-pulley system. With this we thought that we could use the counts on the motor. Our fourth option was a shade in which you pull the sting down to open the window and then push it to the right to release the window. We though this would be to many motions for our machine to handle. 
With the curtain, we decided that we would have some sort of vehicle. We had a few option for the arrangement of the tires. One of the top and bottom seemed unnecessary. A car that pulls the curtain from the bottom wouldn't effectively open the curtain. We also thought about mounting a track on the wall with a vehicle on it that has a hook that would pull the curtain rings. Taking out the car we could have had an arm that extends and contracts from a motor centered above the rod. The idea that we decided to work with was two wheels on the top of the rod. 
Then we thought about the programming part. We thought about how we would want a curtain to open in our room. Both of us like natural sunlight so we want our curtain to open when the sun comes out. We would have a sensor read the sunlight and then open the curtain by driving across the curtain rod and moving the curtain loops. Then at night - either when it is dark or when we turn off our interior lighting- the car would drive the other way. I think we will go with two sensors for this if we have it read interior lighting. There were a lot of technicalities that came up- what if it was cloudy? too sunny during day and we wanted to close the curtain? a manual override button? what if there are lamps outside your window at night? 


Matlab 4, Thermal Systems 2 cont


4: Proportional Control
You should turn in your results, the main one being the graphical comparison of the simulation and experiment. Be sure to label your axis, provide units, and annotate your figures. Provide a short description of each figure so we what the data are. You should also include the MATLAB scripts that you used to create these figures, identifying the values of the heat capacity and thermal resistance that you deduced. Also make sure to answer the bulleted questions above.

Continuing from Wednesday, we implemented proportional control. Proportional control- as we learned in pico blocks- is much better at hitting a target value without over shooting. 
We added the following equations:
error = 340 - readtemp(s)

setpower (s, (K_p*error))

We then tested different values of gain

K_p = .5
T(200) = 325 - did not reach target temp. The gain is so small that it does not allow for the power value to be large enough to reach 340K. Also since K_p is so low it has a harder time overcoming the ambient temperature. If we had the program run longer, it would have reached the temperature



K_p= 5
T(200) = 338  - very close, it looks like it may have hit 340 and was cooling at this point. The temperature rose steadily and then the held the coffee around 340 pretty well.

K_p= 12
T(200) = 342 - here the gain starts to get too high. The temperature over-shot 340 (T(45) = 343) and then cooled back down but was not able to closely hold 340K since it was over correcting with the large gain

K_p=20
T(200)= 339.21 - this only .8 away from our target. It initially overshot [T(35)=344] before settling around 340. With the larger gain we can get much closer to our target but the large gain wouldn't allow it to settle as soon. 





Our perfect gain is somewhere between 5 and 12- we found that it was 8.



5. PI Control system using proportional and integral control


K_p= 8
K_i=2
T(200)=341.1

K_i=5
T(200)=340.48

K_i=10
T(200)=340.4


 With integral control implemented into our system, we are able to get to much closer to 340K. 

Next we blew on the plate and graphed power vs time in red. Since power is a percent, the red dots never go above 100. 

K_p=8
K_i=10
There is a slight dip in temp when we blow.


K_p=8
K_i=10
Here the dips are more visible. The power graph is curved showing that more power is being put in the system the lower the temperature gets. When the temperature is 340K or higher, power = 0.

K_p=4
K_i=5
Here we blew on it for a longer time so the power hits max. 



K_p=2
K_i=2


K_p=2
K_i=2



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