Tank water level scaling in PLC

colesha

Member
Join Date
Feb 2014
Location
Kampala
Posts
6
I want to measure the tank level and get the sensor output to the PLC. Below are the details :

Tank Height =0 - 3m, the sensor is stalled 0,2m above the bottom of the tank and the transmitter is mounted at the tank top. The tank's maximum allowable level is 2.6m. My question is, if the sensor starts reading at 0.2m, how can I get an accurate tank-level reading with that sensor offset?
am using this : Output=LRV+(Input−LRV/URV−LRV)×(URV−LRV)

Below is the tank setup

1713620873735.png
 
how can I get an accurate tank-level reading with that sensor offset?

What are the units and range of the transmitter input?

The formula in Post #1 has the expression (URV - LRV) effectively in both numerator and denominator, so they will cancel. What is LRV (I would guess it is 0.2m i.e. the level at the lowest transmitter input value)? What is URV (it should be the level equivalent to the highesy transmitter value, which appears to be 2.6m, but could be higher)? Where is the range of the transmitter input in that formula?

Do we know whether the transmitter response (input behavior) is linear or non-linear with level?
 
Thanks drbitboy, sorry for the confusion, here is more information
Transmitter range is 0 to 5meters.
Output 4 -20mA.

The formula is the linear formula commonly used for analog scaling.
E.g.,if we want to get the mA reading corresponding the 1m.
URV is upper range value and LRV is the lower range value. My challenge is, when I take 0.2m as the LRV, will my level measured be a true representation of the actual tank level?

E.g: sensor measured current is 10mA,
Sensor input = 10mA,
Sensor span = 4 - 20mA
measuring range = 0.2m - 2.6m

Level = 0.2 + ((10 - 4) / (20 - 4)) * (2.6 - 0.2)
= 0.2 + (6 / 16) * 2.4
= 0.2 + (0.375) * 2.4
= 0.2 + 0.9
Level = 1.1m.
Can this reading be accurate with this scaling yet we are offset by 0.2m?
 
In this formula
Level = 0.2 + ((10 - 4) / (20 - 4)) * (2.6 - 0.2)
the 20 and 2.6 imply that the signal will be 20mA when the level is 2.6m above the bottom of the tank, but if the Transmitter signal range is 4-20mA for a transmitter level range of 0-5m, then 20mA corresponds to 5m on the transmitter, or 5.2m (5.0m + 0.2m) in the tank.

If a signal of 4mA corresponds to 0m on the sensor dip tube, and a signal of 20mA corresponds to 5m on the dip tube, then every additional mA corresponds to 5/16m = 0.3125m on the dip tube. So 10mA would be 6mA above 4mA≡0m, or 1.875m (=0.3125m/mA x 6mA) on the dip tube or 2.075m (1.875m + 0.2m) in the tank.

More generally, the formula is

Level = 0.2 m + ((InputSignal_mA - 4mA) / (20mA - 4mA)) * (5m - 0m)

N.B. that (5m - 0m) for the transmitter range could be replaced by (5.2m - 0.2m) for the tank range, and the formula would yield the same result.

Level at 10mA = 0.2m + ((10mA - 4mA) / (20mA - 4mA)) * (5m - 0m)
= 0.2m + (6mA / 16mA) * 5m
= 0.2m + (0.375) * 5m
= 0.2m + 1.875m
= 2.075m
 
What type of sensor is this anyway? I would just scale it to full sensor value, do some math after installation, pick your points and call it good.
 
