0% found this document useful (0 votes)
11 views8 pages

MATLAB Control Systems Lab Guide

The document outlines Experiment No. 1 for EEE 406: Control Systems Lab, focusing on familiarization with MATLAB for generating and manipulating polynomials, transfer functions, and determining roots, poles, and zeros of control systems. It includes objectives, MATLAB functions, and several examples demonstrating the application of these concepts using MATLAB code. Additionally, it provides references for further reading on control systems engineering.

Uploaded by

abedul.hadi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

MATLAB Control Systems Lab Guide

The document outlines Experiment No. 1 for EEE 406: Control Systems Lab, focusing on familiarization with MATLAB for generating and manipulating polynomials, transfer functions, and determining roots, poles, and zeros of control systems. It includes objectives, MATLAB functions, and several examples demonstrating the application of these concepts using MATLAB code. Additionally, it provides references for further reading on control systems engineering.

Uploaded by

abedul.hadi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Department of Electrical and Electronic Engineering

University of Information Technology and Sciences


EEE 406: Control Systems Lab

Experiment No. 1: Familiarization with the MATLAB and determination of roots, transfer
function and poles and zeros of control system.

Objectives: To learn to use MATLAB to (1) generate polynomials, (2) manipulate


polynomials, (3) generate transfer functions, (4) manipulate transfer functions.

Introduction:

𝑑𝑑𝑛𝑛 𝑐𝑐(𝑡𝑡) 𝑑𝑑𝑛𝑛−1 𝑐𝑐(𝑡𝑡) 𝑑𝑑𝑑𝑑 (𝑡𝑡)


𝑎𝑎𝑛𝑛 + 𝑎𝑎𝑛𝑛 −1 + ⋯ … … + 𝑎𝑎0
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑚𝑚 ( ) 𝑚𝑚 −1 ( )
𝑑𝑑 𝑟𝑟 𝑡𝑡 𝑑𝑑 𝑟𝑟 𝑡𝑡 𝑑𝑑𝑑𝑑(𝑡𝑡)
= 𝑏𝑏𝑚𝑚 + 𝑏𝑏𝑚𝑚 −1 + ⋯ … … + 𝑏𝑏0
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑

𝐶𝐶 (𝑆𝑆) 𝑎𝑎𝑛𝑛 𝑆𝑆 𝑛𝑛 + 𝑎𝑎𝑛𝑛−1 𝑆𝑆 𝑛𝑛−1 + ⋯ … … + 𝑎𝑎0 𝑁𝑁(𝑆𝑆)


𝐺𝐺 (𝑆𝑆) = = =
𝑅𝑅 (𝑆𝑆) 𝑏𝑏𝑛𝑛 𝑆𝑆 𝑚𝑚 + 𝑏𝑏𝑚𝑚 −1 𝑆𝑆 𝑛𝑛−1 + ⋯ … … + 𝑏𝑏0 𝐷𝐷 (𝑆𝑆)

Numerator polynomial, 𝑁𝑁(𝑆𝑆) = 𝑎𝑎𝑛𝑛 𝑆𝑆 𝑛𝑛 + 𝑎𝑎𝑛𝑛−1 𝑆𝑆 𝑛𝑛−1 + ⋯ … … + 𝑎𝑎0

Root: Value of variable, S for which 𝑁𝑁(𝑆𝑆) = 0.

Poles: Values of variable, S for which 𝐺𝐺 (𝑆𝑆) = ∞ ⟹ 𝐷𝐷 (𝑆𝑆) = 0.

Zeros: Values of variable, S for which 𝐺𝐺 (𝑆𝑆) = 0 ⟹ 𝑁𝑁(𝑆𝑆) = 0.

Tools:

MATLAB and the Control System Toolbox


MATLAB Functions:

1. roots
2. poly
3. conv
4. polyval
5. tf

Result & Analysis:

Example 1:

𝑃𝑃(𝑠𝑠) = 𝑠𝑠 2 + 3𝑠𝑠 + 4
MATLAB Code:

p = [1 3 4];
r = roots(p)

r=
-1.5000 + 1.3229i
-1.5000 - 1.3229i

p = poly(r)

p=
1.0000 3.0000 4.0000

Example 2:

𝑃𝑃(𝑠𝑠) = 4𝑠𝑠 4 + 2𝑠𝑠 3 + 5𝑠𝑠 2 + 6


MATLAB Code:

p = [4 2 5 0 6];
r = roots(p)

r=
-0.6999 + 1.0187i
-0.6999 - 1.0187i
0.4499 + 0.8829i
0.4499 - 0.8829i

p = poly(r)
p=
1.0000 0.5000 1.2500 0.0000 1.5000
Example 3:

𝑁𝑁(𝑠𝑠) = (3𝑠𝑠 2 + 2𝑠𝑠 + 1)(𝑠𝑠 + 4)


