PID process simulator for Studio/Logix 5000?

Thanks for the responses, guys. And sorry for the delay in responding.

drbitboy, I'm just looking for a halfway realistic simulation of a feedback process such as flow, pressure, level or temperature that I can use to compare tuning methods and also check out various auto-tune options to see what works best. I realize that those are very different processes but it's a starting point, and if it's in code I can tweak stuff like dead time and process gain to alter the simulation. Thanks for posting the AdvancedHMI and MicroLogix simulation code- I'll dig into that soon :) I saw you mentioned there was another simulator that you used to prove a deadband was beneficial. Was that written for a PLC also?

Also, thanks Peter for mentioning your old hot rod simulator. I'll check that out as well.

Phrog, I've heard good things about pidbot but have yet to try it. One of my reasons for wanting a good PID simulation is so I can learn to use pidbot and other autotune programa without being in a real environment where things can be damaged :) Thanks
 
Last edited:
drbitboy, I'm just looking for a halfway realistic simulation of a feedback process such as flow, pressure, level or temperature that I can use to compare tuning methods and also check out various auto-tune options to see what works best.


These are totally different processes. Flow and temperature are non integrating processes. Level and pressure are integrating processes. The auto tune for integrating process will not work in non-integrating processes.


Velocity is a non-integrating process. Position control is an integrating process.



Do you know the difference?
 
FOPDT Simulator
So when the output of the PID goes to 0 the output of the lead/lag filter goes to? This isn't a very good temperature simulator if the temperature goes to 0. It should go to ambient temperature. Also there needs to be an opoen loop gain. Usually the units are degrees/% control output.


Add the the bias to the out of the lead/lag block. Add a multiplier on the output of the PID to convert the % control output to temperature.


However, this is just a FOPDT. What about SOPDT? Then insert another lead/lag block in series with the first lead/lag block.


This does cover integrating processes.
 
So when the output of the PID goes to 0 the output of the lead/lag filter goes to? This isn't a very good temperature simulator if the temperature goes to 0. It should go to ambient temperature. Also there needs to be an opoen loop gain. Usually the units are degrees/% control output.


Add the the bias to the out of the lead/lag block. Add a multiplier on the output of the PID to convert the % control output to temperature.


However, this is just a FOPDT. What about SOPDT? Then insert another lead/lag block in series with the first lead/lag block.


This does cover integrating processes.


You can use a BIAS term in the Lead Lag to simulate ambient, there is also a GAIN term in the Lead Lag.

Sim.JPG
 
These are totally different processes. Flow and temperature are non integrating processes. Level and pressure are integrating processes. The auto tune for integrating process will not work in non-integrating processes.


Velocity is a non-integrating process. Position control is an integrating process.



Do you know the difference?
Peter- yes, I know the difference. I'm not a wizard at this, but I do it for a living and I'm trying to get better at it. I'm mostly looking for something *resembling* a real life process of any kind so that I can practice various tuning methods and also learn to navigate auto-tune software for situations where that may be useful. I don't have any physical process to practice with, so a software simulation seems like the next best thing. Thanks for the help.
 
How about this old thread, which used a soldering iron as a testbed?





http://www.plctalk.net/qanda/showthread.php?t=4619




I agree a simulation is probably easier to implement if one has the programming and other modeling skills, unless one has the various pieces (temperature sensor, etc.) laying about and the skills to use them.



Also, aren't there three time constants (at least)? The mass of the material heated and the mass of the sensor are the two usually considered, but what about the heating/cooling system response? Granted, an electric heating element may move fast enough to ignore, and condensing steam temperature would follow the jacket pressure, which I would guess will also be quick. But the temperature profile of chilled water flowing in a large-volume jacket may take a few seconds, or tens of seconds, to re-equilibrate when the rate is changed, although of course the heat transfer coefficient would jump right away.
 
There are two time constants. There was no cooling system. There is the dead time it take for the thing being heated to get to the temperature sensor. This is a SOPDT system.
The hotrod system was a a soldering, wood or leather burning iron. It was nothing fancy because Ron used a few of these in his training classes.
 
There are two time constants. There was no cooling system. There is the dead time it take for the thing being heated to get to the temperature sensor. This is a SOPDT system.
The hotrod system was a a soldering, wood or leather burning iron. It was nothing fancy because Ron used a few of these in his training classes.


