Friday, April 11, 2014

MATLAB Thermal Systems Part 2

Deliverable 1:

x-axis: time(s), y-axis: temperature(K)
Using the above heating curve, we were able to determine the thermal resistance and heat capacity:

(See 'MATLAB Thermal Systems Part 1-Working Backwards' for details on how to calculate Rth and C using the heating curve)


From physics, we know that the definition of a time constant is the value of t that makes e^-(t/RC) equal e^(-1).  
Using the Rth and C values calculated from the graph, the time constant comes out to be 93.84 seconds:
The graph shows that y(300) = 357.05K and y(0) = 304K. Therefore, the time constant is the x value that corresponds to the y value of (357.05-304)*(63.2%)=33.53.
Using the cursor, we determined this value to be 96 seconds, which is close to the time constant deduced from the figure.

In simpler terms, we expect the system to heat up 63.2 percent in 93.84 seconds but the experimental data show that the time is 96 seconds. The percent error is 2.25%, which means the values are pretty close.

 

Deliverable 2:

In order to simulate the heating curve of the resistor, we used the heatsim.m file from the previous assignment but changed the P, Rth and C values. 

 

Link to heatsim.m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRbGxYYVFrYUI2ZTA/edit?usp=sharing 


The simulation graph looks almost identical to the experimental heating curve, with the temperature leveling off at about 304 K.


Deliverable 3: Bang-bang controller

 
  For the bang-bang controller, we simply used an if-else statement to set the power to 100% when the temperature is less than the desired temperature and 0% when the temperature is greater than the desired temperature.


Bang-Bang Controller; x-axis: time(s), y-axis: temperature (K)

As the graph shows, the temperature successfully reaches our desired temperature of 340K.

Using the bang-bang control script from the last assignment and plugging in the right variables, we were able to obtain the following graph:
Bang-Bang Simulation
The simulation graph shows more fluctuations but is essentially the same as the experimental graph. 

Link to the Bang-Bang Controller .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRYXc1SGpqMjhOVkk/edit?usp=sharing 

Link to the Bang-Bang Simulation .m file:
https://drive.google.com/a/wellesley.edu/file/d/0Bymp1CBCUUYRRkNHMkdiQXVmWDg/edit?usp=sharing 


Deliverable 4: Proportional Controller

For the proportional controller, we defined error as the difference between the desired temperature and the current temperature. 
Since 'setpower' in MATLAB is the percentage of the total power, we converted the power to percent. 

Gain=0.05 Experimental(left) and Simulation (right)

Gain=0.2 Experimental (left) and Simulation (right)

Gain=0.5 Experimental (left) and Simulation (right)


Q1:
When the gain is too small (0.05), the experimental results to not show significant changes in temperature.

Q2:
When the gain is too high, the system behaves more like a bang-bang controller (like the one from deliverable 3) because it is essentially set at full power for most of the time. The graph proves this because the temperature increases almost linearly until it levels out.

Q3:
Gain=0.2 is the optimal gain setting because the graphs show that the rate of temperature increase (dT/dt=slope of the graph) is the greatest at lower temperatures and gradually decreases as temperature gets higher. This is what we would expect to happen in a proportional controller.

Link to Proportional Controller .m file:

Link to Proportional Control Simulation .m file:



Deliverable 5:


PI Experimental Script
 

PI Experimental

PI Simulation (Temperature graph in red, power graph in blue)

 Link to PI Control Experimental .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRMk0ySG95UGtteE0/edit?usp=sharing


Link to PI Control Simulation .m file:
https://drive.google.com/file/d/0Bymp1CBCUUYRWmlhMm1jbDFmUWc/edit?usp=sharing



 

No comments:

Post a Comment