PID help needed

Feed-Forward

Think of Feed-Forward as predicting the future error and use this prediction to bias the current output. Example (for the process guys):

Boiler Drum level control:

1. To maintain constant drum level, steam out must equal fwwdwater in.
2. If you want to increase load, you must open the steam vlv. Now your drum level will decrease. (more steam out than water in)
3. Predict that drum level will decrease before opening the steam vlv
4. Increase feedwater flow to boiler before steam flow is increased. Use this to bias (increase) the current feedwater output.

The use of this feed-forward will decrease the feedwater error and keep the system stable.

Also, always ramp your setpoint unless your 100% confidant in your tuning skills.
 
Experiments

Allen:

I don't have hardware either but I have done some testing using SoftLogix5. I've tried both equations and some auto-manual switching but can't get results to support your position. Whatever I do, CV=Kp*E.

I can get the system to appear to support you by enabling 'bias back calculation' which copies the manual CV to the bias term and leaves it there when switching back to auto. But that's cheating and only partial support at best.

So, is this some sort of semantics problem? or one of perspective? While I can accept that your (and Peter's) equations may describe the outward appearance of the beast, I believe they misrepresent the internals.
beerchug

Just studied Peter's simultaneous post (below) and while the equation hasn't changed he does state that when the error is zero, the output is the sum of the integral, derivative, and bias terms. Therefore, if those terms are zero.....
But does that agree with his equation? i.e. the previous output term.
 
Last edited:
Allen Nelson said:

Can you explain what you meant by:

Why only fast updates, and not slow? Why can't you jump-step setpoint, instead of ramp?

The two equations will work in the slower systems too. They just aren't in a form that process people are used too.

This equation

y(n) = y(n-1) + (Kp*T)*(e(n)-e(n-1) + Ki*e(n) + (Kd/T)*(e(n)-2*e(n-1)+e(n-2))

suffers from what is called derivative kick and saturates the output when there is a small step jump. This is not noticeable in a temperature system but people hate to see their servo systems jerk around. In a motion system the T may be .001 seconds. This effectively multiplies Kd by 1000. Even a small error when mulitplied by Kd/T will cause the output to saturate which is not good. The I-PD form only depends on changes in the PV or actual position which will not change abruptly.


Allen Nelson said:

Care to post some pseudo code for how (and more importantly where) one should use Bias/Feed Forward?

The BIAS ( feedforward for motion types ) should be used all the time with rare exceptions! If one sets the BIAS correctly the PID does not have to anything! For example, if we are controlling a temperature loop then we need to have and equation that predicts the correct output for every temperature. This can be done as simply as

BIAS(t) = Kt*t + Kdt* delta T + Constant

t is temperature.

or this can be done using a look up table
or as complicated as

BIAS(t) = a + b*t + c*t^2 + d*t^3 or what ever estimate you make.

The output of the PID block is the sum of the P, I, D and BIAS terms. The bad thing about the PID is the it doesn't provide an output unless there is an error. IT RESPONDS TO ERROR. With the BIAS you can predict the output and reduce the amount of output provided by the PID and therefore the error

When the error is zero, the output is equal to the integral term plus the bias. If the errors are 0 for a period of time then

y(n) = y(n-1) + (Kp*T)*(e(n)-e(n-1) + Ki*e(n) + (Kd/T)*(e(n)-2*e(n-1)+e(n-2))+BIAS(t)

BIAS(t) = BIAS(t) + y(n-1)
y(n-1) = 0

This makes the BIAS(t) self adjust. This is easy to do with a look up table.

Wait, don't stop there. The BIAS(t) can be expanded to be BIAS(t,p) where the BIAS is a function of the temperature and the position of a conveyor. It may be even a function of an oven temperature and material temperature.

Don't despair. Just getting the BIAS() close will have very beneficial results. The PID can take care of the changes in load and non-linearities.

Now we can cook pickles with precision.

Gerry, differentiators are essential on servo motor applications and these are not rare. Sometimes, to get around calling then differentiators, they are called the proportional term on the velocity loop. I have found differentiators essential when controlling force/pressure loops or servos in torque mode because otherwise there is no or very little damping. The differentiator provides the required damping and reduces or eliminates overshoot.
 
I see.... I think I see.... I think....

I can understand why I haven't used Bias much before - when I start a project I usually don't have any a priori way of knowing where to even begin to predict what the Bias should be.

Also, it seems (including from the examples given by Gerry and SteveG) that it is more useful for a continuous process, rather than the batch type that I mostly do.

I'm not saying that you can't/shouldn't use Bias in batch, just that "turning it ON" seems trickier (impression).

As I posted above, you don't put conditions on the (AB) PID block when you want to "turn it OFF", but instead put it manual and drive it where you want (usually zero). When you "turn ON PID control", I can see where you could set some Bias right up front, rather than waiting for the integral portion produce the desired output.

But if the goal is to prevent overshoots, then you never want too big a Bias. Zero, of course, is never too big. The Bias would have to be self-adjusting (or at least adjust to conditions), otherwise you risk permanently overshooting. Or having so small a Bias that it isn't helpful and so might as well be zero anyway.

But then, if the Bias is changing due to a function of error, and PID is a function of error, how do you tune it? Won't the two parts fight each other? Do you need to retune if you change your Bias equation?

And how do you determine the Bias equation in the first place? (I'm not fond of look-up tables in the PLC, the code behind them is messy and is hard to follow by the uninitiated. I prefer a straightforward equation, even if it is third-order, or higher.) You all say "you can predict...", but you don't say how.

<hr>
Gerry:

I saw the same thing in Peter's post. I thought I understood. Now I'm getting confused again. I've got a PLC-5 in my basement (don't ask), but no time to play with it until the weekend. (and maybe not even then). But when I do, I'll post what I find.

<hr>

My appologies to Scott Laubach for highjacking his thread. But I've been trying to do the same thing (understand PIDs in general, and develop the "best practices" PLC code for the AB PID) for a long time now, and this was too good an opportunity to pass up. Hopefully, this has been the sort of information he wanted too.
 
Last edited:
Allen Nelson said:

I can understand why I haven't used Bias much before - when I start a project I usually don't have any a priori way of knowing where to even begin to predict what the Bias should be.

And how do you determine the Bias equation in the first place? (I'm not fond of look-up tables in the PLC, the code behind them is messy and is hard to follow by the uninitiated. I prefer a straightforward equation, even if it is third-order, or higher.) You all say "you can predict...", but you don't say how.


Neither do I. I use the past to predict the future. If a system needs 1500 dac counts to control the temperature at 250 degrees and 3000 dac counts to control the temperature 400 degrees, how many dac counts ( BIAS ) does it takes to control at 300 degrees?

(300-250)*(3000-1500)/(400-250)+1500 = 2000 dac counts

To get these number just set the set point to high and low limits of the temperature range.

Allen Nelson said:

Also, it seems (including from the examples given by Gerry and SteveG) that it is more useful for a continuous process, rather than the batch type that I mostly do.

I'm not saying that you can't/shouldn't use Bias in batch, just that "turning it ON" seems trickier (impression).


Trickier, yes, because you are trying to model a dynamic process but this is where it help the most. Feed forward are most helpful in point to point moves where the integrator does not have time to wind up to the proper control output value.


Allen Nelson said:

But if the goal is to prevent overshoots, then you never want too big a Bias. Zero, of course, is never too big.


You are right. But if you get the BIAS right, the integrator will not wind up and cause over shoot.

Allen Nelson said:

The Bias would have to be self-adjusting (or at least adjust to conditions), otherwise you risk permanently overshooting. Or having so small a Bias that it isn't helpful and so might as well be zero anyway.

It changes as a function of the TEMPERATURE SET POINT! A more sophisiticated BIOS function would change as a function of the temperature set point and the temperature of the load.

Allen Nelson said:

But then, if the Bias is changing due to a function of error, and PID is a function of error, how do you tune it? Won't the two parts fight each other? Do you need to retune if you change your Bias equation?

No, No, NO! The BIAS changes as a function of the TEMPERATURE SET POINT and YOU RAMP THE SET POINT! If you hadn't said that you ramp the temperature set point then none of this would be useful and I wouldn't mentioned BIAS(t).

Allen Nelson said:

My appologies to Scott Laubach for highjacking his thread. But I've been trying to do the same thing (understand PIDs in general, and develop the "best practices" PLC code for the AB PID) for a long time now, and this was too good an opportunity to pass up. Hopefully, this has been the sort of information he wanted too.

But you are asking the right questions!
 
<center>
on.gif
</center>
 
Clearing things up I confused before.

Allen ramps his set point as a function of time. Lets call this SP(t)
The BIAS should be as a minimum BIOS(SP(t)). Therefore as Allen ramps the SP from one temperature to the next, the BIAS should also ramp because it is a function of the current SP. To make the BIAS function even more accurate the BIAS should be a function of SP(t) and SP(t)' (') is the short hand for derivative or rate.
Sorry about the confustion.
 
hey guys im needing help in terms of progrming a siemens s7 300 plc. the program must control a level controller.

i must program the plc to implement automatic or manual PID level control on level control rig. You required to implement level control incorporating the following:
Differential Pressure Meter
Variable Speed Drive (VSD)
PLC with analog I/O
Electronic Chart recorder.
You will be required to configure the VSD.
Auto/Manual control must be via a on/off switch connected to the PLC.
In manual mode the VSD must be controlled via a additional analog input on the PLC.
Chart recorder must display the liquid level also coupled to the PLC.
can any one please help me one this. it iis rather urgent how do i start and where. i am use to programming in ladder​
 
I know this thread is very old but i ran across something that i thought would be relevant to this thread. June 3rd, 2002, 04:46 PM Allen asked where one would use the feed forward biased. I am currently in a situation where i need it for the PID to react. It's not that the control block isn't tuned right. Let me describe the system.

It's a cooling application with a VFD transfer pump to pump sauce through the cooling system and a temperature probe at the discharge. After the temp probe there is a divert valve. If the temperature is higher than a deadband setpoint it diverts the sauce for reciruclation. If the temp is at or below good temperature it diverts to refrigerated holding tanks. However, this is where the biased comes in, there is so much pipe between the divert valve and holding tank that when the system diverts over the flow rate drops dramatically.

What i'm doing is a little more complicated than just adding some biased to the control block. The CV must be limited to prevent freezing of the system if the CV got too low (we use ammonia to cool the sauce quickly). So i take a "snapshot" of the flow value right before diverting and adjust the CV of the PID external to the control block to regulate flow for a certain amount of time. Then i reset my bias and give PID control back. This seems to work extremely well.

The old method which saw the drop in flow allowed the sauce to super cool in the system before it reached the probe and then the PID block so it could adjust. There was a time lag there. So i had to do this "external biased" to the CV to allow for flow correction and to get that super cooled sauce quickly to the PID so it can work properly.

Just my two cents.
 

Similar Topics

Dear all, I have a problem tuning a PID loop. I am trying to control the temperature of a pasteurizer for beer cans and bottles. I am using S7-200...
Replies
8
Views
4,174
Hello, I have a problem with tuning my PID loop in my RS5000 project. In my program I am using a PID loop to control the KW output of an engine...
Replies
11
Views
4,309
Hi, I'm new here and horribly inept in working with Step7 and i have a problem. I am trying to use PID control on two analog valves in order to...
Replies
2
Views
1,703
Hi Experts; I attached an image of pid parameters setting. When i increase the speed of gas turbine the speed goes 1% up then come back 1% down...
Replies
17
Views
4,339
Hi experts; I have Ge 90-30 CPU 352. I use PID (ISA) and first set only the proportional and setting as under; Error term= SP-PV Upper clamp=32000...
Replies
4
Views
2,049
Back
Top Bottom