|
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
|
|
|
|
|
Options
|
|
•
|
factored = true or false
|
|
True means return the factored version of the controller gains (, , and ). False means return the controller gains (, , and ). The default is false.
|
•
|
returntype = record or system
|
|
Specifies the returned type. If a record is specified, a record containing the PID controller parameters is returned. If system is specified, a System (DynamicSystems system object) containing the transfer function of the PID controller is returned. The default value is record.
|
|
True means return a System (DynamicSystems system object) containing the PID controller transfer function. False means return a record containing the controller gains. The default value is false.
|
|
True means return PID controller gains to make its transfer function proper in case ( is set to a recommended value of . The default is false.
|
•
|
parameters = {list, set}(name = complexcons)
|
|
Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).
|
|
|
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 , , and , where is the proportional gain, is the integral gain, is the derivative gain and is the time constant of the derivative filter. The controller transfer function is then obtained as:
|
•
|
If the computed value of is equal to zero, the resulting PID controller transfer function is improper. A recommended value to make the transfer function proper is . This value is used when the proper option is set to true and the computed value of is equal to zero. The controller transfer function is then obtained as:
|
|
.
|
|
If the resulting closed-loop is unstable, use RouthTable in order to calculate a value of 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
|
|
>
|
|
>
|
|
>
|
|
Differential equations of a DC motor model:
>
|
|
>
|
|
>
|
|
The numeric values of the model parameters are as follows:
>
|
|
Transfer function
>
|
|
| (1) |
Extract a subsystem with the desired output (position ):
>
|
|
| (2) |
Design a position controller with a settling time of 4 seconds (time constant is 0.7 seconds approximately):
>
|
|
PIDAuto: Using PIDOptimize
| |
| (4) |
Get a proper transfer function for the PID controller
>
|
|
PIDAuto: Using PIDOptimize
PIDAuto: Computed 'Tf = 0' (improper PID transfer function); setting 'Tf = Kd/100' to make it proper
| |
| (5) |
Calculate the closed-loop system and plot a step response:
>
|
|
| (6) |
>
|
|
|
|
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.
|
|
|
|