Feedback Control System Fundamentals: Peter Kennedy
Feedback Control System Fundamentals: Peter Kennedy
Peter Kennedy
Feedback Control System Fundamentals
A SunCam online continuing education course
The physical device or system to be controlled is often called the plant, process, or load. An
example of a feedback control system is the central heating and air conditioning system for a
home, or building. A thermostat or temperature sensor is the feedback sensor that measures the
room temperature and compares it to the desired temperature or set point, calculating a
difference or error. If the temperature is less than the set point, the error is used by the controller
to force more heat into the room. When the set point is reached, the error is zero or below an
error threshold and the controller will stop heating the room. Another example is the speed
control in most of today’s automobiles. The speed of the vehicle is measured and compared to a
desired speed. Based on the difference between actual speed and the set point, acceleration or
braking is applied to the automobile drive to null the error and maintain the desired speed.
Classical control deals directly with the differential equations that describe the dynamics of a
plant or process. These equations are transformed into frequency dependent transfer functions.
The transfer function is the ratio of two frequency dependent polynomials whose roots describe
the response of the plant in a frequency domain. The controller or compensator shapes the closed
feedback loop response, given the plant response, to achieve the control performance objectives.
Modern control theory is another approach to control loop design and analysis; especially useful
for systems with multiple inputs and outputs. It utilizes State Space methods to evaluate the
response of a system as well as generate the control for it. This relies heavily on linear algebra
and matrix theory. Modern control theory and design methods are not discussed further in this
course. Even classical feedback control design and analysis tends to require a good foundation in
mathematics, however the purpose of this course is not to dwell on the math, although examples
are provided, but to provide the basic design and analysis concepts.
2.0 Feedback Control Block Diagram: The feedback control system block diagram provides both
a visual as well as a basis for the mathematical representation of the feedback control system. It
is an important part of the control system design and analysis. In general, the feedback control
block diagram will be complex incorporating many elements and several feedback loops. To
describe just the basic elements, a very simple block diagram is shown in Figure 1.
D
Cmd In + Σ C
+ Σ+ P
Output
-
Controller or Plant, Process, or
Compensator Load
Σ
+ F
+ Feedback Sensor
or Transducer
N
Figure 1 Basic Feedback Control Block Diagram
This simple loop includes a controller (C), plant (P), and feedback sensor (F). The inputs are the
command input (Cmd In), disturbances (D) and sensor noise (N). The command, which is the
desired plant output, is applied to the input summing junction and compared with the actual plant
output. The error between the command and actual output is calculated and fed to the controller.
The controller generates the drive signal to the plant that reduces the error until the command
input equals the actual output or remains within a desired offset.
The dynamics of each block can be expressed in the time or frequency domain. The time domain
is very useful for simulating the loop response and evaluating performance as a function of time.
A set of differential equations which can include non-linear terms are used to describe the
dynamics for each block. The frequency domain is excellent for linear analysis. The gain of each
element can be characterized as a function of frequency; effectively each element is a frequency
dependent gain. The output response can be evaluated as a function of frequency and the
controller adjusted in the frequency domain to improve the loop performance.
3.0 Time and Frequency Domain Representations of Loop Dynamics: The plant dynamics is
normally described by a set of differential equations and non-linearity’s (time and/or multi-
variable dependent). To describe the response in the frequency domain, the Laplace transform or
the differential operator can be used if the plant is linear or approximated by linearizing the
system about an operating point. The definition of the Laplace transform of a time dependent
variable f(t) is defined as:
∞
F ( s ) = ∫ f (t )e − s ⋅t dt
0
This integral exists for an s=σ+jω with any real part σ>0. The variable ω=2πf where ‘f’ is
frequency in hertz. Differentiating this expression n times with respect to time, results in the
important relationship:
∞ n
∫ f n (t )e − s ⋅t dt = s n F ( s ) − ∑ s k −1 ⋅ f n − k (0)
0 k =1
∫f (t )e − s ⋅t dt = s n F ( s ) =
n
for initial conditions 0
0
The inverse Laplace transform is used to convert a frequency domain function back to one in the
time domain. The inverse transform is given by:
c + j∞
1
∫ F ( s )e
s ⋅t
f (t ) = ds
2 ⋅ π ⋅ j c − j∞
This complex integral is evaluated along the path s=c+jω in the complex plane from c-j∞ to
c+j∞ where c is any real number for which the path c+jω lies in the region of convergence of the
transform F(s). Although this is a somewhat complicated definition; methods such as partial
fraction expansion are available for evaluating the inverse transform. Most control textbooks and
engineering reference books have very thorough tables of both the Laplace transform and the
inverse Laplace transform solved for numerous functions. So in many cases, one can obtain the
transform or its inverse from a table and need not evaluate it directly.
It is also important to note that although the definition of the Laplace variable is s=σ+jω, when
performing frequency domain analysis the variable will be equated to s=jω where ω=2πf. The σ
term is assumed zero since for frequency domain analysis a function is being evaluated based
upon its response to periodic sinusoidal signals. The real axis (σ) in the s-domain represents an
exponential decay or growth factor that is not relevant for this analysis.
The relationship between the time and frequency domain can be shown, using the Laplace
transform, for a first and second order plant as follows. For a first order plant (P), let x(t) equal
the plant input and to shorten notation let y(t) equal Output(t), then the plant can be described by
the differential equation:
y (t ) + τ ⋅ y (t ) = τ ⋅ K S ⋅ x(t )
The term τ is the plant time constant while KS is the scaling factor. Taking the Laplace transform,
this converts in the frequency domain (denoted by the Laplace variable ‘s’) to:
(s + τ ) ⋅ Y ( s ) = τ ⋅ K S ⋅ X ( s )
or
τ ⋅ Ks
Output ( s) = Y ( s) = P( s) ⋅ X ( s) = ⋅ X ( s)
s +τ
τ ⋅ Ks
where P( s ) =
s +τ
and L( y (t )) = Y ( s ) ; L( y (t )) = s ⋅ Y ( s ) ; L( x(t )) = X ( s )
4.0 Key Feedback Loop Relationships: Each block in the feedback control loop block diagram
can be expressed in the frequency domain using the Laplace transform described in the last
section, assuming all constraints are met. In the frequency domain, blocks can be treated
algebraically with each element of the loop in the block diagram treated as a frequency
dependent function. Referring to the block diagram of Figure 1, an expression for the Output can
be obtained algebraically as:
Output ( s ) = P( s ) ⋅ [ D( s ) + C ( s ) ⋅ (Cmd In( s ) − ( N ( s ) + F ( s ) ⋅ Output ( s ))]
Solving for the output:
P( s) ⋅ C ( s)
Output ( s ) = ⋅ Cmd In( s ) +
1 + P( s) ⋅ C ( s) ⋅ F ( s )
P( s) P( s) ⋅ C ( s)
1 + P( s ) ⋅ C ( s ) ⋅ F ( s ) ⋅ D( s ) − 1 + P( s ) ⋅ C ( s ) ⋅ F ( s ) ⋅ N ( s )
The terms in brackets that multiply each input are very important relative to the control loop
design. The first term in brackets describes the response from the command input to the output
and is termed the closed loop transfer function (CLTF) with a magnitude called the closed loop
gain (CLG) or:
P( s) ⋅ C ( s)
CLTF ( s ) =
1 + P( s ) ⋅ C ( s ) ⋅ F ( s )
P( s) ⋅ C ( s)
CLG ( s ) =
1 + P( s ) ⋅ C ( s ) ⋅ F ( s )
The control compensator gain, |C(s)|, is normally a very high such that magnitude of the product
of the three terms |P(s)*C(s)*F(s)|>> 1 over the effective operating bandwidth of the loop. This
product is the open loop transfer function (OLTF) and its magnitude called the open loop gain
(OLG).
OLTF ( s ) = P( s ) ⋅ C ( s ) ⋅ F ( s )
OLG ( s ) = P( s ) ⋅ C ( s ) ⋅ F ( s )
The feedback term is often a unity gain (or scaled to provide unity gain in the feedback path) as
it is simply sensing the plant output. This being the case, the closed loop gain, CLG, is unity over
the operating bandwidth of the loop and rolls off towards zero at high frequency. If the feedback
gain is not unity, it will change the closed loop gain from one to the inverse of the feedback gain
magnitude (i.e. 1/F).
In the expression for the loop output above, the second term accounts for the impact of
disturbances on the output response. The transfer function in brackets multiplying the
disturbance is often termed the compliance, as in how compliant the loop is to a disturbance.
P( s)
Compliance( s ) =
1 + P( s ) ⋅ C ( s ) ⋅ F ( s )
This term attenuates the disturbance primarily due to the high gain control compensator, C(s), in
the open loop gain. Therefore the higher the compensator gain, the more disturbance rejection
and the less impact the disturbances will have on the output. However this gain will be limited by
the stability of the loop. Finally, as modeled, the last term is sensor noise which as shown
effectively adds directly to the output since it is multiplied by the closed loop gain. As it is
basically input to the same summing junction as the command input, this would be expected.
The error between the command input and the output is given by:
1 − P( s ) ⋅ C ( s )(1 − F ( s ))
Error ( s ) = Cmd In( s ) − Output ( s ) = ⋅ Cmd In( s ) −
1 + P( s) ⋅ C ( s) ⋅ F ( s)
P( s) P( s) ⋅ C ( s)
1 + P( s ) ⋅ C ( s ) ⋅ F ( s ) ⋅ D( s ) + 1 + P( s ) ⋅ C ( s ) ⋅ F ( s ) ⋅ N ( s )
The error is effectively the accuracy with which the output follows the command input. The first
term in brackets that is multiplying the command input is often called the loop sensitivity
function. For unity feedback (F(s)~1) this term is effectively one over the open loop gain, similar
to the compliance function discussed previously, or:
1
Sensitivity ( s ) = for F ( s) = 1
1 + P( s ) ⋅ C ( s )
The error will be a function of the attenuation provided by this term as well as the magnitude of
the command, disturbance, and noise. One final error relationship of importance is the steady
state error which is defined as:
ESS = lim s→0 [s ⋅ Error ( s )] = lim s→0 ⋅
s
⋅ Cmd In( s )
1 + P( s ) ⋅ C ( s )
It is a measure of the error response or effectively the accuracy of a stable system as time goes to
infinity. It is normally evaluated against three standard input signals; a step, ramp or rate, and
parabolic input or acceleration. These signals have the Laplace transforms:
K step K ramp K parobolic
step → ; ramp → 2
; parobolic →
s s s3
The steady state error is often used as part of the control loop performance specification. The
required response to these input signals will determine what is termed the loop ‘Type’; which
refers to the open loop poles at s=0 or the number of integrators (i.e. 1/s terms) in the OLTF(s). If
we describe a general input to the system as Kx/sn which can be any of the above inputs
depending on the value of n, then the steady state error can be written as:
Kx
ESS = lim s→0 [s ⋅ Error ( s )] = lim s→0 ⋅
s K
⋅ n = lim s→0 n−1 n−1 x
1 + P( s ) ⋅ C ( s ) s s + s ⋅ P( s ) ⋅ C ( s )
From this expression, the following table can be generated that describes the steady state error as
a function of loop type and input.
From Table 1 it is observed that with a Type 0 loop and a step input there will always be an
offset between the input and output which is a function of the loop gain. The Type 0 loop cannot
track a ramp or parabolic input as the error will continue to grow infinitely with time for both
input types. A Type 1 loop will null the error to a step input at a rate based on the loop
bandwidth. The Type 1 loop will track a ramp with an error that is a function of the loop gain. It
cannot track a parabolic input as the error will continue to grow with time. The Type 2 loop
tracks both a step and ramp with zero error and a parabolic input with an offset between the input
and output which is a function of the loop gain. Loop Types greater than two can track all three
inputs with zero error; however a loop with this many integration terms is difficult to stabilize.
5.0 Control Loop Stability: There are many methods for analyzing feedback control loop
stability. For a linear system, if the feedback control loop output remains bounded for any
bounded input (Cmd In, D, N), then the system is considered to be bounded input- bounded
output stable. For non-linear systems, more advanced methods such as the Lyapunov criteria are
required.
Evaluating stability for linear systems can be performed easily in the frequency domain. The
primary transfer functions C, P, F are described in the frequency domain by the ratio of two
polynomials that are a function of ‘s’. The roots of these polynomials in the numerator are
termed zeros and in the denominator termed poles. The closed and open loop transfer function
gain and phase is a function of all these polynomials. For example if subscript ‘N’ denotes
numerator and ‘D’ the denominator then the closed loop transfer function can be expressed as:
PN ( s ) ⋅ C N ( s ) ⋅ FD ( f )
CLTF ( s ) =
PD ( s ) ⋅ CD ( s ) ⋅ FD ( s ) + PN ( s ) ⋅ C N ( s ) ⋅ FN ( s )
CLTFN ( s ) = PN ( s ) ⋅ C N ( s ) ⋅ FD ( s )
CLTFD ( s ) = PD ( s )C D ( s ) FD ( s ) + PN ( s )C N ( s ) FN ( s )
One important observation is that the zeros of the OLTF will also be the zeros of the CLTF. For
a causal linear system to be stable all of the poles of CLTFD(s) must have negative-real values.
Determining the poles of the polynomial can be done with a root finder. A stability method
called the Routh criterion, based upon evaluating only combinations of the polynomial
coefficients can also be used to determine if the poles all have negative real parts. However this
does not really quantify how stable the system is or the margin of stability. Other methods using
a frequency domain representation to evaluate stability while also providing stability margins
are: the Bode Plots, Nyquist Plots, and Nichols plots.
5.1 Bode Stability Criterion: The Bode Plot is a relatively straightforward graphical method
using plots of the OLTF gain and magnitude to evaluate stability. The Bode criteria for stability,
however, is sufficient only for feedback loops whose CLTF is minimum phase (all zero’s and
poles of CLTF have negative real parts or are in left half of s-plane). The Bode plot is
effectively two plots, one of the open loop gain (OLG) or magnitude and the other the phase of
the OLTF. The gain and phase of an arbitrary transfer function G(s) are determined by
substituting s=jω into the numerator polynomial, GN(jω), and the denominator polynomial,
GD(jω), of G(jω) and then calculating the real and imaginary components of the numerator and
denominator or:
G ( jω ) RGN + j ⋅ IGN
G ( s ) s= jω = N =
GD ( jω ) RGD + j ⋅ IGD
where RGN = Real[GN ( jω )] ; IGN = Imaginary(GN ( jω )]
RGD = Real[GD ( jω )] ; IGD = Imaginary(GD ( jω )]
The magnitude and phase are then determined as:
RG 2 + IG 2 IG IG IG
G ( jω ) = ; Φ (G ( jω )) = atan ( ) = atan ( N ) − atan ( D )
RGD2 + RI D2 RG RGN RGD
where RG = RGN ⋅ RGD + IGN ⋅ IGD
IG = RGD ⋅ IGN − IGD ⋅ RGN
The magnitude of the product of several transfer functions is the product of their magnitudes and
the phase is the sum of their phases or:
G ( jω ) = G1 ( jω ) ⋅ G2 ( jω ) = G1 ( jω ) ⋅ G2 ( jω )
The gain margin and phase margin are normally specified in the performance requirements for
a control loop. The gain margin is often expressed in decibels, or:
GM dB = 20 ⋅ Log (GM ) = −20 ⋅ Log (OLG ( f PC ))
It can be noted that given the CLTF satisfies the Bode criteria restrictions, the loop is stable if fGC
< fPC. If the restrictions for the using the Bode criteria are not met, other methods such as the
Nyquist or Nichols plots should be used. A couple of examples of the Bode plots follow. A plot is
shown in Figure 2 for an OLTF given by:
1.6 ⋅ ( s + ω z1 )
OLTF ( s ) =
s ⋅ ( s + ω p1 ) ⋅ ( s 2 + 2 ⋅ ξ ⋅ ωr ⋅ s + ωr2 )
where : ω z1 = 2 ⋅ π ⋅ f z1 = 2 ⋅ π ⋅ 0.1592
ω p1 = 2 ⋅ π ⋅ f p1 = 2 ⋅ π ⋅ 0.01592
ωr = 2 ⋅ π ⋅ f r = 2 ⋅ π ⋅ 0.6366 ; ξ = 0.25
The solid lines are for the open loop gain, which is scaled in units of dB on the right hand side of
the plot and the dotted lines are for the open loop phase scaled in degrees on the left hand side
of the plot. The plot of the OLG is in solid black with a line at 0 dB in solid light blue. Each pole
contributes -20 dB/decade of slope to the magnitude plot and each zero +20 dB/decade of
slope. The quadratic term contributes -40 dB/decade of slope. The OLTF phase is the dotted red
line and a line at the -180° reference in dotted dark blue. Each pole contributes -90° of phase
lag to the phase plot and each zero +90° of phase lead. The quadratic term contributes -180° of
phase lag. As shown in the figure, the system has a gain crossover frequency at 0.05 Hz, a
PM~30° and a GM~23 dB and is stable based upon the Bode stability criterion. The phase
crossover frequency is 0.6°. This is a low bandwidth system and the relatively low PM indicating
some oscillatory response can be expected.
Another example is for a system with a much higher bandwidth system. Figure 3 provides a
Bode plot for an OLTF given by:
248040 ⋅ ( s + ω z1 )
OLTF ( s ) =
s 2 ⋅ ( s + ω p1 )
where : ω z1 = 2 ⋅ π ⋅ f z1 = 2 ⋅ π ⋅15.92
ω p1 = 2 ⋅ π ⋅ f p1 = 2 ⋅ π ⋅159.2
Again the plot of the OLG is in solid black with a line at 0 dB in solid light blue. The OLTF phase is
the dotted red line and a line at the -180° reference in dotted dark blue (at the bottom of the
plot). The system is stable with gain crossover frequency at 40 Hz, a PM~55° and a gain margin
that is infinite (phase is always greater than and never crosses -180°). The PM for this system is
better than the previous example and in the range that indicates a good response.
5.2 Nyquist Stability Criterion: The Nyquist stability criterion is another graphical technique for
determining the system stability. The Nyquist plot is a graph of the OLTF imaginary versus real
parts as a function of s=jω. The real part is plotted on x-axis and the imaginary on the y-axis.
The plot can also be implemented as a polar plot of the OLTF magnitude and phase as a
function of s=jω. It can be applied without explicitly computing the poles and zeros of either the
closed-loop or open-loop system. As a result, it is applicable to systems defined by non-rational
functions and delays. In contrast to Bode plots, it can handle minimum phase transfer functions
as well as those with right half-plane singularities, or non-minimum phase plants. Although it is
one of the more generic stability tests, it is still restricted to linear, time-invariant systems. Non-
linear systems must use more complex stability criteria, such as Lyapunov or the circle criterion.
While Nyquist is a graphical technique, it provides only a limited amount of information about
the reason a system is stable or unstable, or how to modify an unstable system to be stable.
Techniques like the Bode plots previously discussed, while less general, are sometimes a more
useful design tool.
Assessment of the stability of a closed-loop negative feedback system is done by applying the
Nyquist stability criterion to the Nyquist plot. The plot is effectively a mapping of a contour with
infinite radius about the right half of the s-plane to a contour of the OLTF(s) magnitude and
phase. Stability is determined by looking at the number of encirclements, N, of the point at (-1,
0). Using the argument principle for contour integrals, it can be shown that N=NP-NZ where NP
and NZ are the number poles and zeros within the right half s-plane contour. The poles of the
OLTF(s), which are known, are the zeros of the CLTF(s), as was shown in section 5.0 by
expansion of the closed loop transfer function. The number of zeros, NZ that are in the right half
s-plane is known from the OLTF. The number of poles in the right half s-plane is then obtained
as NP=N-NZ. If the point (-1, 0) is not encircled or intersected, then the closed loop system is
stable. The intersection of the Nyquist contour with the negative real axis relative to the origin
is the inverse of the gain margin. For example, if this distance is ‘a’ then the GM=1/a. The phase
margin is obtained by drawing a line from the point of intersection of the Nyquist contour with
a circle of radius one about the origin; to the origin and then calculating the angle relative to
the negative real axis with positive being counter-clockwise. The Nyquist plot for the first
example in section 5.1 describing Bode stability is shown in Figure 4. The top plot shows the
contour is for a frequency range out to 100 Hz while the second two plots are expanded so that
the phase margin and gain margin can be observed.
Nyquist Plot
Unit circle
increase, the loop stability margins begin to decrease, more overshoot results, control elements
can saturate, and noise between loop elements can be amplified. So the design is a tradeoff
between the user requirements and control loop specifications that meet these requirements with
sufficient stability margin. Response time can be specified in terms of rise time, overshoot, and
settling time all of which are a function of bandwidth and the control compensator structure. In
the frequency domain, the designer can specify the resonant peak, peak frequency, gain
crossover frequency, bandwidth (which in some cases are directly related), and the minimum
allowable phase and gain margins. The resonant peak is a maximum of the gain at the peak
frequency. The other important specification is the control loop type which as discussed
previously refers to the number of integrators within the loop; either due to the controller or the
plant dynamics. The loop type or number of integrators will determine the accuracy with which
the output follows an input command in the long term. This error is often referred to as the
following error. The integrator also provides very high gain at low frequency which is good for
disturbance rejection and improved accuracy; however each pole at s=0 also provides a -90°
phase shift which can impact stability. The robustness of the controller design must also be
considered. If the plant parameters change for whatever reason, what will happen to the loop
stability margins? The controller design must account for these variations. This can be
accomplished by designing for the worst case plant variation and ensuring the system meets the
stability margins over the full range of plant variation; measuring the plant response (i.e. plant
identification) and changing control parameters to account for the plant changes (either manually
or on a scheduled basis), or a using an adaptive controller that automatically adjusts the control
parameters as a function of the plant variations.
7.0 Controller Design: There are many control loop design techniques; most involve some form
of loop shaping and/or algebraic pole-zero placement and cancellation. Loop shaping can be
accomplished using Bode or Nyquist plot analysis. Visually, the Bode plot is easy to interpret
and adjust the response especially if implemented in a mathematical computer aided design
program (i.e. Matlab or MathCad). The Bode plot can be used with measured plant gain and
phase response data, the plant-pole zero structure does not have to be known exactly (although
the Bode design is still subject minimum phase criterion). Algebraic methods appear
straightforward but require knowledge of the plant pole-zero structure and care must be taken to
insure stable design. For example, pole and zero cancellation must be done with some sensitivity
analysis because they are never known exactly and in some cases can change or drift. This is
especially true if the poles and zeros are not stable; direct cancellation can result in an pole/zero
pair that are both unstable (both roots in right half s-plane) as opposed cancellation of the
unstable root. Common compensation elements used in a controller are proportional plus integral
(PI) and/or derivative (PID) control, and first or second order lead and lag compensation as well
as a cascade of these basic elements. The loop Type can be adjusted using the PI or PID
controller. When using any control term with a pure integrator, the output should be limited or
other measures taken to insure windup of the integrator does not occur. A couple of simple
design examples are provided.
7.1 Frequency Domain Loop Shaping: Assume for a unity feedback loop the desired gain
crossover frequency is 40 Hz and the phase margin > 55°. This provides two design criteria to
satisfy with the compensator:
1) OLG ( f GC ) = 1
2) PM = 180° + Φ (OLTF ( f GC )) = 55°
or Φ (OLTF ( f GC )) = −125°
From the definition of the open loop transfer function, this can be expressed as:
C N ( jωGC ) PN ( jωGC )
1) ⋅ = 1 ; ωGC = 2 ⋅ π ⋅ f GC
C D ( jωGC ) PD ( jωGC )
2) Φ (C ( jωGC ) ⋅ P( jωGC )) = Φ (C N ( jωGC ) + Φ ( PN ( jωGC ) − Φ (C D ( jωGC ) − Φ ( PD ( jωGC ) = −125°
The pole frequency at 160 Hz is chosen as the roll-off frequency for the loop. It effectively limits
the frequency response and reduces higher frequency noise. Representing the poles and zeros in
terms of a frequency (i.e 2πf) provides for better visualization of the design process and
pole/zero location. It is also useful to cancel plant parameters with a scaling factor so effectively
the loop response is shaped only by the normalized plant response and the compensator. The
compensator is then expressed as:
s
α ⋅ ( + 1)
K
C (s) = P 0 α for KP =
K P0
KL s KL
+1
2 ⋅ π ⋅160
The OLTF is then:
s
α ⋅ ( + 1)
OLTF ( s ) = C ( s ) ⋅ P( s ) = K P 0 α 1
⋅
s s2
+ 1
2 ⋅ π ⋅160
This will be a Type 2 control loop. The values for the compensator gain and zero are obtained by
first obtaining the value of the zero from the phase margin condition and solving for the gain
from the OLG condition. From this expression, the phase components are given by:
ω ωGC
Φ (C N ( jωGC )) = atan ( GC ) ; Φ (C D ( jωGC )) = atan ( )
α 2 ⋅ π ⋅160
Φ ( PN ( jωGC )) = 0 ; Φ ( PD ( jωGC )) = −180
Substituting into the expression for phase margin
ω ωGC
− 125° = atan ( GC ) − atan ( ) − 180
α 2 ⋅ π ⋅160
or
2 ⋅ π ⋅ 40 2 ⋅ π ⋅ 40 2 ⋅ π ⋅ 40
55° = atan ( ) − atan ( ) = atan ( ) − 14°
α 2 ⋅ π ⋅160 α
Solving for α
2 ⋅ π ⋅ 40
69° = atan ( )
α
or
2 ⋅ π ⋅ 40 97
α= = 97 = 2 ⋅ π ⋅ f ZC ⇒ f ZC = = 15.4 Hz
tan(69°) 2 ⋅π
The phase margin criterion is satisfied with the compensator pole at 15.4 Hz. The magnitude
criterion is now used to obtain the value of KP0 that satisfies the open loop gain condition at the
gain crossover frequency.
( jωGC + 2 ⋅ π ⋅15.4) 1
K P 0 ⋅ 2 ⋅ π ⋅160 ⋅ ⋅ =1
( jωGC + 2 ⋅ π ⋅160) ( jωGC ) 2
or
( j 2 ⋅ π ⋅ 40 + 2 ⋅ π ⋅15.4) 1 1
K P 0 ⋅ 2 ⋅ π ⋅160 ⋅ ⋅ = K P 0 ⋅ 2 ⋅ π ⋅160 ⋅ 0.26 ⋅ =1
( j 2 ⋅ π ⋅ 40 + 2 ⋅ π ⋅160) ( j 2 ⋅ π ⋅ 40) 2
(2 ⋅ π ⋅ 40)2
or
1
K P 0 ⋅ 2 ⋅ π ⋅ 41.6 ⋅ = 1 ⇒ K P 0 = 2 ⋅ π ⋅ 38.5
(2 ⋅ π ⋅ 40)2
The compensator gain that satisfies the open loop gain crossover frequency condition is then:
2 ⋅ π ⋅ 38.5
KP =
KL
7.2 Compensator Derivation from a Desired CLTF(s): Another method for controller design is to
specify a closed loop system model based upon a desired performance. For example, response
time or bandwidth, overshoot, stability margins could be specified. With the closed loop transfer
function defined and the plant transfer function known, the compensator can be determined.
Assuming unity gain feedback and using the definition for the closed loop response:
P( s) ⋅ C ( s)
CLTF ( s ) =
1 + C ( s) ⋅ P( s)
∴
CLTF ( s )
C ( s) P( s) =
1 − CLTF ( s )
or
1 CLTF ( s ) P (s) CLTFN ( s )
C (s) = ⋅ = D ⋅
P( s ) 1 − CLTF ( s ) PN ( s ) CLTFD ( s ) − CLTFN ( s )
The compensator cancels out the plant and substitutes an open loop transfer function that gives
the desired closed loop transfer function. There are some important constraints:
• If the plant has a pole in the right half s-plane (pole with a positive real part) then the
desired CLTF(s) must be chosen such the CLTFD(s)-CLTFN(s) has the same root.
• If the plant has a zero in the right half s-plane then the desired CLTF(s) must have the
same right half s-plane zero
• To be realizable, the excess poles of the desired CLTF(s) must be equal or greater than
the excess poles of the plant. If the numerator polynomial of a transfer function is of
order nz and the denominator polynomial of order np then the excess poles are defined as
np-nz.
A very simple example is provided with a desired CLTF(s) and plant of the form:
a
s +1
K
CLTF ( s ) = 2 b ; P( s) = L
s a s
+ ⋅ s +1
b b
a
⋅ s +1
s b
∴ C (s) =
KL s2 a a
+ ⋅ s + 1 − ( ⋅ s + 1)
b b b
b
s+
a a
C ( s) = ⋅
KL s
The constants a, b define the desired response of the CLTF(s). Using this procedure basically
results in a proportional plus integral (PI) controller to realize the form of a desired CLTF(s).
There were no right half plane poles or zeros in this example and the excess pole criterion is also
satisfied. Unfortunately, a real design is seldom this simple. To satisfy the excess pole criterion,
it may be required to add more poles to the desired CLTF(s) than required to just obtain the
desired performance. In this case, the CLTF(s) is constructed as the cascade of a transfer
function that dominates the response and defines performance, and a transfer function with poles
significantly beyond the desired bandwidth that will satisfy the excess pole constraint.
8.0 Home Heating System: The first example is a simplified version of the feedback control for
heating a house. The physical configuration is illustrated in Figure 5. The house is idealized as a
box filled with air at a uniform temperature TC. The walls of the house are considered as pure
resistance to heat transfer with no energy storage capacity. The overall coefficient of heat
transfer is U and the heat transfer area is A. The outdoor environment temperature is Te and
varies with time thereby acting as a disturbance to the control system. The temperature TC is
measured by a temperature sensor in a thermostat or temperature controller mounted inside the
house. The desired temperature can also be set by this device, or in today’s environment may
even interface to a smart phone with an APP that lets it be set remotely. It is assumed that the
temperature is converted to a voltage (or current) with a scaling constant KTV (with units Volt/°F)
and processed by electronics, or more likely in today’s environment a micro-controller.
The controller takes the difference between the desired and actual temperature and generates a
control signal to the furnace. This signal controls an actuator that increases or decreases the gas
flow and effectively the amount of heat into the room. For this simple example, the actuation and
heat generation are modeled as a linear process; in reality it is a complex process. In developing
a model of the system it is assumed that initially the house is at equilibrium with constant values
of TC and Te. The furnace will then be supplying sufficient heat to balance the heat loss to the
environment. Any disturbance or change in the desired temperature will result in an increase or
decrease in heat input from this original value. All variables should be considered deviations
from their initial equilibrium condition. The simple first order thermal dynamic model for the
heat balance in the house (the control loop plant) in the time domain is:
thermal energy stored = thermal energy in − thermal energy leaving the house
or M ⋅ C ⋅ T (t ) = Q (t ) − U ⋅ A ⋅ (T (t ) − T (t ))
P C M C e
BTU
where Q M − thermal energy in
hr
M − mass of air in house
C P − specific heat of air at constant pressure
BTU BTU
assume U ⋅ A = 150 ; M ⋅ CP = 180
Hr ⋅ ° F °F
QM ( s ) T ( s)
TC ( s ) = + e
U ⋅ A ⋅ (τ ⋅ s + 1) τ ⋅ s + 1
M ⋅ CP
where τ = = 1.2 Hr = 4320 sec
U⋅A
1 1 °F
P( s ) = =
U ⋅ A ⋅ (τ ⋅ s + 1) 150 ⋅ ( 4320 ⋅ s + 1) BTU / Hr
A feedback control system measures the house temperature TC and compares it to a desired
temperature TS or the set point. The control loop is shown in Figure 6 with the yet undefined
controller C(s).
Te
U*A
VSET +
TS + + 1 TC
KTV Σ C(s) KVQ Σ
QM U*A*(τ*s+1)
-
scale controller furnace house
volts/F° volts/volts BTU/hr/volt °F/BTU/hr
KTV
sensor
volts/F°
From the block diagram, the dynamics of the loop can be expressed as:
TC ( s ) = P ( s ) ⋅ [U ⋅ A ⋅ Te ( s ) + C ( s ) ⋅ ( KTV ⋅ (TS ( s ) − TC ( s ))]
Volt
assume KTV = 0.067
°F
The error between the set point temperature and the actual temperature is given by:
P ( s ) ⋅ U ⋅ A ⋅ Te ( s ) TS ( s )
TS ( s ) − TC ( s ) = − +
1 + KTV ⋅ P ( s ) ⋅ C ( s ) 1 + KTV ⋅ P ( s ) ⋅ C ( s )
As discussed previously, the error is a function of the magnitude of the outside and set point
temperatures and the attenuation provided by the controller gain. The simplest controller is a
proportional gain or C(s) = KP with units of BTU/Hr/Volt. Substituting into the previous
expression and using the plant definition:
U ⋅ A ⋅ Te ( s ) U ⋅ A ⋅ (τ ⋅ s + 1) ⋅ TS ( s )
TS ( s ) − TC ( s ) = +
U ⋅ A ⋅ (τ ⋅ s + 1) + K TV ⋅ K P U ⋅ A ⋅ (τ ⋅ s + 1) + K TV ⋅ K P
Te ( s ) (τ ⋅ s + 1)TS ( s )
= λs ⋅ +
λs ⋅ τ ⋅ s + 1 λs ⋅ τ ⋅ s + 1
U⋅A
where λs =
U ⋅ A + K TV ⋅ K P
Stability is not an issue, as the open loop has only one real negative pole. The term λs is basically
the attenuation factor whose magnitude is based upon the value of KP. The time constant of the
system will also be reduced by this factor. As this is a Type 0 system, there will be a steady state
error to a step change. For a step change in Te and TS, the steady state error is given by:
λs δT λ ⋅ (τ ⋅ s + 1) δTS
ESS = Lims → 0 s ⋅ (TS ( s ) − TC ( s )) = Lims → 0 s ⋅ ⋅ e+ s ⋅
λs ⋅ τ ⋅ s + 1 s λs ⋅ τ ⋅ s + 1 s
ESS = λs ⋅ (δTe + δTS )
The step change in the input will most likely come from a new set point, as the temperature of
the environment would not be expected to change instantaneously so (δTe=0):
ESS = λs ⋅ δTS step change
The gain KP is chosen to provide an attenuation factor λ that is consistent with the amount of
allowable offset that can be tolerated between the new set point and actual temperature. For
example with the gain was chosen as:
100 ⋅ U ⋅ A
KP =
KTV
The resulting attenuation would be a factor of 100 or -40 dB. The achievable gain will also
depend upon the actual drive characteristics of the furnace. The gain crossover can be
determined by a Bode plot or estimated directly from the OLTF as fGC~0.004 Hz.
With a proportional plus integral controller (PI) the system is Type 1 and the steady state offset
to a step would be zero. The PI compensator has the form:
s +α
C ( s) = K P ( )
s
0.095 ⋅ U ⋅ A ⋅ τ
KP =
KTV
α = 0.045
The open loop transfer function is now:
1 s +α
KTV ⋅ P( s ) ⋅ C ( s ) = KTV ( )KP ( )
U ⋅ A ⋅ (τ ⋅ s + 1) s
Closed loop system denominator is now a quadratic polynomial. Since all coefficients are
positive, the roots will have negative real parts so that the system will be stable. The stability
margins are obtained using a Bode plot. The open loop gain and phase are shown in Figure 7.
phase
margin
The gain crossover frequency is ~0.0167 Hz, the PM~64° and the gain margin infinite since the
PI integrator lag is offset by the zero so the net loop lag is only the lag of the plant which being
first order is only 90°. Care must be taken in an actual design to ensure the higher bandwidth
does not put too much demand on the furnace drive. The expression for the error for this
compensator is:
s ⋅ U ⋅ A ⋅ Te ( s ) s ⋅ U ⋅ A ⋅ (τ ⋅ s + 1) ⋅ TS ( s )
TS ( s ) − TC ( s ) = +
U ⋅ A ⋅ s ⋅ (τ ⋅ s + 1) + KTV ⋅ K P ⋅ ( s + α ) U ⋅ A ⋅ s ⋅ (τ ⋅ s + 1) + KTV ⋅ K P ⋅ ( s + α )
Te ( s ) (τ ⋅ s + 1)TS ( s )
= λr ⋅ s ⋅ +
b2 ⋅ s + b1 ⋅ s + 1 b2 ⋅ s + b1 ⋅ s + 1
2
U⋅A U ⋅ A ⋅τ U ⋅ A + KTV ⋅ K P
where λr = ; b2 = ; b1 =
KTV ⋅ K P ⋅ α KTV ⋅ K P ⋅ α KTV ⋅ K P ⋅ α
For a step change, the steady state error will be zero since:
λ ⋅ s2 δT δT
ESS = Lims → 0 s ⋅ (TS ( s ) − TC ( s )) = Lims → 0 ⋅ e + (τ ⋅ s + 1) ⋅ S = 0
b2 ⋅ s + b1 ⋅ s + 1 s s
2
For a ramp or steadily increasing temperature change, the steady state error is:
λr ⋅ s 2 δTe δTS
ESS = Lims → 0 s ⋅ (TS ( s ) − TC ( s )) = Lims → 0 ⋅ 2 + τ ⋅ + ⋅
s 2
( s 1)
b2 ⋅ s + b1 ⋅ s + 1 s
2
E = λ ⋅ (δT + δT )
SS r e S
The set point will normally not change as a ramp, however the temperature of the environment
can so that most likely the steady state error for this case would be (δ(dTS/dt) = 0):
E = λ ⋅ δT ramp
SS r e
Using the definition of KP for this case, λr=0.054 or -25 dB with the PI controller.
9.0 Motion Control Feedback Systems: Position and rate feedback control systems are used in
many applications; cameras for surveillance and in the movie industry, communication and radar
antennas, positioning concentrating solar collectors, computer disk control, pointing lasers, etc.
A typical pan tilt zoom camera assembly(1) is shown in Figure 8. For this application, the plant or
load (camera as shown in the figure) is mounted on a rotary stage driven by a motor. A servo
amplifier converts control commands to a motor drive signal, for example a control voltage to a
motor drive current which is applied to the motor stator windings to generate a torque causing
the rotary stage on which the load is mounted to rotate. The basic elements of the control loop
are shown in Figure 9.
1. [Link]
TD
+
Pos Cmd In(s) + TM + 1 rate(s) 1 pos(s)
Σ C(s) FSA(s) M(s) Σ
Js s
-
Control Servo Motor Load
Compensator Amplifier
FRDC(s) FRES(s)
The position command is compared to the measured position, calculating the error between the
two positions. The control compensator uses the error to calculate a drive command to the motor
which is applied through the servo amplifier. The output of the motor is a torque that is applied
to the load along with any disturbances. The motor feedback to the servo amplifier is a back
electro-motive force (EMF) which will be discussed later. As shown, the load is simply modeled
as pure inertia and neglects the effects of friction which in general depend on the rate signal. The
position feedback sensor and signal converter work in tandem to generate a measured signal in
the units used by the servo loop; normally the net feedback gain is unity.
9.1 Motor and Servo Amplifier Models: Many motors used for position control applications are
DC servo motors, although AC drives can also be used. The motor assumed for the example is a
DC servo motor. A simple model for a DC motor includes three equations:
+ rate(s)
+ TM +
Σ A(s) KT Σ L(s)
VM(s) - I
motor motor torque Load
admittance constant
Ke
back EMF
constant
Figure 10 DC Motor Block Diagram
The transfer function from motor voltage and disturbance torque in to the rate out can be
expressed as:
KT ⋅ A( s ) ⋅ L( s ) L( s )
rate( s ) = ⋅ VM ( s ) + ⋅ TD ( s )
1 + K e ⋅ KT ⋅ A( s ) ⋅ L( s ) 1 + K e ⋅ KT ⋅ A( s ) ⋅ L( s )
1
where : L( s ) − load response
J ⋅s+ B
1
A( s ) − winding admittance
L⋅s + R
The electromechanical and electrical time constants, with viscous damping assumed negligible
(B~0), can be derived approximately from this expression as:
R⋅J L
τM = ; τE =
K e ⋅ KT R
There are two types of servo amplifiers used to drive the motors; voltage and current. With a
voltage servo amplifier the motor voltage is related to the command voltage by the scaling factor
or gain KV as:
VM = KV ⋅ VC
The model of the voltage servo amplifier and motor from a command voltage and disturbance in
to the rate out can then be expressed as:
KT ⋅ A( s ) ⋅ L( s ) ⋅ KV L( s )
rate( s ) = ⋅ VC ( s ) + ⋅ TD ( s )
1 + K e ⋅ KT ⋅ A( s ) ⋅ L( s ) 1 + K e ⋅ KT ⋅ A( s ) ⋅ L( s )
The block diagram for the current feedback servo amplifier configuration is shown in Figure 11.
The current feedback loop is a high gain servo loop that controls the motor current. The amplifier
GI(s) has very high gain and KA is effectively the scaling constant (Amps/Volt) of the current
amplifier.
1
TD
KA
- +
VC(s) + + TM + rate(s)
Σ GI(s) Σ A(s) KT Σ L(s)
VM(s) - I
motor motor torque Load
admittance constant
Ke
back EMF
constant
Figure 11 Motor Block Diagram with Current Feedback Servo Amplifier with Scaling KA
The transfer function between a command voltage and disturbance in and the rate out is given
by:
KT ⋅ A( s ) ⋅ L( s ) ⋅ GI ( s )
rate( s ) = ⋅ VC ( s ) +
GI ( s )
1 + KT ⋅ A( s ) ⋅ L( s ) ⋅ ( K e + )
K A ⋅ KT ⋅ L( s )
A( s ) ⋅ GI ( s )
L( s ) ⋅ (1 + )
KA
⋅ TD ( s )
GI ( s )
1 + KT ⋅ A( s ) ⋅ L( s ) ⋅ ( K e + )
K A ⋅ KT ⋅ L( s )
The gain of the current amplifier, GI(s), is chosen such that within loop bandwidth:
GI ( s )
>> K e
K A ⋅ KT ⋅ L( s )
For this condition, the transfer function reduces to:
K ⋅ A( s ) ⋅ L( s ) ⋅ GI ( s )
rate( s ) = T ⋅ VC ( s ) + L( s ) ⋅ TD ( s )
GI ( s )
1 + A( s ) ⋅
KA
Again as GI(s) is a high gain amplifier within the loop bandwidth:
GI ( s )
>> 1
K A ⋅ A( s )
The final expression can then be written as:
rate( s ) = L( s ) ⋅ KT ⋅ K A ⋅ VC ( s ) + L( s ) ⋅ TD ( s ) = L( s ) ⋅ ( KT ⋅ K A ⋅ VC ( s ) + TD ( s ))
With a current feedback servo amplifier, the effect of the back EMF and motor admittance is
nearly eliminated and the relationship expressed by the servo amplifier scaling constant KA.
9.2 Position and Velocity Feedback Sensors: Typical rotary position feedback sensors are
resolvers and encoders. For rotary applications, a feature of both these devices is that they can be
mounted directly on the drive shaft and are capable of providing a full 360° continuous
measurement range. There are several units of measure that can be used when describing
angular position, degrees, radians, arc-minutes or arc-seconds. There are 60 arc-minutes per
degree and π/180 radians per degree which equates to π/(180*60) radians per arc-minute.
There are 60 arc-seconds per arc-minute or therefore π/(180*3600) radians per arc-second
(4.85*10-6). As degrees are a familiar unit of measure, this will be used in all examples, however
actual application often used these other units. Resolvers provide absolute angular position
with electrical errors ranging from 0.1° to as low as 10-20 arc-seconds. Accuracy depends upon
size and angular range. Resolvers consist of a stator and rotor, similar to a motor. This
construction makes them very robust in the presence of shock and vibration disturbances and
reduces their sensitivity to temperature variations when compared to encoders. The resolver
stator consists of two windings positioned at right angles to each-other. The rotor has a third
winding that is energized with a sinusoidal signal and rotates relative to the stator. The signal in
the rotor winding induces a signal in both stator windings whose magnitude varies as a function
of the rotation angle. The voltage induced in one stator winding is in quadrature to the voltage in
the other winding. Quadrature refers to the 90o phase relationship between the signals of the two
windings. The output ratio of the two stator windings signals is proportional to the absolute
angular position (arc-tangent of the ratio). An electronic circuit, the resolver to digital converter
(RDC), is normally used to convert the conditioned resolver signal to a digital output that can be
read by a computer.
Encoders are fabricated in both optical and magnetic configurations. The most basic encoder
contains a rotating disk that interrupts transmission between a transmitter and a receiver. With an
optical encoder, the optical source is typically a Light Emitting Diode (LED) and the receiver a
photo detector. The disk has coded patterns of transparent and opaque sectors that interrupt the
light measured by the photo detector. The number of counts (pulses) obtained as the disk rotates
is a measure of the angular position. With a magnetic encoder, the LED is replaced with a
magnet, the photo detector by a magnetic pick-up sensing element, and the disk is replaced by a
rotating disk, similar to a gear, made of ferrous metal. As the gear rotates, the teeth disturb the
magnetic flux emitted by the permanent magnet causing the flux field to expand and collapse.
These changes are again sensed as pulses by the magnetic pick-up detector. The simplest and
least expensive encoders are incremental. These devices do not provide an absolute measure of
angular position as with the resolver. They have to be ‘homed’ periodically to obtain as estimate
of absolute position and will lose the position reference upon power reset. The most common
type of incremental encoder has two output channels that sense position. Two code tracks,
referred to as channel A and channel B, have sectors positioned 90 deg out of phase that provide
quadrature signals that can be used to detect position and direction of rotation. Each channel
provides N counts per revolution (usually a square wave TTL level). Shifting the signals from
the two channels by a quarter of a cycle enables the direction of rotation to be determined based
upon which channel is leading the other. The shift also increases resolution as each encoder cycle
can be divided into four quarters each called a quadrature count. An encoder with N cycles per
revolution produces 4N quadrature counts per revolution. Resolution less an arc-second can be
obtained with interpolation electronics/software. Optical encoders normally use a glass substrate
for the rotating disk, which makes them less desirable for high disturbance environments.
There also are absolute encoders which are normally larger and have more complex disk patterns
containing 4-6 tracks. They generate a unique word (i.e. BCD or gray code) for every angular
position of the shaft. Magnetic encoders also come in both absolute and incremental versions.
They normally have less resolution than optical encoders but are more robust in a high
disturbance environment. Other types of position sensors sometimes used for rotary angular
position measurement include potentiometers, rotary and linear variable differential
transformers. However these devices normally provide only a limited angle measurement range
as opposed to the resolver or encoder. They do have one advantage in that they can generate a
voltage directly proportional to angle requiring only a scale factor for conversion.
Velocity or angular rate can be measured or derived from position. Many resolver RDC cards as
well as encoder conversion circuits can provide an estimate of velocity. Similarly it can be
determined by differentiation of the position signal. If performed digitally at a high sample rate
relative to the bandwidth of the rate signal; a good rate estimate can often be generated. A
tachometer can also be used to measure rate. The analog tachometer resembles a small motor
however the gauge of the wire is very fine. It is effectively a motor in reverse. As the shaft is
turned by a motor it generates a voltage proportional to the angular rate requiring only a scale
factor for conversion.
All the devices described have an associated frequency dependent bandwidth which is a function
of the sensor as well as the conversion process. In a detailed design this must be accounted for. If
the bandwidth of the feedback sensor is high relative to the bandwidth of the feedback control
loop, it will have minimal impact on the response. If not, lead compensation may be required. As
discussed, each device has a unique method of measuring angle and the actual output may be
volts, counts, etc. However the feedback path is scaled such that it provides a signal in the same
units as the command input and is therefore a unity feedback path. In the examples that follow,
the position feedback sensor is assumed to be an ideal sensor with effectively infinite bandwidth
and scaled to unity feedback gain.
9.3 Motion Control Feedback Loop Analysis: A position feedback control loop is shown in
Figure 12. It uses a current feedback servo amplifier.
TD
+
Pos Cmd In(s) + TM + 1 rate(s) 1 pos(s)
Σ C(s) KA KT Σ
Js s
-
Control Servo Motor Load
Compensator Amplifier
KSR FRES(s)
Figure 12 Block Diagram for a Motion Control Feedback Loop with Current Feedback Servo
Amp
The constants and control compensator transfer function are given as:
• KT=0.1 in-lb/amp
• KA=0.5 amp/volt
• C(s)=2*pi*40*KS*2*pi*160*(s+2*pi*16)/(s+2*pi*160) volt/deg
• L(s)=1/(J*s2) ; J=0.0001 in-lb-sec2
• KSR *FRES(s) = 1 (deg/deg) per assumption of ideal sensor
• KS=J/(KA*KT)
This is a lead compensator with a zero at 16 Hz to shape the loop and a roll off pole at 160 Hz
for noise suppression. There are already two integrators in the loop due to the physical dynamics
of converting acceleration to position; which also means this is a Type 2 servo loop. There are
two scaling constants, one in the forward path and the other in the feedback path. The scaling
constant in the feedback path provides for unity gain feedback or KSR*FRES=1. The scaling
constant in the forward path cancels the motor drive and plant scaling parameters and allows the
control compensator to effectively set the loop bandwidth in the analysis. The open loop transfer
function is given by:
K A ⋅ KT
⋅ 2 ⋅ π ⋅ 40 ⋅ 2 ⋅ π ⋅ 160 ⋅ ( s + 2 ⋅ π ⋅ 16)
K A ⋅ KT J
OLTF ( s ) =
J ⋅ s2 ( s + 2 ⋅ π ⋅ 160)
2 ⋅ π ⋅ 40 ⋅ ( s + 2 ⋅ π ⋅ 16) 2 ⋅ π ⋅ 160
= ⋅
s2 s + 2 ⋅ π ⋅ 160
It can be seen from the Bode plot in Figure 13 that the gain cross over frequency is at ~40 Hz.
The phase margin is about 54° with an infinite gain margin. Closed loop response shown solid
green line, with unity gain to ~40 Hz and some minor closed loop peaking. The -3 dB BW is 60
Hz.
closed loop
response
phase
margin
The compliance plot of a disturbance acceleration (or torque as A=T/J) input to the control loop
acceleration output is shown in Figure 14 and effectively provides -16 dB of rejection at 10 Hz.
Rate Loop
KST FTAC(s)
Rate
Rate Feedback
Sensor
Scaling
Position Loop
KSR FRES(s)
The constants are the same as for the previous design however the control compensator transfer
functions have been modified as (dps-degrees per second):
• KT=0.1 in-lb/amp
• KA=0.5 amp/volt
• CR(s)=2*pi*100*KS*2*pi*400*(s+2*pi*35)/[s*(s+2*pi*400)] volt/dps
• KS=J/(KA*KT)
• CP(s)=2*pi*20*2*pi*160*(s+2*pi*10)/[s*(s+2*pi*160)] volt/dps
• L(s)=1/(J*s2) ; J=0.0001 in-lb-sec2
• KST*FTAC(s) = 1 (dps/dps) per assumption of ideal sensor
• KSR*FRES(s) = 1 (deg/deg) per assumption of ideal sensor
•
Both compensators now have the form of proportional plus integral compensators cascaded with
a low pass roll off filter. The transfer function for the inner rate loop from the rate command
input to the rate output is given by:
K A ⋅ KT
⋅ CR ( s )
rate( s ) = J ⋅ s ⋅ rate cmd ( s ) +
1
⋅
1
⋅ TD ( s )
K A ⋅ KT ⋅
J ⋅ s 1 + A KT C ( s )
K
1+ CR ( S )
J ⋅s J ⋅s
R
K A ⋅ KT
ROLTF ( s ) = ⋅ CR ( s )
J ⋅s
K ⋅ K K ⋅ 2 ⋅ π ⋅ 100 ⋅ 2 ⋅ π ⋅ 400 ⋅ (s + 2 ⋅ π ⋅ 35)
= A T⋅ S
J ⋅s s ⋅ ( s + 2 ⋅ π ⋅ 400)
2 ⋅ π ⋅ 100 ⋅ 2 ⋅ π ⋅ 400 ⋅ ( s + 2 ⋅ π ⋅ 35)
=
s 2 ⋅ ( s + 2 ⋅ π ⋅ 400)
A Bode plot of the rate open loop gain and phase is shown in Figure 16.
phase
margin
The gain crossover frequency is 100 Hz, the PM=56.8° and the GM is infinite; effectively this
should be a well behaved loop with a fast response. The closed loop response is shown in green.
The outer position loop can be derived from the rate loop noting that rate(s) = s*pos(s) and rate
cmd = CP(s)*(pos cmd in(s) – pos(s)). Using these relationships the expression for the position
loop can be expressed as:
1
POLTF ( s ) = ⋅ RCLTF ( s ) ⋅ CP ( s )
s
2 ⋅ π ⋅ 20 ⋅ 2 ⋅ π ⋅ 160 ⋅ ( s + 2 ⋅ π ⋅ 10)
= RCLTF ( s )
s 2 ⋅ ( s + 2 ⋅ π ⋅ 160)
It can be seen from Figure 16 that over the position loop bandwidth the closed rate loop
magnitude is ~1, however there is a small phase lag contribution from this loop. The Bode plot
for the position loop is shown in Figure 17 which indicates the gain crossover frequency is 24
Hz, the PM is 54°, the GM is 13 dB, and the phase crossover is 90 Hz.
phase
margin
-180
gain
margin
1 1
PCOMP ( s ) = ⋅
J ⋅ s 1 + 1 ⋅ ROLTF ( s ) ⋅ (s + C ( s ) )
2
P
s
There are several advantages to the inner/outer loop design. The inner rate loop provides a
damping effect for the position loop response. If positioning is implemented with a sensor such
as a camera (a simple model being the outer loop summing junction) to track a target, the loop is
referred to as the track loop. Using the inner/outer loop architecture allows the track sensor or
camera to operate over lower bandwidth reducing noise on the track signal while the higher
bandwidth rate loop primarily rejects disturbances. Actually the effective gain and thereby
disturbance rejection is a function of the product of the open loop gain for both loops, but the
inner rate loop gain normally dominates. The compliance curve for this design is shown in
Figure 18. Comparing the rejection at 10 Hz with the compliance for the first example shown in
Figure 14, this design provides ~5x (16 dB vs 30 dB) the rejection of the single loop design.
10 Digital Control: The majority of control algorithms today are implemented in an embedded or
digital signal processor. Signals to be measured are sampled at a defined rate and commands to
control the plant or load are transmitted at the same rate. The motion control examples discussed
previously will be used to illustrate the digital design procedure. This sample data control
configuration is illustrated for the Motion Control Example 1 configuration in Figure 19. The
block diagram is modified to include sample functions which are analog to digital converters
(ADC) or digital to analog converters (DAC) that sample signals or generate commands at a
specified ΔT time interval. Mathematically these devices can be modeled as zero order hold
(ZOH) functions which sample an input or apply an output at a specified time increment; holding
that value until the next time increment. Inherent with this approach is internal sampling within
the processor.
TD
Computer
internal sampling
ΔT ΔT +
+ TM + 1 rate(s) 1 pos(s)
Σ C(z) KA KT Σ
Pos Cmd In(z) - DAC Js s
ΔT
KSR FRES(s)
ADC
With sampling, the infinite continuous frequency spectrum is mapped to a spectrum whose
maximum frequency is half the sampling frequency per Nyquist’s theorem. So the compensator
C(s) must be converted to a digital format; transforming it from a continuous frequency
dependent function into the sampled frequency spectrum limited at half the sampling frequency.
Many textbooks are available on the theory of sample-data systems as is an excellent Suncam
Course EE 060 “Converting Feedback Systems from Analog to Digital Control”. The z-transform
is often used to represent the frequency response of transfer functions in the sample data
spectrum. The bilinear transformation with frequency pre-warping is one method for
transforming a transfer function in the s-domain to one in the z-domain. For a specified
continuous transfer function G(s), the discrete equivalent can be determined from:
G(z) = G ( s ) | 2 z −1
s=
∆T z +1
Frequency pre-warping tries to compensate for the frequency distortion that occurs when
mapping the infinite continuous frequency spectrum into a sample limited frequency spectrum
using this transformation. Critical frequencies in the continuous domain are modified as:
1
fsampled = tan(π ⋅ f continuous ⋅ ∆T )
π ⋅ ∆T
As an example, the motion control example 1 compensator C(s) was given by:
K ⋅ K 2 ⋅ π ⋅ 40 ⋅ 2 ⋅ π ⋅ 160 ⋅ ( s + 2 ⋅ π ⋅ 16)
C ( s) = A T ⋅
J ( s + 2 ⋅ π ⋅ 160)
The sampling frequency is assumed to be 4000 Hz (ΔT=0.00025 sec). There are three critical
frequencies, when pre-warped become:
2 ⋅ π ⋅ 40 ⇒ ωS 1 = 2 ⋅ π ⋅ 39.986
2 ⋅ π ⋅ 16 ⇒ ωS 2 = 2 ⋅ π ⋅ 15.999
2 ⋅ π ⋅ 160 ⇒ ωS 3 = 2 ⋅ π ⋅ 159.165
Because of the high sample rate relative to the critical frequencies, none really change
significantly from their continuous frequency equivalent. In the z-domain using the bilinear
transform the compensator is given by:
z −α
C ( z ) = C (s) | 2 z −1 = K0 ⋅
s=
∆T z +1 z −β
∆T ⋅ ωS 2 ∆T ⋅ ωS 2 ∆T ⋅ ωS 3
1 + 1− 1−
K A ⋅ KT
with K 0 = ⋅ ωS1 ⋅ ωS 3 ⋅ 2
; α=
2 ; β= 2
J ∆T ⋅ ω ∆T ⋅ ωS 2 ∆T ⋅ ωS 3
1 + S3
1+ 1+
2 2 2
For digital implementation, this can be expressed as:
1 − α ⋅ z −1
C ( z −1 ) = K 0
1 − β ⋅ z −1
Finally in digital format, for a compensator input X at sample interval k, the output Y at k can be
expressed as:
Y (k ) = α ⋅ Y (k − 1) + K 0 ⋅ ( X (k ) − α ⋅ X (k − 1))
The Bode plot for the sampled system is shown in Figure 20 and can be compared to Figure 13
for the continuous time version. Due to the sampling, the phase margin is reduced to 51° while
the gain margin is no longer infinite but ~28 dB.
phase
margin
gain
margin
The motion feedback control loop for example 2 with rate plus position feedback, implemented
as a sampled controller, is shown in Figure 21.
TD
Computer
internal sampling internal sampling
ΔT ΔT ΔT +
+ TM + 1 rate(s) 1 pos(s)
Σ +
CP(z) Σ CR(z) KA KT Σ
Pos Cmd In(z) - DAC Js s
rate cmd(s) -
Position Control Rate Control Servo Motor Load
Compensator Compensator Amplifier
ΔT
Rate Loop
KST FTAC(s)
ADC
Figure 21 Sample Data Motion Control with Position and Rate Feedback
The rate open loop transfer function and control compensator were given by:
K A ⋅ KT
ROLTF ( s ) = ⋅ CR ( s )
J ⋅s
K ⋅ K K ⋅ 2 ⋅ π ⋅ 100 ⋅ 2 ⋅ π ⋅ 400 ⋅ (s + 2 ⋅ π ⋅ 35)
= A T ⋅ S
J ⋅s s ⋅ ( s + 2 ⋅ π ⋅ 400)
2 ⋅ π ⋅ 100 ⋅ 2 ⋅ π ⋅ 400 ⋅ ( s + 2 ⋅ π ⋅ 35)
=
s 2 ⋅ ( s + 2 ⋅ π ⋅ 400)
where
2 ⋅ π ⋅ 100 ⋅ 2 ⋅ π ⋅ 400 ⋅ ( s + 2 ⋅ π ⋅ 35)
CR ( s ) =
s ⋅ ( s + 2 ⋅ π ⋅ 400)
Using the same bilinear transformation with frequency pre-warping as described for the last
example and the sampling frequency of 4000 Hz (ΔT=0.00025 sec) the three critical frequencies,
when pre-warped are:
2 ⋅ π ⋅100 ⇒ ωS 1 = 2 ⋅ π ⋅ 99.795
2 ⋅ π ⋅ 35 ⇒ ωS 2 = 2 ⋅ π ⋅ 34.99
2 ⋅ π ⋅ 400 ⇒ ωS 3 = 2 ⋅ π ⋅ 387.567
Again because of the high sample rate relative to the critical frequencies, only the frequency at
400 Hz changed slightly from their continuous frequency equivalent. In the z-domain using the
bilinear transform, the compensator is expressed as:
z −αR z +1
CR ( z ) = CR ( s) | = K0R ⋅ ⋅
z − 1 z − β R
2 z −1
s=
∆T z +1
∆T ⋅ ωS 3 ∆T ⋅ ωS 1 ∆T ⋅ ωS 3
1 − 1−
K ⋅K ∆T ⋅ ωS 1
with K0R = A T ⋅ ωS 2 ⋅ 1 + ⋅ 2
; αR =
2 ; βR = 2
J 2 1 + ∆T ⋅ ω ∆T ⋅ ωS 1 ∆T ⋅ ωS 3
S3
1+ 1+
2 2 2
The Bode plot for the rate feedback loop is shown in Figure 22. The phase margin is ~48° and
the gain margin 22 dB. The plot of the higher bandwidth loop also shows the effect of the 4000
Hz sample function.
sampler hold
function
phase
margin
-180
closed
gain
loop
margin
The compensator for the position feedback loop was given by:
2 ⋅ π ⋅ 20 ⋅ 2 ⋅ π ⋅ 160 ⋅ ( s + 2 ⋅ π ⋅ 10)
CP ( s ) =
s ⋅ ( s + 2 ⋅ π ⋅ 160)
The same process is followed again with:
2 ⋅ π ⋅ 20 ⇒ ωS 1 = 2 ⋅ π ⋅ 19.998
2 ⋅ π ⋅ 10 ⇒ ωS 2 = 2 ⋅ π ⋅ 9.999
2 ⋅ π ⋅ 160 ⇒ ωS 3 = 2 ⋅ π ⋅ 159.165
The position compensator in the z-domain can then be expressed as:
z −αP z +1
CP ( z ) = CP (s) | = K0P ⋅ ⋅
z − 1 z − β P
2 z −1
s=
∆T z +1
∆T ⋅ ωS 3 ∆T ⋅ ωS 1 ∆T ⋅ ωS 3
1− 1−
∆T ⋅ ωS 1
with K0P = ωS 2 ⋅ 1 + ⋅ 2
; αP =
2 ; βP = 2
2 1 + ∆T ⋅ ωS 3 1+
∆T ⋅ ωS 1
1+
∆T ⋅ ωS 3
2 2 2
The Bode plot for the position plus rate feedback control is shown in Figure 23. The phase
margin is 36° and gain margin 12.5 dB. There is also significant closed loop peaking. Additional
compensation should be applied to the loop to improve the response.
phase
margin
-180
Figure 23 Bode plot for Sample Data Motion Control System; Position and Rate Feedback Loops
11 Summary: This completes course material. The topics covered began with a description of the
basic block diagram in section 2. The relationships between time and frequency domain
representations of the block diagram elements were discussed in section 3 followed by the key
feedback relationships derived from the block diagram algebra in section 4. Control loop stability
and methods to determine stability margins were described in section 5 followed by a discussion
of specifying control loop performance in section 6. A couple of control loop design methods
were provided in section 7. The basic theory was then applied to two examples; a home heating
system in section 8 and motion control applications in section 9. Converting to a digital sample
data controller was discussed in section 10; as related to the motion control example in section 9.