Sign in to follow this  
Followers 0
Michael Lloyd

ML1100 Flow signal in Bbl/Hr to pulses per barrel

16 posts in this topic

This is probably simple but I'm going to toss it out there anyway. I've got 4 LACT units to start up in a couple of days. Normally a LACT comes with a PD meter that sends a 10 pulse per barrel signal to the PLC. I accumulate the pulses and at the end of 20 counts I fire a DO for .125 seconds. That turns a sample solenoid on which trips an injector that adds a small amount of oil to a sample put. That's the old school way of capturing a composite sample for monthly They changed the measuring device to a Coriolis meter for these four LACTs. Personally I think that's a good thing. PD meters require too much maintenance. So, now I have an analog signal that represents a flow rate in barrels an hour that I need to convert to pulses per barrel. Or maybe not? Maybe I just need to accumulate a preset barrel amount and trip the solenoid when that happens. Thoughts?

Share this post


Link to post
Share on other sites
Hi Michael - Always good to be able to bounce questions off a few hundred friends... I think staying with the pulse method is trying to cram a new measuring method into the old. I would suggest looking into the totalizer FB with a periodic task for accuracy.

Share this post


Link to post
Share on other sites
I would agree but I'm stuck with a little Micrologix 1100. Way back when I started spec'ing these things I mulled over Compact Logix vs Micrologix. I took the cheap route. Realistically the little ML1100 does the job but they switched gears on me and now it's time to get creative Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
Most mass meters can do a pulse output and/or a 4-20ma signal. Do you have any influence on the meter output configuration? If I remember correctly a barrel is 42 gallons, so set up the meter for one pulse per gallon and count 84 pulses, then take a sample.

Share this post


Link to post
Share on other sites
Unfortunately, while I do have influence since I am one of the few people that does the configuration, the Coriolis that we are using has a single frequency output and that is connected to an Omni Flow Computer. Plan B is to just use the Omni to trigger the sample solenoid so I'm not in a bind.

Share this post


Link to post
Share on other sites
Well that changes things a little... The 1100 is a great little controller for the price so I can say anything negative there. It's hard to justify the big leap to the compact pricing when you have a little thing called a budget. There are still options in the micro - or there are supposed to be. Everything I see in the docs indicates that it has the capability to have an STI file. I think with that you can accurately totalize the analog signal. There doesnt seem to be a tab for it in my structured status, but S:30 and S:31 seem to be the locations to setup the file. It might be worth playing with or maybe someone can fill me in on an alternative method to configure the STI in these controllers. The documentation speaks of an STI tab, but I dont have one.

Share this post


Link to post
Share on other sites
I reread this post a couple of times and from what I see there is insufficient data to propose a complete solution, but enough to give you some ideas and let you fill in the blanks. The Micrologix 1100 can do a periodic task it is called STI and you'll find information about it under the Help - Contents menu and search for STI. You'll find the STI setup tab {note to PLC Mentor} on the Cotnroller Tree - Under Function Files. You'll have to create a new Ladder file {LAD3 for example} in which your periodic code will reside. A lot will depend on your nominal flow rate. But Sampling a GPH signal every second gives you GPH/3600 == GPS. Or gallons in the last second. If Ken's assumption of 42 GPB is accurate then you'll want to fire your solenoid and reset your totalizer every 84 gallons. I'd ussgest running the totalizer in gallons and when the total is GEQ 84 do two things, fire the sample solenoid and subtract 84 from the total. This way partial gallons don't get thrown away.

Share this post


Link to post
Share on other sites
thanks! I stumble around looking for that every time I need to use something out of those tabs. Must be some sort of mind block.

Share this post


Link to post
Share on other sites
Thanks Bob. The flow signal is BPH. I'm not constrained to tight tolerances so I should be able to divide the flow signal by 3600 and use BPS. Flow rate varies by LACT. Some are down around 200 BPH and some are up over 600 BPH (for truck LACTs, facilities go well into the 3,000 - 5,000 BPH rate and beyond) I was thinking about trying something like this- Put the logic in a Periodic task- thanks for that tip. I used them all the time in CLX but never in Micrologix or SLC. Very handy BPH/3600 = BPS 1/BPS = Seconds per Barrel SPB Use SPB as the PRE for a timer. When it fires latch a bit through a one shot. Call the bit Sample When Sample turns on it fires the solenoid and turns on a 1/8th second timer that Unlatches Sample when it times out. Thoughts? Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
Thanks for the great ideas. The funny thing about the end result is that it's actually more simple than the original version Rung 8 is the timed interrupt routine. I call it every 15 seconds. Flow rate varies between 6 and 12 seconds per barrel. BPH is fairly course flow measurement and the goal is to fill the sample pot about 75% in 31 days. The sample system itself is adjustable by sample volume per stroke so I have a lot of degrees of freedom to play with. Rung 9 is the sample trigger logic. I have to go back and add a multiplier to the barrels per second value. That will let me tweak the sample rate fairly easily. I just attached the entire program. It's not like it's proprietary. Most programmers could write this with one hand tied behind their back and those that can't might learn something from it (even if it's how not to do something). I use the program on all kinds of station configurations so there are "spares" all over the program. If you see any flies on my thinking please let me know. I've never used STI's in the 500 platform so I may not have it set up right. It looks pretty simple LACT 701.RSS

Share this post


Link to post
Share on other sites
Since your sample rate is so slow, is an STI really justified? Is there a chance that the flow rate will vary enough between these 15 second intervals that it will "throw off" the calculation? Also, inside the STI where you DIV by F8:34, I would advise preceding that with a NEQ F8:34, 0. It appears that the data manipulated inside the STI stands alone, so the fact that the STI routine can begin at any point during the main PLC program should not be of any consequence in this case, jsut something to be aware of.

Share this post


Link to post
Share on other sites
15s is an arbitrary number. It could be 1. In a normal situation the LACT pumps to a tank and discharge pressure doesn't vary much. In this case all four LACTs feed a pipeline and line pressure could vary quite a bit. Discharge pressure affects flow rate. Good call on the divide by 0 check. Processors hate those

Share this post


Link to post
Share on other sites
Couple of suggested different way of doing things. 1. Changed the STI to 1 second. 2. Eliminate one of the timers. 3. Went with your original sample every 2 barrels. See what you think. LACT701-2.RSS

Share this post


Link to post
Share on other sites
Nice. Thanks Bob The only thing that I see that isn't quite right is the last branch in the SAMPFLOW routine. Seconds per Barrel is the Inverse of Barrels per second so the calc should be 1/BPS. Preceding the divide there should be a BPS NEQ 0 to prevent a divide by zero error (thanks OkiePC) I am glad that I found this forum.

Share this post


Link to post
Share on other sites
STI are nice and many good functions, but I don't think this is one of them. You said it yourself, you aren't constrained to tight tolerances. I use the STI when I need timing with millisecond precision. I would move this out of the STI and trigger it with a timer in ladder. It will work just as well and when someone unfamiliar, or you years later after the project is far from your mind, goes online with it to troubleshoot a program, it will be clear that the timer is triggering the code as oppose to having to stumble across the STI function file. Plus you only have one STI, save it just in case you need it for a high speed function. Just my 2 cents.

Share this post


Link to post
Share on other sites
I've attached the working version of the program. Live from startup. I had to make some changes. If the value in F8:34 dropped too low it over ranged the value in N7:6 and faulted the processor. That was fun to find LACT 701.RSS

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
Sign in to follow this  
Followers 0