Is there a way in Matlab to take a transfer function, define H
(closed loop system) and sweep all values of Kp
and Kd
that allow the system to be stable?
clear all
clc
close all
s = tf('s');
Gs = tf(0.001667,([1 12.04 20.52 0.8342]));
H = -1;
subplot(3,1,1)
step(feedback(Gs,H))
hold on
grid on
title('Step serponse without a PD controler')
Kp = 1; %-147700.5<Kp<2500
Kd = 0;
subplot(3,1,2)
C = pid(Kp,0,Kd);
T = feedback(C*Gs,H);
t = 0:0.01:140;
step(T,t)
grid on
title('Step response with a PD controler')
subplot(3,1,3)
rlocus(T)
title('Root locus to check for stability')
grid on
stability = isstable(T)
I'm aware that I can use a Routh Hurwitz stability test to find range of Kp
and Kd
values that satisfy stability but is it possible to do this in Matlab without Routh Hurwitz table? I'm not trying to tune this system for a specific function - yet.