Forum

Logix PID loop swin...
 
Notifications
Clear all

[Solved] Logix PID loop swings with a 40 second period after moving it out of a periodic task

6 Posts
3 Users
0 Reactions
74 Views
(@petek)
Trusted Member
Joined: 2 years ago
Posts: 45
Topic starter   [#116]

Hi folks,

1756-L72, Studio 5000 V31. Jacket temperature loop on a mixing vessel, steam valve, the standard PID instruction, not PIDE. The vessels landed on me in the spring so treat me as a beginner on loops.

Last week I moved the PID rung out of a 500 ms periodic task into MainRoutine, gains untouched, Kp 2.5, Ki 0.3, Kd 0. Since then the temperature swings about 2 degrees either side of setpoint with a period of around 40 seconds and it won't settle. Before the move it held within half a degree for two years.

I tried dropping Ki to 0.1 to see what it did and the swing got slower, but it's still sitting there. Not sure that's the right end of it.

What's different about a PID in a continuous task? I'm mostly a TIA person and PID_Compact never cared where I called it from, or so I thought. Does the instruction maybe need telling how often it's being called?


Advertisement

   
Quote
(@marekw)
New Member
Joined: 2 years ago
Posts: 0
 

Was the valve proved before you blamed the software? Stroke it 0 to 100 from the HMI in manual and watch the position feedback follow. A positioner with a dead spot gives you exactly this kind of slow cycle, and it can start the same week as a program change by pure coincidence.


Advertisement

   
ReplyQuote
(@petek)
Trusted Member
Joined: 2 years ago
Posts: 45
Topic starter  

> A positioner with a dead spot gives you exactly this kind of slow cycle

Stroked it this morning in 10 percent steps, feedback follows within a percent each way, no dead spot. So it's back to the software.

Continuous task scan is 18 to 30 ms. The periodic task it came out of was 500 ms.



   
ReplyQuote
(@wandak)
Trusted Member
Joined: 2 years ago
Posts: 39
 

There's your 40 seconds. Open the PID, Configuration tab, look at the timing mode and the update time. I'd bet it's on periodic with .UPD at 0.5 to match the task it used to live in. The integral uses .UPD to work out how much to add each time it runs, so the rung now runs every 20 ms while the block still believes it runs every 500 ms. Integral about 25 times faster than your gains were tuned for. Same gains, wrong time base. Dropping Ki just slowed the swing down.

Put it back in the periodic task. If it has to live in continuous there's a real time sampling mode with a master clock, though I've never bothered with it. Someone did a decent article on the PID setup: https://plctr.com/implementing-pid-control-in-plc-systems/



   
ReplyQuote
(@petek)
Trusted Member
Joined: 2 years ago
Posts: 45
Topic starter  

Back in the 500 ms periodic task since last night. Trend's flat again, within half a degree, gains untouched. .UPD was 0.5 exactly as you said.

So my tidy-up left the update time saying one thing and the task saying another, and the block was doing 500 ms of integral every 20 ms. Putting the rung back where it came from was the whole repair, plus a comment on it so the next tidier reads that first.

PID_Compact does care where you call it from as well, I'd just never moved one.

What I still don't understand is why, with Ki at 0.1, the period got longer rather than the loop settling. I'd have expected less swing, not slower swing. Thanks wandak and marekw.



   
ReplyQuote
(@marekw)
New Member
Joined: 2 years ago
Posts: 0
 

Valve first, then the block. Glad it was the block this time.



   
ReplyQuote
Share: