0% found this document useful (0 votes)
4 views5 pages

final control assignment (Autosaved)-1

The document provides MATLAB code for plotting the response of an accelerometer and the root locus of a given transfer function. It explains the significance of root locus in analyzing system stability and behavior with varying gain values. The results indicate that the system remains stable for all positive gain values, and MATLAB facilitates visualization of the root movement.

Uploaded by

wasifmir28
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)
4 views5 pages

final control assignment (Autosaved)-1

The document provides MATLAB code for plotting the response of an accelerometer and the root locus of a given transfer function. It explains the significance of root locus in analyzing system stability and behavior with varying gain values. The results indicate that the system remains stable for all positive gain values, and MATLAB facilitates visualization of the root movement.

Uploaded by

wasifmir28
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/ 5

Q1. Plot the response of the accelerometer from the example that was done in class.

The Response of the System is :

MATLAB CODE :

% Plot accelerometer response

t = linspace(0, 5, 1000); % Time vector

P = 1; % Step input magnitude

% Response equation: y(t) = 0.5*(-P - 2P*e^(-t) - (P+2)e^(-2t))

y = 0.5 * (-P - 2*P.*exp(-t) - (P + 2).*exp(-2*t));

% Plotting

figure;

plot(t, y, 'LineWidth', 2);

grid on;
xlabel('Time (s)');

ylabel('y(t)');

title('Accelerometer Response');

legend(['P = ', num2str(P)]);

Response of Accelerometer:
Q2. Plot the root locus of the following response:

Root Locus :

The root locus is a graphical method used in control engineering to study how the roots (or poles) of a
system's characteristic equation move in the complex plane as a gain K varies from 0 to ∞.

It is based on the transfer function of the system, usually written as:

Why Do We Use Root Locus?


●​ To analyze system stability.
●​ To predict how the system behaves when the gain is changed.
●​ To design control systems (like PID controllers) by choosing appropriate gain values.
●​ If the poles move into the left half of the s-plane, the system is stable. If they go to the
right half, the system becomes unstable and at zero it will be marginally stable.
MATLAB CODE:
numerator = 9;
denominator = [1 10 9];
H = tf(numerator, denominator);
disp('The transfer function H(s) is:')
figure;
rlocus(H);
title('Root Locus of H(s) = 9 / (s^2 + 10s + 9)');
xlabel('Real Axis');
ylabel('Imaginary Axis');
grid on;
●​ num = 9; defines the numerator (the top of the fraction).

●​ den = [1 10 9]; defines the denominator s2+10s+9s^2 + 10s + 9s2+10s+9.

●​ tf(num, den) creates the transfer function H(s) = 9 / (s² + 10s + 9).

●​ disp('The transfer function H(s) is:') = This will automatically print the transfer function in
nice format
●​ figure; = Open a new figure window
●​ rlocus(H); = Plot the root locus
●​ title('Root Locus of H(s) = 9 / (s^2 + 10s + 9)'); = Add a title
●​ xlabel('Real Axis'); = Label X-axis
●​ ylabel('Imaginary Axis'); = Label Y-axis
●​ grid on; = Enable grid lines on the plot for better visualization.
ROOT LOCUS OF GIVEN RESPONSE : 𝐻(𝑆) = 9/(𝑆 + 1)(𝑆 + 9)

RESULTS :
●​ The root locus plot was successfully generated.
●​ The poles of the system were located at:
●​ S = -1 ans S= -9
●​ The root locus showed that as the gain increases, the poles remain on the real axis and
move further apart (still in the stable region).
CONCLUSION:
The root locus is a useful tool to understand how system stability and behavior change with
different gain values.
In our case, the transfer function showed that the system is stable for all positive gain values.
MATLAB made it easy to visualize the root movement and analyze the system without manual
calculations.

You might also like