1

Good morning.

I am trying to design a PD controller manually and i wanted to be able to have a plot with parameters on which i can change their values live and see their result on plot. I want to emphasize again that i want to do the design by manualy changing Pi and PD parameters and not automatically via matlab pid designer.(The question is more matlab affiliated).

Sorry for my bad English.

Thanks in advance (My code follows):

clear all;
clc;
syms s;
K=1;
num = 4500*K;
den = sym2poly(s^2+361.7*s);
G=tf(num,den);
H=1;
%%
Kp=2;
Ki=0;
Kd=0;
C=pid(Kp,Ki,Kd,0);
T=feedback(C*G,H);
step(T);
Jonas
  • 121,568
  • 97
  • 310
  • 388
ysig
  • 447
  • 4
  • 18
  • 1
    Try the Matlab GUI: http://de.mathworks.com/discovery/matlab-gui.html?refresh=true Otherwise, a function that takes your parameters as input and plots the result is much less time consuming and may accomodate your demand almost good enough. – JaBe May 20 '15 at 11:39
  • I think the `pidTuner` provided with the Control System Toolbox allows you to do that, if you click on "Show Parameters". – am304 May 20 '15 at 13:28
  • See also https://www.researchgate.net/post/Why_are_proportional_derivative_PD_controllers_not_practically_realizable for an important remark about a PD controller. – Karlo Dec 10 '15 at 08:05

1 Answers1

0

You can make a simple matlab GUI for that, with textboxes or sliders to representing your gains and an axes object to hold your plot. Than in the callback functions of the textboxes/sliders you just create your system and controller based on the Value properties of the textbox/sliders, simulate the response and plot it in the axes object.

Here you can find some tutorials for matlab guis

Tamás Szabó
  • 733
  • 6
  • 9