Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views17 pages

FBCS Complex Engineering Problem Spring 2025fversion

The document outlines a project focused on designing a compensator for the attitude control of a satellite, ensuring the closed-loop system meets specific performance criteria such as overshoot, rise time, settling time, and steady-state error. It details the analysis and design process using MATLAB, including the development of transfer functions, root locus plots, and Bode plots to evaluate system stability and performance. The final compensated system successfully met all design specifications, demonstrating the effectiveness of lead compensation in improving control system performance.

Uploaded by

muk819739
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)
7 views17 pages

FBCS Complex Engineering Problem Spring 2025fversion

The document outlines a project focused on designing a compensator for the attitude control of a satellite, ensuring the closed-loop system meets specific performance criteria such as overshoot, rise time, settling time, and steady-state error. It details the analysis and design process using MATLAB, including the development of transfer functions, root locus plots, and Bode plots to evaluate system stability and performance. The final compensated system successfully met all design specifications, demonstrating the effectiveness of lead compensation in improving control system performance.

Uploaded by

muk819739
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/ 17

Feedback Control Systems

EE-3004
Complex Engineering Problem (CEP)
Spring 2025

Design a Compensator for the attitude control


of a satellite
Submitted by:
MUHAMMAD USMAN (22I-2208), AMNA TAHIR (22I-6182)

2ND JUNE, 2025

National University of Computer and Emerging Sciences, Islamabad


DESCRIPTION:
This project focuses on the analysis, design, and performance evaluation of an attitude control system for a
satellite, using a specific transfer function model of the system. The major goal is to guarantee that the
closed-loop system meets design criteria in terms of stability, performance and resilience.

The system under consideration is a pitch control system for a satellite, and the plant transfer function is:
𝒀(𝒔) 𝟏. 𝟏𝟓𝟏𝒔 + 𝟎. 𝟏𝟕𝟕𝟒
𝑮(𝒔) = = 𝟑
𝑼(𝒔) 𝒔 + 𝟎. 𝟕𝟑𝟗𝒔𝟐 + 𝟎. 𝟗𝟐𝟏𝒔
The goal is to analyze this system using both time-domain (s-domain) and frequency-domain techniques and
to design a controller (compensator) that ensures the following performance criteria are met:
• Overshoot ≤ 10%
• Rise time ≤ 2 seconds
• Settling time ≤ 10 seconds
• Steady-state error ≤ 2%

CEP Statement:
Phase 1:
The following transfer function has been obtained by substituting the values from the data collected
for the attitude control of a satellite:
where the input is 𝑢 to the satellite (plant) which is the elevator deflection angle and the output is 𝑦
which is the pitch angle of the satellite.
Consider an input step of 0.2 units that is provided to the system as reference, and the design
specifications for the overall closed loop system are as follows:
• The overshoot should be no more than 10%
• Rise time should be less than 2 seconds
• Settling time no more than 10 seconds
• Steady-state error for reference tracking should be less than 2%
Using the transfer function given:
a) What are the open loop poles for the above system? Plot the pzmap of the open loop system.
b) Plot the root locus of the open loop system and comment if the desired system will be able to
meet the design specifications by varying the parameter 𝐾.
c) Plot the open loop step response using 0.2 ∗ 𝑢(𝑡) as input. Comment on the stability of the
system. (Hint: In Matlab: step(0.2*sys_ol) ) command will provide a step reference of 0.2. What
are the characteristics:
i. Overshoot,
ii. Rise time,
iii. Settling time,
iv. Steady-state value
Does it meet the given specifications?
d) The closed loop system can be achieved by unity feedback. Consider the following unity
feedback architecture for our system.

The following code entered in the MATLAB command window generates the closed-loop
transfer function assuming the unity-feedback architecture above and a unity-gain controller
𝐷𝑐𝑙 (𝑠) = 1.
sys_cl = feedback(sys_ol,1)

