Problem with pidtune function
5 ビュー (過去 30 日間)
古いコメントを表示
For the following code I keep getting just an integral element to my controller even though I am specifying PID. I need PID to get the response I'm looking for but unsure of what I'm doing wrong. tfp4 comes from a state space which I am sure is correct and isn't causing any errors that should effect my response.
[C,info] = pidtune(tfp4, 'PID')
tuned = feedback(C*tfp4, 1);
t = linspace(0, 100, 1000);
u = 3*pi/180*heaviside(t);
[y42, t42] = lsim(tuned, u, t);
y42 = y42*180/pi;
figure()
plot(t42, y42)
2 件のコメント
Paul
2024 年 4 月 28 日
will be difficult for anyone to help w/o the tfp4 model, which can be saved in a .mat file and added to the question using the Paperclip icon in the Insert menu.
If I had to guess, I'd say that pidtune is able to meet its internally generated design goals with just the integral control; the call to pidtune isn't specifying any design goals in particular, i.e., the resopnse you're looking for.
採用された回答
Sam Chak
2024 年 4 月 29 日
According to the documentation, if the tuning algorithm can achieve satisfactory performance and robustness using a lower-order controller than what is specified for the desired PID controller type, the pidtune function will return a 'C' controller with fewer actions than specified. In your case, 'C' could be an Integral-only controller, even though the type is 'PID'.
Additionally, if no performance specifications are provided, the algorithm will choose a crossover frequency based on the plant dynamics and automatically design for a target phase margin of 60°
%% 4th-order transfer function plant (tfp4)
num = [-1 4 6 4 1];
den = [ 1 4 6 4 1];
Gp = tf(num, den)
%% Attempt to implement a PID Controller
% C0 = pidstd(1, 1, 1e-6); % baseline controller
% [C, info] = pidtune(Gp, C0)
[C, info] = pidtune(Gp, 'PID')
%% Closed-loop system
Gcl = feedback(C*Gp, 1)
%% Plot results
subplot(211)
step(Gp, 10), grid on, legend('Original Plant')
subplot(212)
step(Gcl), grid on, legend('Compensated Plant with I-only controller', 'location', 'East')
3 件のコメント
Sam Chak
2024 年 5 月 1 日
You're welcome! If you have additional questions on how to improve the performance, feel free to ask.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で PID Controller Tuning についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

