Main Content

Two-Degree-of-Freedom PID Controllers

Two-degree-of-freedom (2-DOF) PID controllers include setpoint weighting on the proportional and derivative terms. A 2-DOF PID controller is capable of fast disturbance rejection without significant increase of overshoot in setpoint tracking. 2-DOF PID controllers are also useful to mitigate the influence of changes in the reference signal on the control signal.

You can represent PID controllers using the specialized model objectspid2andpidstd2. This topic describes the representation of 2-DOF PID controllers in MATLAB®. For information about automatic PID controller tuning, seePID Controller Tuning.

Continuous-Time 2-DOF PID Controller Representations

This illustration shows a typical control architecture using a 2-DOF PID controller.

The relationship between the 2-DOF controller’s output (u) and its two inputs (randy) can be represented in either parallel or standard form. The two forms differ in the parameters used to express the proportional, integral, and derivative actions of the controller, as expressed in the following table.

Form Formula
Parallel (pid2object)

u = K p ( b r y ) + K i s ( r y ) + K d s T f s + 1 ( c r y ) .

In this representation:

  • Kp= proportional gain

  • Ki= integrator gain

  • Kd= derivative gain

  • Tf= derivative filter time

  • b= setpoint weight on proportional term

  • c= setpoint weight on derivative term

Standard (pidstd2object)

u = K p [ ( b r y ) + 1 T i s ( r y ) + T d s T d N s + 1 ( c r y ) ] .

In this representation:

  • Kp= proportional gain

  • Ti= integrator time

  • Td= derivative time

  • N= derivative filter divisor

  • b= setpoint weight on proportional term

  • c= setpoint weight on derivative term

Use a controller form that is convenient for your application. For instance, if you want to express the integrator and derivative actions in terms of time constants, use standard form. For examples showing how to create parallel-form and standard-form controllers, see thepid2andpidstd2reference pages, respectively.

For information on representing PID Controllers in discrete time, seeDiscrete-Time Proportional-Integral-Derivative (PID) Controllers.

2-DOF Control Architectures

The 2-DOF PID controller is a two-input, one output controller of the formC2(s), as shown in the following figure. The transfer function from each input to the output is itself a PID controller.

Each of the componentsCr(s) andCy(s) is a PID controller, with different weights on the proportional and derivative terms. For example, in continuous time, these components are given by:

C r ( s ) = b K p + K i s + c K d s T f s + 1 , C y ( s ) = [ K p + K i s + K d s T f s + 1 ] .

You can access these components by converting the PID controller into a two-input, one-output transfer function. For example, suppose thatC2is a 2-DOF PID controller, stored as apid2object.

C2tf = tf(C2); Cr = C2tf(1); Cy = C2tf(2);

Cr(s) is the transfer function from the first input ofC2to the output. Similarly,Cy(s) is the transfer function from the second input ofC2to the output.

Suppose thatGis a dynamic system model, such as azpkmodel, representing the plant. Build the closed-loop transfer function fromrtoy. Note that theCy(s) loop has positive feedback, by the definition ofCy(s).

T = Cr*feedback(G,Cy,+1)

Alternatively, use theconnectcommand to build an equivalent closed-loop system directly with the 2-DOF controllerC2. To do so, set theInputNameandOutputNameproperties ofGandC2.

G.InputName ='u'; G.OutputName ='y'; C2.Inputname = {'r','y'}; C2.OutputName ='u'; T = connect(G,C2,'r','y');

There are other configurations in which you can decompose a 2-DOF PID controller into SISO components. For particular choices ofC(s) andX(s), each of the following configurations is equivalent to the 2-DOF architecture withC2(s). You can obtainC(s) andX(s) for each of these configurations using thegetComponentscommand.

Feedforward

In the feedforward configuration, the 2-DOF PID controller is decomposed into a conventional SISO PID controller that takes the error signal as its input, and a feedforward controller.

For a continuous-time, parallel-form 2-DOF PID controller, the components are given by:

C ( s ) = K p + K i s + K d s T f s + 1 , X ( s ) = ( b 1 ) K p + ( c 1 ) K d s T f s + 1 .

Access these components usinggetComponents.

[C,X] = getComponents(C2,'feedforward');

The following command constructs the closed-loop system fromrtoyfor the feedforward configuration.

T = G*(C+X)*feedback(1,G*C);

Feedback

In the feedback configuration, the 2-DOF PID controller is decomposed into a conventional SISO PID controller and a feedback controller.

For a continuous-time, parallel-form 2-DOF PID controller, the components are given by:

C ( s ) = b K p + K i s + c K d s T f s + 1 , X ( s ) = ( 1 b ) K p + ( 1 c ) K d s T f s + 1 .

Access these components usinggetComponents.

[C,X] = getComponents(C2,'feedback');

The following command constructs the closed-loop system fromrtoyfor the feedback configuration.

T = G*C*feedback(1,G*(C+X));

Filter

In the filter configuration, the 2-DOF PID controller is decomposed into a conventional SISO PID controller and a prefilter on the reference signal.

For a continuous-time, parallel-form 2-DOF PID controller, the components are given by:

C ( s ) = K p + K i s + K d s T f s + 1 , X ( s ) = ( b K p T f + c K d ) s 2 + ( b K p + K i T f ) s + K i ( K p T f + K d ) s 2 + ( K p + K i T f ) s + K i .

The filterX(s) can also be expressed as the ratio: –[Cr(s)/Cy(s)].

The following command constructs the closed-loop system fromrtoyfor the filter configuration.

T = X*feedback(G*C,1);

For an example illustrating the decomposition of a 2-DOF PID controller into these configurations, see一个二自由度PID控制器分解成输出成分nts.

The formulas shown above pertain to continuous-time, parallel-form controllers. Standard-form controllers and controllers in discrete time can be decomposed into analogous configurations. ThegetComponentscommand works on all 2-DOF PID controller objects.

See Also

||||

Related Examples

More About