Stability Analysis of Bode Plot

조회 수: 14 (최근 30일)
Muhammad
Muhammad 2023년 10월 26일
답변: Rahul 2025년 7월 31일
Dear Control Community,
I have found open loop frequent response of my plant and then estimated transfer function from it. When I do stability analysis of my plant bode plot, it shows GM -17dB and Phase Margin -54 degree, and shows close loop unstable.
I am very confused and worried about it how can I make this system stable. This device is currently working with PI controller in close loop but I have taken plant open loop response without PI controller.
Is it possible to make this system close loop stable by PI controller or model predictive controller?
My main goal is to design Kalman Estimator and Model Predictive Control for this plant to improve its performance.
%Experimental Data coversion to Bode Plot
T2 = readtable('EIDEL_CSV.csv');
% T2 = readtable('EIDEL2_CSV.csv'); % Fill With Actual Sampling Frequency
FHz = T2.F;
Ts = 1/(2*(max(FHz)+10000))
for k = 1:size(T2,1)-1
if FHz(k+1) == FHz(k)
FHz(k+1) = FHz(k+1)+0.5; % 'Brute Force' Interpolation
end
end
% Remove duplicate entries from the frequency vector
FHz = unique(FHz);
Mag = T2.G;
PhDeg = T2.P;
Response = Mag.*exp(1j*deg2rad(PhDeg)); % Complex Vector
sysfr = idfrd(Response, FHz, Ts, 'FrequencyUnit','Hz');
%bode(sysfr)
tfsys = tfest(sysfr,5,4); %82.69%
%tfsys = tfest(sysfr,6,3)
figure
compare(sysfr, tfsys);
is_stable = isstable(tfsys);
disp(is_stable);
% Assuming you have a tfsys transfer function object named 'tf'
num = tfsys.Numerator; % Extract numerator coefficients
den = tfsys.Denominator; % Extract denominator coefficients
% Plot poles and zeros
figure;
pzmap(tfsys);
title('Poles and Zeros of the Estimated Transfer Function');
ss_model = ss(tfsys);
[A, B, C, D] = tf2ss(num,den);
figure
compare(sysfr, tfsys, ss(A,B,C,D), ss_model);
%compare(sysfr, tfsys, ss_model, ss_model2)
step(tfsys);
% Define the frequency range
% Define the frequency range
% frequencies = logspace(0, log10(20000), 1000); % Creates a logarithmic frequency range from 1 Hz to 20 kHz
%
% % Create a Bode plot
% bode(tfsys, frequencies);
Y = feedback(tfsys,1);
pole (Y);
bode(tfsys);
margin(tfsys)

답변 (1개)

Rahul
Rahul 2025년 7월 31일
Hi Muhammad,
I understand that you are observing negative gain and phase margins in the Bode plot of your identified plant model, even though the overall closed-loop system behaves as expected in simulation with a PI controller or an MPC.
From the Bode plot and model parameters, it appears that the estimated plant 'tfsys' is open-loop unstable, which is why MATLAB’s 'margin' function reports negative margins. However, this does not indicate that the closed-loop system is unstable rather, the 'margin' analysis applies to the plant alone, assuming unity feedback without any controller. Once the loop is closed using a PI or MPC controller, the system can indeed be stabilized.
Designing Controllers for Open-Loop Unstable Systems:
Both PI and MPC controllers are capable of stabilizing open-loop unstable systems, assuming the plant is controllable and the controller is tuned appropriately.
  • PI Controller: You can use the pidtune function with your estimated transfer function to redesign or validate your PI controller:
C = pidtune(tfsys, 'PI');
margin(feedback(C*tfsys, 1)); % Check closed-loop margins
  • Model Predictive Control (MPC): If the system has multiple inputs/outputs or requires handling of input/state constraints, MPC is a good option. You can use the mpc object with the converted state-space model to design a controller:
(ss_model = tf2ss(tfsys)); % COnversion of state space object
mpcobj = mpc(ss_model, Ts); % where Ts is the sample time from your data
For more information on adopting a MPC workflow in a control system, you can refer to the following documentation link:
Observer-Based Control:
If you’re using a Kalman filter in conjunction with MPC, it’s important to note that the Kalman filter estimates states and does not stabilize the system on its own.
MPC uses these estimates to compute the optimal control action, which can stabilize the system, even if it's open-loop unstable.
The observer should be designed such that unstable modes are detectable and that the combined observer-controller loop is stable.
Here are some steps you can follow to optimize the current workflow:
  • Validate that your identified model 'tfsys' accurately captures the plant dynamics by comparing simulated and measured data.
  • Wrap your controller (PI or MPC) around the estimated plant and verify closed-loop stability using 'margin' or 'pole(feedback(...))' functions.
  • If you're using Simulink, you can consider using the PID Controller or MPC Controller block along with the State-Space block for implementation.
  • Optionally, you can use 'looptune' if you're considering robust controller design with stability guarantees.
For more information regarding various functions mentioned in the above code snippet, you can refer to the following documentation links:

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by