0% found this document useful (0 votes)
9 views69 pages

CNTL 5-20 Report - 3

The lab report details experiments conducted in a Control System Lab, focusing on converting state-space representations to transfer functions and analyzing system responses using MATLAB. Key experiments include determining pole-zero locations, transient responses, and the effects of damping ratios on system behavior. The findings emphasize the importance of these concepts in electrical engineering applications such as automation, robotics, and power systems.
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)
9 views69 pages

CNTL 5-20 Report - 3

The lab report details experiments conducted in a Control System Lab, focusing on converting state-space representations to transfer functions and analyzing system responses using MATLAB. Key experiments include determining pole-zero locations, transient responses, and the effects of damping ratios on system behavior. The findings emphasize the importance of these concepts in electrical engineering applications such as automation, robotics, and power systems.
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
You are on page 1/ 69

Lab Report

Course Title: Control System Lab


Course Code: EEE-4104

Submitted to
Kulsuma Khanum
Lecturer
Department of Electrical and Electronics Engineering
Leading University, Sylhet.

Submitted By
Md. Abdul Malek Fahim
ID: 0182220012131004
Batch: 36
Department of Electrical and Electronics Engineering
Leading University, Sylhet

Date of Submission: 25/05/2025


Experiment 5: State Space to Transfer Function &
Transfer Function to State Space
Objective:

To convert a system from state-space representation to transfer function form and vice
versa using MATLAB.

Theory:

State-space and transfer function models are two main ways to represent linear time-
invariant (LTI) systems. The state-space model is especially useful for multiple-input
multiple-output (MIMO) systems and modern control design. The transfer function
provides a frequency domain representation of the system, ideal for analysis of stability
and transient behavior.

MATLAB provides ss2tf() for state-space to transfer function conversion, and tf2ss()
for the reverse.

Code 1:

A=[-2 –1;-3 –5];


B=[1 2]’;

C=[3 2];

D=[0];

[num,den]=ss2tf(A,B,C,D)

printsys(num,den,’s’)

Output:

Code 2:
A=[0 2 3;0 6 5;1 4 2];

B=[0 1 1]';

C=[1 2 0];

D=[0];

[num,den]=ss2tf(A,B,C,D)

printsys(num,den,'s')

Output:
Transfer Function to State Space

Code 1:

num=[100];

den=[1 20 10 7 100];

[A,B,C,D]=tf2ss(num,den)

Output:
Code 2:

num=[30];

den=[1 8 9 6 1 30];

[A,B,C,D]=tf2ss(num,den)

Output:
Discussion:

This experiment is fundamental in control systems as it bridges the gap between classical
and modern control approaches. In Electrical Engineering, these concepts are crucial in:

• Power systems: Modeling generators and network dynamics.


• Control of electric drives: State-space representation is essential for vector
control of motors.
• Signal processing: Realization of filters in both time and frequency domains.
• Robotics and automation: Embedded controllers rely heavily on state-space
designs.

Being able to switch between representations helps in both simulation and real-time
implementation of control systems.
Experiment 6: Determine Pole Zero Location, Values of
Natural Frequency and Damping Ratio
Objective:

To analyze second-order systems using pole-zero plots, and to determine the natural
frequency () and damping ratio () using MATLAB.

Theory:

The damping ratio and natural frequency are parameters that determine the transient
response of a system. MATLAB functions pzmap() and damp() are used to visualize and
compute these parameters. These properties help classify the system as underdamped,
overdamped, critically damped, or undamped.

Code a:

y=tf([400],[1 12 400])

pzmap(y);

sgrid

[wn,zeta]=damp(y)
Output:

Code b:

y=tf([900],[1 90 900])

pzmap(y)

sgrid

[wn,zeta]=damp(y)

Output:
Code c:

y=tf([225],[1 30 225])

pzmap(y)

sgrid

[wn,zeta]=damp(y)

Output:
Code d:

y=tf([625],[1 0 625])

pzmap(y)

sgrid

[wn,zeta]=damp(y)

Output:
Code 1:

wn=10;
zeta=0.3;

[num0,den]=ord2(wn,zeta)

num=wn^2;

printsys(num,den,'s')

Output:
Code 2:

wn=20;

zeta=0;

[num0,den]=ord2(wn,zeta)

num=wn^2;

printsys(num,den,'s')

Output:
Code 3:

wn=25;

zeta=0.8;

[num0,den]=ord2(wn,zeta)

num=wn^2;

printsys(wn,zeta,'s')
Output:

Code 4:

wn=30;

zeta=1.0;

