Parameters tuning of controller using H norm (power systems)

25 views (last 30 days)
Hello,
I am currently trying to optimize the parameters of a controller by minimizing the H infinity or H2 norm of the system. I am using the particleswarm solver for the optimization. The system is shown on the figure.
To compute the norm I am linearizing the system with the signal marked by a red circle as input point and the one marked with a blue circle as output point for linearization. Then I use the hinfnorm function for matlab to compute the norm.
The problem that I have is that the solver find parameters that result in a very low norm but lead to a non-ideal behavior of the system. The only thing where I could see a problem is the linearization of the system because I am not sure to use the right place to linearize the system. So I don't know if I am using the right transfer function to compute the norm.
Function to compute the norm :
function h = h_norm(x, mdl, kind)
set_param(append(mdl, '/PID Controller'), 'P', num2str(x(1)), 'I', num2str(x(2)), 'D', num2str(x(3)));
save_system(mdl);
io(1) = linio(append(mdl, '/PID Controller'), 1, 'input');
io(2) = linio(append(mdl, '/Transfer Fcn'), 1, 'output');
sys = linearize(mdl, io);
%tfsys = tf(sys)
if strcmp(kind, 'h2')
h = norm(sys);
elseif strcmp(kind, 'hinf')
h = hinfnorm(sys);
end
end
Code for optimization :
mdl = 'sys_1';
load_system(mdl);
x0 = [1, 0, 0];
nvars = 3;
n_iter = 100;
swarm_size = 30;
options = optimoptions('particleswarm', 'MaxIterations', n_iter, 'SwarmSize', swarm_size, 'InitialPoints', x0, 'Display', 'iter');
x_best = particleswarm(@(x)h_norm(x, mdl, 'hinf'), nvars, [], [], options);
disp(x_best);
Thank you in advance.

Answers (1)

Karen
Karen on 28 Oct 2024 at 11:49
Edited: John Kelly on 18 Nov 2024 at 15:03
Hey! It seems like you’re encountering an unexpected peak in your tridiagonal system’s graph around the 61st column. I’ve dealt with similar issues before, and it could be linked to boundary conditions or perhaps some numerical instability in the time steps.

Categories

Find more on Nonlinear Control in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!