MATLAB Code:

p = [3 2 1];
q = [1 4];
n = conv(p, q)

n=
3 14 9 4

value = polyval (n,-5)

value =
-66

Example 4:
10
𝑁𝑁1 (𝑠𝑠) =
𝑠𝑠 2 + 2𝑠𝑠 + 5
1
𝑁𝑁2 (𝑠𝑠) =
𝑠𝑠 + 1
MATLAB Code:

num1 = [10];
den1 = [1 2 5];
sys1 = tf(num1, den1)

Transfer function:
10
-------------
s^2 + 2 s + 5

num2 = [1];
den2 = [1,1];
sys2 = tf(num2, den2)

Transfer function:
1
-----
s+1
sys = sys1 + sys2

Transfer function:

s^2 + 12 s + 15
---------------------
s^3 + 3 s^2 + 7 s + 5

Example 5:
6𝑠𝑠 2 + 1
𝐺𝐺 (𝑠𝑠) = 3
𝑥𝑥 + 3𝑠𝑠 2 + 3𝑠𝑠 + 1
(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝐻𝐻 (𝑠𝑠) =
(𝑠𝑠 + 2𝑖𝑖)(𝑠𝑠 − 2𝑖𝑖)(𝑠𝑠 + 3)
MATLAB Code:

numg = [6 0 1]; deng = [1 3 3 1];


sysg = tf(numg, deng);
z = zero(sysg)
z=
0 + 0.4082i
0 - 0.4082i
p = pole(sysg)

p=
-1.0000 + 0.0000i
-1.0000 - 0.0000i
-1.0000

n1 = [1 1];
n2 = [1 2];
d1 = [1 2*i];
d2 = [1 -2*i];
d3 = [1 3];
numh = conv(n1, n2);
denh = conv(d1, conv(d2, d3));
sysh = tf(numh, denh)

Transfer function:

s^2 + 3 s + 2
----------------------
s^3 + 3 s^2 + 4 s + 12

sysg = tf(numg, deng)

Transfer function:

6 s^2 + 1
---------------------
s^3 + 3 s^2 + 3 s + 1

sys=sysg / sysh

Transfer function:
6 s^5 + 18 s^4 + 25 s^3 + 75 s^2 + 4 s + 12
-------------------------------------------
s^5 + 6 s^4 + 14 s^3 + 16 s^2 + 9 s + 2

pzmap(sys)

MATLAB Figure:
Pole-Zero Map
2.5

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2

-2.5
-3 -2.5 -2 -1.5 -1 -0.5 0
Real Axis

Example 6:
(𝑠𝑠 + 1)(𝑠𝑠 + 5)
𝐺𝐺1 (𝑠𝑠) =
(2𝑠𝑠 3 + 𝑠𝑠 2 + 5)(3𝑠𝑠 2 + 2𝑠𝑠 + 6)
10
𝐺𝐺2 (𝑠𝑠) =
(𝑠𝑠 3 − 6𝑠𝑠 2 + 10)(𝑠𝑠 2 + 5)(𝑠𝑠 + 1)

MATLAB Code:

numa1 = [1 1];
numa2 = [1 5];
dena1 = [2 1 0 5];
dena2 = [3 0 2 6];
numg1 = conv(numa1, numa2);
deng1 = conv(dena1, dena2);
numg2 = [10];
denb1 = [1 -6 0 10];
denb2 = [1 0 5];
denb3 = [1 1];
deng2 = conv(denb1, conv(denb2, denb3));
sysg1 = tf(numg1, deng1)

Transfer function:
𝑠𝑠 2 + 6𝑠𝑠 + 5
6𝑠𝑠 6 + 3𝑠𝑠 5 + 4𝑠𝑠 4 + 29𝑠𝑠 3 + 6𝑠𝑠 2 + 10𝑠𝑠 + 30

sysg2 = tf(numg2, deng2)

10
Transfer function:
𝑠𝑠 6 −5𝑠𝑠 5 −𝑠𝑠 4 −15𝑠𝑠 3 −20𝑠𝑠 2 +50𝑠𝑠+50

sysm=sysg1 * sysg2

Transfer function:
10𝑠𝑠 2 + 60𝑠𝑠 + 50
6𝑠𝑠12 − 27𝑠𝑠11 − 17𝑠𝑠10 − 84𝑠𝑠 9 − 308𝑠𝑠 8 + 131𝑠𝑠 7− 91𝑠𝑠 6 − 480𝑠𝑠 5 + 1350𝑠𝑠 4 + 1100𝑠𝑠 3 + 200𝑠𝑠 2 + 2000𝑠𝑠 + 1500

sysd = sysg1 / sysg2

Transfer function:
𝑠𝑠 8 + 𝑠𝑠 7 − 26𝑠𝑠 6 − 46𝑠𝑠 5 − 115𝑠𝑠 4 − 145𝑠𝑠 3 + 250𝑠𝑠 2 + 550𝑠𝑠 + 250
60𝑠𝑠 6 + 30𝑠𝑠 5 + 40𝑠𝑠 4 + 290𝑠𝑠 3 + 60𝑠𝑠 2 + 100𝑠𝑠 + 300

pzmap(sysd)
pzmap(sysm)

MATLAB Figure:
For sysm
Pole-Zero Map
2.5

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2

-2.5
-6 -4 -2 0 2 4 6
Real Axis

For sysd

Pole-Zero Map
2.5

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2

-2.5
-6 -4 -2 0 2 4 6
Real Axis

References:

Control Systems Engineering (6th Edition) by Norman S. Nise. John Wiley & Sons, Inc.

Common questions

Powered by AI

The transfer function is crucial in control systems as it represents the input-output relationship of a linear time-invariant system in the Laplace domain. Mathematically, it is expressed as the ratio of the Laplace Transform of the output to the input, represented as G(S) = N(S)/D(S), where N(S) and D(S) are the numerator and denominator polynomials, respectively. This function provides insights into system dynamics, stability, and frequency response .

Generating a transfer function from individual system components using MATLAB involves defining the numerator and denominator polynomials of each subsystem and then using functions like 'tf' to create a transfer model. This process is crucial because it allows the integration of multiple subsystems into a cohesive unit, representing the overall system behavior. The ability to view and manipulate system components individually and collectively simplifies complex system analysis, facilitates design corrections, and enhances understanding of the interactions within a system, ultimately leading to more efficient and reliable control systems .

Determining the transfer function through MATLAB is essential because it provides a precise mathematical model of a control system's behavior, allowing for detailed analysis and design. MATLAB's capabilities, such as function manipulation, plotting, and simulation, facilitate the comprehensive study of system dynamics, stability, and performance. It enables the seamless testing of design modifications and optimizations, making MATLAB an invaluable tool for engineers to ensure robust and efficient control system designs .

A pole-zero map is a graphical representation of the locations of the poles and zeros of a control system's transfer function in the complex plane. This map provides critical insights into system behavior, such as stability and transient response. The relative locations of poles determine system stability; poles in the left half-plane suggest stability, while those in the right half indicate potential instability. The zeros influence how particular frequencies are attenuated or amplified. By analyzing the pole-zero map, engineers can predict performance and make informed decisions on system design and tuning .

Convolution of two polynomials corresponds to the multiplication of their associated transfer functions, resulting in a new polynomial that represents the combined effect of the two original polynomials in the system. This operation is essential in modeling cascaded systems or combining multiple subsystems into a single transfer function, thereby analyzing the cumulative effect on system dynamics .

Pole-zero cancellation occurs when a pole and a zero of a system’s transfer function are located at the same point in the complex plane. This can simplify the system's response as it leads to the annulment of specific dynamics, effectively removing the corresponding natural frequency. While this may improve the system response in some contexts, it can also hide underlying stability issues, especially if they occur in the right half-plane, potentially masking instability. Thus, while useful, caution is necessary to understand the full implications of such cancellations .

Poles and zeros of a transfer function significantly influence the system's stability and transient response. Poles are the values of the variable S for which the transfer function becomes infinite, indicating the system's natural frequencies and impacting stability. Zeros are the values where the transfer function becomes zero, affecting the system's transient response by cancelling out specific frequencies. The location of poles in the complex plane determines stability: poles in the left half-plane imply a stable system, while those in the right half indicate instability .

System scaling can greatly affect the numerical stability of MATLAB computations involving transfer functions. Scaling alters the magnitude of the coefficients in the polynomials of a transfer function, which can impact the precision and accuracy of the calculations due to the limited numerical precision inherent in digital computations. Poor scaling may result in significant round-off errors and inaccurate roots or poles, potentially leading to incorrect analyses or unstable control systems. Proper scaling ensures that all calculations are done within a numerically stable range, preserving computational accuracy .

In MATLAB, polynomials for control systems analysis can be generated and manipulated using several functions. The 'roots' function computes the roots of a polynomial, determining its zeros. The 'poly' function constructs a polynomial from its roots. 'Conv' performs polynomial multiplication, and 'polyval' evaluates polynomial values at specified points. These tools enable comprehensive polynomial analysis critical for determining system characteristics such as poles and zeros .

Complex poles, particularly those with imaginary components, have a significant impact on a control system's transient response. They typically result in oscillatory behavior, where the frequency of oscillation is related to the imaginary part of the poles, and the rate of decay or growth is determined by the real part. If the real component is negative, the system is stable, exhibiting damped oscillations. If positive, the system displays undersirable behavior, which may lead to instability. Properly placing these poles allows for controlled oscillations crucial for system stability and desired transient performance .

You might also like