Does this Logic make sense

plcnovel

Member
Join Date
Feb 2006
Location
LHR
Posts
215
Greetings to All
I have a existing code written for SLC5/04, initially not written by me. The kernal of the code is doing something like below:

There is a peace of logic that is taking two inputs (outputs of two pid control loops, one is inlet pressure and the other is outlet pressure in percentage) it selects the low out of these two inputs and then it operates two outputs in the following manner:

1) Rcyle valve = Low Select*N
2) Speed of Engine = (Low Select - N/2)*N

Where low select is the lowest selected input, and 'N' is the number of outputs which in my case is 2. Hence above equation becomes

1) Recycle Valve = Low Select*2
2) Speed of Engine = (Low Select-50)*2

which simply means as long as Low select < 50, recycle valve output is active, where as if low select > 50, the speed output is active. It works fine when the engine is ramping up, it tries to close the recycle valve first and then ramp up the speed, but when its going down(ramping down), it doesn't ramp down fast enough to take off the building pressure because during ramping down, it is slowing down the engine speed to Min speed and then it opens up the recyle valve, which is not good in case if something is blocked or frezes in the inlet line.....

So what i came up with to correct this problem is follows:

I am checking the low select all the time, if low select is more than 50, which means the speed output is active, then i am keeping an eye on the Process Variable of Inlet and Outlet pressure loops, now if the outlet pressure loop process variable is greater than the setpoint(it means it is slowing down the engine, but can not hold back the pressure) then i calculate the error(PV-SP), i am changing this error into a percentage amount and then check a condition if PV for outlet is > SP for outlet loop, then open the recycle valve by the percentage error amount otherwise remain the bypass closed.....here is it in structured english:

If Low Select >= 50
then
go to force recylce routine


Force Recycle

if PV (Outlet) > SP(outlet)
then
Error = PV - SP
else
if PV(Inlet) < SP(inlet)
then
Error = SP - PV
end if

change Error into % error (By using SCP instruction, lets say i am using error ranges from Input Min = 0, InputMax = 1000, ScaleMin=0, ScaleMax=100)

If PV(outlet) > SP(outlet)
then apply the percentage error to the recycle output valve

if (check the limits of PV(outlet), low limit = SP-100, high limit = SP), if PV outlet falls in this limit then force the recycle valve output to 100% CLOSE.

Problems: First of all will this peace of logic works the way i wanted it to work ( mean to say will it bleed off some pressure while ramping down so that outlet pid loop does not loose the setpoint)

Secondly i am converting the error into a percentage signal so that i can open the recycle valve according to that error. What i am trying to accomplish is the greater the error the more faster the signal to the recycle valve to open...how can i do that? In otherwords how can i determine the exact ranges into my SCP instruction for the error.

Finally once i open the valve to that error percentage, and everything comes back to normal (means PV of outlet pressure is keeping track of the setpoint ) then i want to close the recycle valve (this is what the last structured rung above trying to accomplish). How can i effectively and bumplessly close the recycle valve when the above normal limits reach?

I haven't tested this logic yet, i dont know what i want out of it can be accomplished or not. But guys i am sitting at the site right now and i have to make this work.......so any other ideas from you guys will always be welcome. I will appreciate all of your guys and thanks in advance
 
Your PID is not tuned properly. You are trying to modify it's actions instead of proper tuning. You will go insane in the attempt!

I don't know if you can have 2 PID's. You need one for 'heating' (ramping up), and another for 'cooling' (ramping down).

Bumpless transfer is a feature of some controllers, but again I don't know if you can do that in AB. To manually do bumpless, you would need to slow down the reaction of the PID to upset, then slowly increase it. The reason you will have a bump in the first place is because you want to interupt the PID, then restore it. This is the part that will never work.

If you can't do 2 PID loops, then you need to tune them one at a time, and use logic to write the new values. You have good values now for ramp up, and need a different set for ramp down.

(spelling: 'peace' should be 'piece').
 
Last edited:
I agree with Keith, I would try to solve it with proper tuning first.

The SLC PID can be bi-polar when it is configured to initialize properly. There is a technote in the AB knowledgebase on bipolar PIDs in the SLC.

You may also find that you need a different set of gains when heating or ramping up and cooling or ramping down. Use MOV instructions to place the appropriate gains in the PID control block.
 

Similar Topics

I have this program: ZIP (.rss inside no documentation) PDF (Italian documentation) Allen Bradley SLC5/03 PLC. Running on a machine, I want to...
Replies
6
Views
1,498
Hello I have logic for two pumps that run based on levels and alternate upon each run. The issue is that I can not seem to figure how to go...
Replies
5
Views
2,994
I am trying to connect with a Schneider plc which has a firmware version only available in Somachine v4.2. In Machine expert After taking upload...
Replies
0
Views
106
They are installed in a control panel that was made in France and are intended for the termination of analog inputs. Each of the red capped...
Replies
4
Views
394
Back
Top Bottom