Regarding Pole Placement Techniques

26 次查看(过去 30 天)
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)

采纳的回答

Paul
Paul 2024-1-19
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);
Error using ss
The "B" and "D" matrices must have the same number of columns.
The matrix D was modified in the call to eig.
  4 个评论
MUHAMMAD ANAS SULHI
Thank you very much, Paul for helping so far but i kinda confused at the question that i've been given.
I need to verify the improved performance of a control system with MATLAB simulation.
My task is that i should;
i. To find the system’s transfer function and express the system’s state equations in phase-variable form.
ii. To find a set of state-feedback gains to obtain 20% overshoot and a settling time of 0.5 second in the phase-variable system.
iii. To obtain the corresponding set of state-feedback gains in the original system.
iv. Verify that the set of gains in (iii) places the closed-loop poles at the desired positions.
I tried simulating closed loop system for both sys_cl and sys_cl2;
%time vector for simulation
t = 0:0.01:5;
%Input vector
u = ones(size(t));
%Simulate the closed-loop system
[y, t, x] = lsim(sys_cl, u, t);
%Plot system response
figure;
subplot(1,2,1)
plot(t, y);
title('Closed-Loop System Response');
xlabel('Time (s)');
ylabel('Output');
hold on;
%Simulate the closed-loop system
[y, t, x] = lsim(sys_cl2, u, t);
%Plot system response
subplot(1,2,2)
plot(t, y);
title('Original Closed-Loop System Response');
xlabel('Time (s)');
ylabel('Output');
And im kinda at wits end, on how should i conclude the project thus far? should i just give comment on the graph? can you give me a tips on how should i approach this? Sorry for taking your time.
Paul
Paul 2024-1-19
编辑:Paul 2024-1-19
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.

请先登录,再进行评论。

更多回答(1 个)

Sam Chak
Sam Chak 2024-1-19
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)
Spv = A = x1 x2 x1 0 1 x2 -4.166e+04 -10 B = u1 x1 0 x2 8.334e+04 C = x1 x2 y1 1 0 D = u1 y1 0 Continuous-time state-space model.
% 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)
omega_n = 8.1650
zeta = -log(OS)/(omega_n*ST)
zeta = 0.3942
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]
desiredPoles =
-7.5938 +14.8229i -7.5938 -14.8229i
%% Find K via Pole Placement
K = place(Apv, Bpv, desiredPoles)
K = 1×2
-0.4966 0.0001
%% Closed-loop system
sys_cl = ss(Apv - Bpv*K, Bpv, Cpv, Dpv);
N = dcgain(sys_cl) % steady-state value
N = 300.4334
Sys_cl = ss(Apv - Bpv*K, Bpv/N, Cpv, Dpv);
%% Check if the design requirements are met
stepinfo(Sys_cl)
ans = struct with fields:
RiseTime: 0.0936 TransientTime: 0.5000 SettlingTime: 0.5000 SettlingMin: 0.9334 SettlingMax: 1.2000 Overshoot: 19.9997 Undershoot: 0 Peak: 1.2000 PeakTime: 0.2123
%% Plot step responses
step(Sys), hold on
step(Sys_cl), grid on
legend('Original System', 'Compensated System')
  2 个评论
MUHAMMAD ANAS SULHI
编辑:MUHAMMAD ANAS SULHI 2024-1-20
Thank you for correcting my omega_n and zeta, Mr. Sam. I just found out the correct equations.
%Desired overshoot and damping ratio
OS = 0.2;
ST = 0.5;
%Natural Frequency and damping ratio
zeta = -log(OS) / sqrt(pi^2 + (log(OS))^2)
zeta = 0.4559
omega_n = 4 / (zeta * ST)
omega_n = 17.5458
Though regarding the converting state-space to phase-variable form. I've seen my friend generate it like this
% 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
[Apv, Bpv, Cpv, Dpv] = canon(A, B, C, D, 'companion');
% Display the state-space matrices in phase-variable form
disp('Phase-Variable Form Matrices:');
Phase-Variable Form Matrices:
disp('Apv:');
Apv:
disp(Apv);
0 -41665 1 -10
disp('Bpv:');
Bpv:
disp(Bpv);
1 0
disp('Cpv:');
Cpv:
disp(Cpv);
0 83335
disp('Dpv:');
Dpv:
disp(Dpv);
0
There is differences in the Bpv and Cpv. Is it better to do the manual way like what you did, Mr. Sam or the way my friend did is just fine?
Sam Chak
Sam Chak 2024-1-20
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')
spv = A = x1 x2 x1 0 1 x2 -4.166e+04 -10 B = u1 x1 0 x2 8.334e+04 C = x1 x2 y1 1 0 D = u1 y1 0 Continuous-time state-space model.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by