PID Tuning Help

BenL

Member
Join Date
Feb 2015
Location
Florida
Posts
26
Good afternoon all!

I was wondering if anyone could explain more clearly to me the tuning parameters of a PID instruction on a 1769 AB Compactlogix.

I currently trying to output a Hertz speed reference based of the tracking of a Dissolved Oxygen meter (PV 0-10 ppm) and an operator input setpoint (SP 0-10 ppm)

The PID is currently tracking but overshooting both ways by .3-.10 on average. I've been playing with the Pk Pi and Integral Time but can't seem to make any sense or get it to tune one way or another. I also tried deadband but saw how that wouldn't work either. Tried manipulating the loop execution time too and could notice results, just not the desired ones. I have been and will continue to search the web for clarification on the tuning parameters but thought I would run it by the experts here as well. Any input when you have time would be greatly appreciated.

I've attached screenshots of my PID parameters screens and logic rung.

Thanks a lot!

Ben
 
Is this for a blower application? What is your lag time between a change in your CV before a change in the PV happens? I don't use PID control for blower D.O for this reason alone, because the dead time can be huge.
 
bjh,

Thanks for the follow-up. Yes it is for a blower application. The lag time is approximatley on average 6 seconds for a change in VFD output to impact the D.O. The meter is quite some distance from the blower itself.

Unfortunately, I don't have many other easy options. I currently have a manual speed reference input for the operators that keeps fairly steady track, but the idea is for it to be automated. The other input on the VFD is for the hand pot speed ref. Any tuning elements I could focus on to at least tighten it up as much as possible? It doesn't need to be an exact tracking.

Thanks again!
 
Are you triggering the PID instruction at a set interval? If you aren't, you should be. If you are the "Loop Update Time" field should be set to that interval. This will have an effect on the rate of the integral sum.

Is your control variable output ( N7[0] ) really an integer or is it a float? If it is an integer, do you have additional output scaling or is the integer a direct reflection of your output? The reason I ask is that an integer taking an output between 37 and 60 will not provide much resolution.

Without actually evaluating this in detail, your proportional gain seems kind of low to me. A proportional gain of 1 will produce 1 output unit for each error unit. Since your total error probably can't be much more than 1 you will not get much proportional action. Also, your integral gain seems kind of high for an independent equation PID. The longer your drive accel/decel rate and the longer the response of your sensor to a speed command change the lower the integral gain needs to be in a relative sense.

It looks to me like you have a PID bias entered of 100%. The bias value is added to the control output to become part of the total output. Said another way, your output will start at 100% and start adjusting from there.

Finally, if this is a centrifugal blower your system gain is not constant. A 5 Hz change in speed at low speed will have less effect than a 5 Hz change at high speed. Your options are to modify the PID gain as the drive speed command changes or tune the loop at high speed and live with non-optimal response at low speed (it will be a little sluggish).

Keith
 
Do not modify the Loop Execution time.....

How are you triggering the PID instruction ?

Are you using a self-resetting timer (usually adequate, but will be slightly affected by scan time variations), or have you got the PID instruction in a Periodic Task (recommended, the execution period will not be affected by the scan time of the other application logic).

Whatever the time-base of the timer is, or the periodic task rate if you are using that, should be written into the loop update parameter (.UPD) of the PID instruction. This tells the PID how much time elapses between executions, which is one thing it definitely needs to know to perform its calculations correctly.

Unless you have the PID triggered at a constant rate, you will find tuning it harder.

For tuning, most people start with I and D terms zero, and then increase the P term until oscillation just starts, then back it off a little. The PV will not be aligned with the SP at this point.

Now start adding Integral to bring the PV to the SP, too much integral will cause overshoot. Make step changes to the SP if possible to aid the tuning of the I term.

Now if you need to speed the loop response, you can raise the I term, but add some D to stop the tendency to overshoot.

