main content

tune 2-凯发k8网页登录

this example shows how to design a two-degree-of-freedom (2-dof) pid controller at the command line. the example also compares the 2-dof controller performance to the performance achieved with a 1-dof pid controller.

2-dof pid controllers include setpoint weighting on the proportional and derivative terms. compared to a 1-dof pid controller, a 2-dof pid controller can achieve better disturbance rejection without significant increase of overshoot in setpoint tracking. a typical control architecture using a 2-dof pid controller is shown in the following diagram.

for this example, design a 2-dof controller for the plant given by:

$$g\left(s\right) = {1 \over {{s^2}   0.5s   0.1}}.$$

suppose that your target bandwidth for the system is 1.5 rad/s.

wc = 1.5;
g = tf(1,[1 0.5 0.1]);
c2 = pidtune(g,'pid2',wc)
c2 =
 
                       1              
  u = kp (b*r-y)   ki --- (r-y)   kd*s (c*r-y)
                       s              
  with kp = 1.26, ki = 0.255, kd = 1.38, b = 0.665, c = 0
 
continuous-time 2-dof pid controller in parallel form.

using the type 'pid2' causes pidtune to generate a 2-dof controller, represented as a pid2 object. the display confirms this result. pidtune tunes all controller coefficients, including the setpoint weights b and c, to balance performance and robustness.

to compute the closed-loop response, note that a 2-dof pid controller is a 2-input, 1-output dynamic system. you can resolve the controller into two channels, one for the reference signal and one for the feedback signal, as shown in the diagram. (see for more information.)

decompose the controller into the components cr and cy, and use them to compute the closed-loop response from r to y.

c2tf = tf(c2);
cr = c2tf(1);
cy = c2tf(2);
t2 = cr*feedback(g,cy, 1);

to examine the disturbance-rejection performance, compute the transfer function from d to y.

s2 = feedback(g,cy, 1);

for comparison, design a 1-dof pid controller with the same bandwidth and compute the corresponding transfer functions. then compare the step responses.

c1 = pidtune(g,'pid',wc);
t1 = feedback(g*c1,1);
s1 = feedback(g,c1);
subplot(2,1,1)
stepplot(t1,t2)
title('reference tracking')
subplot(2,1,2)
stepplot(s1,s2)
title('disturbance rejection')
legend('1-dof','2-dof')

the plots show that adding the second degree of freedom eliminates the overshoot in the reference-tracking response without any cost to disturbance rejection. you can improve disturbance rejection too using the designfocus option. this option causes pidtune to favor disturbance rejection over setpoint tracking.

opt = pidtuneoptions('designfocus','disturbance-rejection');
c2dr = pidtune(g,'pid2',wc,opt)
c2dr =
 
                       1              
  u = kp (b*r-y)   ki --- (r-y)   kd*s (c*r-y)
                       s              
  with kp = 1.72, ki = 0.593, kd = 1.25, b = 0, c = 0
 
continuous-time 2-dof pid controller in parallel form.

with the default balanced design focus, pidtune selects a b value between 0 and 1. for this plant, when you change design focus to favor disturbance rejection, pidtune sets b = 0 and c = 0. thus, pidtune automatically generates an i-pd controller to optimize for disturbance rejection. (explicitly specifying an i-pd controller without setting the design focus yields a similar controller.)

compare the closed-loop responses using all three controllers.

c2dr_tf = tf(c2dr);
cdr_r = c2dr_tf(1);
cdr_y = c2dr_tf(2);
t2dr = cdr_r*feedback(g,cdr_y, 1);
s2dr = feedback(g,cdr_y, 1);
subplot(2,1,1)
stepplot(t1,t2,t2dr)
title('reference tracking')
subplot(2,1,2)
stepplot(s1,s2,s2dr);
title('disturbance rejection')
legend('1-dof','2-dof','2-dof rejection focus')

the plots show that the disturbance rejection is further improved compared to the balanced 2-dof controller. this improvement comes with some sacrifice of reference-tracking performance, which is slightly slower. however, the reference-tracking response still has no overshoot.

thus, using 2-dof control can improve disturbance rejection without sacrificing as much reference tracking performance as 1-dof control. these effects on system performance depend strongly on the properties of your plant. for some plants and some control bandwidths, using 2-dof control or changing the design focus has less or no impact on the tuned result.

see also

|

related topics

网站地图