LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID\Smith predictor simulation problem

Hi,

 

I want to implement a Smith predictor on a distillation column feed temperature. This system has 20 to 30 second time delay. The smith predictor uses an iternal model to give perfect performance for time delay systems. I first want to get some things working before i try it though. In the VI test.vi there is a PID-controller and a simulation of the temperature model, but I don't get the transient behavior what it should be theoretically, with that transfer function. The simulation and PID are not the ones standard in labview PID toolkit or a simulation loop for the model. I tried it first with standard labview blocks and I didn't get the correct transient behavior, so I tried it with a self written version, but I am seeing the same things. Normally they are correctly written (but sloppy Smiley Happy).

 

Also I included a picture of the correct transient behavior and the behavior I am getting, I don't know why I am not getting the correct behavior.I would be very gratefull if someone could get the correct transient behavior with a simulation loop and PID-block, not necessarily mine! The transferfunction is: 0.0003656/(0.0008248+0.06385*s+1*s²), I removed the time delay. PID-settings: K: 20, Ti (s):77, Td (s): 15. The blue line in PID.jpeg is the correct behavior, I am getting the white line.

 

Thanks in advance

 

KF_

Download All
0 Kudos
Message 1 of 13
(4,647 Views)
Also, the PID is not capped at 100% output, so it is not because the closed loop is tuned to fast, it can go from 0 to 1000%. I also forgot to include a small subVI.
Message Edited by KF_ on 02-28-2010 06:18 PM
0 Kudos
Message 2 of 13
(4,646 Views)
I forgot yet another subVI, dont know where my head is!
Message Edited by KF_ on 02-28-2010 08:31 PM
Download All
0 Kudos
Message 3 of 13
(4,624 Views)

Hello,

 

I am curious here. You said that you tried to use the "LabVIEW Control Design and Simulation" but the behavior is not standard. However, I noticed that you are just trying to implement a RK-2 solver and a PID with some specific features. Could you elaborate more about what is different from the "Control and Simulation Loop"? The Module also has an example of it:

 

C:\Program Files\National Instruments\LabVIEW 2009\examples\Control and Simulation\Case Studies\Process Control\Smith Predictor\Smith Predictor.vi

 

Have you exam this example?

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 13
(4,592 Views)

Hi Barp,

 

Thanks for your reply.

 

Nothing is different from the control and simulation loop. But I didn't get the correct transient behavior with the simulation loop, so I tried to write something myself (thinking maybe it has something to do with simulation loop), but I am seeing the same thing. I dont know why I don't get the blue line in the figure, that's basically my question. I have added a.vi with a control loop and also a picture of the output compared to to right output now with a simulation loop. The settling time is much higher and there is overshoot + transient behavior is not of first order which it should be.

 

I didn't see that example yet, I will check it out.

 

Thanks

 

KF_

Message Edited by KF_ on 03-01-2010 10:03 AM
Download All
0 Kudos
Message 5 of 13
(4,583 Views)
one more question. How to you get the "expected" result? I would like to know your assumptions in trying to get the response in the 'jpg'. In general, the results do not match because you did not take into account the sampling time (the controller has to be discretized) and/or you do not take into account the nonlinearities as the saturation of PID.
Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 6 of 13
(4,574 Views)

Hi

 

First I calculated the needed Kc Ti and Td to get a first order closed loop response like the blue line. Then I checked the response with matlab and labview (the blue line in the figure), and I got the response I calculated. I just used the CD step response in labview to check and this gives the desired response. But to simulate it in realtime like I tried, I don't get this. I assume every vi and also matlab uses discretization, so why would they give the correct result and not the test.vi. I tried to make really small steps in my VI and I still get the same + the difference in settling time is pretty big.

 

KF_

Message Edited by KF_ on 03-01-2010 10:59 AM
0 Kudos
Message 7 of 13
(4,569 Views)
Also the PID cant be satured because i set the limit to 1000, so the loop shouldnt be tuned to fast
Message Edited by KF_ on 03-01-2010 11:30 AM
0 Kudos
Message 8 of 13
(4,562 Views)
OK... that is interesting. With the parameter you have in the PID, I also see the same behavior. Now, here is my question: how are you defining your PID formula in a script? I was able to get a good result by changing the PID parameters to "Kc=40", "Ti=400 s", "Td=15 s". and using Ts=0.001 s". It is very possible that the definition of PID in design is different the implentation of the PID parameter. This is actually very common to get overlooked. Do you have the VI or script that does the design?
Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 9 of 13
(4,491 Views)

Hi Barp,

 

I implemented the PID formula Kc*(1+1/(Ti*s)+Td*s), and the parameters I gave Kc= 20, Ti= 77 s en Td=15 s are calculated for this PID formula form. I also tested it with a PID block from the control design box along the way, I got the same results. According to the theory, the parameters I use, should give a first order closed loop response with a time constant of 20 s if I remember correctly (and they are calculated for this PID formula). And with Matlab or the Labview CD step response block I get this exact result.

 

What do you mean with a good result, one that agrees with theory or just a good transient response?

 

-Do you have the VI or script that does the design?-  For a transferfunction without Time delay,it is quite a simple formula to get a certain closed loop response if the transfer function is of 1st or 2nd order.

 

I attached the VI with the CD step response, which gives the good response according to theory. If I give "Kc=40", "Ti=400 s", "Td=15 s" as parameters in this VI, the overall settling time is quite long, altho it reaches the vicinity of 1 quite fast. But my concern is, what is causing the different transient response with my parameters when I simulate it like test.vi or with a control simulation loop.

 

I hope i answered the questions you had in mind.

 

Regards

 

KF_

 

 

 

 

Message Edited by KF_ on 03-03-2010 02:02 PM
0 Kudos
Message 10 of 13
(4,483 Views)