Documente Academic
Documente Profesional
Documente Cultură
Got it?
OK.
1
Loop controls are not trivial in general and especially in the situation you are probably going to encounter.
Let's take this one step at a time.
All closed loop controls work roughly the same way.
You have a SP (set point),
CV (control variable, aka output),
and a PV (process variable, aka input).
The goal of the control loop is to adjust the CV so that the SP equals the PV.
Before we go any further then, we have just ONE input controlling ONE output to try to match ONE setpoint.
You have 12 or 16 inputs (it wasn't clear) controlling 4 outputs.
You have to decide right away how to combine those inputs.
For instance, if any of the thermocouples are clearly out of range (way too high or too low) indicating a broken or shorted
thermocouple, then you will probably want to ignore them.
For the remainder, most commonly you will be either taking the lowest, highest, or average value, or perhaps a median or
some other tricky formula of your own design such as a weighted average.
Whatever you do, it needs to come up with a SINGLE input value for each output.
2
There are several different methods to achieve the control aspect of things.
To begin with, there is "open" vs. "closed", also known as "feed forward" and "feed
back“ loops.
In an open or feed forward loop, you simply perform some math on the SP and feed
the result to the CV.
The PV is ignored.
These types of "loops" have much faster response speeds than closed loop
controllers because closed loop controllers only adjust things based on the errors
(after the fact).
Often the output of both types is summed together before being sent to the actual
output to control the device.
3
The closed loop controller looks at the difference between the PV and the SP (the error signal) and adjusts the CV (output) to
try to make the PV and SP match.
• It does not take changes to the set point into consideration in general, only the error signal.
• Thus the reason that the open loop controller deals with changes in set points so much better.
There are several types of controllers such as IMC (internal model control), SMC (sliding mode control), and the one you
mentioned, PID (proportional, integral, derivative control, plus variations which turn various P/I/D terms off).
• Each has certain distinct advantages in certain applications.
For instance, PID loops work best with low process lags (if you change the CV, the PV responds very quickly), linear
responses and consistent process gains (the same size change in CV results in the same change in the PV every time), and
non-integrating loops (the error value does not go into exponential runaway).
• IMC controllers are much more tolerant of long process lags and process gain issues but intolerant of process linearity
issues and integrating loops.
• Sliding mode controllers are very tolerant of pretty much all of the above except for integrating loops and can be a bit
on the slow side to converge.
The reason I'm mentioning these alternatives is because in general sliding mode controllers tend to work very good as
process heating controllers where PID loops don't tend to work so well.
4
Now more importantly, it is important that any of these controllers are operated either by
taking timing into consideration or else run with consistent timing.
What do I mean by that?
• All of the closed loop controllers have gain settings that are in terms of time.
• They are programmed as if "time" is consistent...that is, the controller gets run say once
every 100 ms or once every second.
• If you put the controller code in your continuous task and don't go through some sort of
gyration to fix the timing issue, your controller will not run consistently.
• So the general rule is to always put the code into a periodic task.
• Start by setting up a periodic task specifically for your control loops no matter which
PLC you are using.
There are alternatives but this is the simplest way that gives you consistent results.
5
Ok, so far you should have code that is transforming your thermocouple inputs into a single PV.
Now create the PID instruction itself, one for each output.
• Enter 0's for any of the parameters that you won't be using.
6
You need to enter the set point into the loop_structure.SP member to be able to
adjust your set points.
Interestingly enough, the above tuning method even though it is "seat of the pants“,
calculated EXACTLY THE SAME GAINS as the software product from ControlSoft.
Or if you have RS-Logix 5000 Professional, there is a loop tuner available in there.
You will have to put it in a function block diagram but it also has an autotuner built
right into the PLC firmware.
I've never used this instruction yet though so I can't really tell you much else about it.
13
If you are having trouble getting the loops to stabilize, realize that you are probably fighting
one of two things.
• Process heating applications usually are notorious for long lags (the time it takes for the
PV to respond after you change the CV is very long), and they are notorious for
integrating loops (errors in the loop tend to exponentially increase/decrease rather than
remaining at a fixed value).
• If this is the case you may find that you will have to set the KP low, the KI even lower,
and have a fairly high KD value.
• KD tends to help keep things stable while KI slowly corrects the errors.
Your gains will be very low since both lag and integrating properties are fighting against
making very fast changes.
14
Or you can instead use a sliding mode controller.
These are often much better at controlling process heating applications than PID.
Search for "SMC" or "sliding mode controller" on this forum for references on how to
do it.