Is it safe to put someone at the valve with a tape measure or ruler or yardstick? You can be watching the trend, so at the time when the CV reaches a peak or valley, and starts one of it subsequent descents or climbs, respectively, the person at the valve can tell you how long it takes after the time of the peak or valley that the valve starts moving.
I estimate there is backlash of at least 5-10% in the valve positioning system. Look at the data:
When the pressure is rising and above setpoint, the CV will be increasing as the PID tries to compensate, e.g. just after at 12:34:02, the actual valve position is some offset in percentage behind the CV. As the valve actually starts opening and the pressure eventually starts dropping, the CV peaks with the valve at some position, call it VPhi. The CV then drops because the [rate of PV (or E) drop] times [K
c] times [update period], i.e. the proportional change per PID update, is more negative than the [E] times [K
c] divided by [T
i], i.e. the integral accumulation, is positive, per PID update. However, as the CV initially drops from that peak, the
valve position is not changing, and
remains at VPhi. This is obvious in that we see the PV dropping at an
essentially constant rate for around 15s or so from its peak while CV is dropping. If the decreasing CV were changing the
actual valve position during those 15s, the rate of PV change would decrease,
but it does not.
After those 15s, the accumulated drop in CV takes out the backlash and starts actually moving (closing) the valve again i.e. reducing the actual valve position from VPhi. And at that point we the PV rate of change decrease. But because of that backlash, the CV overshoots.
This happens again and again, as the actual valve position lags the CV after every CV peak and valley. The correct fix is to eliminate the backlash.
A possible software solution would be to add or subtract some fraction of the backlash as the Feedforward/Bias term of the PID: positive bias when the CV is increasing; negative bias when the CV is decreasing; zero bias when the CV is level.
Perhaps a deadband* model for the CV would work and be not too complicated to implement in a handful of rungs:
- Append the CV to a FIFO at every PID update i.e. the FIFO trigger would be the PID DN, bit 13 of Word 0, one-shot is one
- Have a pair of FALs that find the maximum and minimum values in the CV
- If the current CV is more than some percentage (2?) above the minimum, and the current PID feedforward/bias is not positive [LEQ PID_Word_6 0], then assign a positive value to the feedforward/bias of 5-10% of the range (e.g. +1638 for +10%).
- If the current CV is less than some percentage (2%?) below the minimum, and the current PID feedforward/bias is not negative [GEQ PID_Word_6 0], then assign a negative value to the feedforward/bias of 5-10% of the range (e.g. -1638 for -10%).
- If the current CV is neither of those, then assign a value of 0 to the feedforward/bias.
Hmm, one problem with that algorithm is that the feedforward/bias will affect the FIFO.
* N.B. this has nothing to do with the deadband parameter of the PID instructions.