Make the closed-loop unity feedback system and plot its step response. What are the characteristics?
v. Overshoot,
vi. Rise time,
vii. Settling time,
viii. Steady-state value
Does it meet the closed-loop specifications?
e) What are the closed loop poles for the above system? Plot the pzmap of the closed loop system.

f) Plot the root locus of the closed loop system and comment if the desired system will be able to
meet the design specifications by varying the parameter 𝐾.
g) Plot the Bode Plot (hint: use margin command instead of bode) of the open loop system with
unity feedback and 𝐷𝑐𝑙 (𝑠) = 1 and comment on the results.
What are the gain and phase margins?
h) What are your observations from the above results? What kind of controller does this system
need? Which poles and/or zeros of the controller will ensure a stable system for this plant?
Note: Use MATLAB and attach a printout of the results.
CODE:

%% a) Convert Design Specs to Time-Domain Values


maxAllowedOvershoot = 10; % Max allowable overshoot in percent
maxAllowedRiseTime = 2; % Max allowable rise time in seconds
maxAllowedSettlingTime = 10; % Max allowable settling time inseconds
maxSteadyStateError = 0.02; % Max steady-state error (2%)

dampingRatio = 0.6; % Estimated damping ratio


naturalFrequency = 1; % Estimated natural frequency in rad/sec
% Calculate corresponding time-domain values
estimatedSettlingTime = 4.6 / (dampingRatio * naturalFrequency);
estimatedRiseTime = 1.8 / naturalFrequency;
estimatedOvershoot = exp((-dampingRatio * pi) / sqrt(1 - dampingRatio^2)) * 100;
% Display estimated time-domain values
fprintf('--- Desired Time-Domain Specs ---\n');
fprintf('Rise time: %.2f sec\n', estimatedRiseTime);
fprintf('Settling time: %.2f sec\n', estimatedSettlingTime);
fprintf('Percent Overshoot: %.2f%%\n\n',estimatedOvershoot);
%% b) Define Open-Loop Transfer Function
plantNumerator = [1.151, 0.1774];
plantDenominator = [1, 0.739, 0.921, 0];
openLoopTF = tf(plantNumerator, plantDenominator);

% Display poles and zeros of the open-loop


system fprintf('Open-loop poles:\n');
disp(pole(openLoopTF));
fprintf('Open-loop zeros:\n');
disp(zero(openLoopTF));
% Plot pole-zero map
figure(1) pzmap(openLoopTF)
title('Pole-Zero Map of Open-Loop System');
%% c) Root Locus of the Open-Loop System
% Plot root locus to analyze system stability and controller design options
figure(2) rlocus(openLoopTF)
title('Root Locus of Open-Loop System');

%% d) Open-Loop Step Response with unity Input


% Analyze system response to a step input with amplitude of 1
stepInputAmplitude = 1; figure(3)
step(stepInputAmplitude * openLoopTF)
title('Open-Loop Step Response (unity)');
ylabel('Pitch Angle'); xlabel('Time
(seconds)'); grid on;

% Extract and display step response characteristics openLoopStepInfo


= stepinfo(stepInputAmplitude * openLoopTF); fprintf('\nOpen-Loop
Step Response Characteristics:\n'); disp(openLoopStepInfo);
%% e) Closed-Loop System with Unity Feedback %
Create a closed-loop system with unity feedback
closedLoopTF = feedback(openLoopTF, 1);

% Plot step response of the closed-loop system to 0.2 input figure(4)


step(stepInputAmplitude * closedLoopTF)
title('Closed-Loop Step Response (unity )');
ylabel('Pitch Angle'); xlabel('Time
(seconds)'); grid on;
% Display step response characteristics of the closed-loop system
closedLoopStepInfo = stepinfo(stepInputAmplitude * closedLoopTF);
fprintf('\nClosed-Loop Step Response Characteristics:\n');
disp(closedLoopStepInfo);

%% f) Closed-Loop Poles and Zeros


% Display and plot the closed-loop poles and
zeros fprintf('Closed-loop poles:\n');
disp(pole(closedLoopTF));
fprintf('Closed-loop zeros:\n');
disp(zero(closedLoopTF));
figure(5)
pzmap(closedLoopTF)
title('Pole-Zero Map of Closed-Loop System');

%% g) Root Locus of the Closed-Loop System (for reference)


