Endress Hauser Flow Meter 4-20ma

mavrick

Member
Join Date
Jun 2015
Location
usa
Posts
122
Hello I am new to setting up a flow meter totalizer in ladder logic.I know using pulse to configure gallons total would be best, but currently 4-20 ma is what i have to work with.

I am using studio 5000 software and control logix hardware.

I am currently using the compute instruction with this formula below to get my total:

(mag register/60+HMI total) ex. 250gpm/60+600 gallons this is pulsed every 1000 ms by a timer dn. bit. and the accumulation is showed on the HMI screen.

Are there any AOP instructions or a better way to create a totlizer using ladder logic.

The higher my gallon set point is the more skewed my totals become. Any help would be much appreciated. I have looked through the threads and found some good information , but some of it is over m head at the moment. Thank you
 
What is the rate of skew, and is it fairly constant?


Clock drift is one possibility here: a self-repeat-triggering 1000ms timer will actually take (1000+epsilon)ms, where epsilon could be in the range from a fraction of a millisecond to a few milliseconds, so that (1minute/60seconds) conversion factor would more correctly be defined as (1minute/59.XXXsamples). Cf. here.



A quick-and-dirty fix would be to calibrate the behavior of the combination of

  1. the PLC clock,
  2. the running program, and
  3. the process
to determine a better value for that 59.XXX, assuming average behavior is consistent.


See that link for other suggestions.




P.S. if the skew is not constant, or is more than say a percent or so, or is high not low (PLC accumulation higher than the assumed-correct Rosetta Stone source), then look somewhere else.
 
Last edited:
I would recommend that you first calibrate the analog values as precisely as you can. Next, I would put the totalizer logic in a periodic task and do away with the timer. I might run it at 100ms and adjust the divisor accordingly. Those things probably about as good as you are going to get when you are totalizing from a signal that has to pass through the D/A converter in the instrument and a A/D converter in the PLC.
 
At 700 gallon set point its typically spot on. At a 1500 gallon set point its consistently 100 gallons less than it should be. I didn't see a link listed? When you are referencing to your calibration options , i'm a little confused. How would i calibrate those 3 options?
 
Okie , the analog values are scaled on a engineered card. I plan to check my card with sourcing a 4-20 signal to make sure i'm reading the correct values per the scaling.

I will look into using a periodic task. I have never used one, im assuming they are fairly easy to setup.
When you referring to the divisor are you just saying find a number that will match flow meter reg. to the totalizer reg.? I was using 60 based off of 60 mins in 1 hour since the meter reads Gallons per minute.
 
At 700 gallon set point its typically spot on. At a 1500 gallon set point its consistently 100 gallons less than it should be. I didn't see a link listed? When you are referencing to your calibration options , i'm a little confused. How would i calibrate those 3 options?


The link was on the word [here]; basically it points you to the same thing that @OkiePC said about a periodic task (or equivalent).

You would calibrate all three options together; characterize might be a better word than calibrate, but the idea is the same.

However, if it is accurate at one flowrate and inaccurate at another, then that, plus the 6%+ errors, implies something else is at play here, not a few milliseconds of drift per sample.


That said, the "consistently" suggests that characterization is still a possible solution.

What is the assumed-correct source of the values?
 
Okie , the analog values are scaled on a engineered card. I plan to check my card with sourcing a 4-20 signal to make sure i'm reading the correct values per the scaling.

I will look into using a periodic task. I have never used one, im assuming they are fairly easy to setup.
When you referring to the divisor are you just saying find a number that will match flow meter reg. to the totalizer reg.? I was using 60 based off of 60 mins in 1 hour since the meter reads Gallons per minute.

You can add a periodic task to a program that is scheduled, set the period at which it should execute, and it will run repeatedly at that specified interval. It is more precise and repeatable than a PLC timer.

By changing the divisor, I just mean that if you are measuring GPM and taking samples every 100ms, you need a divisor that will get the time units matched up. Once a second: divide by 60 to get minutes. 10 times a second: divide by 600.

I didn't think to mention it, but if you are totalizing floating point numbers (and you might need to be using floats) then you can run into issues with precision there too. In that case, you may need extra code to preserve as much resolution as possible. Whether you need to do this depends on the range of values you are anticipating in your total tag.

You know, that reminds me, I think there is a TOT instruction you should look at. It is built for totalizing in Logix5k. I think it is not available in Ladder, only in ST or FBD.
 
Last edited:
A common way to make a non-critical timer pulse is XIO the .DN bit ahead of the timer.

For accuracy, a periodic task is one way to not lose scan time.

