|
Calling Sequence
|
|
GainPhaseMargin(sys, GM, PM, opts)
|
|
Parameters
|
|
sys
|
-
|
System; system object
|
GM
|
-
|
realcons; desired gain margin
|
PM
|
-
|
realcons; desired phase margin
|
opts
|
-
|
(optional) equation(s) of the form option = value; specify options for the GainPhaseMargin command
|
|
|
|
|
Options
|
|
|
Specifies the controller type. The default value is PID.
|
•
|
decibels = true or false
|
|
Specifies whether the desired gain margin is given in decibels, i.e. . The default is the value of decibels in .
|
•
|
radians = true or false
|
|
Specifies whether the desired phase margin is given in radians. The default is the value of radians in .
|
•
|
alpha = realcons and positive
|
|
Specifies the ratio between the derivative time and the integral time of the PID controller as , in the numerical solution, where and . The default value is .
|
•
|
factored = true or false
|
|
True means return the factored version of the controller gains (, , ). False means return the controller gains (, , ). The default is false.
|
•
|
returntype = list or record or system
|
|
Specifies the returned type. If list (or record) is specified, a list (or record) containing the controller parameters is returned. If system is specified, a System (DynamicSystems system object) containing the transfer function of the specified controller type (P, PI, PID) is returned. The default value is list.
|
|
|
Description
|
|
•
|
The GainPhaseMargin calculates the controller parameters to meet the specified gain and phase margins. The gain-phase margin specifications correspond to a set of nonlinear equations based on the controller structure. The algorithm first tries to find a numerical solution to the original problem. If no such solution exists, an approximate analytical solution is used.
|
•
|
The numerical solution is found by solving the set of nonlinear equations associated to the selected controller type. For the PI controller, there are four equations (two magnitude equations and two phase equations) and four unknowns (two controller parameters and two crossover frequencies for gain and phase margins) to be solved for. For the PID controller, there are four equations as in the PI case but five unknowns (three controller parameters and the two crossover frequencies). In this case, one extra equation is provided by establishing a ratio between the PID integral and derivative times as . The ratio is a design parameter whose value can be specified by the user. The default value of this parameter is as suggested in Astrom et al. (1984), Hang et al. (1991) and Ho et al. (1999).
|
•
|
If a numerical solution to the original problem does not exist for the selected controller type and the specified gain-phase margins, then the approximate analytical solutions for the PI and PID controller designs are used as described in Ho et al. (1995). Since the analytical method is based on lower order approximations of the system, the performance of the designed controller must be verified and fine tuned if necessary.
|
•
|
Note: The numerical solution is applied to both stable and unstable systems, but the approximate analytical solution is only applicable to stable systems.
|
•
|
The system sys is a continuous-time linear system object created using the DynamicSystems package. The system object must single-input single-output (SISO) and one of the following types: TransferFunction (tf), ZeroPoleGain(zpk), Coefficients(coeff), StateSpace(ss), DiffEquations (de).
|
•
|
The GainPhaseMargin command returns a list of the form [, ] for a PI controller or [, , ] for a PID controller, where is the proportional gain, is the integral gain, and is the derivative gain.
|
•
|
The controller transfer function is then obtained as:
|
|
|
Examples
|
|
>
|
|
>
|
|
Build a transfer function for a SISO system sys1
>
|
|
>
|
|
| (1) |
| (2) |
Design a PI controller (desired gain margin equal to 25 decibels and desired phase margin equal to 60 degrees)
>
|
|
| (3) |
PI controller transfer function
>
|
|
| (4) |
>
|
|
>
|
|
| (5) |
>
|
|
| (6) |
Design a PID controller with the same gain-phase margin specifications
>
|
|
| (7) |
PID controller transfer function
>
|
|
| (8) |
>
|
|
>
|
|
| (9) |
>
|
|
| (10) |
Build a transfer function for a SISO system sys2
>
|
|
>
|
|
| (11) |
| (12) |
Design a PI controller (desired gain margin equal to 25 decibels and desired phase margin equal to 60 degrees)
>
|
|
| (13) |
>
|
|
>
|
|
| (14) |
>
|
|
| (15) |
Design a PID controller with the same gain-phase margin specifications
>
|
|
| (16) |
>
|
|
>
|
|
| (17) |
>
|
|
| (18) |
Build a transfer function for a SISO system sys3
>
|
|
>
|
|
| (19) |
| (20) |
Design a PI controller (desired gain margin equal to 25 decibels and desired phase margin equal to 60 degrees)
>
|
|
| (21) |
PI controller transfer function
>
|
|
| (22) |
| (23) |
>
|
|
>
|
|
| (24) |
>
|
|
| (25) |
Design a PID controller with the same gain-phase margin specifications
>
|
|
| (26) |
>
|
|
PID controller transfer function
>
|
|
| (28) |
>
|
|
>
|
|
| (29) |
>
|
|
| (30) |
|
|
References
|
|
|
[1] K. J. Astrom and T. Hagglund, Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins, Automatica, Vol. 20, No. 5, pp. 645-651, 1984.
|
|
[2] C. C. Hang, K. J. Astrom, and W. K. Ho, Refinements of the Ziegler-Nichols Tuning Formula, IEE Proceedings D, Control Theory and Applications, Vol. 138, No. 2, pp. 111-118, 1991.
|
|
[3] W. K. Ho, K. W. Lim, C. C. Hang and L. Y. Ni, Getting more Phase Margin and Performance out of PID Controllers, Automatica, Vol. 35, No. 9, pp. 1579-1585, 1999.
|
|
[4] W. K. Ho, C. C. Hang, L. S. Cao, Tuning of PID Controllers Based on Gain and Phase Margin Specifications Automatica, Vol 31, No. 3, pp. 497-502, 1995.
|
|
|
|