Regarding Pole Placement Techniques
26 views (last 30 days)
Show older comments
I am trying to solve a question and ultimately verify the performance of a DC-DC converter system through pole placement techniques.
clc; clear
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C = [0 1];
D = 0;
%Create state-space and convert to transfer function
sys = ss(A, B, C, D);
tf_sys = tf(sys);
%Define 20% overshoot and 0.5s settling time
OS = 0.2;
ST = 0.5;
%Natural Frequency and damping ratio
omega_n = 4 / (ST * (1 - OS^2)^0.5);
zeta = -log(OS) / (omega_n * ST);
%Desired Poles
sigma = -zeta * omega_n;
omega_d = omega_n * sqrt(1 - zeta^2);
desiredPoles = [sigma + 1i*omega_d, sigma - 1i*omega_d];
%Find K
K = place (A, B, desiredPoles);
%create closed loop
sys_cl = ss(A - B*K, B, C, D);
%Finding K_Original
[V, D] = eig(A);
T = V;
K_original = K / T;
A_cl = A - B * K_original;
sys_cl2 = ss(A_cl, B, C, D);
The error below shows for sys_cl2, but not for sys_cl. Can someone point out wheres the wrong step?
Error using ss
The "B" and "D" matrices must have the same number of columns.
Error in ProjectControlSystem (line 78)
sys_cl2 = ss(A_cl, B, C, D)
0 Comments
Accepted Answer
Paul
on 19 Jan 2024
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C = [0 1];
D = 0;
%Create state-space and convert to transfer function
sys = ss(A, B, C, D);
tf_sys = tf(sys);
%Define 20% overshoot and 0.5s settling time
OS = 0.2;
ST = 0.5;
%Natural Frequency and damping ratio
omega_n = 4 / (ST * (1 - OS^2)^0.5);
zeta = -log(OS) / (omega_n * ST);
%Desired Poles
sigma = -zeta * omega_n;
omega_d = omega_n * sqrt(1 - zeta^2);
desiredPoles = [sigma + 1i*omega_d, sigma - 1i*omega_d];
%Find K
K = place (A, B, desiredPoles);
%create closed loop
sys_cl = ss(A - B*K, B, C, D);
%Finding K_Original
[V, D] = eig(A);
T = V;
K_original = K / T;
A_cl = A - B * K_original;
sys_cl2 = ss(A_cl, B, C, D);
The matrix D was modified in the call to eig.
4 Comments
Paul
on 19 Jan 2024
Edited: Paul
on 19 Jan 2024
You're applying different feedback gain matrices to the same A matrix, which can't be right. Revisit your text book and/or course notes and recheck the workflow.
I suspect the workflow would be something like:
1) define the system in physical coordinates.
2) define the similiarity transformation, T, to go to phase-variable coordinates
3) apply similarity transformation to get model in phase-variable coordinates ss2ss
4) compute feedback gain matrix K1 to place desired poles for phase-variable coordinates
5) use T to transform K1 to K which would be the feedback gain matrix to use in physical coordinates.
What's your definition of phase-variable form? Based on what I think it is, I don't understand how eigenvectors would get involved in any of the calculations.
More Answers (1)
Sam Chak
on 19 Jan 2024
Just a heads up, it looks like you forgot to convert the original state-space system to phase-variable form. Also, I noticed a small hiccup with the computed omega_n and zeta – they seem a bit off. Double-check the formulas; I'm unable to recall the formulas right now. Your pole placement procedure is on point, though. The last piece of the puzzle is scaling the Input matrix in the Closed-loop system to achieve zero steady-state error. Keep up the good work!
%% Original State-space System
A = [0 -83.33;
500 -10];
B = [166.67;
0];
C = [0 1];
D = 0;
Sys = ss(A, B, C, D);
%% Convert to State-space in phase-variable form
Apv = [0 1;
A(2,1)*A(1,2) A(2,2)];
Bpv = [0;
A(2,1)*B(1)];
Cpv = [1 0];
Dpv = D;
Spv = ss(Apv, Bpv, Cpv, Dpv)
% tf_sys = tf(sys); % unused
%% Define 20% overshoot and 0.5s settling time
OS = 0.2;
ST = 0.5;
%% Natural Frequency and damping ratio
omega_n = 4/(ST*(1 - OS^2)^0.5)
zeta = -log(OS)/(omega_n*ST)
omega_n = 16.6548075069292;
zeta = 0.455949810769126;
%% Desired Poles
sigma = -zeta*omega_n;
omega_d = omega_n*sqrt(1 - zeta^2);
desiredPoles = [sigma + 1i*omega_d, sigma - 1i*omega_d]
%% Find K via Pole Placement
K = place(Apv, Bpv, desiredPoles)
%% Closed-loop system
sys_cl = ss(Apv - Bpv*K, Bpv, Cpv, Dpv);
N = dcgain(sys_cl) % steady-state value
Sys_cl = ss(Apv - Bpv*K, Bpv/N, Cpv, Dpv);
%% Check if the design requirements are met
stepinfo(Sys_cl)
%% Plot step responses
step(Sys), hold on
step(Sys_cl), grid on
legend('Original System', 'Compensated System')
2 Comments
MUHAMMAD ANAS SULHI
on 20 Jan 2024
Edited: MUHAMMAD ANAS SULHI
on 20 Jan 2024
Sam Chak
on 20 Jan 2024
I've triple-checked. Your friend's code with the 'canonical' approach:
% [Apv, Bpv, Cpv, Dpv] = canon(A, B, C, D, 'companion');
is referred to as the Companion Canonical Form. I hope you have read the documentation. Mine corresponds to the Controllable Canonical Form, but it also goes by the less recognized term, the phase-variable canonical form.
To the best of my knowledge, there isn't a direct MATLAB command to transform the linear model into the phase-variable canonical realization. You'd need an additional line to achieve that. However, I don't recommend taking this route because both you and your friend seem to heavily rely on certain commands without fully grasping their implications and the underlying control theory.
My suggestion is to heed @Paul's advice for your Part 2 adventure, as you are going to need the Phase-variable coordinate Transformation Matrix, .
% Define the state-space matrices
A = [0 -83.33; 500 -10];
B = [166.67; 0];
C = [0 1];
D = 0;
% Convert to phase-variable form
[Acc, Bcc, Ccc, Dcc] = canon(A, B, C, D, 'companion');
spv = ss(Acc', Ccc', Bcc', Dcc')
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!