how PID Tuning for Pitch Angle Control using PSO

11 ビュー (過去 30 日間)
douara ben ouadeh
douara ben ouadeh 2025 年 5 月 16 日
コメント済み: Sam Chak 2025 年 5 月 30 日
Hello,
I am working on a control system that includes a pitch angle control loop using a PID controller, and I want to tune the PID gains using Particle Swarm Optimization (PSO).
I am looking for a MATLAB (or Simulink) code that meets the following requirements:
Uses PSO to optimize the PID parameters (Kp, Ki, Kd)
Supports defining bounds or constraints on the PID gains
If anyone has a working example or template that I could build upon, I would greatly appreciate it.
Thank you in advance!
  6 件のコメント
douara ben ouadeh
douara ben ouadeh 2025 年 5 月 29 日
移動済み: Sam Chak 2025 年 5 月 30 日
Thank you for the clarification and for your time.
To better explain what I’m aiming for, please refer to the following link:
Sam Chak
Sam Chak 2025 年 5 月 30 日
@douara ben ouadeh, The user-supplied PSO code shared in the provided link is incomplete, preventing any testing. It is not surprising that you are experiencing issues. Have you tried using MATLAB built-in particleswarm()?
%% call PSO
fun = @costfcn;
nvars = 1;
lb = 0;
ub = 2;
Kbest = particleswarm(fun, nvars, lb, ub)
Optimization ended: relative change in the objective value over the last OPTIONS.MaxStallIterations iterations is less than OPTIONS.FunctionTolerance.
Kbest = 1.0000
%% Cost function
function J = costfcn(K)
J = (K - 1)^2;
end

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by