PID controller in simulink

Hi everyone! I am working on PID controller. I am having a model in simulink which I have uploaded at http://tinypic.com/view.php?pic=15cyg2&s=6. The gains of PID are: kp=1,Kd=1,ki=1.Saturation block has limits equal to -30 & +30. The state-space model has A=[0 1 0 0; 0 3.5 -106.5 0.37;0 0 0 1;0 0.21 -6.3 1.59]; B=[0 0;48.06 46664; 0 0; 340.18 47.7]; C=[1 0 1 0]; D=[0 0] and initial condition equal to 0. The system should converge at 20 as input is 20. But the problem is firstly its not converging and secondly the input of PID which is error signal appears as it is; as output with no modification. Need urgent help?

4 Comments

Azzi Abdelmalek
Azzi Abdelmalek on 7 Sep 2012
Edited: Azzi Abdelmalek on 7 Sep 2012
What is the constant you are using? and what method are you usinng to set PID prameters for unstable systems
Beenish Mazhar
Beenish Mazhar on 7 Sep 2012
Edited: Beenish Mazhar on 7 Sep 2012
Its just the input;as in my system two inputs are required for complete system modelling. Actually I am following a paper in which gains are already mentioned so I am not following any method to set PID parameters. I am varying them on hit and trial basis. Is there any such method to set the parameters.
Yes, Ziegler Nochols method is used dear.
Dear Azizi brother, I have one question, I want to Tune my Simulink Model with PID, but I tried a lot to tune but failed badly. If you kind send your email address, I will send the model, and after Tuned kindly send back to me on this email: grkhan@hec.gov.pk Please, just send me an email with your good name AZIZI and obliged. with Many Thanks
Gul Rukh Khan

Sign in to comment.

 Accepted Answer

Beenish Mazhar
Beenish Mazhar on 8 Sep 2012

0 votes

The problem can be sorted out if we use Ziegler-Nichols Tuning of PID controller.

1 Comment

Azzi commented "the answer expected was the value of PID parameters Kp Ti and Td"

Sign in to comment.

More Answers (2)

Ryan G
Ryan G on 7 Sep 2012
Edited: Ryan G on 7 Sep 2012
I looked at the root locus with the PID and I don't believe this will be enough to adequately stabilize this system. Just for kicks I tried utilizing looptune to stabilize the system and was successful in finding a 4th order TF that would do it. Since I know nothing of your system other than the SS matrices it may or may not make any sense.
If you replace the PID with a Transfer fcn block this should stabilize the system:
num = [-1.19566835199456 0.150677296783384 -4.87470249290078 -5.9378741332245 -3.64167152790914e-05];
den = [1 32.4776016633891 994.732763803663 6558.83645377611 0.0401083722778298];
The resulting controller doesn't do a particularly good job but your system may not be easy to stabilize anyway.
What is the 2nd input and why don't you use it?

3 Comments

Its the requirement of my system.I have kept it zero to make the problem simple initially later on I will give it some value other than zero.
The reason I ask is both inputs are coupled. So if you have a controller on both inputs it is easier to stabilize. As I mentioned previously, it's difficult to determine what makes sense not knowing anything about the system. I would suggest taking a look at slTunable if you have access to the robust control toolbox.
This will allow you to add an arbitrary compensator and have MATLAB automatically place the poles and find the gains based on requirements. However, if the system cannot meet the requirements or cannot be stabilized (which seems to be the case for just PID here) then it won't work.
I would figure out how you want to implement both inputs and tune them together.
Beenish Mazhar
Beenish Mazhar on 7 Sep 2012
Edited: Beenish Mazhar on 7 Sep 2012
ok sir I will work on it. Thank you for your guidance.

Sign in to comment.

Azzi Abdelmalek
Azzi Abdelmalek on 7 Sep 2012
Edited: Azzi Abdelmalek on 7 Sep 2012
eig(A) shows that your system is unstable (positive real(poles)in your system)
eig(A)
ans =
0
2.5582 + 2.3191i
2.5582 - 2.3191i
-0.0264
and if your output is not converging that means your PID parametes are not quite choosen

5 Comments

If I only use the PID controller with the same gains as mentioned above; & give its output as feedback it converges at the desired value. But when I use the space state block with it its not converging. The matrices mentioned above actually represent a physical system so I can't modify them. But how can I change my gain parameters in such a way that they completely suit my system. I even tried by varying the gains but no useful result. any guidance?
when you don't use SS model means you are using a system with transfer function H(p)=1. you did'nt tell about unstability of your system.
Beenish Mazhar
Beenish Mazhar on 7 Sep 2012
Edited: Beenish Mazhar on 7 Sep 2012
Sir I was just trying to verify the function of PID so that's why I was using it alone; but if my system is unstable; then what strategy should I choose with the gains of PID so that the system should converge. One thing more sir which I forgot to mention; as my system is unstable so that's why I am using PID controller which would make it to converge otherwise according to me there is no need to use it.
We don't use PID to make systems stable, (ofcourse they can do it) . PID are mainly used to control the output, make it below a certain reference in presence of any dsturbance. Now the problem is to find adequat PID parameters, because the ones you gave did'nt work, If I find something I will post it
Azzi Abdelmalek
Azzi Abdelmalek on 7 Sep 2012
Edited: Azzi Abdelmalek on 9 Sep 2012
I guess, since your system is 4rth order and unstable, it's difficult to be stabilized with a PID, maybe you should look for another controller

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!