PID Position to Velocity Equation Tuning Parameter Conversion

JLand

Member
Join Date
Apr 2019
Location
Madison, Wisconsin
Posts
114
Hi folks,

I am upgrading a SLC to a ControlLogix platform. The goal of the project isn't simply to get the same program to run on different hardware (which Rockwell makes easy), but instead to rewrite the program using modern standards to improve ease of use and troubleshooting.

Part of this is I would like to convert the SLC PID to a PIDE (which I prefer from a programming standpoint and is the more modern instruction anyways). SLC PID to CLX PID seems easy, just be sure your settings (execution time/STI mode, control action, equation form, tuning parameters, etc.) match between the two projects.

However, this is a bit more difficult as PIDE uses the velocity equation instead of the position equation used in PID, changing the transfer function, meaning the tuning parameters are no longer equivalent.

For reference, the PV is the level of a tank, the CV is the speed of a VFD for a positive-displacement pump feeding into the tank, we are using a dependent equation, normal acting direction. The goal is to duplicate (or come as close as possible) the control of the original PID, not necessarily improve the control of the PID. The original controller gain is 20, reset is 1min/rpt, and rate is 0.01min (I did not come up with these values). I will have to do a similar conversion to a steam heat exchanger TIC as well.

I've been tinkering for a bit and can't seem to crack it. Can someone lend me a hand? Would it be best to just put in a PID instruction instead?
 
Velocity vs Positional form of the equation may not be the issue; it is more likely the Independent gains vs. Dependent "gains" option. Have you reviewed the document at this link?

It sounds like the current SLC tuning is similar* to the Dependent form (Integral and Derivative parameters are both in units of min**1 i.e. time). I suspect the PIDE Dependent option was chosen to be as close as possible to the SLC form, and if you can scale the PV, SP and CV to be the same as they were for the SLC, then you can use the same tuning parameters. E.g. if the PID CV output is in the range 0-16383, make the PIDE CV output have the same range, and then scale that PID CV output to the actual control element, and the measured (controlled) value to the PID PV input, separately.

Final advice: document the dickens out of it, once you get it working.

Actually, have you done a search on this forum for "convert SLC PID to PIDE?"

* if not identical cf. the formula on this page from SLC manual vs. the fomula on this page from Logix manual. The error (E) for Logix is in units of "percent of span," but the SLC manual does not give units
 
Last edited:
I am aware of independent vs. dependent tuning parameters.

In CLX PID, the independent PID equation is identical to the SLC PID equation (when the SLC PID is used in conjunction with two SCPs to scale the PV and CV, which CLX integrates into the PID instruction).

In PIDE however, the PID equation (both dependent and independent) is in the velocity form, not the position form, as in the PID instruction for both CLX and SLC. Velocity and position forms of the PID equation have different transfer functions and will, by extension, have different tuning parameters. All posts on this site (and other, inferior sites) refer to converting SLC/PLC5 to CLX PID (which is essentially trivial), not PIDE.

Attached are two screenshots. Both are dependent forms of the PID equation, one is position (which SLC PID uses) and the other is velocity (which PIDE uses and I want to convert to). You can see that the issue is not dependent vs. independent, the issue is the velocity form calculates a change in CV and adds it to the current CV where the position form recalculates a new CV every execution. Position is pretty much inferior to velocity in every way which is why Rockwell updated the PIDE accordingly and I wish to use it instead.

PID Dependent Positional.jpg PIDE Dependent Velocity.jpg
 
Actually, thinking more critically about this, I think the tuning parameters may not be different, position vs. velocity forms of the PID equation. All that's going on to generate the velocity equation is to take the derivative of the position equation with respect to CV and add it to the previous CV (and some other relatively minor inconsequential changes). Seeing as coefficients are unchanged when taking the derivative of an equation, I don't see why the tuning parameters should change.
 
Exactly.

If we assume that

  • [CVn-1] in Velocity Form = [FeedForward or Bias] in Positional form
  • ⌡(E)dt is equivalent to EΔt
  • D(PV)/df is essentially d2PV/dt2, and
    • SP is constant, so E[n] - 2E[n-1] + E[n-2] is the same as Δ(ΔPV)/Δt
      • Because En = (PV[n]-SP), and
      • E[n-1] = (PV[n-1] - SP), and
      • E[n-2] = (PV[n-2] - SP), so
      • E[n] - 2E[n-1] + E[n-2]
        • = PV[n] - SP - 2PV[n-1] + 2SP + PV[n-2] - SP
        • = (PV[n] - PV[n-1]) - (PV[n-1] - PV[n-2])
        • = ΔPV[n] - ΔPV[n-1]
        • = Δ(ΔPV)
Then the two equations are the same.
 
Great, that's what I was looking for, just some reassurance that the tuning parameters are the same. Thank you.

Two watch-outs when going from SLC to Logix:

1. Logix uses a %-to-% scaling on the proportional term, where SLC is %-to-eng.-units (per SP scaling, if used).
2. SLC has a "Reset and Gain Enhancement Bit" which applies different factors of ten to the gain values.

As mentioned, dependent/independent form, along with the time units of the I and D gains may need additional conversion.
 
Two watch-outs when going from SLC to Logix:

1. Logix uses a %-to-% scaling on the proportional term, where SLC is %-to-eng.-units (per SP scaling, if used).
2. SLC has a "Reset and Gain Enhancement Bit" which applies different factors of ten to the gain values.

As mentioned, dependent/independent form, along with the time units of the I and D gains may need additional conversion.

Awesome, thanks for the tips. I appreciate it quite a bit.
 

Similar Topics

I'm using a three term equation to control position, but the velocity profile from point A to B is failing expectation. I'm assuming the...
Replies
3
Views
1,416
Hey Guys, Got an application where the Engineer purchased some Hydraulic Servo Valves and would like me to write a PID to control the position...
Replies
3
Views
1,663
Damper control: air to air heat exchanger, pre-heater We call this a block and bypass dampers, I have process air coming into this preheater at...
Replies
12
Views
9,834
I have a ML1100 PLC and a DC motor with a potentiometer mounted to its shaft. I want to demonstrate positional control using a PID loop(no load)...
Replies
3
Views
4,134
The link below is to an Excel spreadsheet. I used Excel 2003. Hopefully those with out Excel can at least use the Excel viewer. I decided to...
Replies
34
Views
22,370
Back
Top Bottom