automatic tuning of PID controller based on a desired closed-loop time constant - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim Toolboxes : MapleSim Control Design Toolbox : ControlDesign Package : PID Tuning : ControlDesign/PIDAuto

ControlDesign[PIDAuto] - automatic tuning of PID controller based on a desired closed-loop time constant

Calling Sequence

PIDAuto(sys, Tc, opts)

Parameters

sys

-

System; system object

Tc

-

And(positive, numeric); desired closed-loop time constant (seconds)

opts

-

(optional) equation(s) of the form option = value; specify options for the PIDAuto command

Description

• 

The PIDAuto command automatically calculates the controller gains of a PID controller with filtered derivative, based on the desired closed-loop time constant, Tc (seconds).  

• 

The system sys is a continuous-time linear system object created using the DynamicSystems package. The system object must be in transfer function (TF) form. The system must be single-input single-output (SISO). The system must be proper and must have a nonzero static gain.

• 

The parameter Tc is a tuning parameter that generally has the same order of magnitude as the time constant of the closed-loop. Tune this parameter to adjust the time constant of the closed-loop precisely.

• 

The PIDAuto command returns a record containing the controller parameters Kp, Ki, Kd and Tf, where Kp is the proportional gain, Ki is the integral gain, Kd is the derivative gain and Tf is the time constant of the derivative filter. The controller transfer function is then obtained as:

  

Cs=Kp+Kis+KdsTfs+1.

• 

If the computed value of Tf is equal to zero, the resulting PID controller transfer function is improper. A recommended value to make the transfer function proper is Tf=1100Kd. This value is used when the proper option is set to true and the computed value of Tf is equal to zero. The controller transfer function is then obtained as:

  

Cs=Kp+Kis+Kds1+1100Kds.

  

If the resulting closed-loop is unstable, use RouthTable in order to calculate a value of Tf that keeps the closed-loop stable.

• 

If the order of sys is greater than two and sys is unstable or has complex poles, the gains are calculated using an optimization algorithm that may not be able to find a solution if Tc is too small. The error message is then could not compute a stabilizing PID. In this case, try increasing Tc until a solution can be found.

Examples

withDynamicSystems:

withControlDesign:

infolevelControlDesign3:

Differential equations of a DC motor model:

eq1Jⅆⅆtωt+bωtKit=0:

eq2Lⅆⅆtit+Rit=VtKωt:

eq3ⅆⅆtθt=ωt:

The numeric values of the model parameters are as follows:

paramsJ=0.01,K=0.01,L=0.5,R=1,b=0.1:

Transfer function

systfTransferFunctioneq1,eq2,eq3,Vt,it,ωt,θt:

PrintSystemsystf

Transfer Functioncontinuous3 output(s); 1 input(s)inputvariable=Vsoutputvariable=is,ωs,θstf1,1=Js+bJLs2+JR+Lbs+K2+Rbtf2,1=KJLs2+JR+Lbs+K2+Rbtf3,1=KJLs3+JR+Lbs2+K2+Rbs

(1)

Extract a subsystem with the desired output (position θ):

subsystfSubsystemsystf,'all',3:

PrintSystemsubsystf

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=Vsoutputvariable=θstf1,1=KJLs3+JR+Lbs2+K2+Rbs

(2)

Design a position controller with a settling time of 4 seconds (time constant is 0.7 seconds approximately):

τ0.7

τ:=0.7

(3)

pidPIDAutosubsystf,τ,'parameters'=params

PIDAuto:   Using PIDOptimize

pid:=RecordpackedKp=10.2115133154945,Ki=0.000879895477927287,Kd=1.01771326328058,Tf=0

(4)

Get a proper transfer function for the PID controller

pidtfPIDAutosubsystf,τ,'parameters'=params,'returntype'=system,'proper'=true:

PIDAuto:   Using PIDOptimize
PIDAuto:   Computed 'Tf = 0' (improper PID transfer function); setting 'Tf = Kd/100' to make it proper

PrintSystempidtf

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=u1soutputvariable=y1stf1,1=1.121637189s2+10.21152227s+0.00087989547790.01017713263s2+s

(5)

Calculate the closed-loop system and plot a step response:

clsysPIDClosedLoopsubsystf,pidtf,'parameters'=params:

PrintSystemclsys

Transfer Functioncontinuous1 output(s); 1 input(s)inputvariable=theta_refsoutputvariable=θstf1,1=0.01121637189s2+0.1021152227s+8.79895477910−60.00005088566315s5+0.005610627958s4+0.06101873098s3+0.1113163719s2+0.1021152227s+8.79895477910−6

(6)

ResponsePlotclsys,Step,'output'=θ,'duration'=10,'gridlines'=true,'parameters'=params

See Also

ControlDesign, ControlDesign[CohenCoon], ControlDesign[DominantPole], ControlDesign[GainPhaseMargin], ControlDesign[ZNFreq], ControlDesign[ZNTimeModified]

References

  

[1] Philippe de Larminat, Automatique appliquee, Hermes, 2007.

  

[2] Sigurd Skogestad, Simple analytic rules for model reduction and PID controller design, Journal of Process Control, Vol. 13, 291-309, 2003.

  

[3] J. M. Maciejowski, Multivariable Feedback Design, Pearson Education, 1989.

  

[4] J. M. Edmunds, Control system design and analysis using closed-loop Nyquist and Bode arrays, International Journal of Control, 30: 5, 773-802, 1979.


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam