PID CV only changes after SP crossed

khelza

Member
Join Date
Sep 2015
Location
Ontario
Posts
67
AB Rockwell PID function

I am tuning a PID function for a hot water tank. There is a valve (CV) that opens to allow hot water through when the temperature (PV) goes below the setpoint. The valve will close when the PV goes above the temperature (stops adding hot water). But there is a constant overshooting and undershooting ~15deg above and below the SP, without maintaining the SP.

The problem is, when the PID is trying to maintain the temperature, it will keep the valve 100% when it's cold (below SP), and 0% open when it's too hot (above SP). the CV will range in between 0-100% for a short period of time when crossing the setpoint (in either direction), and depending on the Kp, Ki values, I can slow down how fast/slow it takes to get to 100% or 0%, however I have not found a setting that allows the output to maintain CV somewhere in between 0-100% for a more gradual PV change.

Currently, the PV will be somewhere below the SP, and CV is 100% (fully open) to bring in hot water. The PV will slowly creep up to the SP, but the CV is still 100% open. It's not until the PV gets a decimal over the SP that the CV value starts to drop, until it gets to 0% (fully closed), and stays at 0% until the PV reaches a decimal back below the SP, and then it will gradually go back to 100% and stay there.

What I am trying to accomplish is BEFORE the PV reaches the SP, I would like the valve to gradually open or close, so that it is not getting a constantly swinging temp +/-15 from the SP. In this scenario, when the PV is below the SP, the valve starts to open a little. It stays open a little in hopes of achieving the SP, or opens more if the PV continues to drop. As it approaches the SP, the CV closes more and more. Once it reaches the SP, the CV modulates so that the temperature maintains the SP. If it goes over, the valve closes a little, if it continues to climb, the valve closes more, and modulates appropriately to maintain the SP...basically, how a PID is supposed to work.

I have never tuned one of these, but did receive training many, many years ago. Perhaps there is something I am forgetting or missing completely but my changes seem to only affect how long it takes the valve to swing from 0-100% and vise verse, but not WHEN it starts changing.

Apparently this only started not working when the controller was upgraded from SLC to CTL.

These are the settings it is set to currently:
- Output bias: 0.0
- Kp: 0.5
- Ki: 0.005
- Kd: 0.0

- Equation: Independent
- Control A: SP - PV
- Der. of: PV
- Loop Update Time: 0.5s (I changed it from 4 to 0.5)
- Deadband: 0.0

No boxes checked off

----------------

Please let me know your thoughts. Thanks!
 
Last edited:
Apparently this only started not working when the controller was upgraded from SLC to CTL.

I think you mean SLC to CLX ? do you have the original SLC program? was there a min/max set maybe you need to make one if not and set it to 75% so it will only open/close 75%
 
how long does it take the temperature to increase by 1 degree when it is cold (below sp) and valve is open at 100%?


how long does it take the temperature to decrease by 1 degree when it is hot (above sp) and valve is closed at 0%?
 
AB Rockwell PID function
...
Apparently this only started not working when the controller was upgraded from SLC to CTL.
...
- Loop Update Time: 0.5s (I changed it from 4 to 0.5)
...

Please make sure the PID instruction is being scanned at the 0.5-second interval specified in the configuration; otherwise the integral (and derivative, if used) action will be affected. Options include using a recurring timer in a continuous task and conditioning the PID rung with the done bit, or putting the PID instruction in a period task with a 500 ms interval.

An incorrect loop update time acts as a scaling factor on the time-dependent gains.
 
Hi, hope I can help a little. I wouldn't dare to get crossways with Peter; it would be great if I knew what he forgot. I had trouble with valves until I basically did what he posted here. Anyway, I did a lot of PID's' on a project this last 2 years and one thing jumped out at me in your settings. Change "independent" to "dependent". Mine all work well that way. I made my ki 0.016 on all my loops. I played with the kp and most of my valves are something like 0.007 and such. This way the CV sort of creeps up and then "lands" on the SP. One last thing, as Mispeld wrote, be sure the update time and what you have as update time match. Many folks have suggested a periodic task, I don't do that. I just put a free running timer at 500 mS setpoint and use the done bit to run the PID. All other conditions I do elsewhere in logic. I'm sure there are a myriad of better ways, but all my stuff is working and I get no callouts. Hope this helps.
 
The reason I want to know about the valve is because the control is much different between the two cases. If the valve spool position is speed is proportional to the control signal then the valve is acting like an integrator. This will definitely be a potential problem if you don't take this into account. This is much different from the hydraulic servo valves I work with most of the time where the control signal is controlling the position.
 
Have you verified in the field the valve will hold an output sent in manual? Almost sounds like open loop on the positioner, I'm assuming there is one.
 
Hey guys, just wanted to give an update. My apologies for the delay, I wasn't able to look at this again until today.

I added a timer.DN bit that matched the Loop update time, and it worked a lot better, and then did some tuning and adjusting of the Kc = 5.0, Ti = 0.5, Td = 0.3
I also changed the PID Equation to Dependent, and the Derivative to Error.

It's seems a lot smoother, with still some, but a lot less overshoot, and not having the valve jumping to 100% open or close.

I plotted my CV, PV and SP, which I will upload for interest.

Couple questions:
Would the new plot be considered acceptable for PID standards, with a little overshoot?
- it doesn't matter in real life for this application
Does RSLogix have a trending capabilities comparable to the Pi software I used?
- I know it can trend, but can I use a shared or separate axis? Or am I better off using the software I am now?
OLD
https://i.lensdump.com/i/izugJM.jpg
NEW
https://i.lensdump.com/i/izuZ8A.jpg
 
Couple questions:
Would the new plot be considered acceptable for PID standards, with a little overshoot?
- it doesn't matter in real life for this application


Looks a lot better, but it looks to me like it could use a little bit of fine tuning. It definitely smooths out toward the end, but the initial response is a bit oscillatory in my opinion. As always, it depends on what's acceptable for the process and the customer, but objectively it looks like it could use a bit of additional tuning. Great job so far!
 

Similar Topics

I am using a LS PLC - DR60SU - to control various control loops. I have set up the PID loops in the PLC and am using an HMI to set the sepoints...
Replies
0
Views
3,410
I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
5
Views
218
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
851
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
384
I'm setting up a PID for a 50hp RO pump in a water treatment plant. When I go to manual mode on hmi I set the swm bit, I also ons the pid output%...
Replies
5
Views
524
Back
Top Bottom