[num0,den]=ord2(wn,zeta)

num=wn^2;

printsys(num,den,'s')
Output:

Discussion:

This experiment is widely used in designing controllers in Electrical Engineering. It helps


engineers understand how poles affect system dynamics in power electronics, motor
control, and signal filtering. It’s also essential for designing stable and responsive systems
in automation and robotics.
Experiment 7: Transient and Steady State Responses
Objective:

To analyze the step, impulse, and ramp responses of a second-order system using
MATLAB.

Theory:

Transient and steady-state responses help evaluate system performance. step(),


impulse(), and lsim() functions simulate how systems react to various inputs.

Code:

num = 10;

den = [1 2 10];

subplot(3,1,1); % Unit Step Response

step(num, den);

title('Step');

subplot(3,1,2); % Unit Impulse Response

impulse(num, den);

title('Impulse');
% Unit Ramp Response

r = t; % Ramp input: r(t) = t

t = 0:0.01:5; % Time vector

sys = tf(num, den); % Transfer function

subplot(3,1,3);

lsim(sys, r, t); % Simulate ramp response

title('Ramp');

Output:

Discussion:

The ability to analyze transient and steady-state responses is fundamental in evaluating


system behavior in Electrical Engineering domains such as automation, robotics, and
power system controls. These responses determine how quickly and accurately a system
can follow input commands. For example, in electric motor applications or energy
converters, minimizing settling time and overshoot can directly improve system efficiency
and safety. This experiment equips engineers with the tools to interpret and improve
dynamic performance using time-domain analysis.

Experiment 8: Unit-Ramp Response using 'lsim'


Objective:

To simulate ramp input response for different transfer functions using lsim().

Theory:

The lsim() function simulates time response to arbitrary inputs such as ramps. It helps in
understanding how systems handle slowly changing signals.

Code:

r = t; % Ramp input: r(t) = t

t = 0:0.01:10; % Simulate from t = 0 to 10 seconds


% Define transfer functions

sys1 = tf(1, [1 3 2]); % G1(s) = 1 / (s^2 + 3s + 2)

sys2 = tf([2 5], [1 4 5]); % G2(s) = (2s + 5) / (s^2 + 4s + 5)

sys3 = tf(10, [1 2 10]); % G3(s) = 10 / (s^2 + 2s + 10)

% Simulate ramp responses

y1 = lsim(sys1, r, t);

y2 = lsim(sys2, r, t);

y3 = lsim(sys3, r, t);

subplot(3,1,1); % Plot the results

plot(t, y1);

title('Ramp Response of G1(s) = 1 / (s^2 + 3s + 2)');

subplot(3,1,2);

plot(t, y2);

title('Ramp Response of G2(s) = (2s + 5) / (s^2 + 4s + 5)');

subplot(3,1,3);

plot(t, y3);

title('Ramp Response of G3(s) = 10 / (s^2 + 2s + 10)');


Output:

Discussion:

Simulating unit-ramp responses is critical in systems that require constant tracking, such
as servomechanisms, antenna positioning systems, or elevator controllers. Electrical
Engineers often design controllers to minimize the error between actual and desired
positions or speeds over time. By using the lsim function, engineers gain practical insight
into how systems respond to linear inputs, allowing them to assess lag, steady-state error,
and response time in real applications involving continuous control and regulation.

Experiment 9: Step Response of Systems with Different


Damping
Objective:

To visualize the step response of systems with varying damping ratios.

Theory:

Step response varies significantly with damping. MATLAB enables simulation using
second-order transfer functions to classify systems.

Code:
t = 0:0.01:1; % Time vector long enough to show all responses

num1 = [625];

den1 = [1 0 625];

t1 = tf(num1, den1);

subplot(2,2,1)

step(t1, t)

title('Undamped')
num2 = [400];

den2 = [1 12 400];

t2 = tf(num2, den2);

subplot(2,2,2)

step(t2, t)

title('Underdamped')

num3 = [225];

den3 = [1 30 225];

t3 = tf(num3, den3);

subplot(2,2,3)

step(t3, t)

title('Critically Damped')

num4 = [900];

den4 = [1 90 900];

t4 = tf(num4, den4);

subplot(2,2,4)

step(t4, t)

title('Overdamped')
Output:
Discussion:

Understanding damping conditions helps Electrical Engineers choose appropriate control


strategies for different system dynamics. For instance, underdamped systems are suitable
for fast response but may cause oscillations, while overdamped systems prioritize stability
at the cost of speed. This knowledge is vital when designing protective systems in power
grids, ensuring smooth motor startups, or tuning analog filters in communication systems.
The ability to identify and tailor damping behavior ensures safe and efficient system
operation.