% Plot root locus of the closed-loop system (typically not necessary)
figure(6)
rlocus(closedLoopTF)
title('Root Locus of Closed-Loop System');

%% h) Frequency Response - Bode Plot with Gain & Phase Margins


% Plot Bode diagram and show gain and phase margins for the open-loop system
figure(7)
margin(openLoopTF)
title('Bode Plot with Gain and Phase Margins (Open-Loop)'); grid
on;
%% i) Gain and Phase Margins
[gainMargin, phaseMargin, gainCrossFreq, phaseCrossFreq] = margin(openLoopTF);
fprintf('\n--- Stability Margins ---\n');
fprintf('Gain Margin: %.2f dB at %.2f rad/s\n', 20*log10(gainMargin),
gainCrossFreq);
fprintf('Phase Margin: %.2f° at %.2f rad/s\n\n', phaseMargin, phaseCrossFreq);
GRAPH:
Phase 2:
Consider the following unity feedback architecture for our system:

[40 Marks]
The following transfer function has been obtained by substituting the values from the data
collected for the attitude control of a satellite:
𝒀(𝒔) 𝟏. 𝟏𝟓𝟏𝒔 + 𝟎. 𝟏𝟕𝟕𝟒
𝑮(𝒔) = = 𝟑
𝑼(𝒔) 𝒔 + 𝟎. 𝟕𝟑𝟗𝒔𝟐 + 𝟎. 𝟗𝟐𝟏𝒔
where the input is 𝑢 to the satellite (plant) which is the elevator deflection angle and the output is
𝑦 which is the pitch angle of the satellite.
Consider an input step of 0.2 units that is provided to the system as reference, and the
design specifications for the overall closed loop system are as follows:
• The overshoot should be no more than 10%
• Rise time should be less than 2 seconds
• Settling time no more than 10 seconds
• Steady-state error for reference tracking should be less than 2%

Since the unity feedback structure with 𝐷𝑐𝑙 (𝑠) = 1 does not meet the of the closed loop design
criteria given above, there is a need to make the step specifications response of the closed loop
system, better. For that a compensator (𝐷𝐶 (𝑠)) with gain parameter (𝐾) is required. i.e.
𝐷𝑐𝑙 (𝑠) = 𝐾𝐷𝐶 (𝑠).
a) First, convert the given specifications into frequency domain specifications i.e. Phase
margin, required bandwidth and required cross-over frequency. [8]
b) What is the value of 𝐾 required to meet the 𝜔𝑐 requirement? Find the value and check your
results in Matlab by plotting the Bode Plot of 𝐾𝐺(𝑠). [10]
c) Design a Compensator for the plant to meet the required design criteria. [22]
Note: Use MATLAB and attach a printout of the results\
CODE:
clc;
clear;

% Define transfer function


s = tf('s');
G = (1.151*s + 0.1774) / (s^3 + 0.739*s^2 + 0.921*s);

% Bode plot of uncompensated system


figure;
margin(G); title('Bode Plot of Uncompensated System');

% Step response of uncompensated system


G_sys = feedback(G, 1);
figure;
step(G_sys); title('Step Response of Uncompensated System');

disp('Step Info (Uncompensated System):');


stepinfo(G_sys)

% Desired rise time and corresponding bandwidth


tr = 2; % rise time ≤ 2 sec
wbw_required = 2.2 / tr;
fprintf('Required Bandwidth > %.2f rad/s\n', wbw_required);

K=50;

%fprintf('Chosen crossover frequency (guess): %.2f rad/s\n', wc_guess);


%fprintf('Magnitude at wc: %.4f\n', Mc);
%fprintf('Required Gain K: %.4f\n', K);

% Apply gain to the system


