Pole Placement Techniques Part 2
Mostrar comentarios más antiguos
My task is that i should
- Determine the system's transfer function and express the system's state equations in phase-variable form.
- Identify a set of state-feedback gains using the pole placement technique to achieve specific performance criteria.
- Convert the obtained set of state-feedback gains in the phase-variable system to the original system representation.
- Verify that the set of gains in step (iii) successfully places the closed-loop poles at the desired positions.
This is my code thus far and my answer was deemed incompleted to which i've asked my peers and we all arrived at the same conclusion regarding task 3 and 4. Can you point me to the right direction on how i should approach? Thank you in advance.
clc; clear
% (1)
% Define the state-space matrices
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C = [0 1];
D = 0;
% Create a state-space system
sys = ss(A, B, C, D)
% Convert the state-space system to transfer function
disp('The system transfer function:');
tf_sys = tf(sys)
% Convert to phase-variable form
[Apv, Bpv, Cpv, Dpv] = canon(A, B, C, D, 'companion');
% Display the state-space matrices in phase-variable form
disp('Phase-Variable Form Matrices:');
disp('Apv:');
disp(Apv);
disp('Bpv:');
disp(Bpv);
disp('Cpv:');
disp(Cpv);
disp('Dpv:');
disp(Dpv);
%(2)
% Specify desired 20% overshoot and 0.5s settling time
OS = 0.2; %overshoot
ST = 0.5; %settling time
% Calculate natural frequency and damping ratio of system
zeta = -log(OS) / sqrt(pi^2 + (log(OS))^2);
omega_n = 4 / (zeta * ST);
disp('omega_n=');
disp(omega_n);
disp('zeta=');
disp(zeta);
% Calculate desired poles
sigma = -zeta * omega_n;
omega_d = omega_n * sqrt(1 - zeta^2);
desiredPoles = [sigma + 1i*omega_d, sigma - 1i*omega_d];
disp('The desired poles for the system :')
disp(desiredPoles);
% Use the place command to find state-feedback gains
K = place(Apv, Bpv, desiredPoles);
disp('State-feedback gains (K):');
disp(K);
sys_cl = ss(Apv - Bpv*K, Bpv, Cpv, Dpv); % Create the closed-loop state-space model
N = dcgain(sys_cl) %Steady-state value
Sys_cl = ss(Apv - Bpv*K, Bpv/N, Cpv, Dpv);
%step(sys_cl); % Plot the step response of the closed-loop system
%(3)
% Diagonalize matrix A
[T, ~] = eig(A);
%T = V;
%D = 0;
% Display transformation matrix T
disp('Transformation matrix (T):');
disp(T);
% Calculate state-feedback gains in the original system
K_original = K / T;
disp('State-feedback gains in the original system (K_original):');
disp(K_original)
%(4)
% Calculate closed-loop system matrix A_cl
A_cl = Apv - Bpv * K_original;
disp('The closed-loop system matrix A_cl:')
disp(A_cl);
sys_cl2 = ss(A_cl, Bpv, Cpv, Dpv)
% Calculate closed-loop poles
closedLoopPoles = eig(A_cl);
% Display the results
disp('Desired pole locations:');
disp(desiredPoles);
disp('Actual closed-loop pole locations:');
disp(closedLoopPoles);
% Check if the poles match the desired locations
if isequal(round(closedLoopPoles, 4), round(desiredPoles, 4))
disp('The closed-loop poles match the desired locations.');
else
disp('The closed-loop poles do not match the desired locations.');
end
%Plot Step Response
step(sys), hold on
step(Sys_cl), hold on
step(sys_cl2), grid on
legend('Original System', 'Compensated System', 'TBH IDK')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre State-Space Control Design en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



