Deliverable 1:
|
Code of test.thermal.m |
|
First run of test_thermal. We moved the container of the system for a second and it caused a sudden spike in the temperature which is the little blip on this graph. |
|
We learned from our mistake and made sure not to disturb the system which gave is this nice graph. |
Thermal resistance (Rth) can be calculated using this equation:
Rth =
Δ T / Power = y(300) - y(0) / power = (378.4592 -315.1095) / 6.5 =63.3497 / 6.5 = 9.7 K/W
Heat Capacity (C) can be calculated using this equation:
C = Power/ slope = power / [(y(50) - y(0))/50] = 6.5 / (22.87 / 50) = 14.2 J/K
To gut check the math, we can use this equation = Rth*C = 9.7 K/W * 14.2 J/K = 137.4 s
Using the graph we determined that y(0) = 315.1095 and y(300) = 378.4592. The y value of (378.4592 - 315.1095) * 63.2% is 40. So the x value that corresponds to a change of temperature that is 40 degrees is the time constant. Using a ruler, we determined that a temperature of 40 degrees is around the x value of 130 seconds which is close to the calculated 137.4 s.
So although we predicted that the system would heat up 63.2% in 137.4 s, it actually took about 130 s. The percent error is 5.39% which is pretty low so the experiment is pretty close to the simulation.
:D This percent error is much lower than the usual 20% or so percent error I get in my chem labs so nice nice I am satisfied with this.
Deliverable 2:
|
Code for heat simulation |
|
Heating simulation curve |
The simulated heat curve is very similar to the experimental curve that we got from earlier. It's nearly exactly the same! :)
Deliverable 3: Bang-bang control
|
Simulation of bang bang control |
|
Experimental results of bang bang control |
For bang bang control, we used a simple if/else statement for the experiment. We said that if the temperature was less than 340 then turn the power to 100% but if it is more than 340 then turn off the power. The experimental results were fairly similar to the simulation. The experimental just fluctuated a little bit more than the simulation but it is a given that that will happen since there is a delay between the time the sensor senses the temperature and when the power is adjusted.
|
Code for bang bang control of simulation. |
|
Code for experimental heating using bang bang control. |
Deliverable 4:
|
Code for heat simulation using proportional control. |
|
Code for heat experiment using proportional control. |
|
Simulation using 0.02 gain. |
|
Experimental results using a 0.02 gain |
kp = 0.02 | With a very small gain of 0.02, the system never reaches its control set point since the power is too small and does not cause a large enough temperature change for the system to reach its target.
*note: We accidentally used a gain of 0.02 instead of 0.05 but both gains are so small that I would expect that a gain of 0.05 would behave very similarly to these runs.
|
Simulation using a 0.2 gain. |
|
Experimental results using a 0.2 gain. |
|
Simulation using 0.5 gain |
|
Experimental results using 0.5 gain. |
kp = 0.2 | The optimal gain seemed to be 0.2 since the simulation and the experimental both behaved similarly to the first runs we performed of heatsim.m and test_thermal.m.
kp=0.5 | When the system has a high proportional gain like 0.5, the system behaves similarly to the system that we used bang-bang control on. From the beginning of the experiment until, the system reaches it's target temperature, it increases linearly. When the system reaches the target temperature, it levels out like seen in these graphs.
No comments:
Post a Comment