Optimisation PID Using Sliding mode script

9 views (last 30 days)
Tarek
Tarek on 30 Apr 2023
Answered: Sam Chak on 14 Mar 2024
This question was flagged by Luca Ferro
I want à script for optimise PID paramèters Using Sliding Mode Control

Answers (2)

Sam Chak
Sam Chak on 1 May 2023
I don't think that SMC can optimize the PID gains. The structure of SMC is not an optimization algorithm.
Before optimizing the PID gains, have you designed a stabilizing PID controller?
If you want to optimize the PID gains, I think that the basic LQR algorithm works for a linear plant or a linearized system.
If you need a demonstration, please show the model of the system.
  1 Comment
Tarek
Tarek on 2 May 2023
(-0.014*s^2+3.436e-5 *s+1.214e-8) /(S^2+0.0004*s 5.834e-9) This is my model

Sign in to comment.


Sam Chak
Sam Chak on 14 Mar 2024
Are you still working on this? I revisited this control problem and discovered that a PID controller can be tuned to eliminate the steady-state error in the step response.
s = tf('s');
%% Plant
Gp = (-0.014*s^2 + 3.436e-5*s + 1.214e-8)/(s^2 + 0.0004*s + 5.834e-9)
Gp = -0.014 s^2 + 3.436e-05 s + 1.214e-08 ------------------------------------ s^2 + 0.0004 s + 5.834e-09 Continuous-time transfer function.
%% Controller
Gc = pidtune(Gp, 'PIDF')
Gc = 1 s Kp + Ki * --- + Kd * -------- s Tf*s+1 with Kp = 0.645, Ki = 1.98e-05, Kd = -1.57e+03, Tf = 1.73e+04 Continuous-time PIDF controller in parallel form.
%% Closed-loop system
Gcl = minreal(feedback(Gc*Gp, 1))
Gcl = -0.007826 s^4 + 1.84e-05 s^3 + 8.749e-09 s^2 + 7.389e-13 s + 1.402e-17 ---------------------------------------------------------------------- s^4 + 0.0004799 s^3 + 3.796e-08 s^2 + 1.079e-12 s + 1.402e-17 Continuous-time transfer function.
%% Plots
step(Gp ), hold on
step(Gcl), grid on
legend('Plant', 'Closed-loop', 'location', 'se')

Community Treasure Hunt

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

Start Hunting!