0% found this document useful (0 votes)
51 views8 pages

Calculations:: Case I: Manipulated Variable: Heat and Disturbance Variable: Flow Rate

This document contains calculations and analysis of step response experimental data from two cases of a temperature control system. For each case, it estimates the gain and time constant from the step response, calculates an average transfer function model, and plots the input/output data. It then performs controller tuning calculations for P and PI controllers using direct synthesis methods. Finally, it provides MATLAB code for modeling the step response data and comparing the measured and modeled responses.

Uploaded by

Nikhil Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views8 pages

Calculations:: Case I: Manipulated Variable: Heat and Disturbance Variable: Flow Rate

This document contains calculations and analysis of step response experimental data from two cases of a temperature control system. For each case, it estimates the gain and time constant from the step response, calculates an average transfer function model, and plots the input/output data. It then performs controller tuning calculations for P and PI controllers using direct synthesis methods. Finally, it provides MATLAB code for modeling the step response data and comparing the measured and modeled responses.

Uploaded by

Nikhil Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Calculations:

̂ is the Heat deviation variable, 𝐹̂ (𝑠) is the Flow Rate deviation variable, 𝑇̂(𝑠) is the
Here 𝐻(𝑠)
Temperature deviation variable
Case I: Manipulated Variable: Heat and Disturbance Variable: Flow Rate
Gain from positive step: 4.437847
Gain from negative step: 3.974368
Average Estimated Gain: 4.2061075

Time Constant from positive step: 265.952998 𝑠𝑒𝑐 −1


Time Constant from negative step: 205.280998 𝑠𝑒𝑐 −1
Average Estimated Time Constant: 235.616998 𝑠𝑒𝑐 −1

Average Transfer function model:


̂
𝑇(𝑠) 4.2061075
=
̂ (𝑠) 235.616998𝑠 + 1
𝐻

Case II: Manipulated Variable: Flow Rate and Disturbance Variable: Heat
Gain from positive step: -6.955941
Gain from negative step: -3.359578
Average Estimated Gain: -5.1577595

Time Constant from positive step: 0.741608 𝑠𝑒𝑐 −1


Time Constant from negative step: 183.031 𝑠𝑒𝑐 −1
Average Estimated Time Constant: 91.886304 𝑠𝑒𝑐 −1

Average Transfer function model:


̂
𝑇(𝑠) −5.1577595
=
𝐹̂ (𝑠) 91.886304𝑠 + 1

Case I Input and Output plots for step up experiment:


Comparison Plots for all Cases:
Manipulated Variable: Heat and Disturbance Variable: Flow Rate, Positive Step

Manipulated Variable: Heat and Disturbance Variable: Flow Rate, Negative Step
Manipulated Variable: Flow Rate and Disturbance Variable: Heat, Positive Step

Manipulated Variable: Flow Rate and Disturbance Variable: Heat, Negative Step
Controller Tuning:

P Controller:

𝑦(𝑠) 𝐺𝑃 (𝑠)𝐺𝐶 (𝑠) 𝐾𝑃 𝐾𝐶 𝐾𝑃 𝐾𝐶


= = ∗ =
𝑟(𝑠) 1 + 𝐺𝑃 (𝑠)𝐺𝐶 (𝑠) 𝜏𝑠 + 1 1 + 𝐾 ∗ 𝐾𝑃 𝜏𝑠 + 1 + 𝐾𝑃 𝐾𝐶
𝐶 𝜏𝑠 + 1
From Direct Synthesis Method:
𝛼 −1 0.85
For 𝛼1 = 1.85, 𝐾𝐶1 = 𝐾1 = 4.2061075 = 0.20208
𝑃
𝛼2 −1 1.75
For 𝛼2 = 2.75, 𝐾𝐶2 = = 4.2061075 = 0.41606
𝐾𝑃

PI Controller:

1
𝑦(𝑠) 𝐺𝑃 (𝑠)𝐺𝐶 (𝑠) 𝐾𝑃 𝐾𝐶 (1 + 𝜏 𝑠) 𝐾𝑃 𝐾𝐶 (1 + 𝜏𝐼 𝑠)
𝐼
= = ∗ =
𝑟(𝑠) 1 + 𝐺𝑃 (𝑠)𝐺𝐶 (𝑠) 𝜏𝑠 + 1 1 + 𝐾 (1 + 1 𝐾𝑃 𝜏𝜏𝐼 𝑠 + 𝜏𝐼 (1 + 𝐾𝑃 𝐾𝐶 )𝑠 + 𝐾𝑃 𝐾𝐶
𝐶 𝜏𝐼 𝑠) ∗ 𝜏𝑠 + 1

From Direct Synthesis Method:


For 𝛼 = 2.25 and 𝜁𝐶1 = 0.81,
2𝛼𝜁𝐶1 −1 2∗2.25∗0.81−1
𝐾𝐶1 = = = 0.62885
𝐾𝑃 4.2061075
2𝛼𝜁 −1
𝜏𝐼𝐶1 = 𝜏𝑃 ∗ 𝐶12 = 123.10261 𝑠𝑒𝑐−1
𝛼
For 𝛼 = 2.25 and 𝜁𝐶1 = 1.22,
2𝛼𝜁 −1 2∗2.25∗1.22−1
𝐾𝐶2 = 𝐶2 = = 1.0675
𝐾𝑃 4.2061075
2𝛼𝜁𝐶2 − 1
𝜏𝐼𝐶2 = 𝜏𝑃 ∗ 2
= 208.9719 𝑠𝑒𝑐−1
𝛼