Maybe or maybe not a silly question is this tank square or circular ? it will make a difference if you want true tank capacity or is it just level ? as in 0-100 (I omited % as true % would require a mathmatical function to calculate the real amount in % in the tank.
 
You may be looking in the wrong place: many level transmitters can be configured to send their analog output signals based on "strapping tables" configured in them.

You may be able, for example, to configure the transmitter to send the PLC 5.23 mA when the water is just above the tip (assuming 0.2 m is the height of the tip) and 18 mA at 2.6m,. It may also be able to be configured so that if the transmitter does detects water exactly at the tip (or below), it will send 4 mA.

Now your equation is fine, but you'll use 5.23 and 18 instead of 4 and 20. At 3m, you'll get a hair over 20 mA, but many AI cards can read up to 21 mA, so you'll have no trouble with accuracy at the high level.

Without the probe going lower, you'll never have any accurate measurement, but the apparent tank level will drop off from 0.2m to 0.0 m, which will look better than reading 0.2 when you have an empty tank.

Just because you can program around design problem doesn't mean you should. Look at the transmitter to see what it's capable of before you go running to the PLC code.
 
The problem you are running into is more of a design problem that should be resolved or understood before you go through programming something, just as @Aardwizz is talking about. From the looks of your drawing, you are using a Guided Wave Radar (cable or rod) installed in a tank, and I'll assume this until you say otherwise. This application is possible, but with this instrument selection, you will ALWAYS have inaccuracies below 0.2m, as the sensor is not touching the product anymore. Now, this isn't to say it will not read something, but it will not be accurate. The problem you are also running into is understanding how the sensor/transmitter is setup. With a guided wave radar, many times these are installed in a bridle on the side of a vessel/tank and they normally trap a certain amount of product (can be drained). In this design, the 0m mark can be well calibrated with product touching the sensor, but the application is such that the tank is NOT normally empty. If you can assume the process will always maintain at least 0.2m of product, then your application will work just fine. Now, if it's expected to be completely empty, you have options to attempt to calibrate the sensor to pick up product when it's not touching the sensor (the guided wave uses the cable/rod to radiate a signal and when it hits product, the reflection generates an echo that can be picked up). I've calibrated a sensor in this manner with very good success. This is not very accurate and is not recommended, but is possible. You will just need to look at the echo curve of the radar gauge to see what is possible. From there, you can then span the instruments 4-20ma signal to be whatever you want it to be, whether that is from tank bottom or sensor bottom (0.2m).

What I would do is work with the customer to understanding the actual design and process that can help you eliminate some of these uncertainties. In many cases, a tank is storing product that gets filled and consumed. When a pump is pulling product from here, many times you want to limit how low it goes to protect the pump from damage or other hazards. In this case, the suction line should be fully covered with product. Now, if suction is from the bottom of the tank, then it would indeed be 0m, but many times (depending on size of tank), this would be a side entry and is normally a little bit off the bottom. In practice, if the product goes below the 0.2m mark, then it's possible to indicate an "invalid" level and alert the operator of such a state, and if this only occurs during maintenance activities, then this is not a problem, just an understanding of how the design is limited. From a design perspective, this would have been better with a through-air radar but depends on product in the tank of course and the price a customer is willing to pay, and again, what the process design was intended to solve.
 
If this is radar or some other distance-from-transmitter measuring device, is it possible a 0m (≡4mA signal) measurement is when the level would be up to the transmitter, and the 0.2m tank level would yield a 2.8m (3m - 0.2m) measurement, and a 5m (≡20mA signal) would be when the level was 5m from (below) the transmitter (which cannot happen in the current arrangement, of course).

I guess my question is how does a measuring device with a 2.8m tube (sensor?) have a 0-5m range?

Btw, the general formula for a linear measurement that is easiest to understand is
Code:
  (InputSignal - LowLevelSignal)        (MeasuredLevel - LowLevel)
-----------------------------------  =  --------------------------
(HighLevelSignal - LoweLevelSignal)       (HighLevel - LowLevel)
which expresses the linear relationship between the input signal and the measured level between their respective limits, and which is solved for measured level as a function of the input signal, yielding the form of the equation from the first post:
Code:
                             (InputSignal - LowLevelSignal)
MeasuredLevel = LowLevel + ---------------------------------- x (HighLevel - LowLevel)
                           (HighLevelSignal - LowLevelSignal)
 
We measure tank levels with pressure transmitters all the time. When it is a submersible, we like to keep them at least a few inches off of the bottom of the tank to avoid any debris that might have settled there.

I simply scale to the full range of the sensor in engineering units and then apply the offset for the distance from the level of the sensor to the bottom of the tank.

With water tanks, that offset might be a negative number when the sensor is fitted to a pipe in a vault several feet below the floor of the tank.
 
Set the sensor upper range to 3.0m, lower range to 0.0m, offset 0.2m. Your input will be 4 - 20mA from 0.0m to 3.0m. Set an alarm or other control to alert or prevent filling past 2.6m.
 
You guys are just fun! Without being onsite, standing in front of this tank, taking measurements, observing what is really happening, you have no frikin clue as to what is going on. If you have no clue as to actual, it's speculation.

Good efforts tho, but I think you really need to be there.
 
I could not agree more, which is to say it's a typical thread 😉

I would not be surprised if a low level sends a higher signal than the signal sent by a high level. Anything is possible when OP does not know the value of unity.

This is more an opportunity to enlighten OP than solve their problem; if they had a sense of proportion, they would solve it themselves.
 
Thanks for the responses and guidance. The tank is not circular and the sensor used is a pressure sensor (sumersible level sensor) as OkiePC has stated.

" I simply scale to the full range of the sensor in engineering units and then apply the offset for the distance from the level of the sensor to the bottom of the tank "


MeasuredLevel = offset + LowLevel + ((InputSignal - LowLevelSignal)/(HighLevelSignal - LowLevelSignal)) x (HighLevel - LowLevel)


OkiePC, is this what you mean?

 
I'll give a real world example we use often with in ground clearwells. We drop in a submersible 10psi transmitter with a 4 to 20mA output. I scale it in the PLC linearly where 4mA = 0 and 20mA = (10psi * 2.31ft/psi) so at 20mA I would have 23.1 feet of head, or level of water above the sensor. The clearwell may only be 14 feet deep, but that doesn't matter. I will never get 20mA from it unless something has gone wrong. The sensor is 6" from the bottom so I add 0.5 to my result.

Always check your analog signal for an out of range condition and generate an alarm and take appropriate control actions. In cases like yours, where the tank level can be below the sensor at times, set your lower alarm limit to a value less than 4.0 mA, perhaps 3.8 to give it a little margin for normal operating error, but still detect an open circuit or failed sensor.

Even when I use devices that can be programmed with custom scaling, as long as I have adequate resolution at the analog input, I will prefer to leave the device at its out-of-the-box setup and just set up my PLC scaling for the max range of the sensor. This way, if a sensor has to be replaced, there's no need to program it first and it is simpler for the people that operate these systems to plug in a new sensor.

In your case, you already have the sensor range in meters, so you will scale it with 20mA = 5.0 meters, then add the offset 0.2 to the result.

Make the offset a variable that can be adjusted. If it is safe to do so, I also recommend filling the tank to the overflow level to verify and, if needed, adjust that offset as precisely as possible.
 

Similar Topics

In our water cooling tank, I've installed and successfully wired up 4 float switches & updated the PLC (big thanks to @parky for that). As a...
Replies
46
Views
11,539
I am trying to build a project for controlling water level in a tank using PLC,3 level sensor, water pump, and electrical valve and i need help...
Replies
5
Views
3,728
Hello.. i need help doing my project..i dont know how to start using CJ1M plc..can anyone?
Replies
2
Views
2,688
need to know how to determine how much water in a tank by taking the MA output of a transmitter and converting it to feet of H2O. thanks
Replies
7
Views
5,768
H
hello everyone. I am a very poor programmer and admit it freely if there is a hard way to do it I find it. my problem is I have a set of tanks...
Replies
23
Views
24,520
Back
Top Bottom