TheJacobsDad

Help Needed - Priority System

15 posts in this topic

Hi all,

I am need of some help and I hope that this is the right place to come.

I have a system with up to 15 generators which automatically adjust their loads together based on the available fuel. This works fine.

However we would like to implement a system of priority whereby we have 5 levels of priority and those with priority 1 increase load first and decrease last.

We would work on the priority 1 generators (more than one can be assigned priority 1) first and then if the fuel is no longer availble we would stop trying to adjust load or if they have reached max capacity and there is still available fuel we would move onto priority 2 and so on.

I read in the priority number for each generator from a SQL database which works fine, and I initially had a 2 dimensional array with first dimenion being priority (0-4) and second being generator number (0-14). I can pulll into this and set the bits accordingly e.g If engine 1 was priority 3 I get a result of 1 in the array position 3,1

My issue is how to use this within my control. How can I look at this array and have a method to know which generators are priority 1, which are 2 and so on ?

Also how best to step through the priorities in a sequence and once I do that how can I reverse the order when I decrease load.

Note that that priority numbers may alter, so although Generator 1 is priority 1 today it may be priority 5 in a month.

Any help would be REALLY appreciated as I am tying myself in knots over this one and cant see the wood for the trees !

Share this post


Link to post
Share on other sites

That's really hard to answer without knowing more about the code. Do you have any sort of order to the loading now? Like, start with generator 1 and move down the line? If so, I would start by making the order variable. Create an array that defines the order of the loading. Then you can build a routine to search through your priority array and generate (haha) the loading order array.

Also, you didn't indicate the PLC you're using. Is this Logix 5000?

Share this post


Link to post
Share on other sites

Thanks for the reply. Sorry Yes I am using Logix Studio and the processor is a Compactlogix at V.24

With regard to order, there isn't any in place for this. The generators react together but independently of one another there is nothing to make one react before another.

Share this post


Link to post
Share on other sites

I haven't done any work with generator loading, so I'm shooting in the dark here. I have no basis for what you might be doing. I can only make guesses unless you give me more information about your operation.

Will your priority simply keep the lower priority generators off until needed?

Share this post


Link to post
Share on other sites

Hi Jeremy,

Thanks for the reply.

The actual control of the generators is external, all I do is pass a setpoint value to them from my Compactlogix which acts as a marshalling PLC.

Currently I am loading the generators based on balancing my fuel source ( a single fuel source shared amongst the generators)

The generators all react together in that if there is excess fuel available they all step up together, I simply add a nominal value (ie 10) to each setpoint until either there is no longer an excess and the actual fuel EQU target Fuel or a generator has reached max capacity.

I dont turn them off at any point, all I do is add or subtract value to each generators setpoint.

Instead of doing them all together I now want to prioritise them and do them in an order.

 

In your initial post you mention "Create an array that defines the order of the loading. Then you can build a routine to search through your priority array and generate (haha Thats a terrible pun ! :-)) the loading order array"

I have a 2 dimensional array which has Priority and generator number but I am struggling on how I could build a routine to seach this and generate the loading order array as you mention

Edited by TheJacobsDad

Share this post


Link to post
Share on other sites

Let's simplify this slightly. Say you wanted to load the generators in a fixed order. I'm imagining you would do this by stepping the setpoint until you reach 100% on generator 1. Then stepping the setpoint on generator 2. And so on until you either run out of generators or your fuel source is balanced. Then do the opposite if you need to step down. Am I on the right track?

Share this post


Link to post
Share on other sites

Your pretty much there although I want to step all the generators with priority 1 together, then all the priority 2 together and so on.

 

The complication is that I can have more than one generator with the same priority and that this priority can change on a daily basis (although its unlikely to be this frequent) thus altering the order.

Share this post


Link to post
Share on other sites

So you need to have the individual generator priority levels, and a currently active priority level. The currently active level comes from logic that monitors the current level and fuel balance. You start with level 1, stepping the generator setpoints until they are maxed, then go to priority level 2 and step those until maxed, then increase.... and so on until you find the balance. Do the same thing in reverse for stepping down.

Now only enable the setpoint step up/down logic for a generator when the generator's priority level matches the active one.

Think something like that might work?

Share this post


Link to post
Share on other sites

Yes that's exactly it, my problem is I have the individual generator priorities being set okay, but how to I manage the steps to only move on once all the generators in that priority group are at max.

What I mean is, how does my step control (just using a CTU and CTD) know which generators are in that priority group that it needs complete before moving on a step ? 

Share this post


Link to post
Share on other sites

Just one counter for everything, or one counter per generator? If one per, then can you examine the done bits to know when each generator is done stepping up or down?

Create a long rung that looks at the CTU done bits for all generators. Then branch around each done bit with a NEQ instruction that compares that generator's priority with the active priority. Then you'll know when all the generators of the active priority have completed stepping. Create a similar rung for stepping down.

Edited by JRoss
type

Share this post


Link to post
Share on other sites

I had a single counter of each type (CTU and CTD) controlling the steps - so a .ACC 1 I wanted all the priority 1 generators to increase and when complete fire the Counter to go to .ACC 2 and so on for the 5 priorities.

My issue was how to step on to the next step if I had 2 or more with the same priority, as soon as one of them had completed it stepped up and I didn't want reams of ugly code to manage it.

But as you say, maybe a counter per generator could be the key I have been looking for. I will try it out in the morning and see how I get on.

I really appreciate your help with this one !

Share this post


Link to post
Share on other sites

Oh, you're using the counter for the active priority level. I misunderstood, I thought you were using that for the setpoint stepping.

You need bits for each generator that indicates that the generator is done increasing/decreasing. Then use those bits as I described to know whether all the generators of a particular priority are done stepping.

Share this post


Link to post
Share on other sites

Jeremy,

Tried your suggestion and it worked like a charm so thankyou so much for all your help.

Sometimes you can't see the wood for the trees and you need a little point in the right direction and my thanks to you for taking the time out to get me there.

To get to the crux of the problem, especially with my poor rambling description is nothing short of amazing !!

Thanks again but I can't promise I won't be back with another head scratcher soon :-)

 

 

Share this post


Link to post
Share on other sites

Your application would suit it well to flowcharted code.  A concise flowchart and state machine programming should suffice for your needs.

What you are trying to do is develop a lead-lag system for determining the lead dog with backup generators identified.  This is a popular concept in waste water treatment, to insure that pump systems see equal runtime.

Share this post


Link to post
Share on other sites

Glad I could help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now