Need Help On Sequencing Outputs

Brantel

Member
Join Date
Feb 2007
Location
Tennessee
Posts
4
Anyone have any tips on a program that can stage on four discrete outputs one at a time based on a variable.
These outputs must come on sequentially and as the variable goes up and down, the output that has been off the longest needs to come on as the variable gets larger, as the variable gets smaller, the output that has been on the longest needs to go off first.

Like First on is the First off.

Each on stage needs a time delay and each off stage needs a time delay.

I am using a MicroLogix 1000 from AB.

Example:

Variable Output
0% 0000
20% 0001
40% 0011
60% 0111
40% 0110
60% 1110
80% 1111
60% 1101
40% 1001
20% 0001
0% 0000
 
Last edited:
Looking at your post, it appears that the same output always comes for a certain value. So.....

Just use compares for each individual output. Each output will come on / go off as the variable value changes.
I missed the time delay, you can use the compares to fire timers for the delays. This smells kind of like a homework assignment, so I don't want to do everything, just get you started. If it's not a homework assignment, please explain exactly what you're trying to accomplish.

CMPR.png



edit:

I just re-read you post, and I totally missed the going off based on time, please ignore everything posted above, it does not meet the requirements.
I'll have to think on it, a little longer.
 
Last edited:
Also, the oldest on bit must be the first to turn off when the number of steps required goes down. The oldest off bit must be the first to turn on when the number of steps required goes up.

Example:
Demand = 0 to 100%

0-19% #steps required = 0
20-39% #steps required =1
40-59% #steps required =2
60-79% #steps required =3
80-100% #steps required =4

This is for a staged heating system. The larger the error, the more the demand. We need the steps to rotate in a first on first off manner in order to properly distribute the wear across all elements and contactors. Each step also must have a time on and off delay giving time between each # of steps on or off. So if the demand goes from 0 to 100%, all 4 steps do not come on all at once, they sequence on with the time on delay in between steps.

Getting the number of steps required, number of steps on etc. is the easy part for me, it is working out the best logic for doing the first on first off thing that is killing me.

At first glance, this looks super easy but it is not for me at least.
 
These outputs must come on sequentially and as the variable goes up and down, the output that has been off the longest needs to come on as the variable gets larger, as the variable gets smaller, the output that has been on the longest needs to go off first.

This is for a staged heating system. The larger the error, the more the demand. We need the steps to rotate in a first on first off manner in order to properly distribute the wear across all elements and contactors. Each step also must have a time on and off delay giving time between each # of steps on or off. So if the demand goes from 0 to 100%, all 4 steps do not come on all at once, they sequence on with the time on delay in between steps.
Brantel, I do not think a straight Sequencer is the right approach, due to the changing inputs and outputs. I think some timers, regular old Outputs, some Indirect Addressing, combined with a FIFO (First In, First Out) instuction would do the trick.
 
just a thought...

1) Keep track of on/off time for each output
Use RTO timers and floating point counters (F8:1 = F8:1 + 1) to keep a running total of the on time for each Output. i.e. increment F8:1 every minute while running and decrement F8:1 every minute while stopped.

2) Always know which counter is the lowest for the outputs that are off.

3) Always keep track of which counter is the highest for the outputs that are on.

4) If the Required # Running is Less than the # Running, run a timer and when the timer goes done, start the one w/ the lowest counter (least amount of on time).

5) If the converse is true, i.e. you need to shut off or stop an output, then shut the one off w/ the most on time.


This is actually kind of tough to do in ladder logic. Hope this helps. Good Luck
 
Well, I found this problem so interesting that I spent quite a bit of time coming up with a solution. There may be a simpler method using a real sorting routine, but I just couldn't bring myself to add one for only four items. I tested this using RSLogix500 Emulate.

It was my first experience with an emulator which was educational. Now I have a bunch of questions about RSEmulate for another thread...

I just re-read that you are using a Micrologix, so you'll need to ditch the F8 file and re-work the "run hours" logic to match your hardware to make this work in a ML1000. And, it requires a change it the range of demand when you first run it in order to get started. Once those two details are ironed out, it will do the job.

Note the attached file is .rss type, I just renamed it with a zip extension to get it to upload...

Hope this helps...
Paul

EDIT: I did NOT include delays to prevent turning on multiple outputs simultaneously...
 
Last edited:
Thanks for all your help guys!

Thanks for all your help. With using little clues here and there in all the refered threads and some of the replies, I was able to do this very well.

The MicroLogix 1000 does not support indirect addresses so I had to simulate the effect by using more compair instructions but it works well. It also does not support floating point.

I created a program that has an indexible "Pointer" for both stepping outputs on and a different "Pointer" for stepping outputs off. Each time an output is stepped on, the "On Pointer" advances ready for the next output in line. Any time the demand falls, a output is turned off and the "Off Pointer" advances ready for the next oldest output to turn off. At the end of the rotation, the pointers are reset to the begining. Works very well!

This is only for four outputs but it could run hundreds of them if it was required.

Here is the file for those interested. There is a bunch of other stuff in here and they did not want to use subroutines so everything is on the main program.
 
Last edited:

Similar Topics

So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
60
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
11
Views
353
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
177
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
88
Back
Top Bottom