PID Controller problem, Please help!

izzy prad

Member
Join Date
Nov 2008
Location
Ohio
Posts
12
Hello

I know this is not a Matlab forum, but I believe people here has better knowledge to help me with this problem.



I am a E.Eng major student and I have been using Matlab for my Control Systems class. But recently I am having a big confussion in Matlab simulink, that I cannot understand at all.


Here is my problem:


I have this open loop transfer function :
= 173/(s^2 +2.57s)
And I am supposed to find PID gain so that the system's settling time is =0.3sec. Now by solving mathematically I came up with the answer of
Kp = 0.198
Kd = 0.077
Ki = 0

Therefore, the PD controller transfer function will be
= 0.077s + 0.198

WhenI plug that value into the PID controller block, it does not work! But when I combine the open loop transfer function with the PD controller transfer function, i.e.
= 173*(0.077s + 0.198)/(s^2 +2.57s)

it works!



What am I doing wrong? Or is it some kind of glitch in matlab?
Here is the picture that will explain in more detail:
http://img379.imageshack.us/my.php?image=matlabfj7.jpg

i would really appreciate any help here.
 
Last edited:
I don't see how it can work

Kp+Kd*s implies the power of s is higher in the numerator than the denominator. I don't use Matlab but I have seen other complain about the same thing.

The denominator of the CLTF does not look right. The steady state gain is infinite. That can't be. Show us how you computed the CLTF ( closed loop transfer function ).

What is the desired CLTF? Does it have a setting time of 0.3 seconds?

Warning, Matlab is great for getting answer without understanding them.

Post your work. Some of have Scilab or Matlab.
 
Thank you so much for the reply!

I have attached my calculation below in .doc format. This was how my professor asked me to do. But I dont get the same result when I plug those Kp and Kd value in PID controller. I am so confused.


I really really appreciate your help.


[font='Calibri','sans-serif'] [font='Calibri','sans-serif'] [/font][/font]
 
It looks good but...

I don't understand why the value of K changes.

You should be careful about pole placement. The response is first order. Most systems cannot follow a first order system.

In reality you should add an integrator. This results in a 3 pole system. a^3/(s+a)^3. You should then solve leaving a as a variable. If you want a faster response then increase a. If some unmodeled feature causes instability you should reduce a.
 
Our professor wanted us to only use Kp and Kd, for simplicity. I asked him already about the answer and he said it is right. But then I mentioned about matlab notgiving me the right answer and he said, matlab might have iteration problem.

He may be right, but I feel there is something fishy about this whole system. I feel like I am missing something. How ca it be possible that when I use a PID block it doesnot work and when I combine the same PID transfer function with plant's equation it works fine.

I dont get it.

How can such a big well known software like Matlab have problem. I still feel like I am missing something.
 
izzy prad said:
He may be right, but I feel there is something fishy about this whole system. I feel like I am missing something. How ca it be possible that when I use a PID block it doesnot work and when I combine the same PID transfer function with plant's equation it works fine.

I dont get it.

How can such a big well known software like Matlab have problem. I still feel like I am missing something.
The problem is that the order of the numerator can not be higher than the denominator. It is that simple. It is a Matlab thing.

If you want to look at other examples then look here.
ftp://ftp.deltacompsys.com/public/NG/
 
Thanks for the link, I will go through them.

But does that mean We can never use PD controller? Or just D?
Cause that is going to make the numerator of the controller always higher than the denominator.
 
When you use a pole placement scheme to control a system you should have one can for every pole. In your example there are two poles so you need two gains. If you use the integrator gain it does not count because it has its own pole.

You can use just D but it isn't very practical for most applications. You will not be able to place both poles.

Here is a link were the Simulink would not let the user enter a PID.
http://groups.google.com/group/sci.engr.control/browse_frm/thread/cc151f7e77095470#

I use Mathcad. It is like a free form spread sheet. Here is an example close to what you just did
ftp://ftp.deltacompsys.com/public/NG/Mathcad - t1p1 IMC Pandiani.pdf
 
hello izzy prad,
I see that Peter has already taken control over situation. Hehe
well, there is more about this.
First, questions to you:

1. Did you try to use PID controller with aproximative derivator? I bet not. You can find it in the Simulink library: Simulink Extras -> Addition linear.
What is the result?
2. Have you tried to implement PID controller yourself, by using derivator block? What is the result in that case?
3. Have you tried to implement your PID controller yourself using continuous transfer function block to mimic real world derivator?
What is the result?
4. Last but not least, Have you tried to make simple test and use standard derivator block (in library "continuous") and compare its ramp test output with real world derivator which you made it yourself? I bet not. Have you tried to change solvers and observe responses to this simple test?

