How to get PD parameters
29 views (last 30 days)
Show older comments
Hi
I've a question regarding PD controller in order to enhance a liquid level control system in a tank. It is required to ensure the steady state error in the liquid level in the tank when it undergoes a step change is always less than ±0.5% (0.005). The settling time and overshoot of the system response should also be less than 1.5 seconds and 5% respectively.
what would be the appropriate parameters of PD. I tried a lot to find by changing the parameters of PD but unfortunately no improvement.
below is the code:
s = tf('s');
The Transfer functions of the components
Gp = 2 / (0.2 * s + 1); %pump
Gv = (2.2 * 10^-3) * 2; %valve
Gt = 24.2 / (3.3 * s + 1); %tank
Gl = 1; % level sensor
The Open loop transfer function
oltf = Gp * Gv * Gt * Gl;
%PD controller parameters
kP = 6; % Start with an initial guess for kP
TD = 0.2; % Start with an initial guess for TD
% PD controller transfer function
PD = kP * (1 + TD * s);
% Closed loop transfer function with PD
CLTF_PD = (PD * oltf) / (1 + PD * oltf);
0 Comments
Answers (1)
Paul
on 7 Dec 2024 at 20:32
Hi Hasan,
Let's take a look at the code.
s = tf('s');
Gp = 2 / (0.2 * s + 1); %pump
Gv = (2.2 * 10^-3) * 2; %valve
Gt = 24.2 / (3.3 * s + 1); %tank
Gl = 1; % level sensor
oltf = Gp * Gv * Gt * Gl;
%PD controller parameters
kP = 6; % Start with an initial guess for kP
TD = 0.2; % Start with an initial guess for TD
% PD controller transfer function
PD = kP * (1 + TD * s);
Assuming that the goal is to control the true level and that the level sensor is in the feedback path, the closed-loop transfer function is:
H(s) = PD(s)*Gp(s)*Gv(s)*Gt(s)/( 1 + PD(s)*Gp(s)*Gv(s)*Gt(s)*Gl(s) )
So this line should really be:
% Closed loop transfer function with PD
CLTF_PD = (PD * Gp * Gv * Gt) / (1 + PD * Gp * Gv * Gt * Gl);
Of course, with Gl(s) = 1 it doesn't really matter, but maybe you're going to change Gl(s) later. Also, transfer function algebra in Matlab is discouraged. Instead, better to get in the habit of using interconnection commands, such as feedback
CLTF_PD = feedback(PD * Gp * Gv * Gt, Gl);
Step response
figure
stepplot(CLTF_PD)
We see that the steady state error is quite a bit larger (~0.45) than the requirement (0.005), so let's start with that.
What is the expression for the final value of the output , in terms of H(s), in response to a step input ? Or alternatively, what is the expression for the final value of the error, e(t) = r(t) - y(t), in terms of H(s), when r(t) is a step input ?
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!