PID Smith predictor

Matjuhnl

Member
Join Date
Jun 2020
Location
Somewhere
Posts
23
Sturggling a lot with long death times. Electrical heaters are damn slow :(.

Any of you have PLC (Siemens) blocks/codes? I have seen a 300/400 FB in one article. Also PCS7 supply such block.

I would really like to get in contact with some experts around here.
 
Did you search this forum with the terms "Smith predictor?"

Apparently there was a webinar 10y ago, maybe it was recorded?
 
Did you search this forum with the terms "Smith predictor?"

Apparently there was a webinar 10y ago, maybe it was recorded?
It was not recorded. I was using Gotomeeting and I was rather a noob when it came to using it. I didn't know I could record it. I didn't do another because only two people attended. I did talk about Smith Predictors back then
 
Hello guys,

I haven't been here for a long time, but I'm here now, after Peter sent me an email.

Matjuhnl, do you understand how Smith predictor works? The most crucial part is to have a good model that will represent your process around working/operational point.
Smith predictor is a fairly good dead time compensator and I have used it successfully and two occasions in practice where there were transport delays involved (coal power plant applications, where there is a time delay between fuel/coal delivered to the boiler and actual measured response such as steam flow/pressure increase).

First, I almost always direct people to read and understand how to make a model of a process they try to control. Most technological process can be reasonably good described with FOPDT models. If the systems are hydraulic where there is also compressible fluids then most likely SOPDT (second order plus dead time) would be more appropriate. Second order systems can have oscillations and overshoots in response.

First step is to read this article.
You need to know for sure FOPDT is a good approximation of your process and that you can conclude/derive process gain, time constant and dead time from time response (graphs).

Then you need to know how to implement this FOPDT model in actual PLC. As you know, a PLC is a discreet system and you need a discrete model of your continual process. I'm not sure about your university/colledge background and if you're familiar with the Laplace transformation, but I will say that continual process are described with differential equations in time domain, while discrete processes are described with so called difference equation.

Discrete models of continuous system have a sample time. This sample time must be exact. In order to ensure that logic is executed with the exact same time period, you need to use OB35 or similar i.e. cyclic interrupt blocks. This is the only way to ensure that all your time constants and the dynamics will be consistently calculated.

Please have a look at the attached SCL code. It needs to be executed in cyclic block, for example OB35.
Play with it a bit in PLCSIM. Do not download to the actual PLC and do not include it in actual application without understanding what is going on. This code is for educational purpose only and I take no responsibility whatsoever.

Use it at your own risk, but first in the PLCSIM until you know exactly what it is doing and how.

This should give you a pretty good starting point.

Once again, I want to point that I have used the Smith predictor in practice. But one needs to understand the process.
The Smith predictor gives best results where process time constants are large (minutes), and I have no experience with dealing with relatively fast process.

FOPDT STEP 7.JPG
 

Attachments

  • FOPDT_SCL.txt
    2.1 KB · Views: 65
Last edited:
Thank you very much!

Modelling processes is working fine. However, I do this manually. I would like to automate this in the PLC. Perhaps you have a solution for that too?


The implementation of the function is like in the attachment? Except the fact that the example shows a SOPDT.

FOPDT.jpg
 
In the attachment you have an implementation of FOPDT. It is written is SCL and will produce FB in the STEP7.

So, is your process second order in nature or first order? I‘m talking about approximation around operational point? I have had experience with FOPDT approximation of real process I tried to control efficiently. The process time constants were in minutes and dead time was not larger than 1 or 2 minutes.

I believe PCS7 has built in autotuner, but I never used it. I made estimation from the graphs and implement that as a model in PLC. It worked better than classical PID. After bit of tuning it was „good enough“. I used to tune controller for the processes that have constant setpoint 99% of the time and can be modelled by FOPDT.
 
In nature my process is first order. Electrical heater + PT100.

The following parameters are unclear to me:
- Times (inputs) in Sec.?
- "u" (input); this is the PT100 PV?
- "init_y" (input); what should I do with this value?
- "y" (output) directly to the heater control?
 
I see nothing wrong in trying a FOPDT model first but I would be prepared to try a SOPDT model because the OPs initial post said his heaters were slow. There is a time constant to heat the mass, there is a time constant for the heaters. There could be yet another for the sensor.


A SOPDT just requires knowing a second time constant and one more differential equation.


This is where SCL or ST shine.

BTW, control engineers use
u as the CV
r as the SP
x as the state or 2 entry array. This is the PV and rate of change in PV.
y is sometimes used as the true state after other modifications.


This ISA dependent model of PID uses minutes but often I get data where the time entries are in seconds to then my time constant are in seconds. It depends on the data. The hotrod.txt in my SOPDT example is in seconds.


The controlguru link doesn't work. The controlguru site was redone a few years back. The article(s) I wrote back in 2005 are now gone.
@Pandiani, if you were pointing to anything I did, I still have my original documents in Mathcad.
 
Last edited:
The article is still there, but your link had some funny characters at the end. Here is the article
https://controlguru.com/step-test-data-from-the-heat-exchanger-process/

Thank you, I don‘t know how I placed invalid link, but thank you for posting a correct one.

Peter, if the main objective is to improve control by compensating for dead time, then I don‘t think SOPDT would improve much, since there isn‘t inherently oscillatory response.
It would improve accuracy of the model for sure, but I‘m not convinced it is worth the extra effort. Tomorrow, I‘ll try to find a complete Smith predictor simulation with FB41 Siemens PID as a STEP 7 project. It is important that OP understands the implementation of the FOPDT in a real time system such as PLC.

@Peter, you did an excellent job on the controlguru by explaining how discrete model is derived from continuous one.
This is your contributing article.

@Matjuhnl I suggest you to look up one more article. You might find it also interesting.
 
Last edited:
@Peter, you did an excellent job on the controlguru by explaining how discrete model is derived from continuous one.
This is your contributing article.
Thanks for the link. I thought it was gone.
Yes, that works and is simple enough to implement on a PLC but the control guru convinced me that I should learn Levenberg-Marquardt for system identifications and use state space for SOPDT. So long ago. Like I said above. He gave me helpful suggestions. That was in 2005. The control guru's partner, Robert Rice provided me with a document that shows how to compensate the the dead time on FOPDT systems. I then expanded the equations for use with SOPDT systems. Up until then I had no need for learning about dead time because motion systems don't usually have dead time problems. After some research I found out that hydraulic systems do suffer from dead time when the is lot of tubing between the valve and the piston because the speed of sound, pressure waves, in oil is only 4 ft/sec.
This was a wake up.
 

Similar Topics

Hi all, The problem is to control the dry mass with a delay time system. I know Smith Predictor method can do it but how to implement it on ladder...
Replies
4
Views
3,711
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
5
Views
212
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
840
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
383
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
523
Back
Top Bottom