Experiment 10: Effect of Damping Ratio on Step


Response
Objective:

To study how varying damping ratios affect the system's step response.

Theory:

Damping ratio affects overshoot, rise time, and settling time. This helps in choosing proper
damping for performance tuning.
Code:

t = 0:0.01:10; % Time vector

% Transfer function for zeta = 0 (Undamped)

num1 = [1];

den1 = [1 0 1];

t1 = tf(num1,den1);

subplot(3,2,1)

step(t1, t)

title('0')

num2 = [1]; % Transfer function for zeta = 0.2

den2 = [1 2*0.2 1];

t2 = tf(num2,den2);

subplot(3,2,2)

step(t2, t)

title('0.2')

num3 = [1]; % Transfer function for zeta = 0.4

den3 = [1 2*0.4 1];

t3 = tf(num3,den3);
subplot(3,2,3)

step(t3, t)

title('0.4')

num4 = [1]; % Transfer function for zeta = 0.6

den4 = [1 2*0.6 1];

t4 = tf(num4,den4);

subplot(3,2,4)

step(t4, t)

title('0.6')

% Transfer function for zeta = 0.8

num5 = [1];

den5 = [1 2*0.8 1];

t5 = tf(num5,den5);

subplot(3,2,5)

step(t5, t)

title('0.8')

% Transfer function for zeta = 1.0 (Critically damped)

num6 = [1];

den6 = [1 2*1 1];

t6 = tf(num6,den6);

subplot(3,2,6)
step(t6, t)

title('1.0')

Output:
Discussion:

The damping ratio directly influences how a system reacts to sudden changes, making it a
key consideration in fields like renewable energy systems, electric vehicle control, and
industrial drives. By studying how varying the damping ratio alters the step response,
Electrical Engineers can design systems that are not only stable but also responsive and
energy-efficient. This experiment provides foundational insight for optimizing performance
and avoiding issues like excessive overshoot or sluggish behavior in practical control
systems.
Experiment 11: Step Response of 2nd Order System
According to Pole Movement

Objective:

To analyze how changes in the location of poles affect the step response of second-order
systems.

Theory:

Pole locations in the s-plane significantly impact the time response of a system. Systems
with poles farther to the left are faster and more stable. This experiment explores systems
with complex conjugate poles with varying real parts.

Code 1:

den1=poly([-1+2i -1-2i]);

den2=poly([-1.5+2i -1.5-2i]);
den3=poly([-2+2i -2-2i]);

num1=den1(3);

num2=den2(3);

num3=den3(3);

f1=tf(num1,den1)

f2=tf(num2,den2)

f3=tf(num3,den3)

pzmap(f1,f2,f3)

t=0:0.1:10;

c1=step(num1,den1,t);

c2=step(num2,den2,t);

c3=step(num3,den3,t);

plot(t,c1,t,c2,t,c3)
Output:
Code 2:

den1=poly([-1+2i -1-2i]);

den2=poly([-1+4i -1-4i]);

den3=poly([-1+6i -1-6i]);
num1=den1(3);

num2=den2(3);

num3=den3(3);

f1=tf(num1,den1)

f2=tf(num2,den2)

f3=tf(num3,den3)

pzmap(f1,f2,f3)

t=0:0.1:10;

c1=step(num1,den1,t);

c2=step(num2,den2,t);

c3=step(num3,den3,t);

plot(t,c1,t,c2,t,c3)
Output:
Code 3:

den1=poly([-1+2i -1-2i]);

den2=poly([-2+4i -2-4i]);

den3=poly([-3+6i -3-6i]);

num1=den1(3);

num2=den2(3);

num3=den3(3);

f1=tf(num1,den1)

f2=tf(num2,den2)
f3=tf(num3,den3)

pzmap(f1,f2,f3)

t=0:0.1:10;

c1=step(num1,den1,t);

c2=step(num2,den2,t);

c3=step(num3,den3,t);

plot(t,c1,t,c2,t,c3)
Output:

Discussion:

This experiment is important for understanding how system poles influence time-domain
performance like speed and damping. In control design and power electronics, many
systems require precise tuning of transient characteristics. For instance, motor drives and
compensators for inverter systems often rely on pole placement analysis to balance
stability and responsiveness. Knowledge of how pole manipulation affects step response
supports the design of more reliable and optimized control systems.

Experiment 12: Underdamped System Parameters

Objective:

To evaluate key parameters of an underdamped second-order system using MATLAB's


stepinfo.

Theory:

Underdamped systems exhibit oscillations before settling. Parameters like rise time, peak
time, overshoot, and settling time define system performance.
Code:

m = 5; % mass (kg)

b = 5; % damping coefficient (N·s/m)

k = 28; % spring constant (N/m)

% Transfer function denominator only

num = 1;

den = [m b k];

sys = tf(num,den);

% Get step response info

info = stepinfo(sys);

% Display

fprintf('Rise Time %.4f sec\n', info.RiseTime);

fprintf('Peak Time %.4f sec\n', info.PeakTime);

fprintf('Overshoot %.4f %% \n', info.Overshoot);

fprintf('Settling Time %.4f sec\n', info.SettlingTime);

Output:
Discussion:

Underdamped systems are commonly encountered in electrical engineering applications


such as RLC circuits, motor control loops, and resonant converters. The ability to extract
and interpret key parameters such as overshoot, settling time, and rise time is essential for
assessing and improving system performance. This experiment demonstrates how to
evaluate dynamic behavior, which is a fundamental step in the design and troubleshooting
of circuits and systems that operate under oscillatory conditions.

Experiment 13: Second Order Approximation

Objective:

To understand the impact of far poles and zeros on the second-order approximation.
Theory:

Second-order approximation is a simplification used in control design. Far poles/zeros


have minimal impact on transient response, allowing simplification

Code:

% Base second-order system

num = [1];

den = [1 2 10]; % Example: wn=√10, zeta=0.316

sys = tf(num, den);

% 1. Add far pole (at -50)

sysPF = tf(num, conv(den, [1 50])); %PF=PoleFar

% 2. Add far zero (at -50)

sysZF = tf(conv(num, [1 50]), den); %ZF=ZeroFar

% 3. Add right-half-plane zero (at +2)


sysNM = tf(conv(num, [1 -2]), den); %NM=NonMinimum

% Plot all step responses

step(sys,'b', sysPF,'g--', sysZF,'r-.', sysNM,'m:');

Output:

Discussion:

Simplifying complex systems into second-order models is a common practice in fields


such as automotive electronics, robotics, and signal processing. Second-order
approximations help reduce computational load while preserving key dynamic
characteristics. This experiment emphasizes how distant poles and zeros influence
system behavior, enabling effective modeling decisions that maintain accuracy and
facilitate implementation on embedded or resource-constrained platforms.
Experiment 14: Reduction of Multiple Subsystems
Objective:

To simplify block diagrams with series and feedback systems using MATLAB.

Theory:

Combining multiple blocks into one system using convolution and feedback functions
helps in analyzing and designing complete control systems.
Code 1:

numg=[1 1];

deng=[500 0 0];

numh=[1 1];

denh=[1 2];

[num,den]=feedback(numg,deng,numh,denh,-1);

printsys(num,den)

Output 1:

Code 2:

% Define G(s)

numg = [1 1]; % Numerator of G(s): s + 1


deng = [500 0 0]; % Denominator of G(s): 500s^2

% Define Gc(s)

numh = [1 1]; % Numerator of Gc(s): s + 1

denh = [1 2]; % Denominator of Gc(s): s + 2

% Series connection: multiply numerators and denominators

num = conv(numg, numh); % (s+1)*(s+1)

den = conv(deng, denh); % (500s^2)*(s+2)

% Display result

printsys(num, den)

Output:
Code 3
Output

Discussion:

Simplifying complex systems into second-order models is a common practice in fields


such as automotive electronics, robotics, and signal processing. Second-order
approximations help reduce computational load while preserving key dynamic
characteristics. This experiment emphasizes how distant poles and zeros influence
system behavior, enabling effective modeling decisions that maintain accuracy and
facilitate implementation on embedded or resource-constrained platforms.

Experiment 15: Steady State Error


Objective:

To calculate steady-state error of a system using MATLAB.


Theory:

Steady-state error indicates how accurately a system follows an input. It is determined


using the final value theorem and depends on the system type.

Code:

num=1000*[1 8];

den=poly([-7 -9]);

G=tf(num,den);

kp=dcgain(G)

estep=1/(1+kp)

Output:
Discussion:

Steady-state error analysis is essential in applications that demand long-term accuracy,


including speed control of electric drives, voltage regulation, and position tracking in
robotics. This experiment introduces methods to calculate and interpret steady-state
error, supporting the design and tuning of control systems that must maintain precision
under continuous operation.

Experiment 16: Root Locus Technique


Objective:

To plot the root locus of a system and observe how poles change with gain.
Theory:

Root locus shows the path of poles as gain varies. It is used in controller design for system
stability.

Code:

G=1/(s*(s+2)(s^2+2s+10)); % Plot the root locus

rlocus(G);

% Plot root locus with a damping ratio line (for example: zeta = 0.5)
zeta=0.5; % Damping ratio

sgrid(zeta,0) % Plot constant damping ratio line

Output:
Discussion:

Root locus is a valuable tool for control system design, particularly in tuning controllers to
meet stability and transient performance requirements. In areas such as voltage
regulation, motor drive control, and industrial automation, visualizing pole migration with
gain variation aids in selecting appropriate controller gains. This experiment builds the
foundation for using root locus to enhance system responsiveness and reliability.

Experiment 17: Frequency Response Analysis


Objective:

To analyze the frequency response of systems using Bode plots.


Theory:

Frequency response provides insights into gain and phase margins. Bode plots help in
stability and performance analysis.

Code a:

G = 10 / (s * (s + 1) * (s + 2));

bode(G)

Output:
Code b:

G = 1000 / ((s + 3) * (s + 4) * (s + 5) * (s + 6));

bode(G)

Output:
Code c:

G = 50 * (s + 3) / ((s + 2) * (s + 4));

bode(G)

Output:
Q: Determine the Gain Margin, Phase Margin, Gain Crossover Frequency, phase crossover
frequency of any transfer function using both figure and margin command.

Code:

G = 10 / (s * (s + 2) * (s + 5)); % Using margin command (prints and plots all info)

figure;

margin(G); % This gives GM, PM, ω_gc, ω_pc on the plot

% Using margin() function to extract values numerically

[GM, PM, w_gc, w_pc] = margin(G);

% Convert to dB

GM_dB = 20 * log10(GM);

Output:
Code a:
a=[0 1;-25 -4];

b=[0;25];

c=[1 0];

d=[0];

bode(a,b,c,d)

Output:
Discussion:

Frequency response analysis is vital in disciplines such as analog circuit design, power
systems, and communications. This experiment provides experience with Bode plots and
the interpretation of gain and phase margins. These concepts are essential when designing
stable filters, amplifiers, and feedback systems, and are widely applied to validate the
robustness and performance of electrical systems in varying frequency environments.
Experiment 18: Routh-Hurwitz Criterion for Stability

Objective:

To determine the range of gain K for which a system remains stable using Routh-Hurwitz
criterion.

Theory:

The Routh-Hurwitz criterion provides a method to determine the number of right-half plane
poles without solving the equation. It is fundamental in control system stability analysis.

Question

Code:

syms K; a3 = 1; a2 = K - 1; a1 = 2*K - 4; a0 = 24;

r1 = [a3, a1];

r2 = [a2, a0];

r3_1 = simplify((a2a1 - a3a0)/a2); % Avoid division by 0

ineq1 = a2 > 0; ineq2 = r3_1 > 0;

assume(K, 'real'); S1 = solve(ineq1, K, 'ReturnConditions', true); S2 = solve(ineq2, K,


'ReturnConditions', true);

disp('Condition from a2 > 0:'); disp(S1.conditions);

disp('Condition from Routh array row 3 > 0:'); disp(S2.conditions);


% Optional: Find intersection of intervals manually fplot(r3_1, [0, 10]); grid on; xlabel('K');
ylabel('Routh Row 3 Value'); title('Routh Criterion Condition for Stability');

Output:
Discussion:

The Routh-Hurwitz criterion is a foundational analytical technique for determining system


stability without explicitly solving for poles. This method is especially useful in embedded
system design, analog circuit stability checks, and protective relay settings in power
systems. This experiment reinforces mathematical tools that are essential in designing
stable and predictable control systems under various parameter conditions.

Experiment 19: Improvement of a System using PID


Controller

Objective:

To observe the performance improvement of a system using P, PI, PD, and PID controllers.
Theory:

PID controllers combine proportional, integral, and derivative actions to improve transient
and steady-state behavior.

Question:

Code:
Output:

Discussion:

Understanding pole-zero locations and system characteristics like damping ratio and
natural frequency is crucial in fields such as power electronics, motor control, and filter
design. In an Electrical Engineering job, this knowledge allows professionals to predict how
systems will behave under different conditions. For example, in designing a servo motor
system or tuning a power converter, engineers must know how to shape the transient
response. Using MATLAB tools to analyze these parameters speeds up design cycles and
enhances accuracy in real-world applications.

You might also like