2 PIDs 1 Output

rankhornjp

Member
Join Date
Dec 2008
Location
Georgia
Posts
241
Processor: Modicon Quantum 652 60
Software: Unity 7.0
Language: LL984
Equipment: Extractor (basically, a large drag conveyor)
Input: Level transmitter in hopper
Output: Speed of extractor motor

Current programming: First PID2 loop is on when extractor is started. SP is 60% hopper level. This is tuned more aggressively than the second PID2 (P gain of 1). This PID2 will run for a minimum of 1 hour. During this hour an average block is calculating the average speed of the OUTPUT. Once hopper level is +- 15% of SP for at least 1 hour, the control moves to the second PID and clamps the output at +-5% of the average. The second PID2 is less aggressive so the speed swings a LOT less (P gain of .25). The second PID2 will stay in control as long as the hopper level doesn't go +-20% of SP (in this case, greater than 80% or less than 40%). If this happens, control switches back to the first PID2 and we start over from the beginning.

We are trying to smooth out the output of product from the extractor so that everything down stream will run smoother. If you run the extractor at a steady speed the hopper level will oscillate and sometimes the hopper will fill up too much or empty out (which is just as bad). So that is why we are using the second PID2 to lessen the oscillations, but allow it to adjust the speed in a smaller range to prevent overfilling the hopper, or running it empty.


Problem: When control shifts from the second PID to the first PID I get a huge jump in extractor speed. This is bad because it will increase the load (amps increase by ~40%) on the conveyor that the extractor dumps out onto (if hopper level is high).


Is there a better way of accomplishing this? If not, how can I prevent the large jump in output when the PIDs change?


Pic attached to show extractor trend during change. This shows a change from hopper level being too low.

extractor trend during PID change.jpg
 
Not sure, but maybe only one pid with two different P, I and D terms. At auto copy pid's output to manual output.
At change put pid to manual and back to auto (one scan), so it should start with new terms from same output than before change?
 
how about letting them both run at the same time, just writing to two different addresses. then use the output value that matches which pid mode you want to be in. that should make your transitions smoother.

Not sure how this would work, but I'll look into it.

Not sure, but maybe only one pid with two different P, I and D terms. At auto copy pid's output to manual output.
At change put pid to manual and back to auto (one scan), so it should start with new terms from same output than before change?

This isn't possible with the PID2 as they don't have a manual output. I will have to reprogram it in the newer ladder to be able to try this. I believe I read something similar in an AB Technote, so it might work. The Technote used 2 PIDs, but the concept was similar.
 
Last edited:
Not sure, but maybe only one pid with two different P, I and D terms. At auto copy pid's output to manual output.
At change put pid to manual and back to auto (one scan), so it should start with new terms from same output than before change?
This is one way to do it but I would change the gains smoothly. Unfortunately the PID2 is a rather crude PID so the easiest thing to do is to run both PIDs as suggested before and use a weighted average of the two PIDs based on the output deviation from average.


ControlOutput =K*ControlOutPut1*+(1-K)*ControlOuput2
Where K changes smoothly from 0, when ABS(SP-PV) is small, to 1, when ABS(SP-PV) is big. It is easy to workout a function that will yield a K from 0 to 1.

Another way of doing this is to use only 1 PID using the second lower gain PID2. To make the PID more responsive when the error is big then do this
error = error + K*(error^3)
were K is a small number like 0.001 so if SP-PV is 10 the modified error is 11. If SP-PV the modified error is 28. etc. IF SP-PV = 30 then the modified error is 30+27=57. etc.
You may need to change the 0.001 to some other constant.
 
This isn't possible with the PID2 as they don't have a manual output. I will have to reprogram it in the newer ladder to be able to try this. I believe I read something similar in an AB Technote, so it might work. The Technote used 2 PIDs, but the concept was similar.

You can try it also only changing pid-terms at fly.
Putting PID to manual and back only initialize calculations.
 
Not sure how this would work, but I'll look into it.



This isn't possible with the PID2 as they don't have a manual output. I will have to reprogram it in the newer ladder to be able to try this. I believe I read something similar in an AB Technote, so it might work. The Technote used 2 PIDs, but the concept was similar.

like this:
 
Probably the easiest way to ensure a smooth (output) transition between the two PID2s is to use the 'reset feedback' function that is a standard feature of the PID2 instruction.
A software selector function would determine which PID2s output is utilized; the other PID2's output would be reset by the output of the selector.
 

Similar Topics

I don't have a lot of experience with the 90-30 PID, but I'm working on some for an existing system. My question concerns manual operation. It is...
Replies
18
Views
3,817
Hello, I've done several migrations from SLC 5/05's to 5370 L33ER Compactlogix controllers. I've just encountered my first PID instructions with...
Replies
2
Views
1,693
Hey all, I'm pretty new to PLC programming and am on a team doing a PLC5 to Studio5000 conversion. After doing the built in conversion, I've...
Replies
6
Views
2,522
I'm constantly amazed by the number of "things" that can be copy/pasted or just drag/dropped from one application to another but I think I may...
Replies
3
Views
1,410
I have 2 PID blocks running at the same time and they seem to be giving identical outputs and SV and PV are different on each. Any ideas why this...
Replies
6
Views
2,573
Back
Top Bottom