Parameters tuning of controller using H norm (power systems)
37 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Karen
2024-10-28,11:49
编辑:John Kelly
2024-11-18,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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinear Control 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!