Predicting Closed Loop Behavior:


𝐺𝑑 (𝑠) 1 𝐾𝑑 (1+𝜏𝑃 𝑠)
̂=
a. 𝑇(𝑠) ∗ =
1+𝐺𝑃 (𝑠)𝐺𝐶 (𝑠) 𝑠 𝑠(𝜏𝑑 𝑠+1)(1+𝜏𝑃 𝑠+𝐾𝑃 𝐾𝐶 )
(Flow Rate is Disturbance Variable)

Here, 𝐾𝑑 = −5.1577595, 𝜏𝑑 = 91.886304, 𝜏𝑃 = 235.616998, 𝐾𝑃 =4.206107, 𝐾𝐶 =


0.41606

𝑇(𝑡) = 1.87557𝑒 −0.01127𝑡 cosh(0.00039𝑡) − 88.9𝑒 −0.01127 sinh(0.00039𝑡)

1+𝜏𝐼 𝑠
̂=
b. 𝑇(𝑠) 𝜏𝑃 𝜏𝐼 2 (1+𝐾 𝐾𝐶 )
𝐾𝑃 𝐾𝐶
𝑠 +𝜏𝐼 𝐾 𝑃 𝑠+1
𝑃 𝐾𝐶
Here, 𝜏𝐼 = 208.9719, 𝜏𝑃 = 235.616998, 𝐾𝑃 = 4.206107, 𝐾𝐶 = 1.0675

𝑇(𝑡) = 0.01906𝑒 −0.01173𝑡 cosh(0.00682𝑡) − 0.01942𝑒 −0.01173 sinh(0.00682𝑡)


Code Files:
Main File:
global delU step_out step_time
load('B6a_401_IP1_Negative.mat');
Ys = mean(OUTPUT(1:50));
dev_out = OUTPUT-Ys;
Us = INPUT(1);
dev_in = INPUT-Us;

figure(1);
plot(TIME, INPUT, TIME, OUTPUT),grid;
xlabel('Time'); ylabel('Input and Output(mA)'); title('Raw Step Input Data');
legend('Input', 'Measured Output');
figure(2);
plot(TIME, dev_in, TIME, dev_out),grid;
xlabel('Time'); ylabel('Deviation Input and Output (mA)');
title('Perturbation Data');
legend('Input', 'Measured Output');

delU = INPUT(end)-Us;
Ysf = mean(OUTPUT(end-50:end));
delY = Ysf-Ys;
K0 = (Ysf-Ys)/(INPUT(end)-INPUT(1));
yc = 0.633*(Ysf-Ys);

if(Ysf-Ys>0)
n_c = find(dev_out-yc>=0,1);
else
n_c = find(dev_out-yc<=0,1);
end
n_step = find(dev_in,1);
tau0 = TIME(n_c)-TIME(n_step);

step_out = dev_out(n_step:end);
step_time = TIME(n_step:end)-TIME(n_step);

X0 = [K0, tau0];
Xopt = fminunc('fun',X0);
Kopt = Xopt(1);
tauopt = Xopt(2);

N_op = length(step_time);
step_output_graphical = zeros(N_op, 1);
for i=1:N_op
step_output_graphical(i) = K0*delU*(1-exp(-step_time(i)/tau0));
end
STEP_OUTPUT_GR = step_output_graphical + Ys;
step_output_opt = zeros(N_op, 1);
for i=1:N_op
step_output_opt(i) = Kopt*delU*(1-exp(-step_time(i)/tauopt));
end
STEP_OUTPUT_OPT = step_output_opt + Ys;
STEP_OUTPUT_MEASURED = step_out + Ys;

fprintf('\n Steady State Gain Graphical Method: %f', K0);


fprintf('\n Time Constant Graphical Method: %f', tau0);
fprintf('\n Gain Optimal: %f', Kopt);
fprintf('\n Time Constant Optimal: %f \n\n', tauopt);

figure(3);
plot(step_time, STEP_OUTPUT_MEASURED, '-');
hold on
plot(step_time, STEP_OUTPUT_GR, '--');
plot(step_time, STEP_OUTPUT_OPT, '-.');
xlabel('Time');
ylabel('Measured and Predicted Outputs');
title('Comparison of Model Step Responses');
legend('Measured', 'Graphical', 'Optimum');
hold off

Function File:
function fofx=fun(X)
global delU step_out step_time
Kg = X(1);
taug = X(2);
N_op = length(step_time);
dev_output_hat = zeros(N_op,1);
error = zeros(N_op,1);
fofx = 0;
for i=1:N_op
dev_output_hat(i) = Kg*delU*(1-exp(-step_time(i))/taug);
error(i) = step_out(i) - dev_output_hat(i);
fofx = fofx + error(i)^2;
end
end

You might also like