Thursday, April 14, 2016

Thermal Systems using MATLAB Part 2

Day 19 (4/5/16)

Task #1:

The first part of the Thermal Systems #2 assignment asked us to generate an experimentally measured heating curve. To do this, we ran the test_thermal code:


and we ran it on our LogoChip, which looked like:


We got a resulting heating curve that looked like:



From this heating curve we can calculate the values of the thermal resistance (Rth) and the heat capacity (C). We calculated Rth by taking the total change in temperature (21.7 K) and dividing by the power (6.5 W). We determined that Rth was 3.34. We calculated C by dividing the power by the slope of the graph (0.2736). We determined that C was approximately 23.75. Using both the values of Rth and C, we multiplied them together to get the time constant tao which was 79.6. Tao is the time it takes for the system to reach about 63% of the asymptotic value. Our graph and our tao match to this definition because at a time of 79.6 seconds, the temperature reads about 321.8 K, which is about 60% of the final asymptotic value for the temperature.

To summarize the values:
Rth = 3.34
C = 23.75
Tao = 79.6

Task #2:

Our second task was to modify the heatsim code with our calculated quantities and see how similar our heat curve was to the simulation. Here was the plot from our simulation:


As you can see, both plots are pretty similar. Any differences that exist may be due to fluctuating ambient temperatures in the air or inaccuracies in our calculations. Also, the real world isn't perfect, so the perfect simulation will likely not match up exactly with the real heat curve.

Task #3:

Our third task was to use bang bang control to modify the test_thermal code to change the amount of power supplied to the system based on if the temperature is above or below the target temperature. In our case, the target temperature was 340 K and here is the modified code we used:



Here is the resulting plot from bang bang control for our thermal system compared with the simulation for bang bang:



Task #4:

Our final task was to use proportional control in attempts to reach our target temperature of 340 K. For a discussion on what proportional control is or how to set it up see my previous blog postings.

For our system, we tested the code with 3 different proportional gain coefficients (Kp). The values for Kp were given to us in the assignment with units of W/K, and since we were using percentages to determine how much power to deliver to the system we had to change the units. To do this, we divided the given Kp by the total power, 6.5 W, and multiplied by 100. This gave us resulting values of:

Kp1 = 0.77%
Kp2 = 2.08%
Kp3 = 7.70%

To plot the heat curve with proportional control using these values we used the following code:


And here is a resulting plot for proportional control using the smallest Kp:



The system does not reach the control set point when the gain is small because the constant only allows for a maximum of 30% power. Since the biggest the error could be is only about 40K and the constant is .77, the max power will be very low. Not having a lot of power will take the system a lot of time to reach the target temperature.

Here is the comparison of our simulation and the actual thermal system:


When the proportional gain is high, the temperature of the system shoots up at the beginning and levels off quicker, much like the simulation. The optimal gain setting for our thermal system seems to be a high gain because that gets us closer to the desired temperature because it shoots up higher at the start. Regardless of our chosen Kp though the temperature does not reach the target temperature. 

1 comment:

  1. I really liked the amount of detail you have in your explanation of how you calculated specific numbers/values!

    ReplyDelete