2
votes

I'm relatively new to Control systems. I'm trying to obtain a graph for the step response of a PID controller of the form enter image description here

Is this possible to plot in mat lab because I get the error that the function cannot plot the step response of a system with more poles than zeros. Is there any way to plot this system without the whole infinity issue so that I can observe the characteristics of its step response? I'm sorry if I'm asking a dumb question that may seem obvious but any help or explanation would be greatly appreciated.

This is my mat lab code for my PID controller:

%3.PID Control,Td=0.001, 0.01, 0.05, 0.1
a=tf([0 0 -10],[0 1 10]);
b=tf([0 -1 -5],[1 3.5 6]);
kc=5;
Ti=1;
Td=0.001;
k1=tf([0 Td 0],[0 0 1]);       %derivative control
k2=tf([0 1],[Ti 0]);            %integral control
G=kc*(k1+k2+1);                % the controller
G1=series(a,b);
y=feedback(G,G1,-1);
subplot(2,2,1),stepplot(y),title('kc=5,Ti=1,Td=0.001');
1
For some reason Matlab as well as Simulink can not deal with "models with more zeros than poles." in case they are defined as transfer functions in means of tf. Try to set up your system in Simulink and use the PID Block for your controller. There is probably also an outside-Simulink solution, but I don't have the time for research now.Robert Seifert

1 Answers

4
votes

As thewaywewalk mentioned, MATLAB can only deal with proper systems, and a pure derivative isn't proper, so you need to use an approximate derivative in your transfer function. It's never a good practice to use pure derivatives as they tend to amplify noise.

Look at the documentation on the PID Controller block in Simulink to see how to implement a PID controller with approximate derivative. In short, you need to replace Kd*s by Kd*s/(1+a*s) where a is small compared to the dominant time constant of the system.

EDIT: The best way to create your PID is to use the actual pid function from the Control System Toolbox. It implements a first-order derivative filter on the derivative term.