0% found this document useful (0 votes)
20 views

AC LAB Exp.5

The document describes designing and simulating P, PI, and PID controllers for temperature control systems using MATLAB. It discusses designing a PI controller for a heat exchanger process to regulate tank temperature. Feedforward control is also explored to help reject disturbances from changes in inlet temperature. Combined feedforward-feedback control is shown to have identical setpoint tracking as feedback only, but better disturbance rejection.

Uploaded by

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

AC LAB Exp.5

The document describes designing and simulating P, PI, and PID controllers for temperature control systems using MATLAB. It discusses designing a PI controller for a heat exchanger process to regulate tank temperature. Feedforward control is also explored to help reject disturbances from changes in inlet temperature. Combined feedforward-feedback control is shown to have identical setpoint tracking as feedback only, but better disturbance rejection.

Uploaded by

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

Experiment:-5

Aim:- Characteristics of PID controllers using MATLAB. Design and implementation of P, PI


and PID Controllers for temperature and level control systems.

Theory:-
Temperature Control in a Heat Exchanger
This example shows how to design feedback and feedforward compensators to regulate the
temperature of a chemical reactor through a heat exchanger.
Heat Exchanger Process
A chemical reactor called “stirring tank” is depicted below. The top inlet delivers liquid to be mixed
in the tank. The tank liquid must be maintained at a constant temperature by varying the amount
of steam supplied to the heat exchanger (bottom pipe) via its control valve. Variations in the
temperature of the inlet flow are the main source of disturbances in this process.

Feedback Control
A block diagram representation of the open-loop process is shown below.
The transfer fiction
Gp(s) = (e ^ (- 14.7s))/(21.3s + 1)
models how a change in the voltage V driving the steam valve opening affects the tank temperature
T, while the transfer function
Gd(s) = (e ^ (- 35s))/(25s + 1)
models how a change in inflow temperature affects T. To regulate the tank temperature T around.A
given setpoint Tsp, we can use the following feedback architecture to control the valve opening
(voltage V):

Figure: Feedback Control


In this configuration, the proportional-integral (PI) controller
C(s) = K_{c}(1 + 1/(tau_{c}*s))
Calculate the voltage V based on the gap Tap-T between the desired and measured temperatures
You can use the ITAE formulas to pick adequate values for the controller parameters
K_{c} = 0.859 * (theta / tau) ^ - 0.977
tau_{c} = (theta / tau) ^ 0.68 * tau / 0.674

MATLAB Programming:-
clc
clear all
s=tf('s');
Gp=exp(-14.7*s)/(21.3*s+1);
tau=21.3000;
theta=14.7000;
Kc=0.859*(theta/tau)^(-0.977);
tauc=(tau/0.647)*(theta/tau)^0.680;
C=Kc*(1+1/(tauc*s));
Tfb=feedback(ss(Gp*C),1);
step(Tfb),grid on
title('Response to step change in temprature setpoint T_(sp)')
ylabel('Tank temprature')
margin(Gp*C), grid

OUTPUT:-
Reducing the proportional gain Ke strengthens stability at the expense of
performance.
MATLAB Programming:-
clc
clear all
s=tf('s');
Gp=exp(-14.7*s)/(21.3*s+1);
tau=21.3000;
theta=14.7000;
Kc=0.859*(theta/tau)^(-0.977);
tauc=(tau/0.647)*(theta/tau)^0.680;
C=Kc*(1+1/(tauc*s));
Tfb=feedback(ss(Gp*C),1);
step(Tfb),grid on
title('Response to step change in temprature setpoint T_(sp)')
ylabel('Tank temprature')
margin(Gp*C),grid
C1 = 0.9 * (1 + 1/(tauc*s)); % reduce Kc from 1.23 to 0.9
margin(Gp*C1), grid
step(Tfb,'b', feedback(ss(Gp*C1),1),'r')
legend('Kc = 1.23','Kc = 0.9')

OUTPUT:-
Feedforward Control
Recall that changes in inflow temperature are the main source of temperature fluctuations in the
tank. To reject such disturbances, an alternative to feedback control is the feedforward architecture
shown below:
In this configuration, the feedforward controller F uses measurements of the inflow temperature to
adjust the steam valve opening (voltage V). Feedforward control thus anticipates and preempts the
effect of inflow temperature changes.
Straightforward calculation shows that the overall transfer from temperature disturbance d to tank
temperature T is

