Control Systems Lab 08 11
Control Systems Lab 08 11
3
CONTENTS CONTENTS
4
List of Figures
5
LIST OF FIGURES LIST OF FIGURES
6
Part I
7
Chapter 1
Background
In control systems, the transfer function is a vital tool that simplifies the analysis of system behavior by
avoiding the need to solve differential equations directly. A transfer function is generally expressed as the
ratio of two polynomials in the complex variable s:
N (s) am sm + · · · + a1 s + a0
H(s) = = (1.1)
D(s) bn sn + · · · + b1 s + b0
Where N (s) and D(s) are the numerator and denominator polynomials, respectively. Factoring these
polynomials allows us to express the transfer function in terms of poles and zeros:
(s − z1 )(s − z2 ) . . . (s − zm )
H(s) = K (1.2)
(s − p1 )(s − p2 ) . . . (s − pn )
Here, zi are the zeros, pi are the poles, and K is the system gain. Understanding the location of poles and
zeros in the s-plane is crucial for analyzing system stability and dynamic behavior.
MATLAB Program
clear all;
clc;
9
Chapter 1 MATLAB code for Control Systems Part-1 1.1 Plotting Pole-Zero Configuration in the s-Plane
Output
The MATLAB script generates a pole-zero plot in the s-plane for the provided transfer function, offering
insights into system stability and dynamic characteristics.
Results:
10
Chapter 1 MATLAB code for Control Systems1.2
Part-1
Determining Transfer Function for a Closed-Loop System
Background
Analyzing complex systems can be simplified by breaking them down into smaller, manageable blocks, each
with its own transfer function. Using block diagram reduction techniques, these blocks can be combined to
determine the overall transfer function of the system.
MATLAB Program
clear all;
clc;
n2 = [5]; % G2: 5
d2 = [1];
n4 = [1]; % H1: 1
d4 = [1];
% Feedback connection
[n7, d7] = feedback(n6, d6, n4, d4);
G_overall = tf(n7, d7, ’inputname’, ’R’, ’outputname’, ’C’);
11
Chapter 1 MATLAB code for Control Systems1.2
Part-1
Determining Transfer Function for a Closed-Loop System
pzmap(G_overall);
Output
The program calculates and visualizes the overall transfer function of a closed-loop system, providing essential
information for understanding the system’s performance.
Results:
12
Chapter 1 MATLAB code for Control Systems Part-1 1.3 Analyzing the Unit Step Response
Background
The transient response of a system, which includes parameters such as rise time, delay time, and maximum
overshoot, is a critical aspect of system analysis. The unit step response is a standard test used to evaluate
these parameters and determine how the system behaves when subjected to a step input.
MATLAB Program
clear all;
clc;
Output
This MATLAB code produces a step response plot and computes important system parameters, helping assess
the system’s transient response and overall performance.
Results:
13
Chapter 1 MATLAB code for Control Systems Part-1 1.4 Time Response to Various Inputs
Objective
To analyze the time response of a system subjected to different input signals, including step, impulse, sinu-
soidal, ramp, and parabolic inputs, using MATLAB.
Background
Time response analysis is fundamental for understanding how a control system reacts to different inputs over
time. By examining the system’s response to various inputs, we can evaluate its stability, accuracy, and overall
behavior.
MATLAB Program
clear all;
close all;
14
Chapter 1 MATLAB code for Control Systems Part-1 1.4 Time Response to Various Inputs
Output
This script generates time response plots for various input signals, allowing for a comprehensive analysis of
the system’s dynamic behavior under different conditions.
Results:
15
Chapter 1 MATLAB code for Control Systems Part-1 1.4 Time Response to Various Inputs
16
Chapter 2
Background:
The root locus technique provides a graphical representation of the possible locations of closed-loop poles as a
system parameter, usually the gain K, is varied. The system’s closed-loop transfer function can be represented
as:
Y (s) KH(s)
= (2.1)
R(s) 1 + KH(s)
where H(s) is the open-loop transfer function. The closed-loop poles are determined by solving the
characteristic equation:
1 + KH(s) = 0 (2.2)
P (s)
Expressing H(s) as H(s) = Q(s) , the characteristic equation becomes:
(s + 10)
H(s) = (2.4)
s(s + 8)(s + 12)(s + 25)
Design a feedback controller using the root locus method that satisfies a 10% overshoot and a 0.5-second
rise time.
MATLAB Code:
s = tf(’s’);
sys = (s + 10) / (s*(s + 8)*(s + 12)*(s + 25));
rlocus(sys);
17
Chapter 2 MATLAB code for Control Systems Part-2 2.1 Root Locus Analysis
Results:
18
Chapter 2 MATLAB code for Control Systems Part-2 2.2 Steady-State Error Analysis
Background:
For a unity feedback system, the transfer function can be written as:
C(s) H(s)
= (2.5)
R(s) 1 + H(s)
The error signal is defined as:
R(s)
E(s) = (2.7)
1 + H(s)
The steady-state error ess can be found using the final value theorem:
sR(s)
ess = lim sE(s) = lim (2.8)
s→0 s→0 1 + H(s)
MATLAB Code:
clc;
clear all;
close all;
h = tf([6], [1 4 6]);
a = step(h);
[y, t] = step(h);
i = length(y);
z = y(i);
c = y(end);
sserror = abs(1 - c);
Results:
19
Chapter 2 MATLAB code for Control Systems Part-2 2.3 Bode Plot Analysis
Background:
Bode plots offer a frequency-domain perspective of a system’s transfer function, displaying both magnitude
and phase as functions of frequency. The Bode plot is advantageous for analyzing stability margins and
understanding the influence of controller parameters on system behavior.
The gain margin (GM) and phase margin (PM) are determined from the Bode plot as follows:
• The gain margin is the amount by which the system gain can be increased before instability occurs. It
is found at the frequency where the phase angle equals −180◦ .
• The phase margin is the additional phase lag required to bring the system to the brink of instability,
identified at the frequency where the magnitude equals 0 dB.
MATLAB Code:
clear all;
clc;
n = [80];
d = [1 12 45 60];
sys = tf(n, d);
w = logspace(-1, 2, 5);
bode(sys);
grid on;
[a, phase] = bode(sys, w);
mag = 20*log10(a);
[G_Margin, P_Margin, w_phase_crossover, w_gain_crossover] = margin(sys);
Gain_Margin_dB = 20*log10(G_Margin);
disp(’Frequency(rad/sec) Magnitude(dB) Phase(degree)’);
for i = 1:5
fprintf(’%f\t\t %f\t\t %f \n’, w(i), mag(i), phase(i));
end
(a) 4
s(1+0.5s)(1+0.08s)
200(s+1)
(b) (s+10)2
200(s+2)
(c) s(s2 +10s+100)
2. The response of a second-order system can be characterized by its damping ratio (ζ), which significantly
affects the system’s stability and performance. The Bode plot provides a graphical representation of the
system’s frequency response, including magnitude and phase information.
In this analysis, we will consider a standard second-order transfer function given by:
20
Chapter 2 MATLAB code for Control Systems Part-2 2.3 Bode Plot Analysis
ωn2
G(s) = (2.9)
s2 + 2ζωn s + ωn2
where ωn is the natural frequency, and ζ is the damping ratio.
We will plot the Bode plot for different values of the damping ratio (ζ = 0, 0.2, 0.4, 0.6, 0.8, 1) to observe
how it influences the system’s response.
The following MATLAB code generates the Bode plot for the specified damping ratios:
1 % Define the natural frequency ( omega_n )
2 omega_n = 1; % Natural frequency ( rad / s )
3
4 % Define the damping ratios to be analyzed
5 zeta_values = [0 , 0.2 , 0.4 , 0.6 , 0.8 , 1];
6
7 % Create a figure for the Bode plots
8 figure ;
9
10 % Loop through each damping ratio and plot the Bode plot
11 for zeta = zeta_values
12 % Define the transfer function for the second - order system
13 num = omega_n ^2; % Numerator ( omega_n ^2)
14 den = [1 , 2* zeta * omega_n , omega_n ^2]; % Denominator ( s ^2 + 2* zeta * omega_n * s
+ omega_n ^2)
15
16 % Create the transfer function
17 sys = tf ( num , den ) ;
18
19 % Plot the Bode plot for the current damping ratio
20 [ mag , phase , w ] = bode ( sys ) ;
21 mag = squeeze ( mag ) ; % Squeeze to remove singleton dimensions
22 phase = squeeze ( phase ) ;
23
24 % Plot magnitude
25 subplot (2 , 1 , 1) ; % Magnitude plot in the first subplot
26 semilogx (w , 20* log10 ( mag ) ) ; % Convert to dB
27 hold on ;
28
29 % Plot phase
30 subplot (2 , 1 , 2) ; % Phase plot in the second subplot
31 semilogx (w , phase ) ;
32 hold on ;
33 end
34
35 % Customize the magnitude plot
36 subplot (2 , 1 , 1) ;
37 title ( ’ Bode_Plot_of_Second - O r d e r _ S y s t e m _ w i t h _ V a r y i n g _ \ zeta ’) ;
38 xlabel ( ’ Frequency ( rad / s ) ’) ;
39 ylabel ( ’ Magnitude ( dB ) ’) ;
40 legend ( arrayfun ( @ ( z ) sprintf ( ’ \\ zeta =%.1 f ’ , z ) , zeta_values , ’ UniformOutput ’ ,
false ) ) ;
41 grid on ;
42
43 % Customize the phase plot
44 subplot (2 , 1 , 2) ;
45 xlabel ( ’ Frequency ( rad / s ) ’) ;
46 ylabel ( ’ Phase ( degrees ) ’) ;
47 legend ( arrayfun ( @ ( z ) sprintf ( ’ \\ zeta ␣ = ␣ %.1 f ’ , z ) , zeta_values , ’ UniformOutput ’ ,
false ) ) ;
21
Chapter 2 MATLAB code for Control Systems Part-2 2.3 Bode Plot Analysis
48 grid on ;
49
50 % Adjust the figure layout
51 sgtitle ( ’ B o d e _ P l o t s _ f o r _ D i f f e r e n t _ D a m p i n g _ R a t i o s ’) ;
Results:
22
Chapter 2 MATLAB code for Control Systems Part-2 2.4 Nyquist Plot and Stability Analysis
Background:
The Nyquist plot is a graphical method used to analyze the frequency response of a system, especially for
stability assessment in control systems. The Nyquist stability criterion determines stability based on the
number of encirclements of the critical point (−1, 0) in the complex plane.
The Nyquist plot combines magnitude and phase information into a single plot and provides insights into
stability by examining the number of clockwise encirclements of the critical point. Gain and phase margins
are calculated similarly to the Bode plot.
MATLAB Code:
clear all;
clc;
k = 5;
s = tf(’s’);
GH = k / (s * (1 + 0.8 * s) * (1 + 0.05 * s));
nyquist(GH);
[Gm, Pm, Wcp, Wcg] = margin(GH);
disp(’Gain Margin is’);
disp(Gm);
disp(’Phase Margin is’);
disp(Pm);
disp(’Phase crossover frequency is’);
disp(Wcp);
disp(’Gain crossover frequency is’);
disp(Wcg);
grid on;
23
Chapter 2 MATLAB code for Control Systems Part-2 2.4 Nyquist Plot and Stability Analysis
24
Part II
25
Chapter 3
3.1 Introduction
All the systems we will discuss in this course are linear systems. In simple terms, a linear system has the same
response to a very small signal and to a very large signal. First order systems are described by a first-order
differential equation.
y = c + ax (1.1.1)
The constant a is the sensitivity of the transducer and c is a constant offset. The sensitivity of a transducer
or system is its most important property. It is usually desirable to have no offset, and we try to make c = 0.
Static calibration is performed by applying different values of input and measuring the corresponding output.
Non-Linearity If the input-output relationship is non-linear then it is desirable to linearize it. The lin-
earization can be done using analog devices or after digitization. Linearization in a modern digital system can
be done either by using transformation equations or by using look-up tables.
Dynamic Calibration Dynamic calibration determines the input-output relationship that may be a func-
tion of time. If the input-output relationship does not depend on the rate of change of any of the quantities,
then it is a zero-order system, and such a system is completely characterized by its static calibration. A
zero-order system has a perfect or ideal time response as the output function is a purely scaled (and possibly
amplitude shifted, or offset) version of the input.
Zero Order System A zero-order system has no time dependence and contains no time derivatives. The
input-output relation is given by a linear algebraic equation, for a linear zero-order system. In the following
equation, we explicitly indicate that the input variable, x(t), and the output variable, y(t), are both functions
of the independent variable time, t.
27
Chapter 3 First Order Systems 3.1 Introduction
First Order System A system whose input-output relationship contains first derivatives is called a first-
order system. The input-output relationship can be described by a first-order differential equation. For exam-
ple, if x(t) is the input and y(t) is the output:
dy(t)
b + y(t) = ax(t) (1.1.3)
dt
Here, a and b are constants representing properties of the system.
Step Response For this system, if a step change in input is given at time zero:
(
0 t<0
x(t) = (1.1.4)
1 t≥0
Then the output is given by the function:
n
y(t) = f0 t<0 (1.1.5)
This describes many commonly used systems like mercury in glass thermometers. From eq. 1.1.5 we can
get:
28
Chapter 3 First Order Systems 3.1 Introduction
Y (s) a
= (1.2.1)
X(s) 1 + bs
The Laplace transform is a purely mathematical tool and does not have any physical meaning. A special
case of the Laplace transform is the Fourier√transform which can be obtained by replacing the Laplace variable
s by the complex frequency jω. Here j = −1 and ω is the angular frequency in radians/second (ω = 2πf ,
where f is the frequency in cycles/second or Hertz). The Fourier transform obtained by substituting s = jω
yields the frequency domain representation of the system. The Laplace transform (and implicitly the Fourier
transform) of the input-output relation is referred to as the transfer function of the system.
Applying the Fourier transform to a time function or signal describes the time function in terms of a set
of sinusoids (with a specific set of amplitude and phase values) - this is the frequency spectrum of the signal.
Applying the Fourier transform to a transfer function describes the frequency response of the system (with a
frequency-dependent gain, and a frequency-dependent phase shift). Taking the Fourier transform of eq. 1.2.1
and separating the real and imaginary parts using complex algebra, we have:
Y (jω) a abω
= −j (3.4)
X(jω) 1 + b2 ω 2 1 + b2 ω 2
We can now get the magnitude and phase:
1
|X(jω)| = √ (3.5)
1 + b2 ω 2
29
Chapter 3 First Order Systems 3.2 Aims of this Practical
interest must be used for such a test. An advantage of using sinusoidal test signals is that prior assumptions
about the order of the system are not required.
Figure 3.3: Magnitude and Phase of the transfer function plotted against frequency as semi-log plots
We will use a resistor-capacitor network shown in Fig. 3.4 to study the behaviour of first order systems.
3. To experimentally determine the frequency response of a first-order system using a sample electrical
RC circuit.
30
Chapter 3 First Order Systems 3.3 Experiments
3.3 Experiments
2. Function Generator
3. Power Supply
Since the step function has a transition only once in time, we will find it more convenient to use a rectangu-
lar function with repeating transitions. Therefore, we will use a periodic rectangular function with a pulse
duration of T1 and a period of Tp . It repeats every Tp seconds.
(
1 0 ≤ t ≤ T1
r(t) =
0 T1 ≤ t ≤ Tp
Using rectangular pulses of duration 500ms and amplitude 1V, obtain the step response of the system. The
period can be 1s. Capture the response of the RC system on the oscilloscope, and measure the rise time and
calculate the time constant.
Impulse Response
An impulse signal is a mathematical ideal, defined as a function having an area of unity and duration tending
to zero. In engineering application we can define the function as a rectangular function of duration ∆t, with
∆t → 0: (
1 0 ≤ t ≤ ∆t
δ(t) =
0 elsewhere
Set the function generator output amplitude to be 10V (use low Z-mode) and the pulse duration to be 1ms
(approximating ∆t ≈ 0) - note that this has an area of 0.01 V.s; therefore this is a gross approximation of an
impulse with the amplitude being too small and the duration being quite large. Capture the response on the
oscilloscope and measure the time constant.
Frequency Response
Using the frequencies, in the range 1Hz to 1000 Hz, determine the voltage gain and the phase shift of the
input-output of the given RC circuit. Use about 10 frequency values spaced logarithmically in this range.
31
Chapter 3 First Order Systems 3.4 Preliminary Report
2. For the circuit of Fig. 3.4 write the equation relating the output voltage to the input voltage in the form
of eq. (3.1).
3. Draw the frequency response of the given system as Bode plots of magnitude and phase.
4. Determine the corner frequency (the frequency where the gain is 3dB less than that at very low fre-
quencies).
32
Chapter 4
Temperature Sensor
4.1 Introduction
Any sub-system which may be a sensor, actuator, or even a mathematical operation can be characterized in
terms of their input-output relation. In this lab practical, we will use an electronic temperature sensor and
determine its system characteristics. The LM35 is a single-chip integrated circuit temperature sensor. The
temperature sensor is a silicon bandgap temperature sensor, in which the forward junction voltage of a PN
junction varies as a function of temperature and current through the junction. The IC LM35 has additional
electronic circuitry to convert the temperature-sensitive semiconductor junction voltage into an output pro-
portional to the temperature in ◦ C.
33
Chapter 4 Temperature Sensor 4.1 Introduction
Thermal conduction
If the temperature at the surface of the casing is T1 , the temperature of the sensor, T2 , depends on the prop-
erties and dimensions of the intervening material and is given by the equation:
dT2 (t) kA
= [T1 (t) − T2 (t)]
dt mcd
where:
• c = sensing element specific heat (J.K−1 .kg−1 ); for silicon, c = 700 J/◦ K/kg
This is the equation of a first-order system, and we should perform dynamic characterization to obtain the
transfer function of the sensor.
4.1.2 LM35
Fig. 4.2 shows the functional block schematic of the temperature sensing IC, LM35. The supply voltage can be
up to 30V. Note that both the supply and the output voltage are with reference to the terminal labeled Gnd.
4.1.3 Aims
1. To characterize the temperature sensor LM35.
34
Chapter 4 Temperature Sensor 4.1 Introduction
2. Power Supply
3. LM35
Applying sinusoidal temperature changes is not possible. Therefore, we will use a step change in temperature
for dynamic characterization. A beaker of water at a temperature about 20◦ C above the ambient temperature
is used to provide the step change. Connect the LM35 to a power supply and the output to an oscilloscope. Set
the sweep-time of the oscilloscope to be about 1s/div. With the LM35 in air, ensure that the output corresponds
to the ambient air temperature. Immerse the LM35 quickly into the water and capture the transient voltage
change. Use triggered single sweep capture.
The response of the LM35 to the step change in temperature will be a first-order response based on eq. ??,
and as shown in Fig. 5.3. From this, the time constant of the system response can be determined. Using the
time constant and assuming the system to be a first-order system based on the physics given by eq. ??, we
can write the transfer function and draw the frequency response. You can either make measurements on the
oscilloscope itself or you can transfer the waveform to a computer and perform the calculations.
Figure 4.4: Step change in temperature shown in the upper graph results in the response shown in the lower
graph
35
Chapter 4 Temperature Sensor 4.1 Introduction
36
Chapter 5
5.1 Introduction
In the first two labs, we saw that first-order systems are described by a first-order differential equation, and
we saw examples of an electrical first-order system and a thermal second-order system. Second-order systems
are described by a second-order differential equation. The discussion in this lab is only about underdamped
second-order systems where the damping is between 0 and 1.
With the usual notation, if the system input is x(t) and the output is y(t), a general second-order system
is described by equation 5.1, with system parameters g, ωn , and ζ. These constants represent commonly
recognized physical properties called sensitivity, natural frequency, and damping.
dy(t)
y(t) + 2ζωn + ωn2 y(t) = g · x(t) (5.1)
dt
Y (s) gωn2
H(s) = = 2 (5.2)
X(s) s + 2ζωn s + ωn2
Examples of second-order systems are electrical resistor-inductor-capacitor (RLC) circuits, Fig. 5.1(i),
mechanical mass-damper-spring systems, Fig. 5.1(ii), and liquid flow systems in elastic tubes (liquid inertance,
tube elasticity, and viscous damping).
37
Chapter 5 Second Order Systems 5.1 Introduction
Vo (s) 1
= (5.6)
Vi (s) 1 + RCs + LCs2
Comparing equation 5.6 with equation 5.1, we see that:
r
1 R C
ωn = √ , ζ= (5.7)
LC 2 L
For the mechanical system:
d2 y(t) dy(t)
F (t) = m +B + Ky(t) (5.8)
dt2 dt
Taking the Laplace transform:
Y (s) 1 1/K
= 2
= B 1 2
(5.10)
F (s) ms + Bs + K 1 + K s + mK s
Comparing with equation 5.1, we see that:
r
K B
ωn = , ζ= √ (5.11)
m 2 mK
38
Chapter 5 Second Order Systems 5.1 Introduction
1
X(s) =
s
ωn2
Y (s) =
s(ωn2 + 2ζωn s + s2 )
Using partial fraction for separation of the terms to have only first order and second order terms:
ωn2 ωn2
Y (s) = =
s(ωn2 + 2ζωn s + s2 ) s(s + ζωn )2 + ωn2 (1 − ζ 2 )
A Bs + C
= +
s (s + ζωn )2 + ωn2 (1 − ζ 2 )
We find: A = 1, B = 1, C = 2ζωn . The term ωd = ωn 1 − ζ 2 is called the damped frequency. We also
p
write the denominator as the sum of two squares so that we can use the Laplace transform table.
1
s [(s + ζωn )2 + ωn2 (1 − ζ 2 )]
Taking the inverse Laplace transform using Table 3.1:
!
−ζωn t ζ
y(t) = 1 − e cos(ωd t) + p sin(ωd t) u(t)
1 − ζ2
39
Chapter 5 Second Order Systems 5.1 Introduction
Note that u(t) represents the unit step function which is equal to one for t ≥ 0 and is zero for t < 0.
The sine and cosine terms can be put in the form: sin A cos B + cos A sin B = sin(A + B), and we get a
convenient closed form:
!!
−ζωn t −1 ζ
y(t) = 1 − e sin ωd t + tan p
1 − ζ2
5.1.2 Determining the Second Order System Parameters from the Time Response
In the step response of Fig. 5.3, p = ys (t∞ ) = ys (t → ∞).
Maxima of the step response occur when the sine term is -1, i.e., when ωd t = 1 − ζ 2 ωn t = (4q − 1) π2
p
where q = 0, 1, 2, 3, . . . The period of the damped step response can be measured as t3 − t1 . Therefore,
2π
ωd =
t3 − t1
To calculate the damping coefficient, we consider the decay of the oscillation. If ∆y(t1 ) = y(t1 ) − y(t∞ )
and ∆y(t3 ) = y(t3 ) − y(t∞ ), then:
∆y(t3 )
= e−ζωn (t3 −t1 )
∆y(t1 )
∆y(t1 )
Let α = ln ∆y(t3 ) , then rearranging eq. (3.1.14) we calculate
α
ζ=√
4π 2 + α2
Y (jω) 1
= 2
X(jω)
1 + j2ζ ωωn − ω
ωn
Y (jω) 1
= s (3.1.17)
X(jω) 2 2 2
1 − ωωn + 2ζ ωωn
40
Chapter 5 Second Order Systems 5.1 Introduction
Y (s) b0 + b1 s + b2 s2 + . . .
=
X(s) a0 + a1 s + a2 s2 + . . .
For analysis, the polynomials can be factorized in the following form:
Y (s) (s − z1 )(s − z2 ) . . .
=
X(s) (s − p1 )(s − p2 ) . . .
The values z1 , z2 , . . . are called zeros since when s = z1 or s = z2 , etc., the transfer function becomes
zero. The values p1 , p2 , . . . are called poles since when s = p1 or s = p2 , etc., the transfer function becomes
infinite. The denominator equated to zero is called the characteristic equation. For the second order system
discussed here, the characteristic equation can be written from (??):
s2 + 2ζωn s + ωn2 = 0
The roots of this quadratic equation are:
p
s = −ζωn ± ωn ζ 2 − 1 = −ζωn ± jωd (5.12)
In eq. (5.12), we have used the fact that ζ < 1. When s takes the value of the roots, the transfer function
becomes infinite.
We see that the Laplace variable is necessarily a complex quantity of the form s = σ + jω. The transfer
function can be plotted in the complex s-plane with the poles and zeros represented by circles and crosses.
For the second order system discussed here, the transfer function, eq. (5.2) can be written as:
41
Chapter 5 Second Order Systems 5.2 Aims
Y (s) ωn2
= (3.1.21)
X(s) (s + ζωn )2 + ωn2 (1 − ζ 2 )
From fig. 5.5, we see that as the damping coefficient, ζ, becomes smaller, the poles move closer to the
imaginary axis. When ζ = 0, the poles lie on the imaginary axis. We know that replacing s = jω in the
Laplace transform of a system (or a signal) gives us the Fourier transform. Therefore, the transfer function
taken along the imaginary axis of the complex plane is the Fourier transform. When the poles lie on the
imaginary axis, they represent impulses in the Fourier transform. From our study of Fourier transforms, we
know (or should know) that the inverse transform of a pair of impulses gives us a sinusoidal time-function—the
frequency of the sinusoid is ωn or the natural frequency. In the case of a system transfer function, this
represents sustained oscillation at the natural frequency—regardless of the input. The system oscillates at the
natural frequency or resonant frequency.
When the poles are on the left of the imaginary axis, the oscillation is damped until they fall on the real
axis, and the damped frequency becomes zero. When the poles lie on the right of the imaginary axis, the oscil-
lation grows exponentially—this represents instability. This instability is what is defined by the Bounded-Input
Bounded-Output condition for stability—i.e., a system is stable when a Bounded-Input produces a Bounded-
Output, and when a Bounded-Input produces an unBounded-Output, the system is said to be unstable.
5.2 Aims
1. To determine the parameters of a second order system, namely the natural frequency and the damping
coefficient.
42
Chapter 5 Second Order Systems 5.3 Experimental Procedure
(a) Using L = 68µH, R = 2Ω, C = 0.1µF , assemble the circuit on a breadboard and measure the
response.
(c) Using L = 68µH, R = 10Ω, C = 0.1µF , note that the inductor has an internal resistance of about
1.2Ω.
• Keeping the damping constant at the mid-position, adjust the frequency. Does the system oscillation
increase?
43
Chapter 5 Second Order Systems 5.5 Final Report
44
Chapter 6
Feedback Control
The feedback control system works by taking the difference between the input, and the actual output - this
difference is called the error signal. In Fig. 6.1, the input is denoted by X(s), the output by Y (s), and the error
signal by E(s). The output is passed through a system H(s) which represents the sensor that measures the
output to provide the feedback. Combination of system blocks is easier to analyze in the Laplace or Fourier
domain than in the time-domain. We can obtain the overall transfer function of the feedback control system
as follows:
45
Chapter 6 Feedback Control 6.2 Operational Amplifier Circuits for Control Systems
R2
Vo (t) = [V1 (t) − V2 (t)]
R
1
V1 (t) − V2 (t)
Vo (t) = R2
R1
The circuit shown in Fig.6.2 is an improvement on the summing block - this is essentially an instrumen-
tation amplifier with high input impedance, differential inputs, and easy to adjust gain and common-mode
rejection.
46
Chapter 6 Feedback Control 6.2 Operational Amplifier Circuits for Control Systems
Fig.6.3 shows the block schematic of a Proportional-Integral-Derivative controller. The input-output re-
lation of this controller is:
Z
dx(t)
y(t) = Kx(t) + KI x(t) dt + KD
dt
Taking the Laplace Transform, we get:
Y (s) KI
G(s) = =K 1+ + KD s
X(s) s
2. Increase the proportional gain as long as the system remains stable and free of oscillations.
3. If there is any steady-state error in the output, then increase the integral gain to minimize the long-term
error.
4. Finally, increase the derivative gain so that the system becomes faster.
47
Chapter 6 Feedback Control 6.3 Aims
5. The values for the P-I-D coefficients can be checked theoretically to ensure that the overall system
transfer function is stable and has fast response. However, steady state error is usually due to slight
variations in system parameters in practical implementation - therefore, final tuning often requires
experimental adjustment.
ko e−to s
G2 (s) =
(1 + τo s)
In such a case, the time delay makes the system more prone to instability. Ziegler-Nichols proposed a
method for tuning a PID controller to control such a system. First, the values of the time constant, τ , and the
time delay, to , are measured from the step-response of the system-under-control, i.e., the plant. The slope is
estimated at the point of maximum steepness.
Figure 6.4: General first order response with time delay. The slope m = ko ≈ 1
Using these parameters, ko , the steady-state value, to , the time delay, and To , the Ziegler-Nichols method
gives an empirical way of calculating the coefficients, kP , kI , kD as given in the table below. One can choose
to use a “P” (Proportional only controller), “PI” (Proportional-Integral controller), or a full “PID” controller.
Controller Type kP kI kD
P To
to 0 0
PI 0.9 Ttoo t3o 0
PID To
1.2 to 2
to
0.5
to
6.3 Aims
1. To understand the components of feedback control.
48
Chapter 6 Feedback Control 6.4 Experimental Procedure
Figure 6.5: General first order response with time delay. The slope m = ko ≈ 1
Fig.6.5 shows the lab setup to be used. Two PCBs, the summing block and the PID controller will be
given. The internal circuits in these boards is as described above. The first order system-under-control must
be assembled on a breadboard. Using Fig.6.5 as a guide, connect the system. The time constant of the system
being controlled, the so- called “open-loop” system is known to be 0.01s. Adjust the PID controller using
Method I described above. Determine the time-constant of the overall system.
4. Power supply, oscilloscope, arbitrary function generator, and cables and probes
2. If H(s) = 0.5, and KP = 20, what is the control system’s overall transfer function?
49
Chapter 6 Feedback Control 6.4 Experimental Procedure
50
Chapter 7
DC Motor Control
7.1 Introduction
The DC motor is an electromagnetic actuator, and converts electrical energy into mechanical work. The torque
generated by a DC motor is proportional to the current through its coil. A controlled voltage is very easy, but
with a little effort, we can make circuits to deliver controlled current to a motor. DC geared motors are used
for continuous motion as well as positioning. In this lab, we will use a DC motor with an attached gearbox.
The torque generated by the motor is proportional to the current through the coil, with a proportionality
constant, km , that depends on the physical parameters of the motor and the magnet:
Vi (t) is the voltage applied across the motor, and L and R are the inductance and resistance of the coil.
The rotating coil develops a back emf, eb = ke ϕ̇(t), where ϕ(t) is the angular displacement, and ϕ̇(t) is the
angular velocity of the motor shaft:
dI(t)
Vi (t) = L + RI(t) + eb
dt
dI(t)
=L + RI(t) + ke ϕ̇(t) (5.1.2)
dt
The moment of inertia of the motor is Jm , and the motor shaft frictional resistance coefficient is bm . The
gears provide a reduction ratio of n, so that the rotation of the gear-output shaft θ(t) and the braking torque
at the output shaft To (t) is:
51
Chapter 7 DC Motor Control 7.1 Introduction
The moment of inertia of all the gears is Jg , and the gears’ total frictional resistance coefficient is bg . Any
load or perturbation on the gear-output shaft is TL . The gears and external load referred to the motor shaft
is:
1
Tc = Jg θ̈(t) + bm θ̇(t) + TL
n
The torque developed by the motor can be written as:
1
Tm (t) = Jm ϕ̈(t) + bm ϕ̇(t) + Jg θ̈(t) + bm θ̇(t) + TL
n
= n2 Jm + Jg θ̈(t) + n2 bm + bg θ̇(t) + TL
The relation between the motor speed and motor current is a first-order system.
7.1.1 Voltage and Current Control - Voltage Amplifier and Transconductance Amplifier
The current required by a small DC motor can be several amperes, and a signal from a function generator
cannot provide such a large current. Therefore, we need to have a controllable voltage or current source
that can provide large currents. The figure here shows a power amplifier that can supply a few amperes of
current. The output is made with a complementary pair of transistors in a push-pull configuration. Used by
itself, such a pair of transistors will have a large crossover distortion when the voltage is near zero. Using a
feedback circuit as shown reduces the crossover distortion and gives a linear control for the output voltage.
If we measure the current at the output of the power amplifier and provide that as the feedback, we will have
a controlled current output. This is a voltage-controlled-current-source, or a transconductance amplifier. The
circuit is shown below.
52
Chapter 7 DC Motor Control 7.2 Aims
7.2 Aims
1. To characterize a geared DC motor
2. Function generator
53
Chapter 7 DC Motor Control 7.5 Preliminary Report
3. Oscilloscope
5. Geared DC motor
6. Rotary potentiometer
54
Chapter 8
8.1 Introduction
8.1.1 Plant Model - Geared DC motor
The permanent magnet electric motor comprises a current-carrying conductor wound in an armature placed
in a magnetic field. The force on the conductor is proportional to (a) magnetic flux density, (b) the current,
and (c) the length of the conductor. The magnetic flux density is constant, and the length of the conductor
is also constant. The torque on the motor shaft is proportional to the applied current with proportionality
constant km , defined as
In the previous lab, we only considered the angular velocity of the motor for system identification since,
when the motor is freely running, the speed is related to the armature current. When the motor was freely
running, instantaneous angular displacement was not related to any input quantity, except as an integral over
time of the speed that was controlled by the armature current.
θ(t)
Vθ (t) = Vp = kθ θ(t)
360◦
55
Chapter 8 Position Control System 8.2 Aims
This is a second-order system, as seen in the previous lab, and it can have a stable step response if the
poles are on the left side of the complex s-plane. Comparing eq.6.1.3 to the general form for a second-order
system, we can write:
s
kθ kp km bo
ωn = , ζ= p (8.6)
Jo 2 Jo kθ kp km
The poles are at:
s = −ζωn ± jωd
When ζ is large and close to unity, the system is stable. But when ζ is large, the system is also sluggish.
The damping coefficient ζ is inversely related to the value of kp .
8.2 Aims
1. To show position control using a DC motor and angular position sensor in a feedback control system.
56
Chapter 8 Position Control System 8.4 Preliminary Report
3. PID controller board, Summing amplifier board, power amplifier board (transconductance amplifier)
57
Chapter 8 Position Control System 8.5 Final Report
58