Everyone has their own trusted way of tuning, and I'm sure you'll get multiple replies on how to tune a PID, some will suggest you actually time the oscillations that you induce by having too much P. That time is used to calculate some "starting-point" P, I and D terms. Look at the Ziegler-Nichols method
 
Thanks all for the great feedback! I am no expert on this stuff by any means. daba, I think I will try your steps from a base point to try again.

Correct me on bad form here. The PID is executing solely off Rung scans. I tried a timer.dn the same as the loop execution time and got inverse effects.

I am using the PID output% into an analog scale converting the float % to a 4-20 mA scaling for input to the VFD speed ref.

VFD min run speed is 37, hence the 37 min 60 max for the PID CV high and low. I also may try slowing down the accel/decel of the VFD's, so there will be some latency of the speed ref to the actual speed response.

Thanks again for all the good info. Seems like this is quite a task in this application. I've done one before for a pressure application and it seemed fairly cut and dry. It's actually the PID parameters exactly copied from that one.

I'll still welcome any thoughts on my plans or maybe being incorrect on the lack of timer triggering the PID.

Thanks all again!

Ben
 
Thanks all for the great feedback! I am no expert on this stuff by any means. daba, I think I will try your steps from a base point to try again.

Correct me on bad form here. The PID is executing solely off Rung scans. I tried a timer.dn the same as the loop execution time and got inverse effects.

I am using the PID output% into an analog scale converting the float % to a 4-20 mA scaling for input to the VFD speed ref.

VFD min run speed is 37, hence the 37 min 60 max for the PID CV high and low. I also may try slowing down the accel/decel of the VFD's, so there will be some latency of the speed ref to the actual speed response.

Thanks again for all the good info. Seems like this is quite a task in this application. I've done one before for a pressure application and it seemed fairly cut and dry. It's actually the PID parameters exactly copied from that one.

I'll still welcome any thoughts on my plans or maybe being incorrect on the lack of timer triggering the PID.

Thanks all again!

Ben

Absolutely the wrong thing to do.

Take a look at the RPI and RTS rate of the analog input serving the PV. There's no point executing the PID faster than either of those, it'll just be calculating that nothing has changed since it made its last adjustment to the OP, and will "overcompensate".

I can't think of any time I've needed a PID update rate (interval) of faster than 100mS, I think most of the ones I've worked on over many years were of the order of 500mS.

May I recommend that you create a Periodic Task of 500mS period, and put your PID instructions in the main routine in that task on unconditional rungs... You only need the PID instructions themselves, none of the other control logic, that can stay in the continuous task. Then write a rung of code to put 0.5 (seconds) into the .UPD of the PID tag. That tells the PID it is being updated every 500mS.... EDIT : If you feel brave, you can read the periodic task rate with a GSV instruction (Task, THIS, Rate), do a bit of math with it DINT mS to REAL Seconds), and put that into the PID.UPD parameter, then you can adjust the periodic task rate, and the PID will be set accordingly.

It's all in the instruction Help....

2017-01-11_223917.jpg
 
Last edited:
Is this for a blower application? What is your lag time between a change in your CV before a change in the PV happens? I don't use PID control for blower D.O for this reason alone, because the dead time can be huge.

bjh:

What had you found to work well with tracking D.O. with any sort of accuracy? Over two days and it is very hard to get this tightened up. Any input is appreciated.

Thanks,
Ben
 

Similar Topics

Hi, I have a question in my Instrumentation & Control HND which is as follows: Figure 3 shows the open-loop response of a process modelled by...
Replies
6
Views
4,242
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,298
Hello, I'm having a lot of trouble tuning a PID loop on a SLC 5/05. Can someone tell me if I'm doing something wrong? Please see attachment to...
Replies
8
Views
3,814
I have a PID installed in ladder on a very slow process. My PV is an ORP analyzer. The CV is connected to a chlorinator which pumps chlorine...
Replies
3
Views
3,139
We have a system that we are programming for a controlled paint booth environment. We are controlling temperature and humidity in the booth at...
Replies
6
Views
2,394
Back
Top Bottom