Perfect disturbance rejection requires

In reality, modeling inaccuracies prevent exact disturbance rejection, but feedforward control will
help minimize temperature fluctuations due to inflow disturbances. To get a better sense of how
the feedforward scheme would perform, increase the ideal feedforward delay by 5 seconds and
simulate the response to a step change in inflow temperature.
MATLAB Programming:-
clc
clear all
s=tf('s');
Gp=exp(-14.7*s)/(21.3*s+1);
tau=21.3000;
theta=14.7000;
Kc=0.859*(theta/tau)^(-0.977);
tauc=(tau/0.647)*(theta/tau)^0.680;
C=Kc*(1+1/(tauc*s));
Tfb=feedback(ss(Gp*C),1);
step(Tfb),grid on
title('Response to step change in temprature setpoint T_(sp)')
ylabel('Tank temprature')
margin(Gp*C),grid
C1 = 0.9 * (1 + 1/(tauc*s)); % reduce Kc from 1.23 to 0.9
margin(Gp*C1), grid
step(Tfb,'b', feedback(ss(Gp*C1),1),'r')
legend('Kc = 1.23','Kc = 0.9')
Gd = exp(-35*s)/(25*s+1);
F = -(21.3*s+1)/(25*s+1) * exp(-25*s);
Tff = Gp * ss(F) + Gd; % d->T transfer with feedforward control
Step(Tff), grid
title(‘Effect of a step disturbance in inflow temperature’)
ylabel(‘Tank temperature’)

OUTPUT:-

Combined Feedforward-Feedback Control


Control is good for setpoint tracking in general, while feedforward control can help with rejection
of measured disturbances.
Use connect to build the corresponding closed-loop model from Tsp.d to T. First name the input
and output channels of each block, then let connect automatically wire the diagram:

MATLAB Programming:-
clc
clear all
s=tf('s');
Gp=exp(-14.7*s)/(21.3*s+1);
tau=21.3000;
theta=14.7000;
Kc=0.859*(theta/tau)^(-0.977);
tauc=(tau/0.647)*(theta/tau)^0.680;
C=Kc*(1+1/(tauc*s));
Tfb=feedback(ss(Gp*C),1);
step(Tfb),grid on
title('Response to step change in temprature setpoint T_(sp)')
ylabel('Tank temprature')
margin(Gp*C),grid
C1 = 0.9 * (1 + 1/(tauc*s)); % reduce Kc from 1.23 to 0.9
margin(Gp*C1), grid
step(Tfb,'b', feedback(ss(Gp*C1),1),'r')
legend('Kc = 1.23','Kc = 0.9')
Gd = exp(-35*s)/(25*s+1);
F = -(21.3*s+1)/(25*s+1) * exp(-25*s);
Tff = Gp * ss(F) + Gd; % d->T transfer with feedforward control
Step(Tff), grid
title(‘Effect of a step disturbance in inflow temperature’)
ylabel(‘Tank temperature’)
Gd.u = 'd'; Gd.y = 'Td';
Gp.u = 'V'; Gp.y = 'Tp';
F.u = 'd'; F.y = 'Vf';
C.u = 'e'; C.y = 'Vc';
Sum1 = sumblk('e = Tsp - T');
Sum2 = sumblk('V = Vf + Vc');
Sum3 = sumblk('T = Tp + Td');
Tffb = connect(Gp,Gd,C,F,Sum1,Sum2,Sum3,{'Tsp','d'},'T');
C.u = 'e'; C.y = 'V';
Tfb = connect(Gp,Gd,C,Sum1,Sum3,{'Tsp','d'},'T');
step(Tfb,'b',Tffb,'r--'), grid
title('Closed-loop response to setpoint and disturbance step change')
ylabel('Tank temperature')
legend('Feedback only','Feedforward + feedback')
OUTPUT:-

The two designs have identical performance for setpoint tracking, but the addition of feedforward
control is clearly beneficial for disturbance rejection.

Result: We have designed the PI controller for temperature control systems.

You might also like