4.2.4. Analytical Design of a PID Compensator¶
This section presents an analytical procedure for PID compensator design. It is based on Section 7.11 of Phillips and Harbor Feedback_ Control Systems, Prentice Hall, 1988[1].
The compensator transfer function is assumed to be
where Kprop is the proportional gain, KDis the derivative gain and KI is the integral gain. In this procedure we choose the PID gain parameters such that, given a desired location for one of the closed-loop poles s1, the equation
is satisfied; that is we are designing a compensator that places a root of the closed-loop characteristic equation at s=s1.
The design proceeds as follows. First we express the desired closed loop pole position
and
Then the design equations (derived in Appendix B of Phillips and Harbor, 1988) are
Since there are three unknowns and only two relationships that must be satisfied, one of the gains may be chosen to satisfy a different design specification, such as choosing KI to achieve a certain steady-state response. These equations can also be used for PI and P+D controllers by setting the appropriate gain to zero. We now illustrate the design procedure with an example.
4.2.4.1. Example¶
Definitions (change these to change design)
The plant transfer function is
The feedback transfer function is H(s)=1:
So G(s)H(s) is:
The root locus of the uncompensated system is:
From the root locus diagram, it is clear that for ideal damping the natural frequency of the closed-loop poles would be about 0.9 rad/s with a settling time of:
Ts=4.6ζωn=4.65/8=7.36 s
Suppose we wish to half the settling time then we need to double the natural frequency to ωn=2rad/s.
That is:
The steady state error of the uncompensated type 0 system is:
For the compensated system, which is type 1:
So if we want a steady-state _velocity _error of 20% we need
4.2.4.2. Calculations¶
Having set up your problem, you shouldn?t need to change these commands
Polar form of s1
Transfer function evaluated at s1is G(s1)H(s1)in polar form:
Magnitude:
Phase2:
Hence:
From (5) and (6)
Compensator is therefore given by
4.2.4.3. Evaluation of Design¶
Open loop transfer function:
4.2.4.3.1. Root locus:¶
rlocus(Go)
4.2.4.3.2. Closed-loop transfer function:¶
4.2.4.3.3. Step response:¶
4.2.4.4. Footnotes¶
[1] The proofs of the formulae given are derived in Appendix B of this text.
[2] You must be careful with angles when using packages like MATLAB, and indeed pocket calculators. It is nearly always beneficial to have a sketch so that you can correct the results. In this case a correction of −90∘ was needed.
4.2.4.5. Resources¶
An executable version of this document is available to download as the MATLAB Live Script file analrloc.mlx.