Host Engineering Forum

General Category => General Discussion => Topic started by: Dean on November 30, 2015, 10:44:03 AM

Title: Sequencing? Controlling Priority? I'm not sure?
Post by: Dean on November 30, 2015, 10:44:03 AM
We have a vacuum powered resin transport system here at work. Its an older Motan system that is micro-controller based. We had a little scare a couple of weeks ago, in that we thought the control board had been blitzed by a power outage. Turns out it had just lost some of the configuration settings, and once the we put those all back, everything was hunky dory. It of course got me to thinking that this would be a good learning opportunity to try to replicate the controller function with ladder. Everything is pretty straightforward except the station sequencing, and for the life of me, I can't quite get what to do. Basically this system can control up to 6 receivers, (we only use 3) and it only allows 1 receiver at a time to fill. Basically if station 1 is calling for resin, then stations 2-6 have to wait. If station 3 is also calling then it gets a chance next, and so on. This sounds like it has to be some classic first year automation student problem that has been solved a thousand times to Sunday already, but it is giving me fits. Where do I need to be looking?
Title: Re: Sequencing? Controlling Priority? I'm not sure?
Post by: PLCGuy on November 30, 2015, 12:21:37 PM
I am doing something similar hear at work. I have 3 tanks that pump from a common source. But only one is allowed to pump at a time.
Start by writing down your criteria.
-only one can pump at a time.
-after a certain level, shut down, allow the other to pump if it needs too
-first in , first out
-Overflow alarms
-Main tank empty, hold
etc, etc
Once you see it on paper, start to construct you ladder.

I have lots of if and thens when all said and done. Has worked for years flawlessly. Lots of preventative measures built in.
Auto shut down sequences and much more, then I care to type. :)

It can be done.

Write it down first.

Title: Re: Sequencing? Controlling Priority? I'm not sure?
Post by: Controls Guy on November 30, 2015, 12:24:22 PM
You need some kind of flag that says whether the system is already filling another station (or you might even have it say which other station is filling).

There are quite a few ways to to that.  You could have a register whose value says which station is filling.  When a station calls for resin, and no other station is filling, it starts filling and sets the register to its own station number.  When it's done, it resets the register to zero, which is how the next station calling for resin will know the system is available.  You could also use bits in a register.  Again, if the value is zero, set your bit and begin filling, clear it when done, and so on.  You could even just set a single bit as the busy/available bit if you have no need to know which other station has control.

I think you may also want to have a request queue, so that the station that's been calling the longest gets filled next, rather than the next station to gain control depending on the order in ladder or something like that.
Title: Re: Sequencing? Controlling Priority? I'm not sure?
Post by: plcnut on November 30, 2015, 12:59:14 PM
I agree on writing out exactly what needs to happen. I will attach a couple of screenshots of a prioritizer layout that I use quite a bit. I have a different bits that I SET for each part of the process that needs to complete (First screenshot). This will in turn start a Program block that controls the additional Program/Task blocks that are required to complete each step. Inside this Program block I use stages to sort through the higher priority items to queue their completion (Screenshot 2).


(https://forum.hosteng.com/proxy.php?request=http%3A%2F%2Fi761.photobucket.com%2Falbums%2Fxx256%2Fplcnut%2FPLCs%2FPriorityControl01_zpsenerblyo.png&hash=9a281f37c4f64e2cf39d2a1ec9e10740f5fd75e0) (http://s761.photobucket.com/user/plcnut/media/PLCs/PriorityControl01_zpsenerblyo.png.html)


(https://forum.hosteng.com/proxy.php?request=http%3A%2F%2Fi761.photobucket.com%2Falbums%2Fxx256%2Fplcnut%2FPLCs%2FPriorityControl02_zpsmwc8re3l.png&hash=3ee271484b7c72ab61124d586329aef00a17a58e) (http://s761.photobucket.com/user/plcnut/media/PLCs/PriorityControl02_zpsmwc8re3l.png.html)
Title: Re: Sequencing? Controlling Priority? I'm not sure?
Post by: LWgreys on November 30, 2015, 10:22:05 PM
The JMPI (Index Jump) would do the shortcut of calling the staged code needed and use a small index first-in first-out buffer for the index of receiver numbers. When the receiver is full then shift the buffer up one buffering out the first and the next one in calling order will be next. Maybe with the MOVER instruction to shift the buffer.
Title: Re: Sequencing? Controlling Priority? I'm not sure?
Post by: Dean on December 01, 2015, 06:50:58 AM
Thanks everyone. Looks like I have a bit of work to do.