Another way without a separate task is GSV WallClockTime and make a one second pulse with Seconds.0 and two ONS. DateTime UDT details here: http://www.plctalk.net/qanda/showpost.php?p=850942&postcount=52
85A505C4-B018-4A97-A4D8-04BD52FA87BC.jpego

Another way I've used for time periods other than whole seconds is with a free-running timer, or at least one that doesn't reset itself. Give it a higher preset and when .ACC > 1000 OTE the pulse and SUB 1000 from .ACC. There's a slight risk to this if you're not attentive and use bad values. A negative .ACC value will fault the processor. Example here: http://www.plctalk.net/qanda/showpost.php?p=859721&postcount=3

*1000 for 1 second or whatever pulse time you want

Edit: OneSecond.Pulse, OneSecond.ONSOn, and OneSecond.ONSOff, also in the linked example System.TenthSecondTimer and System.TenthSecondPulse are elements of UDTs. You don't have to do that. Whatever BOOLs and TIMs you create will be fine.

Response: WallClockTime and TIM instructions are as accurate as the system clock. The worst I've seen recently is within a couple seconds a month.
 
Last edited:
So if i'm understanding the function of periodic task correctly. I just add a task under task folder , set the time interval, add my logic such as just the compute instruction and it should sample this instruction every 100 ms no matter what the main task is doing?

Will this interfere with main task operation?

The correct source values are 4ma=0 gpm/20ma 400gpm
 
5618 thank you for the links . I will look into that. Are wall clock timers more accurate then timer instructions?
 
Okie, if i'm looking at this correctly. It should basically be a copy and paste into the periodic task? Just use the logic that is already wrote. And then remove it from the main task?
 
Okie, if i'm looking at this correctly. It should basically be a copy and paste into the periodic task? Just use the logic that is already wrote. And then remove it from the main task?

Yes.

The CPU will drop what it is doing once per second and run your periodic task, so it can have just the math instructions on a rung without conditions.

That can mean that the scan time of the main continuous task (assuming you have one) will have spikes of a few microseconds in its scan time when it is interrupted by the periodic task. For most applications, you will not suffer any negative consequences.

Another thing to consider in your totalizer logic is a low flow cutoff. The Flowmeter probably has one, but should you really be adding up values when the input signal is 4.05mA (1.25gpm) or should that be regarded as zero?

You didn't say in which direction your totals appear "skewed". Is the PLC showing too large a value or too small?

Your situation is common and is the primary reason I prefer to have a flow meter that supports a comms protocol or 2nd best is to use a pulse.
 
Sorry the total gallons are typically 100 gal. less than the set point. So if i was needing 1500 gal., The hmi was reading 1500 gal. and the actual flow meter read 1400 gal.

I was using pulse but we run two different liquids that have different temps and density's.

It seemed to cause more accuracy issues with the pulse application. i know it doesn't make sense , but it wasnt as accurate as 4-20
 
As for the 4ma reading a 1.25 gpm. By the time the liquid reaches the flow meter it is basically at full GPM the pump can produce with how the pipe is installed. Not much to any lag.
 
So is this a batch control application? Run apx. 1500 gallons at a time? Reset the total for the next batch?

In that case, using floats for the total should be fine.

Using a pulse should have been dead nuts accurate as far as matching the flowmeter. There was probably some detail that wasn't set up right. The only concerns I have ever had with a pulse are electrical noise causing false pulses and missing pulses if the PLC is powered down while flow still occurs. For the latter, I usually provide a means for the operator to enter the correct total into the HMI to get them matched up again. I am in the water industry where the totals can run to hundreds of millions of gallons before rolling over, and they like what is on the meter to match their HMI even after running for months...this is all but impossible with analog.

Are you having to change settings in the flowmeter for these two different products?
 

Similar Topics

We have a contract to refurbish/upgrade a filling/bottling machine. We have the machine but not its control panel or PLC. We've built a new...
Replies
4
Views
3,898
I have an endress hauser flow meter to be connected and confiured to work with an existing Allen Bradley 5000 plc and a scada system.this is new...
Replies
5
Views
4,522
Hi, I have a Endress+Hauser Flow Meter (Model:Prowirl 72F). In the technical Details sheet it shows some details on Communication, What do you...
Replies
18
Views
5,984
Hi all, Well, here I find myself at a former client after I left water treatment trying to help him get the plant back up and running after a...
Replies
2
Views
1,053
E+H Promag P500 5069 Compact Logix implicit Ethernet IP using endress device description 30ish flowmeters, every time I download, some (but not...
Replies
2
Views
1,263
Back
Top Bottom