You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 16th, 2017, 10:49 AM   #1
TheJacobsDad
Member
United Kingdom

TheJacobsDad is offline
 
Join Date: Feb 2017
Location: Bedford
Posts: 2
Exclamation Setting Priorities

Hi All,

I am in the middle of having a brain **** and hoping you guys can get me back on track.

I have some code in a marshalling PLC (CompactLogix L30ER) which is adjusting the load outputs of generators based on the available fuel which is working fine.

However we now want to introduce a priority system whereby a value from 1-3 is set in an external database (I can read write from this already) and I adjust the generators in order based on this priority value - So if for example Generator 1 is set with a priority of 1 it will increase load first and decrease load last, if however it is a priority 2 then it will wait until the other generators with priority 1 have reached their max load and so on

I am sure there is an elegant solution to this but I currently cant see the wood for the trees.

Any help would be much appreciated
  Reply With Quote
Old February 16th, 2017, 11:58 AM   #2
Mispeld
Member
United States

Mispeld is offline
 
Join Date: Feb 2017
Location: VA
Posts: 119
You could have a three-element array where item 0 is highest priority, 1 = second, 2 = third. The database would set the array element values corresponding to the generator ID's. A capacity pointer will have the value 0, 1, or 2 depending on how much generation is currently in use. Short-term changes in load will affect the generator ID referenced by this pointer. When it exceeds the current generator capacity, add one to the pointer and activate the next generator ID in the array. It is similar for decreasing capacity and deactivating generators.
We do this with compressors and cooling towers, and it readily extends to more complicated scenarios with using fractional capacity across units (e.g., 25%, 25%, 25%, 50%, 50%...) or within units (e.g., 25%, 50%, 75%, 100%, 25%, 50%, ....) depending on how the array contents are defined and interpreted by the capacity adjustment routine.
Of course, the system should be shut down when the capacity strategy (i.e., array values) is adjusted from the database, or very carefully if done on-the-fly.
  Reply With Quote
Old February 16th, 2017, 12:05 PM   #3
3176dan
Member
United Kingdom

3176dan is offline
 
Join Date: Jul 2012
Location: Hemel
Posts: 3
Thanks for the reply, really useful and got me thinking. Once complexity I neglected to mention (told you I was in a spin !) is that there could be multiple generators using the same priority.....Will this approach still accommodate ?
  Reply With Quote
Old February 16th, 2017, 12:31 PM   #4
cwal61
Member
United States

cwal61 is offline
 
Join Date: Jan 2011
Location: NC
Posts: 821
There 6 combinations of priority:
1 = (123) 2 = (132) 3 = (213) 4 = (231) 5 = (321) 6 = (312)

N
Attached Images
File Type: png Capture.PNG (10.2 KB, 115 views)
  Reply With Quote
Old February 16th, 2017, 01:29 PM   #5
Mispeld
Member
United States

Mispeld is offline
 
Join Date: Feb 2017
Location: VA
Posts: 119
It depends on how the priority system is supposed to work. If the behavior is such that two generators at the same priority means they are interchangeable, but that you still run one of them to maximum before activating the next one; then the priority array only needs to have generators of equal priority adjacent to each other. For example, say generator A is priority 2, B is 1, and C is 1. The array contents would either be (B, C, A) or (C, B, A). [If implementing as an integer array, you would define A, B, and C to numbers; letters are used here for clarity.]

It gets trickier if equal priorities mean running two generators at the same output, and both must be maxed out before activating the next priority. That would require another level of indirection coming off of the priority array. The capacity control routine would need to scan the list of generators at the current priority to manipulate all of them before moving to the next priority.
  Reply With Quote
Old February 16th, 2017, 01:33 PM   #6
cwal61
Member
United States

cwal61 is offline
 
Join Date: Jan 2011
Location: NC
Posts: 821
Disregard my previous post. I hit post before I saw your 2nd response.
  Reply With Quote
Old February 16th, 2017, 01:34 PM   #7
3176dan
Member
United Kingdom

3176dan is offline
 
Join Date: Jul 2012
Location: Hemel
Posts: 3
Thanks for the info thus far, sadly it is the trickier of the two options. So if I have 2 generators (A & B) both at priority 1 they need to increase to their max load simultaneously before moving onto increasing any generators set to priority 2,3 and so on
  Reply With Quote
Old February 16th, 2017, 04:30 PM   #8
ASF
Lifetime Supporting Member
Australia

