In this control engineering tutorial, we explain the zero placement approach for designing two degrees of freedom Proportional Integral Derivative (PID) controllers.
Two degrees of freedom PID controllers give us more freedom and possibilities when designing PID controllers. They can be used to improve the tracking performance while at the same time ensuring good disturbance rejection performance. The zero placement approach is an elegant method for tuning the two degrees of freedom PID controllers. We explain this approach by using the control structure given below.
We have two controllers and , and a plant . Here, is the Laplace complex variable, and capital letters denote that signals and models are expressed in the Laplace domain. is the reference signal we want to track, and is the output.
Roughly speaking, since we have two controllers, we have two degrees of freedom when designing controllers. The classical PID control loop is obtained by erasing the controller . The classical PID control loop has only a single degree of freedom since we only have a single controller. It should be noted that this is one of the possible control structures of two degrees of freedom PID controllers. Other structures will be discussed in our future tutorials.
Here is the problem we want to address:
Control Design Problem: For the plant model given by
(1)
Design the controllers and such that
a) The overshoot of tracking step reference signal is below 25 percent.
b) The steady-state error of tracking step, ramp, and quadratic (acceleration) reference signals is zero.
c) The settling time of the system is smaller than seconds
d) The designed controllers are able to completely reject the step disturbance signals .
Solution by using the zero-placement approach:
STEP 1: Derive the output-disturbance and output-reference transfer signals. From the block diagram in Fig. 1., we have
(2)
Let us define as follows
(3)
By using the last definition, we can define the following transfer functions
(4)
Consequently, we can write (2) as follows
(5)
Here, it is important to emphasize that our goal is to select the controllers and . We defined the new controller that is a sum of and . This is an intermediate controller that is used to derive the controllers and .
STEP 2: Select the intermediate controller structure such that the step disturbance is rejected. Let us select the intermediate controller as follows
(6)
where , , and are the controller parameters that need to be selected. By multiplying the controller coefficients, we can see that this is actually a PID controller:
(7)
Let us for a moment assume that is zero, and let us substitute this controller in (5):
(8)
Let us assume that the coefficients , , and are selected such that the system is stable. Then, by assuming that the disturbance signal is a step signal in the time domain (or in the Laplace domain), and by applying the finite value theorem:
(9)
where we assumed that all the zeros of are in the left half of the complex plane (stable system).
Consequently, an integrator component (1/s) in the controller will ensure that the step disturbance can be rejected successfully. This is because the term from the denominator is transferred to the numerator. In the next step, we will select the parameters of the PID controller.
STEP 3: Use the zero placement approach to design the output-reference signal transfer function and the controller .
First, it is important to observe that the terms in the denominator of the output-disturbance transfer function and output-reference signal transfer function are identical. This means that the characteristic polynomials of these two transfer functions are identical. That is, they will share the same poles.
On the other hand, notice that in the numerator of the transfer function we have . That is, by wisely selecting the structure and parameters of this controller we can ensure that the zeros of are designed such that the steady-state errors of tracking ramp and quadratic reference time signals are zero. The zero placement approach can be used to design such zeros.
To explain the main idea od the zero placement approach, let us consider the following transfer function
(10)
Let us assume that this system is stable. Our goal is to design the polynomial in the numerator such that the steady-state errors of tracking step, ramp, and quadratic functions are zero. Let us compute the steady-state error
(11)
Let us select the polynomial to be equal to the last three entries of the polynomial in the denominator:
(12)
Then, the error becomes
(13)
Now, let us show that this approach will produce zero tracking errors for step, ramp, and quadratic reference signals in the time domain.
- Step input: and
(14)
- Ramp input and
(15)
- Quadratic input (acceleration input) and
(16)
Let us now apply this approach to our problem. We will combine the zero placement approach with the pole placement approach. That is, we will parameterize the transfer function.
The denominator of the transfer function is equal to the denominator of the transfer function that is derived in (8) and that is equal to
(17)
We can observe that the polynomial in the denominator of is of a 3rd order. Our goal is to design the parameters , , and , such that the desired transient response specifications are met. We will use the pole placement method to find these parameters. Since the denominator polynomial is of the 3rd order, this means that we need to select three poles. Let these poles be parametrized by
(18)
where , , and are positive numbers that parameterize the location of poles.
The desired characteristic polynomial has the following form
(19)
This polynomial can be expressed as follows
(20)
From the structure of the last polynomial, we conclude that the transfer function can be parametrized as follows
(21)
where we used the zero placement method in order to ensure that the last three terms of the numerator are equal to the last three terms of the denominator.
We will use a simple grid search in MATLAB to search for the parameters , , and that meet the transient response specifications. To perform the grid search, we need to determine the regions of these parameters.
To find these regions, we need to recall the formulas that relate the maximal overshoot and sampling time with the damping ratio and natural undamped frequency. These formulas are
(22)
(23)
where is the maximum overshoot, is the settling time, is the damping ratio, and is the natural undamped frequency. Here, it should be kept in mind that these formulas are derived under the assumption that the transfer function is a second-order prototype function. Despite the fact that we have a third order transfer function, these formulas can still be useful by ensuring that the third real pole parametrized by is further away to the left in the complex plane from the two complex poles. When connecting the parameters and with the poles, the graph presented below is useful
From (22), we have
(24)
On the other hand, from (23), we have
(25)
The specification is that the overshoot is less than 25 percent. This corresponds to
(26)
However, we need to specify a lower bound on the overshoot in order to avoid slow transient responses. We choose a minimum value of overshoot of percent. Consequently, we have
(27)
Substituting these values in (24), we obtain the following values of
(28)
That is, the damping ratio that ensures the desired overshoot, should be in the interval
(29)
Consequently, by taking into account that , these two values correspond to the following angle
(30)
On the other hand, for the computed bounds on (bounds and ), and from the requirement on the settling time (below 1.2 second), and by using the formula (25), we obtain the following bounds on :
(31)
The equations (30) and (31) define a disc segment in the complex plane. By using this formula
(32)
we can compute the coordinates of the segment edge points. The segment is shown in the figure below
The coordinates are
(33)
The MATLAB code for computing the bounds on and , and for computing the coordinates is given below
clear
ub=0.25
lb=0.04
s1=log(ub)
s2=log(lb)
zeta1=sqrt((s1^2)/(pi^2+s1^2))
zeta2=sqrt((s2^2)/(pi^2+s2^2))
theta_upper=acosd(zeta1)
theta_lower=acosd(zeta2)
ts=1.2
wupper=3.2/(zeta1*ts)
wlower=3.2/(zeta2*ts)
% wn2<=omega<=wn1
% zeta1<=zeta<=zeta2
pointA1x=wlower*cosd(theta_lower)
pointA1y=wlower*sind(theta_lower)
pointA2x=wlower*cosd(theta_upper)
pointA2y=wlower*sind(theta_upper)
pointA3x=wupper*cosd(theta_upper)
pointA3y=wupper*sind(theta_upper)
pointA4x=wupper*cosd(theta_lower)
pointA4y=wupper*sind(theta_lower)
This segment can help us to select the search region for the parameters and . For computational purposes, we select rectangular search regions. These search regions should contain the segment. We should keep in mind that we parametrized the controller such that , , and are positive. We select the following search region for :
(34)
We select the following search region for
(35)
The search region for the is
(36)
We selected the search region for gamma such that the pole corresponding to is further left in the complex plane compared to the poles parametrized by and .
Next, our goal is to perform a grid search in order to determine the optimal values of the parameters , , and that will guarantee that the transient response of the parametrized transfer function (21) meets the design specifications. We vary the parameters , , and , and for every selection of these parameters we compute a transient response. If the transient response meets the specifications, we memorize the parameters , , and . In this way, we obtain a set of parameters that produce the desired response. The MATLAB code is given below.
clear,clc
% bounds
alpha_lower=1.4;
alpha_upper=5;
beta_lower=2.5;
beta_upper=6.2;
gamma_lower=6.2;
gamma_upper=12;
alpha=alpha_lower:0.1:alpha_upper;
beta=beta_lower:0.1:beta_upper;
gamma=gamma_lower:0.1:gamma_upper;
% bounds on the overshoot
overShootUpper=0.25;
overShootLower=0.04;
% simulation time
timeInput=0:0.01:10;
% coefficients
coefficientSelection=[];
for index_a=1:numel(alpha)
% here track the progress
(index_a/numel(alpha))*100
for index_b=1:numel(beta)
for index_c=1:numel(gamma)
num=[(2*alpha(index_a)+gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2+2*alpha(index_a)*gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2)*gamma(index_c)];
den=[1,(2*alpha(index_a)+gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2+2*alpha(index_a)*gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2)*gamma(index_c)];
W=tf(num,den);
[output,timeReturned]=step(W,timeInput);
maxOutput=max(output);
overShoot=maxOutput-1;
errorStep=output-ones(size(output));
if (overShoot<overShootUpper) & (overShoot>overShootLower)
i=length(errorStep);
while (abs(errorStep(i))<0.02)
i=i-1;
end
if (timeInput(i)<1)
coefficientSelection=[coefficientSelection;
index_a,index_b,index_c,alpha(index_a),beta(index_b),gamma(index_c),timeInput(i),overShoot];
end
end
end
end
end
% Select one model
index_a=37; index_b=21; index_c=50;
% this corresponds to
% alpha=5, beta=4.5, gamma=11.1
num=[(2*alpha(index_a)+gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2+2*alpha(index_a)*gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2)*gamma(index_c)];
den=[1,(2*alpha(index_a)+gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2+2*alpha(index_a)*gamma(index_c)), (alpha(index_a)^2+beta(index_b)^2)*gamma(index_c)];
W=tf(num,den);
step(W)
We select the following model:
(37)
These parameters produce the step response shown below.
On the basis of the computed parameter values, we can determine the coefficients of the controller . From (17), we can see that the parametrized characteristic polynomial is
(38)
and this characteristic polynomial should match the characteristic polynomial (20), that is repeated here for clarity:
(39)
By substituting the computed values of , , and in the last equation, we obtain
(40)
By equating (38) and (40), we obtain
(41)
This is a system of 3 equations with three unknowns. From the first equation, we obtain
(42)
By substituting this computed value of in equations 2 and 3, and after some manipulation, we obtain
(43)
We actually do not need to solve this system of equations, since the controller is determined by
(44)
That is, the sum and product of and determine the controller . The controller is given by
(45)
STEP 4: Design the controllers and
We design the controller