Lecture 13 Ece4330t
Lecture 13 Ece4330t
Lecture 13
Laplace Transform
Application to Feedback Control and System Realization
Prof. Mohamad Hassoun
Motor Control
Consider the problem of controlling a dc motor in such a way that its
shaft’s angle at time 𝑡 is determined by the value of the input signal 𝑓(𝑡).
For example, if we set 𝑓(𝑡) = 8, then we expect the output angle 𝑦(𝑡) =
𝜃(𝑡) to quickly change and stabilize at 8o. Ideally, we would like the
motor angle to be equal to the input signal [i.e., 𝑦(𝑡) = 𝑓(𝑡)] for all time.
In practice, we would expect 𝑦(𝑡) to quickly and smoothly track 𝑓(𝑡).
𝑑 2 𝜃 (𝑡 )
Ampere’s Law: 𝑖(𝑡) = 𝑐2 𝐽 𝑑𝑡 2
1 1 1
1 𝜃0
( ) −1
𝑦 𝑡 =𝐿 { } = 𝜃0 𝐿−1 {− 64 + 82 + 64 }
𝑠(𝑠 + 8) 𝑠 𝑠 𝑠 𝑠+8
1 𝑡 1 −8𝑡
= 𝜃0 {− + + 𝑒 } 𝑢(𝑡)
64 8 64
𝑡
which diverges for large 𝑡, lim 𝑦(𝑡) = ∞. (Can you explain the 8 term?)
𝑡→∞
We want 𝑦(𝑡) to track 𝑓(𝑡); i.e. lim 𝑦(𝑡) = 𝜃0 . So, we employ negative
𝑡→∞
feedback with amplification (𝐾 > 0) as shown below.
Convergence occurs when 𝑓(𝑡) − 𝑦(𝑡) = 0. So, this strategy changes the
signal that drives the motor to the error signal 𝑓(𝑡) − 𝑦(𝑡). Thus, when
𝑦(𝑡) tracks 𝑓(𝑡), the input driving the motor is 0 Volt and the motor
should stop spinning (what is the difference between zero input voltage
and open input terminals on the motor?). However, if 𝑦(𝑡) < 𝑓 (𝑡), then
the error signal is positive and is going to spin the motor in the direction
that increases 𝑦(𝑡). On the other hand, if 𝑦(𝑡) > 𝑓 (𝑡) the error signal is
negative and it will attempt to spin the motor in the opposite direction [the
direction that decreases 𝑦(𝑡)]. So, in both cases, the magnitude of the error
signal driving the motor is reduced. The gain 𝐾 amplifies the error signal.
As this goes on, one should keep in mind the loaded motor’s inertia that
“resists” the motor’s acceleration/deceleration.
The stability of the above (closed loop) system is determined by the poles
of its transfer function. The following is a derivation of the transfer
function for the closed loop system (refer to the previous figure),
𝑌(𝑠) 𝐾𝐻 (𝑠)[𝐹 (𝑠) − 𝑌(𝑠)]
𝐺 (𝑠) = =
𝐹 (𝑠) 𝐹 (𝑠)
𝑌(𝑠)
𝐺 (𝑠) = 𝐾𝐻 (𝑠) − 𝐾𝐻 (𝑠)
𝐹 (𝑠)
𝑌 (𝑠 )
Noting that 𝐺 (𝑠) = 𝐹(𝑠), the above equation becomes
Case (𝑖𝑖𝑖): 16 − 𝐾 > 0 (i. e. , 0 < 𝐾 < 16) → 𝑠1,2 are real and are located
in the LHP. This leads to the overdamped, step-response:
Your turn: Generate the root locus plot for the feedback system with gain
𝐾, where the open-loop transfer function.
𝑠 2 + 2𝑠 + 4
𝐻 (𝑠) =
𝑠(𝑠 + 4)(𝑠 + 6)(𝑠 2 + 1.4𝑠 + 1)
Solution:
Your turn: Solve for the above result analytically; i.e., show that:
80
𝑦𝑧𝑠 (𝑡) = 𝐿−1 { 2 }
𝑠(𝑠 + 8𝑠 + 80)
Your turn: Show that the following two expressions are equivalent,
𝑒 𝑥 +𝑒 −𝑥 𝑒 𝑥 −𝑒 −𝑥
Hint: cosh(𝑥 ) = , sinh(𝑥 ) =
2 2
The following is the closed-loop system response to a piece-wise linear
input signal for two different gain values (𝐾 = 7 and 80).
Show that the overall system transfer function (with feedback) 𝐻𝐹𝐵 (𝑠) is given by
𝑌(𝑠) 𝐻 (𝑠)
𝐻𝐹𝐵 (𝑠) = =
𝐹 (𝑠) 1 − 𝐻 (𝑠)𝐺(𝑠)
Your turn: Employ the above result to determine the overall transfer function
𝑌(𝑠)
𝐻 (𝑠) = for the following systems.
𝐹(𝑠)
System Interconnection
Consider two LTI systems whose unit-impulse responses are ℎ1 (𝑡) and
ℎ2 (𝑡) [or, equivalently, transfer functions 𝐻1 (𝑠) and 𝐻2 (𝑠)]. If we cascade
the two systems (does not matter which one comes first) then the overall
unit-impulse response would be the convolution ℎ(𝑡) = ℎ1 (𝑡)*ℎ2 (𝑡); and
the overall transfer function would be the product 𝐻 (𝑠) = 𝐻1 (𝑠)𝐻2 (𝑠) (as
long as the impedance of the second system is very high, so it would not
load the first system). This is illustrated in the following figure.
Therefore, the overall system can be thought of one having the unit-
impulse response ℎ(𝑡) = ℎ1 (𝑡) ∗ ℎ2 (𝑡).
Physical System Realization of dc Motor with Controller
Motorcontrol_movie.
MOV
Watch the movie of the controller in action:
Realization of Transfer Functions Using Electric Circuits
Differentiator Circuit
Let us say we are interested in realizing the transfer function 𝐻 (𝑠) = 𝑠, or
𝑉𝑜 (𝑠) = 𝑠𝑉𝑖𝑛 (𝑠)
Taking the inverse Laplace transform of this equation leads to
𝑑𝑣𝑖𝑛 (𝑡)
𝑣0 (𝑡) =
𝑑𝑡
The following is an operational amplifier (op-amp) circuit that
differentiates its input:
0 − 𝑉0 0 − 𝑉𝑖𝑛
KCL at 1: 0 + + 1 =0
𝑅
𝑠𝑐
Integrator Circuit
An op-amp circuit who’s output is given by,
−1 𝑡
𝑣𝑜 (𝑡) = ∫ 𝑣𝑖𝑛 (𝜏)𝑑𝜏 − 𝑣𝑜 (0− )
𝑅𝐶 0−
is shown below.
Your Turn: Derive the equation from the Laplace circuit, where 𝑣𝑜 (0− )
is the initial voltage across the capacitor.
The transfer function for this circuit is (set 𝑣𝑐 (0− ) = 0 and use the
integration property of the Laplace transform),
1
𝑉𝑜 (𝑠) − 𝑅𝐶
𝐻 (𝑠) = =
𝑉𝑖𝑛 (𝑠) 𝑠
and if 𝑅𝐶 = 1, the above expression becomes,
1
𝐻 (𝑠) = −
𝑠
Refer to the last part of this lecture for a synthesis method of a passive
1
circuit having a transfer function of the form 𝐻 (𝑠) = 𝐷(𝑠).
Realization of the dc Motor’s Closed Loop System
Employing the component circuits introduced above, we may formulate a
block diagram for the complete feedback control system as shown below.
It should also be noted here that the typical operational amplifier can’t
drive the motor directly, because a dc motor requires relatively high
currents (especially, when it is stalled). So, in practice, a power amplifier
(of unity voltage gain) must be used between the gain amplifier and the
motor.
The poles of the closed loop system are the solution to the polynomial
equation
𝑠 3 + 0.739𝑠 2 + 2.072𝑠 + 0.1774 = 0
The closed loop, pitch angle zero-state response is shown in the following
plot. After as brief oscillatory period, the steady-state angle, 𝜃𝑠𝑠 (𝑡),
asymptotically approaches the 3𝑜 elevator deflection angle.
Your turn: Repeat the above aircraft pitch angle analysis employing a
gain 𝐾, which results in the closed-loop transfer function
𝐾𝐻 (𝑠)
𝐺 (𝑠) =
1 + 𝐾𝐻 (𝑠)
In practice, the gain block, 𝐾, is not appropriate for controlling the system
at hand and it must be replaced with a controller having a rational transfer
function, 𝐻𝑃𝐼𝐷 (𝑠). A relatively simple type of controller that is common in
the industry is known as PID controller. Refer to the appendix for an
introduction and an example.
Active Analog (op-amp) Circuit Realization of Transfer Functions
Next, we design an active circuit realization of the linear system,
𝑌 (𝑠) 1
𝐻 (𝑠) = =
𝐹 (𝑠) 𝑠 + 8
The above transfer function can be expressed as
𝑠𝑌(𝑠) + 8𝑌(𝑠) = 𝐹 (𝑠)
Taking the inverse Laplace transform (recall that the initial conditions are
assumed to be zero here) we get,
𝑦̇ (𝑡) + 8𝑦(𝑡) = 𝑓 (𝑡)
or
𝑦̇ (𝑡) = 𝑓(𝑡) − 8𝑦(𝑡)
Integrating the above equation leads to,
𝑡
𝑦(𝑡) = ∫ (𝑓 (𝜏) − 8𝑦(𝜏))𝑑𝜏
0
We could have also arrived at the above block diagram by working in the
frequency domain:
𝑠𝑌 (𝑠) + 8𝑌(𝑠) = 𝐹 (𝑠) → 𝑠𝑌(𝑠) = 𝐹 (𝑠) − 8𝑌(𝑠)
1
or, 𝑌(𝑠) = 𝑠 [𝐹 (𝑠) − 8𝑌(𝑠)]
Had we started with the formulation
1
𝑦(𝑡) = [𝑓(𝑡) − 𝑦̇ (𝑡)]
8
the realization would have been given as shown below (note differentiator)
2𝑠+5
Next, we illustrate this realization approach for 𝐻(𝑠) = 𝑠2 +4𝑠+10.
𝑋 (𝑠 ) 1 𝑌 (𝑠 )
Here, 𝐻1 (𝑠) = 𝐹(𝑠) = 𝑠2 +4𝑠+10 and 𝐻2 (𝑠) = 𝑋(𝑠) = 2𝑠 + 5
and we may express the input/output relation for each subsystem as,
respectively,
(𝑠 2 + 4𝑠 + 10)𝑋(𝑠) = 𝐹(𝑠) and 𝑌(𝑠) = (2𝑠 + 5)𝑋(𝑠)
The following block diagram represents the first subsystem in terms of
1
integrator blocks, 𝑠
Your turn: Use Simulink to generate (on a virtual scope) the zero-state
4𝑠+28
response of the system 𝐻(𝑠) = 𝑠2 +6𝑠+5 to the input 𝑓(𝑡) = 𝑢(𝑡) − 𝑢(𝑡 − 2).
Verify your result by solving for the response (analytically) employing the
Laplace transform and then plot it.
Simulink Answer:
The direct (differential equation based), canonical and parallel realizations
by no means lead to the use of the smallest number of op-amps. There are
circuits (such as the Sallen-Key, see below) that are capable of realizing a
second-order transfer function using only one op-amp.
1
𝑅1 𝑅2 𝐶1 𝐶2
𝐻 (𝑠) = 1 1 1
𝑠2 + ( + )𝑠 +
𝑅1 𝐶1 𝑅2 𝐶1 𝑅1 𝑅2 𝐶1 𝐶2
1 1
−√2 < −√2 < 0 < √2 < √2.
It can be shown that when 𝐷(𝑠) = 𝑝(𝑠) + 𝑞(𝑠) is Hurwitz, then the
1
transfer function 𝐻 (𝑠) = 𝐷(𝑠) can be realized with a passive 𝐿𝐶 ladder
network terminated by a 1Ω resistor. In this case, the output impedance
𝑍(𝑠) (the impedance of the circuit looking into the unterminated circuit
𝑝 (𝑠 )
output) can be shown to be 𝑍(𝑠) = . The synthesis method is
𝑞 (𝑠 )
illustrated with the following example.
1
Consider the transfer function 𝐻(𝑠) = 𝑠3 +2𝑠2 +2𝑠+1. We showed above that
𝑝 (𝑠 ) 𝑠 3 +2𝑠
𝐷(𝑠) is Hurwitz. Now, we form the ratio 𝑍𝑎 (𝑠) = = 2𝑠2 +1 and
𝑞 (𝑠 )
express it as a continued fraction in the form,
1
𝑍𝑎 (𝑠) = 𝑘𝑜 𝑠 + 1
𝑙0 + 1
𝑘1 + 1
𝑙1 +
𝑘2
..
𝑒𝑡𝑐
Now we can view this impedance (looking into the output terminals) as a
1 4
series inductor 𝐿1 = in series with the parallel combination of a 𝐶 =
2 3
3
capacitor and an 𝐿2 = 2 inductor. As shown in the figure below.
Since the last component (on the left) in the circuit is an inductor, the rule
is to break the connection and insert a voltage source. Finally, the circuit
is completed by applying a 1Ω load resistor to the output terminal. The
circuits output is then the voltage across the resistor. The complete circuit
is shown below.
3𝑠 3 3
( + ) 𝐼1 (𝑠) − 𝐼2 (𝑠) = 𝐸 (𝑠)
2 4𝑠 4𝑠
3 𝑠 3
− 𝐼1 𝑠 + (1 + + ) 𝐼2 (𝑠) = 0
( )
4𝑠 2 4𝑠
1
𝐻 (𝑠) =
𝑠 3 + 2𝑠 2 + 2𝑠 + 1
Alternatively, we could have started with the reciprocal impedance 𝑍𝑎 (𝑠),
𝑝(𝑠) 2𝑠 2 + 1 1 1
𝑍𝑎 (𝑠) = = = = 1
𝑞(𝑠) 𝑠 3 + 2𝑠 𝑠 + 4 1 1 1 +4
1
1
2 𝑠+3 𝑠 𝑠+3
3 𝑠 2 3 𝑠
2 2
Now we can view this impedance (looking into the output terminals) as a
1 3
shunt capacitor 𝐶1 = 2 in parallel with the series combination of a 𝐶1 = 2
4
capacitor and an 𝐿 = 3 inductor. As shown in the figure below.
Since the last component (on the left) in the above circuit is a capacitor,
the rule is to apply the input as a current source in parallel with that
capacitor. Finally, the circuit is completed by applying a 1Ω load resistor
to the output terminal. The output signal is the voltage across the resistor.
The complete circuit is shown below.
We can verify our resulting circuit by applying nodal analysis to the 𝑠-
domain circuit (setting all initial energy to zero) to obtain,
3𝑠 3 3
( + ) 𝑉1 (𝑠) − 𝑉2 (𝑠) = 𝐼𝑔 (𝑠)
2 4𝑠 4𝑠
3 𝑠 3
− 𝑉1 (𝑠) + (1 + + ) 𝑉2 (𝑠) = 0
4𝑠 2 4𝑠
𝑉2 (𝑠)
Solving for 𝐻(𝑠) = results in the desired transfer function,
𝐼𝑔 (𝑠)
1
𝐻 (𝑠) =
𝑠 3 + 2𝑠 2 + 2𝑠 + 1
P accounts for present values of the error. For example, if the error is large
and positive, the control output will also be large and positive.
I accounts for past values of the error. For example, if the output is not
sufficiently strong, the integral of the error will accumulate over time, and the
controller will respond by applying a stronger action.
D accounts for possible future trends (prediction) of the error, based on its
current rate of change.
In practice (and in the built-in Simulink “PID Controller” block), the derivative
term is problematic (becomes very large) when the signal is noisy and/or has sharp
variations. For this reason, the differentiator component is disabled for high
frequencies by passing its output through a low-pass filter having transfer function
𝑁 1
= 1 , with high cutoff frequency (𝑁 >> 1). This allows us to express the
𝑠+𝑁 𝑠+1
𝑁
PID controller as
1 𝑠
𝐻𝑃𝐼𝐷 (𝑠) = 𝑃 + 𝐼 + 𝐷 1
𝑠 𝑠+1
𝑁
A basic block diagram for the feedback controlled system utilizing a PID controller
is shown below
or equivalently,
The effects of varying the PID controller parameters are nicely captured in the
following animation: https://en.wikipedia.org/wiki/File:PID_Compensation_Animated.gif
The effects of independently increasing the PID controller parameters on the
controlled system behavior are summarized in the following table.
There are other variations of the Zeigler-Nichols heuristic PID settings that are
designed to meet certain desirable performance criteria. Such settings are
summarized in the following table and apply to the PID controller:
1 𝑠 1 𝑇𝑑 𝑠
𝐻𝑃𝐼𝐷 (𝑠) = 𝑃 + 𝐼 + 𝐷 1 = 𝐾𝑝 (1 + +1 )
𝑠 𝑠+1 𝑇𝑖 𝑠 𝑠+1
𝑁 𝑁
1 1 1
(𝑁 + 𝑇𝑑 ) 𝑠 2 + (𝑁𝑇 + 1) 𝑠 + 𝑇𝑖
𝑖
= 𝐾𝑝 1
𝑠2 + 𝑠
𝑁
The following is a PID controller simulation for the zero-state response of the
commercial aircraft system discussed earlier in this lecture [with 𝑓 (𝑡) = 3𝑢(𝑡)].
The PID parameters were determined using the classical Ziegler-Nichols method,
with the aid of Simulink.
Your turn: Employ the (classic) Ziegler-Nichols method and Simulink to
determine the PID coefficients and generate the above plot. Derive the overall
𝑌(𝑠)
closed-loop transfer function 𝐺 (𝑠) = and determine its poles and zeros for the
𝐹(𝑠)
two PID controllers: (𝑃1 , 𝐼1 , 𝐷1 ) = (0.6,0.24,0.375) and (𝑃2 , 𝐼2 , 𝐷2 ) =
(0.5,0.12,0). Assume 𝑁 = 100. Employ Mathcad to solve for 𝑦𝑧𝑠 (𝑡) [the pitch
angle], when subjected to the step input, 𝑓(𝑡) = 𝑢(𝑡), for both PID controllers. Plot
the two responses on the same graph. Your plot should look like this plot:
Your turn: Generate a root locus plot for the following closed loop system. Sweep
𝐾 from 0 to 200 with 0.5 increments. From the plot, estimate the range of gain
values that lead to a stable system.
𝑠+1
𝐻 (𝑠) =
𝑠(𝑠 − 1)(𝑠 2 + 4𝑠 + 16)
Recall that the root locus is a plot of the trajectory of the poles of the system,
𝐾𝐻 (𝑠)
𝐺 (𝑠) =
1 + 𝐾𝐻 (𝑠)
Ans. 23.4 < 𝐾 < 35.7
Your turn: Show that the transfer function of the following operational amplifier
based circuit is equivalent to that of the PID controller:
1
𝐻𝑃𝐼𝐷 (𝑠) = 𝑃 + 𝐼 + 𝐷𝑠
𝑠
Your turn: Show that the transfer function of the following circuit is equivalent to
that of a PID controller:
1 𝑠
𝐻𝑃𝐼𝐷 (𝑠) = 𝑃 + 𝐼 + 𝐷 1
𝑠 𝑠+1
𝑁
Demonstration:
https://youtu.be/X2ELSFnOlUM
Mini Project
Consider the dc motor with transfer function
1
𝐻(𝑠) =
𝑠(𝑠 + 8)
We have studied the simple negative feedback with error amplification of 𝐾earlier in this
lecture. It was determined that the fastest non-oscillatory unit-step response corresponded to a
gin 𝐾 = 16 (critically damped response). We may view this controller as a PID controller with
gain only (That is a proportional controller or P controller). Employ Simulink to answer the
following:
c. Modify the tuned PID controller obtained in Part 𝑏 by setting the sliders inside the PID
controller menu as shown below, and then display the resulting step-response on the same
plot as before (allowing you to compare the step-responses of your four controllers).
d. Design the Operational Amplifier PID circuit (the bottom circuit, two slides back) so that
it implements the PID controller form Part 𝑎. Assume 𝑅1 = 100KΩ and 𝑁 = 200.
e. Employ Mathcad to determine the transfer function, its poles and the unit-impulse
response for the closed loop system obtained in Part 𝑐.
Mini Project
The Segway people mover can be roughly modeled as a frictionless inverted pendulum on a cart
with the following linear dynamics (assuming small angles):
g 1
y(t ) y (t ) x(t )
L L
Where y(t) = (t) is the angle (in radian) from the vertical, x(t) is the displacement of the cart (in
meters), L is the length (in meters) of the pendulum and g is gravitational acceleration.
a. Derive the transfer function H(s) for the system and show that it is not stable.
K1 s K 2
b. Let K1 and K2 be two positive constants. And let K1 + K2/s = be the transfer
s
function of a controller that is used to stabilize the system (see Figure below). Derive the
transfer function of the closed look system (i.e., the new Y(s)/X(s)).
Use what you have learned so far in ECE 4330 to design, verify (by
simulation using two or more of the following tools: Matlab, Mathcad,
Simulink and Multisim) and build a linear electric circuit that displays and
sustains a perfect circle on an oscilloscope. The circuit must not employ
external signal generators, but it can employ a dc power supply (say 9Volt
batteries). Bring your circuit to your instructor’s office for evaluation (an
oscilloscope will be made available). Also, provide a well-written report.