Answer to all this questions is simple:
Pure derivator is a mathematical fiction and this system is non causal. You should know that.
I had many of these problems with Matlab myself, but I understood when I made my own implementations (using Matlab and Scilab scripts). Guys like Peter have opened my eyes.

Looking forward to your answers...

P.S.

 
Last edited:
Thank again for your help guys, I really appreciate your help!

Sorry I forgot to mention that I did try with simple gain and derivative block to mimic the PID controller, but it didn't work.

I have attached the screenshots of different plots that i got by using different form of PID.

Basically that transfer function is the transfer function of the whole plant , which was obtained by simplifying the block diagram of the plant, which I am pretty sure is the right transfer function. The whole plant is shown in the picture below.And I have used the subsystem(compact version) of the plant for simplicity.

One thing i noticed is when I used PID controller with Approximate Derivative, with Derivative divisor as 100, it worked for the transfer function block diagram, but when I used that for the plant it didnt work. So I reduced the divisor to around 10 for the plant block diagram then it kind of gave desired response at about 0.3 sec as per spec, but there was huge overshoot and oscillation.

I believe these two picture should explain things in more detail:
Please note Step input's final Value is 12.

Here is the actual plant simulation:
http://img266.imageshack.us/my.php?image=57978335pl0.jpg


here is the simulation using Plants transfer function.(Please note the non dominant pole at -700 has been ignored)
http://img388.imageshack.us/my.php?image=13240675eo5.jpg



Oh one thing I forgot to mention is when I use PID controller with Kp 13.33 and Kd as 1 then it works for both Plant(subsystem) and the transfer function.

Any thoughts?
 
Last edited:
Now, I'm not sure I understand what you mean by transfer block and plant diagram..

Look at the first attached picture. I used parameters as shown and obtained good result. Please, verify this. So you already tried some of suggested steps. What is your conclusion? What do you think why is this happening?

izzy prad said:
One thing i noticed is when I used PID controller with Approximate Derivative, with Derivative divisor as 100, it worked for the transfer function block diagram, but when I used that for the plant it didnt work. So I reduced the divisor to around 10 for the plant block diagram then it kind of gave desired response at about 0.3 sec as per spec, but there was huge overshoot and oscillation.
I think you're doing something wrong here.

Did you try to change solver? Did it help? So is this simple problem "blame solver"?

Now, make the following diagram like shown in second attached picture and tell me what is the differece. There lies the key answer to your problem.

Please take time to do this and try to figure out why this is happening, so we can discuss further.

PID_1_izzy.JPG

PID_2_izzy.JPG
 
Hello,


Thanks for taking time and explaing in detail. I appreciate your help!

I think I had already posted that I can get a good response using PID with Approximate derivate for the plant's transfer function block diagram, which is the one that has only one transfer function block with 172/(s^2+2.57s), which was reduced from that big block diagram.

The problem is I have to use the big plant (with lots of blocks), which has been reduced to SUB SYSTEM block with only input and outputs shown. So when I use that PID with Approximate derivate on the big one it does not work.


As per your suggestion I tried changing solver, but no improvement.

I also tried making those two block diagrams shown above and simulating them. Yes I do see the difference between them, One has the desired response and the other one has slower response. But I am not sure if I understand the difference very well. Please note this is my first control class and I haven't taken control's lab yet, so I don't have much knowledge in this topic.


Anyways, my main goal is to use PID block or any form of PID with those Kp and Kd value in the Plant's SUB SYSTEM model, not the model with one one block having the transfer function, 172/(s^2+2.57s).
Let me know if I am missing something.
 
Last edited:
One more thing, One of the difference that I observed is that the derivative block has the same response as the transfer function block with 1000 as divisor.
 
Since you are still working on this

This is how I solve your problem. The answer is the same ( It better be ) but I use a slightly different technique. I don't start by canceling poles for reasons stated above. I would prefer to change the desired transfer function to be a second order instead of a first order.

Note, I don't need to worry about derivative gain filters.
 

Similar Topics

How can I get the curret "t" in SCL dt=tnow-tprevious I dont know how to get "tnow". I am not sure should it be in s(seconds) or miliseconds. I...
Replies
4
Views
2,098
hi all friends I have problem with "S7-300 cpu315-2DP PID controller".I want make PID control and HAET system.But I am not working. Please...
Replies
1
Views
2,811
I have an old Chinese Temperature PID controller XMT 8038c2kp that am able to send and receive requests via Modbus poll test center in this format...
Replies
0
Views
438
I have a question regarding the features of the so called incremental (velocity) form of the PID controller. As far as I understand this form in...
Replies
14
Views
2,465
Hi - I have an application where there is an option to use a PID loop embedded in the Transmitter to directly control (via 4-20mA output from the...
Replies
4
Views
1,064
Back
Top Bottom