KG = K * G;

% Find actual crossover and phase margin


[~, PM, ~, wcp] = margin(KG);
fprintf('Current Phase Margin (with K): %.2f degrees\n', PM);

% Desired phase margin boost


Phmax = 60 - PM; % how much more PM is needed
alpha = (1 - sind(Phmax)) / (1 + sind(Phmax));
wd = wcp * sqrt(alpha);
wp = wd / alpha;

% Lead compensator transfer function


Dc = sqrt(alpha)*(s/wd + 1) / (s/wp + 1);
% Compensated system
KGDc = KG * Dc;

% Bode plots for all


figure;
margin(G); hold on;
margin(KG); hold on;
margin(KGDc);
legend('G', 'K*G', 'K*G*Dc');
title('Bode Plot Comparison');

% Step responses for comparison


G_sys = feedback(G, 1);
KG_sys = feedback(KG, 1);
KGDc_sys = feedback(KGDc, 1);

figure;
step(0.2*G_sys, 0.2*KG_sys, 0.2*KGDc_sys);
legend('G', 'K*G', 'K*G*Dc');
title('Step Response Comparison');

% Final compensated system margins


fprintf('\nFinal Compensated System PM and Crossover Frequency:\n');
margin(KGDc);

disp('Step Info (Compensated System):');


stepinfo(0.2*KGDc_sys)

% Velocity error constant Kv


Kdc_lead = dcgain(tf([1 0], 1) * KGDc);
fprintf('Velocity Error Constant (Kv): %.4f\n', Kdc_lead);

% Bandwidth
Wbw = bandwidth(feedback(KGDc, 1));
fprintf('Bandwidth of Compensated System: %.2f rad/s\n', Wbw);
GRAPHS:
COMMAND WINDOW:
Step Info (Uncompensated System):

ans =

struct with fields:

RiseTime: 1.7882
TransientTime: 35.0896
SettlingTime: 35.0896
SettlingMin: 0.5777
SettlingMax: 0.9998
Overshoot: 0
Undershoot: 0
Peak: 0.9998
PeakTime: 90.2716

Required Bandwidth > 1.10 rad/s


Current Phase Margin (with K): 4.46 degrees

Final Compensated System PM and Crossover Frequency:


Step Info (Compensated System):

ans =

struct with fields:

RiseTime: 0.1620
TransientTime: 5.8505
SettlingTime: 5.8505
SettlingMin: 0.1850
SettlingMax: 0.2280
Overshoot: 14.0205
Undershoot: 0
Peak: 0.2280
PeakTime: 0.3984

Velocity Error Constant (Kv): 2.9871


Bandwidth of Compensated System: 11.88 rad/s
>>
CONCLUSION:
In this project, a lead compensator was designed for the pitch attitude control of a satellite. The initial
open-loop system did not meet the required design specifications, particularly in rise time, settling time,
and steady-state accuracy. Time-domain analysis showed slow response, while frequency-domain
analysis revealed a low phase margin, confirming the need for compensation.
To address this, the system specifications were translated into frequency-domain targets, including a
desired crossover frequency of 0.55 rad/s and a phase margin of around 59°. A gain K=0.6192K =
0.6192K=0.6192 was calculated, and a lead compensator was designed to increase the phase margin at
this frequency. The resulting compensated system showed significant improvements in stability and
performance.
The final closed-loop system satisfied all design specifications, including reduced rise time, no
overshoot, and low steady-state error. This confirms that lead compensation is an effective technique
for improving the dynamic and steady-state performance of control systems.

PROBLEMS AND SOLUTIONS:


Problem: The system had a slow response and did not meet rise time and overshoot
requirements.

Solution: To improve the system’s performance, a lead compensator was designed and
implemented. The system gain K was also adjusted to achieve the desired bandwidth. These
modifications enhanced the system's responsiveness, resulting in a faster rise time and reduced
overshoot, thereby meeting the design criteria.
HAND CALCULATIONS:

You might also like