good , how do i calculate the instantaneous flow according to the flow totalizer in the tia portal ?
1 pulse = 1m3/h [?]
Unless each pulses indicates a unit of flow (rate, i.e. volume per time), and not only a unit volume passed since the previous pulse, I suspect the
bold red italicized statement above is a typographical error.
The PLC is a discrete device, not a continuous device such as an orifice flowmeter with a manometer, so
there is no such thing as an "instantaneous" measurement in a PLC, there are only "the most recent measurements." Also, the volume pulse, assuming that is what this is, is a discrete event, which is another reason
there is no such thing as an "instantaneous" flowrate.
The most recent flow rate would be calculated as
- the most recent volume increment (pulse count) measured,
- divided by
- the most recent time increment measured for that volume increment.
and then converted to the desired units via multiplication by unity (i.e. multiplying by one).
But the devil is in the details i.e.
when in
time those incremental measurements are made.
Because PLC programming is primarily about
time, and typically the scan cycle is the clock; in this case there is also the possibility of using an interrupt OB as the clock, triggered by the flowmeter incremental volume pulse. These represent the two primary approaches:
- measure the incremental pulse count over a pre-determined chosen incremental time interval;
- measure the incremental time over a pre-determined chosen incremental pulse count.
Both approaches have problems at low flowrates: the former approach yields noisy results; the latter approach may not update
over long periods.
So the questions are
- What does OP mean by "instantaneous" i.e. what non-instantaneous, discrete time increment is short enough to be acceptably called "instantaneous?"
- How often should the value be updated (with the caveat that it cannot be updated more frequently than once per incremental volume pulse)?
- What is the error budget for this so-called "instantaneous" flow rate calculation?
- There are error bars around the volume represented by one pulse; what is their magnitude?
- There are error bars around any time calculations made by the PLC. To wit ...
- The scan cycle time is part of the error budget if this is done under OB1
- The clock resolution and accuracy is part of error budget if this is done in an interrupt routine
- What is the noise budget for the calculated?
- Will some form of filtering be required?
- Will some form of "no measurement has been available for the past N seconds" warning message be required?