why my “pid” parameters(Kp,Ki and Kd) values are not showing up in pidtuner tool?
12 views (last 30 days)
Show older comments
I am trying to implement PID controller in matlab,but pid parameters(Kp=350,Ki=300 and Kd=50) values are not showing up in my pidtuner app for base line response as shown highlighted in attached photo
My code is below
clc
clear all
close all
kp=350
ki=300
kd=50
m=1
b=10
k=20
num=[kd kp ki]
den=[1 0]
num1=[1]
den1=[m b k]
sys1=tf(num,den)
sys2=tf(num1,den1)
A=series(sys1,sys2)
sys3=1
B=feedback(A,sys3)
step(B)
xlabel('time')
ylabel('amplitude')
pidtool(B,pid)
0 Comments
Answers (1)
Sam Chak
on 14 Sep 2023
The command pidtool(B, 'pid') launches the PID Tuner app and designs a PID controller for plant B. However, plant B is actually the closed-loop feedback system with your improperly configured PID controller embedded. The configuration of your PID controller is improper because the degree of the numerator exceeds the degree of the denominator.
By the way, please note that pidtool has been removed. Instead, use pidTuner with this syntax: pidTuner(Plant, Cbase) to launch the app and compare the performance of the auto-tuned PID controller to that of the baseline controller (Cbase).
% parameters
kp = 350;
ki = 300;
kd = 50;
m = 1;
b = 10;
k = 20;
% baseline controller
numC = [kd kp ki];
denC = [1 0];
Cbase = tf(numC, denC)
% plant tranfer function
numP = 1;
denP = [m b k];
Plant = tf(numP, denP)
% launch the app and make comparison to Cbase
pidtool(Plant, Cbase)
0 Comments
See Also
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!