ASF is offline
 
Join Date: Jun 2012
Location: Australia
Posts: 2,169
Try this.

Let's say each generator has 5 "loading" steps: 20%, 40%, 60%, 80%, 100%.

For each unique "duty" (1, 2 or 3) that exists, you therefore have 5 steps (let's assume that a duty of 0 means the generator is disabled).

So, first thing to do is work out how many total sequence steps you have. If you have duty set to 1, 2, 3 then you have 15. If you have duty set to 1, 1, 3 you have 10. If you have duty set to 0, 1, 1 you have 5. There are a few ways to approach this, but even brute force is only a handful of instructions.

Once you have this number, move it into the preset of a counter. That counter is your load/unload master control.

Use your counter to count up and down as necessary (just remember to limit the count where necessary - e.g. if your counter is up to 15 and one generator gets switched to duty 0, then you'll need to drop it back down to 10).

If the counter is at 0, no generators running (theoretically).
If a generator has duty 1, it will load 20% at count 1, and 100% at count 5.
If a generator has duty 2, it will load 20% at count 6, and 100% at count 10.
If a generator has duty 3, it will load 20% at count 11, and 100% at count 15.
Again, there are a few ways to approach this, but even brute force is not overly complex.

This will work no matter what combination of duties you have. Of course, there's the potential issue that if you have duties 1, 1 and 3 - nothing will happen while the counter counts between 5 and 10. Likewise, if you have nothing on duty 1, no generators will turn on until the counter gets to 6. If either of these are issues, you can tweak things to suit - have the counter check to see if there is an available generator for it's current loading step, and if not, immediately count to the next one. Or, you could force duties to not leave gaps. Or, you could slap your operators with a wet fish every time they do something silly with the duty numbering until they learn not to. So many possibilities!
  Reply With Quote
Old February 16th, 2017, 05:17 PM   #9
Mispeld
Member
United States

Mispeld is offline
 
Join Date: Feb 2017
Location: VA
Posts: 119
I would probably go with a 2-dimensional array where, say, the rows are priority groups and the columns are generator ID's within each group. An Active-Priority pointer would indicate the highest priority group (row) with available capacity.
When the capacity control routine needs to change capacity it would reference the Active-Priority to find the ID's of generators in that group by examining non-zero columns in that row. Those generator(s) would be manipulated together, and if all are running at maximum, increment the Active-Priority pointer and start increasing the next, lower priority group. Likewise on decreasing capacity, when all are turned off, decrement the priority pointer to the next, higher priority group.
Since your number of columns would be the maximum possible generators at specific priority, and the number of rows equal to the total number of generators, this ID table will likely be sparsely populated.
[In practice, I would probably add a column (e.g., col zero) to indicate status of the group (e.g., empty, capacity full, capacity available) and have the capacity control routine scan that column to decide which group to operate on (i.e., highest priority with available capacity), rather than relying on the Active-Priority pointer.]
  Reply With Quote
Old February 17th, 2017, 04:01 AM   #10
3176dan
Member
United Kingdom

3176dan is offline
 
Join Date: Jul 2012
Location: Hemel
Posts: 3
Great suggestions everyone, I will try setting up the 2 dimensional array solution today in a test environment as see how I get on and will keep you posted !
  Reply With Quote
Old February 17th, 2017, 06:33 AM   #11
TheJacobsDad
Member
United Kingdom

TheJacobsDad is offline
 
Join Date: Feb 2017
Location: Bedford
Posts: 2
Still struggling, I can get the 2 dimensional array set up but struggling getting the active priority pointer to reference it
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Commander SK forgets speed setting Red Lion HMI icc1john LIVE PLC Questions And Answers 13 June 2nd, 2015 08:21 AM
how to setting the hardware and software in cj2m cpu31, crm21 omron plc mustaqim90 LIVE PLC Questions And Answers 4 March 12th, 2015 04:36 AM
how is setting real clock in plc CPM1A ??? ngoclan LIVE PLC Questions And Answers 1 October 3rd, 2014 11:52 AM
Recommendations for "Last Scan of Active Steps" setting in Logix 5000 SFC radfahrer LIVE PLC Questions And Answers 0 July 6th, 2012 01:58 PM
Tuning pid of ab (slc500) amjad hadi LIVE PLC Questions And Answers 4 April 4th, 2010 09:22 AM


All times are GMT -5. The time now is 09:58 PM.


.