PD控制器扫描满足系统稳定性的Kd和Kp的所有值

时间:2022-12-04 19:24:15

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?

在Matlab中是否有一种方法可以采用传递函数,定义H(闭环系统)并扫描所有Kp和Kd值,以使系统稳定?

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.

我知道我可以使用Routh Hurwitz稳定性测试来找到满足稳定性的Kp和Kd值的范围但是在没有Routh Hurwitz表的情况下可以在Matlab中执行此操作吗?我不是试图为特定的功能调整这个系统 - 但是。

1 个解决方案

#1


Not that I know of. Your best bet is to use pidTuner to tune the PID gains:

从来没听说过。您最好的选择是使用pidTuner来调整PID增益:

pidtuner(Gs,'pd') % open PID tuner for plant Gs with PD controller

or

pidtuner(Gs,'pdf') % open PID tuner for plant Gs with PD controller & approximate derivative

#1


Not that I know of. Your best bet is to use pidTuner to tune the PID gains:

从来没听说过。您最好的选择是使用pidTuner来调整PID增益:

pidtuner(Gs,'pd') % open PID tuner for plant Gs with PD controller

or

pidtuner(Gs,'pdf') % open PID tuner for plant Gs with PD controller & approximate derivative