I read that thread last night and Ron had a fan blowing on the hotrod, but that was to vary the load, not for controlled cooling. But I was speaking more generally and referring to (conflating?) the other recent thread - [PID Nightmare] - that has cooling that will probably be put on a split-range control with the heating.


Anyway my point was that any system may have several time constants and/or dead times, even if some are so short with respect to others that they may be ignored. For example, with a jacketed tank the heating/cooling is occurring at a thin layer at the wall of the tank and so will require time* to reach the bulk of the fluid and the temperature sensor. If that time constant is large then the response time of the sensor itself might be negligible and not need to be part of the model, but that doesn't mean it isn't there.



So an N-order system (N>2) may be modeled as an (N-K)-order system (N-K<3) without too much loss of accuracy.


* how much time depends on the vigor of any mixing, convection vs. conduction, etc.
 
I read that thread last night and Ron had a fan blowing on the hotrod, but that was to vary the load, not for controlled cooling.
I didn't see the part about the fan but you are correct about changing the load.



Anyway my point was that any system may have several time constants and/or dead times, even if some are so short with respect to others that they may be ignored.
Yes, the can be many poles, but the dead times are additive when it comes to the final result.


If the poles are far to the left of the origin then they can be ignored.


Most of my work has been with hydraulic servo control. The cylinder and mass have two poles. There is an additional pole added for integrating the velocity to position. Finally, adding an integrator gain adds yet another pole so there are four poles IF you assume the valve's poles are much "faster" that the cylinders poles.


A controller must supply one gain for every open loop pole. The integrator does not count because it adds its own pole.

Therefore a good servo hydraulic controller will have a proportional gain, derivative gain and second derivative gain. Most controllers and NO PLC PIDs have a second derivative gain.


If the valve is slow it is not practical to add more derivative gains. Instead an valve PID or inner loop is required. A valve is a non-integrating system. If the control signal goes to zero the flow will go to zero. Most valves have two dominant poles so the P and D gains can place those two poles. Remember the integrator has its own pole so the closed loop valve control has 3 poles.





For example, with a jacketed tank the heating/cooling is occurring at a thin layer at the wall of the tank and so will require time* to reach the bulk of the fluid and the temperature sensor. If that time constant is large then the response time of the sensor itself might be negligible and not need to be part of the model, but that doesn't mean it isn't there.
Yes, but there are practical limits. If I could model a system perfectly then I could simply use feed forwards and not worry about closed loop control but reality sucks so closed loop control is necessary. However, My models are usually very accurate and within 2%. This means the feed forwards are correct with 2% and the closed loop control only need to supply at most 2% of the control. This reduces errors significantly.



So an N-order system (N>2) may be modeled as an (N-K)-order system (N-K<3) without too much loss of accuracy.
It depends where the poles are. The poles far to the left of the origin is the s-plane can be ignored. In the case of servo hydraulic control I usually ignore the the poles of the valve because they are relatively "fast". If the customer buys a cheap valve where the valve's open loop poles are close to the origin they must accept the poor performance or go through the hassle of setting up an inner loop.


In some cases the customers don't even buy valves with spool feed back and wonder why the system doesn't control well. This is similar to the situation in the PID Nightmare thread where there is no feedback for the steam valve.


BTW, this is one of my hydraulic servo simulations.
https://deltamotion.com/peter/Mathcad/Mathcad - Hydraulic Cylinder.pdf
I have used this file as a starting point for simulations for the US department of energy.
I am not modeling a very fast valve and still the control is pretty good.
 

Similar Topics

Hi all, I'm working on a wastewater plant with oxidation ditch aerators. The aerators are on VFDs and the operators want the dissolved oxygen in...
Replies
45
Views
17,412
Hi, Have problem with getting PID to work. Have been using 4x different programmers on siemens, not one could make PID to work as I want. Problem...
Replies
6
Views
1,717
I am currently trying to implement a process control of the temperature of water going down a drain after it has gone through 2 radiators. I have...
Replies
6
Views
1,940
I'm not really experienced with PID so I need some help. I have a 300l insulated pasteurizer with heat exchanger on the inner side wall and the...
Replies
6
Views
2,698
Hi, I have a basic query about how PLC handles out of range process parameter. I have a control valve which is modulated to maintain its...
Replies
4
Views
2,047
Back
Top Bottom