Rain Gauge Float Coefficients¶
Before any sensors can be repaired or replaced, it must be possible to recreate their current coefficients. Once current coefficients can be reliably reproduced, then new coefficients could be derived for any repairs or replacements.
How to relate orifice collection to tank level¶
Most preciptation collectors at HJ have different diameters at the tank(s) and the orifice.
Checking the equation¶
Convert everything to cm, since cm\(^3\) = cc = ml
[1]:
from math import pi
def area_circ(n, radius=True, diameter=False):
r = n if radius and not diameter else n/2
a = pi * r**2
return a
def vol_to_depth(vol_ml, diam_cm):
cm2 = area_circ(diam_cm, diameter=True)
cm3 = vol_ml
cm = cm3/cm2
return cm
# so if we get 0.1 in of precip, what happens in the tank
# convert 0.1 in precip to cm
precip = 0.1*2.54
# With a 13.3" orifice, convert depth to vol
orificeDiam = 13.3*2.54
orificeArea = area_circ(orificeDiam, diameter=True)
vol01inch = precip * orificeArea
# Now calculate the vol in the tank
diam_float_rod = 5/8*2.54
diamtank1 = 10*2.54
diamtank2 = 6*2.54
tankarea = area_circ(diamtank1, diameter=True)
tankarea += area_circ(diamtank2, diameter=True)
tankarea -= area_circ(diam_float_rod, diameter=True)
dpth_in_tank = vol01inch/tankarea
print '0.1 in in the orifice leads to '+ str(dpth_in_tank/2.54) + ' in tank'
print 0.130066176471/0.1
print tankarea/orificeArea
print orificeArea/tankarea
print precip/dpth_in_tank
dpth_in_tank * (tankarea/orificeArea)/2.54
0.1 in in the orifice leads to 0.130066176471 in tank
1.30066176471
0.768839391712
1.30066176471
0.768839391712
[1]:
0.1
So, first calculate the volume that comes into an orifice of known dimmensions when it rains 0.1”
Then calculate the depth that volume would be in tanks of known cross sectional area, making sure to subtract the cross sectional area taken up by any instruments.
Then, it turns out that the ratio of depth of precip to depth in tank, is equal to the ratio of orifice area, to tank area.
So let’s reduce the math. The precip is the depth accumulated within the orifice, so:
\(DepthInorifice_{cm} = \frac{RainVolume_{cm^3}}{orifice Area_{cm^2}} = \frac{TankDepth_{cm} * TankArea_{ cm^2}}{orificeArea cm^2} = TankDepth_{cm} * \frac{TankArea_{cm^2}}{orificeArea_{cm^2}} = TankDepth_{cm} * coef\)
or to summarize for known area
\(coef = \frac{TankArea}{orificeArea}\)
or to summarize for known volume
\(coef = \frac{DepthInorifice_{cm}}{TankDepth_{cm}}\)
Writing a function¶
[2]:
def tank_coef(diam_orifice, diam_tank1, diam_sensor, diam_tank2=None):
def diam2A(diam):
return pi*(diam/2)**2
A_or = diam2A(diam_orifice)
A_tk = diam2A(diam_tank1)
A_tk -= diam2A(diam_sensor)
A_tk += diam2A(diam_tank2) if diam_tank2 else 0.0
return A_tk/A_or
print 'test with Shelter '
# Orifice 13.3", twin tanks, 10" + 6"
tank_coef(13.305,6,5/8,10)
test with Shelter
[2]:
0.7682616428004211
[3]:
# from the documents, for the SA
# (https://andrewsforest.oregonstate.edu/sites/default/files/lter/data/studies/ms01/meta/uplmet.htm#ppt)
print ' 3.67" in the tank equals '+ str(3.67 * (1/3.67)) + ' of precip'
# OR
print 1/3.67
t = tank_coef(20.,10.0,5/8.,3.)
print t
print str(t/(1/3.67)*100) + ' % of reported'
3.67" in the tank equals 1.0 of precip
0.272479564033
0.2715234375
99.6491015625 % of reported
Well that’s close…
Prototype UPLO SH tipping bucket¶
OK, I’ll try to work it out for the shelter going into a tipping bucket with a 0.01” tip.
[7]:
#rad_cm_sh_or = (13.3/2)*2.54
#a_sh_or = pi*rad_cm_sh_or**2
a_sh_or = area_circ(13.3*2.54, diameter=True)
# 0.01" = 8.37 ml in the TR-525USW
# Orrifice depth = Precip Vol/ Orrifice Area
precip_or = 8.37/a_sh_or
# coef = orifice depth / tank depth
coef = precip_or/ (0.01*2.54)
print coef
# tank depth * coef = orrifice depth
print 'so 1 tip in the tipping bucket is ' + str(coef*0.01*25.4) + ' mm of rain'
#coef = tank area/orifice area
print (pi*4**2)/(pi*(13.3/2)**2)
print 'or, the precip in each tip in cm is ' + str(precip_or)
print 'just to check the function' + str(tank_coef(13.3,0.,0.,4.))
0.367647100192
so 1 tip in the tipping bucket is 0.0933823634487 mm of rain
0.361806772571
or, the precip in each tip in cm is 0.00933823634487
just to check the function0.0904516931426
[8]:
# Double checking in cm
8.37/area_circ(13.3*2.54, diameter=True)
[8]:
0.009338236344866397
Use of a 4-20mA magnetorestrictive float¶
Both the shelter and stand alone rain gauges have used these since the ’90’s, but they are breaking, so I need to be able to configure a replacement. The final coefficient needs to convert sensor signal to mm, and then convert mm measured in tank to mm collected in orifice.
The sensor¶
The sensor sends a current down a rod at a known speed (electrical constant) generating an electromagnetic field. When the current hits a magnetic float, the signal is bounced back. The end of the rod has a dampener, so that the magnetic field is not reflected back upwards. This means there is a dead zone at the bottom of the sensor. The sensor transmits the reading using a current from 4-20 mA. 4 means the float is at the bottom of the rod (empty tank) and 20 means the sensor is at the top of the rod.
This is the best source of information I have found about this video and concept explained
Reading the output¶
The data logger then needs to measure the current returned by the sensor. To do this, we create a current shunt and measure the voltage drop across it. In other words, we send 12 V to the sensor and on the negative side, we put a resistor between the return current, and the ground. To achieve this, we:
- bring the negative sensor wire to an H Diff port.
- run a resistor from the H Diff port to the L Diff port
- run a jumper wire from the L Diff to Ground.
So the power is not going through either the H or L port. It is returning from the sensor, passing through the resistor and jumper back to ground, but the logger can read the voltage at both the L and H ports. This way, it works like a shunt.
Max output¶
If the tank is full, the sensor will output 20 mA. The logger has a 12.4 \(\Omega\) resistor so it will measure:
\(E = R * I = 12.4 \Omega * 20 mA = 248 mV\)
This is why the Diff chanel is set to a 250 mV range
Min output¶
If the tank is empty, the sensor will output 4mA. The resistor value stays the same.
\(E = R * I = 12.4 \Omega * 4 mA = 49.6 mV\)
Convert the output to mm¶
It seems like a straight forward units conversion using dimmensional analysis should work. The sensor height is listed as 105” here. However, manual inspections at VARA and UPLO found model LT420113, which is 113” on the SA, and LT420053 (53”) at the shelters. CENT SA sensor cannot be visualized without cutting the roof off.
So:
\(\frac{Physical range}{Signal range}* Signal = \frac{mm}{mV}*Signal_{mV}\)
Is the signal range 20mA, or 20-4=16 mA. Since it’s measured in mV, it probably makes more sense to do \(\frac{mm}{mV}\) than \(\frac{mm}{mA}\).
Converting sensor to orifice measurements¶
This isn’t seeming to line up quite right. Let’s try some things.
[5]:
def sensor_coef(range_mA, range_in, resistor=12.4, SAE=True):
range_mm = range_in*25.4 if SAE else range_in
range_mV = range_mA*resistor
return (range_mm/range_mV)
r20 = sensor_coef(20,113)
r16 = sensor_coef(16,113)
sa = tank_coef(20.,10.0,5./8.,3.)
sh = tank_coef(13.3,6,5/8.,10)
print r20
print r20*sa
print ((r20*sa)/3.716)
print r16
print r16*sa
print ((r16*sa)/3.716)
print '\n'
r_sh = sensor_coef(16,54-(5+3))*sh
print r_sh
print r_sh/4.788
11.5733870968
3.14244584803
0.845652811635
14.466733871
3.92805731004
1.05706601454
4.51477709374
0.942935900947
So this doesn’t line up quite right.
- 16 A is definitely the correct range to use.
- A visit to CENT discovered that the sensor is 53”, not 54” (big improvement).
- At VARA, it turns out the orrifice is 19.7917” and the sensor is 113”
- the manual is pretty clear that 4 mA should be at 3” but 20 mA is at a user set height which is usually 5”
- SH 4.7880
- SA 3.716
- VARA 3.7434
Maybe it will be better if we subtract the mounting and dead zones from the length…
VARA test¶
[9]:
sa = tank_coef(19.71917,10.0,5/8.,3.)
height_sub_mount = 113-5
coef_sub_mount = sensor_coef(16,height_sub_mount)
height_sub_all = 113-5-3
coef_sub_all = sensor_coef(16, height_sub_all)
print coef_sub_mount*sa
print coef_sub_mount*sa/3.7434
print '\n'
print coef_sub_all*sa
print coef_sub_all*sa/3.7434
3.86194297395
1.03166719398
3.75466678023
1.00300977193
OK, let’s try with the other sites
[14]:
sa_tank = tank_coef(19.75,10.0,5/8.,3.)
lt420 = sensor_coef(16, 113-5-3)
coef = lt420*sa_tank
print 'UPLO/CENT SA with 113" sensor and 19.75" orifice'
print coef
print coef/3.716
sh_tank = tank_coef(13.305,10.0,5/8.,6.)
lt420 = sensor_coef(16,53-5-3)
coef = lt420*sh_tank
print 'UPLO/CENT SH with 53" sensor'
print coef
print coef/4.788
UPLO/CENT SA with 113" sensor and 19.75" orifice
3.74295376471
1.00725343507
UPLO/CENT SH with 53" sensor
4.41331086303
0.92174412344
Can’t get the correct coef for VARA, but can get it for UPLO/CENT if the copper heating pipes are subtracted.
[7]:
orifice_area = area_circ(19.75*25.4)
tank_area = area_circ(10*25.4)
tank_area += area_circ(3*25.4)
# subtract the sensor rod plus the 2 copper heating pipes (1/2" ID/nominal; 5/8" OD)
tank_area -= 3*area_circ(5/8*25.4)
# 4-20 mA signal X 12.4ohm resitor = volts)
mv_range = 12.4*(20-4)
# sensor has 108" of usable range with 200 mv of signal
correct_coef = tank_area/orifice_area * (105*25.4)/mv_range
[9]:
print("UPLO/CENT SA near exact recreation subtracting heating pipes")
print(correct_coef)
print(correct_coef/3.716)
orifice_area = area_circ(19.71917*25.4)
vara_coef = tank_area/orifice_area * (105*25.4)/mv_range
print("\nVARA larger orifice coef doesn't match")
print(vara_coef)
print(correct_coef/3.7434)
UPLO/CENT SA near exact recreation subtracting heating pipes
3.7160299137209196
1.000008049978719
VARA larger orifice coef doesn't match
3.727658675064088
0.9926884419834695
Forensic Coefficient Examination¶
With the contradictory information obtained from on-site sensor labels (53”/113” not 54”/105”), as well as notes on VARA orifice size that imply other SA are 19.75, the coefficients for the SA’s can be recreated within 0.5%. However the UPLO and CENT SH cannot be recreated within +-7%. Below is a deep dive into dispersed notes to try and find potential causes of this variation.
Based on notes from VARA, a remeasurement of the orifice diameter may assist at both sites. If we infer from VARA’s notes, that the orifice’s were known to be 19.75”, instead of 20”, we finally get under 1%…
The manual clearly states that the factory set point is 4 mA at 3” and that typicaly 20 mA is -5” from top, but the top can be adjust by the installer/operator… Subtracting 8” from the total length seems to better match coeficients currently in use.
The notes on VARA explain:
; 4. Modified on 9-22-99. Remeasured the funnel diameter and came up with a average of 19.7917 instead of 19.75.
; Changed the resistor for the level transmitter from 55.8 OHMs to 12.4 +_ 0.1%. Changed instruction 1 mult
; from 0.8463 to 3.7434 and offset from -63.233 to -185.67.
...
;MEASURE LEVEL TRANSMITTER
1: Volt (Diff) (P2)
1: 1 Reps
2: 4 250 mV Slow Range
3: 1 DIFF Channel
4: 1 Loc [ PRECIP ]
5: 3.7434 Mult
6: -185.67 Offset
CENT¶
The CENT SA sensor length cannot be confirmed without cutting a portion of the roof off, which will need to wait until summer. However, it is a safe assumption that it is the same as UPLO and VARA since it was constructed in-between the two.
I can confirm the coefficients from the time the CR1000’s were installed in 2015:
'MEASURE STAND ALONE RAIN GAGE FLOAT
VoltDiff (SA_PRECIP,1,mV250,3,True,0,_60Hz,3.7160,-184.31)
'
'MEASURE SHELTER RAIN GAGE FLOAT
VoltDiff (SH_PRECIP,1,mV250,4,True,0,_60Hz,4.7880,-237.48)
It looked like it changed around a bit in the early days. Here is the 2013 status with notes, we don’t have to seem anything earlier…?
;{CR23X}
;;Program: CENT13.CSI - Central Met. Station
;
; 1. Modified 9-26-96.
; A. Changed multiplier on instruction to measure shelter float raingage
; from 1.065 to 1.0785
...
; 3. Modified 11-2-00. Changed both raingage bridge resistors to 12.4 ohms and the
; ranges to 250mv slow to improve accuracy. Also added Stand Alone Raingage orifice
; temperature to the 5 minute output.
...
;MEASURE STAND ALONE RAINGAGE FLOAT
24: Volt (Diff) (P2)
1: 1 Reps
2: 23 200 mV, 60 Hz Reject, Slow Range
3: 4 DIFF Channel
4: 25 Loc [ SA_PRECIP ]
5: 3.7160 Mult
6: -184.31 Offset
;
;MEASURE SHELTER RAINGAGE FLOAT
25: Volt (Diff) (P2)
1: 1 Reps
2: 23 200 mV, 60 Hz Reject, Slow Range
3: 5 DIFF Channel
4: 26 Loc [ SH_PRECIP ]
5: 4.7880 Mult
6: -237.48 Offset
UPLO¶
It looks like it uses the same coefficients as CENT, although it was a bit more turbulent in the early years.
;{CR23X}
;;Program: UPLO_227_V22.CSI - UPLO Met. Station
...
;
;5. Modified 10-15-97 Added insruction 20 (port set) at the end of table 1 to allow setting of port 7 to open
; solenoid valve on stand alone. FAB
;
;6. Modified 3-8-99 Changed Stand Alone Raingage Float instruction multiplyer from .3776 to .3873 and offset from
; -181.69 to -184.82. This was necessary because the intake funnel was changed.
;
;7. Modified 3-15-99 Changed program to bypass faulty relay in the multiplexer that is used for the Stand Alone
; Raingage orifice temperature. Added third multiplexer loop.
;
;8. Modified 3-24-99 Added Stand Alone Raingage orifice temperature to 5 minute output.
;
;9. Modified 11/4/99. Changed bridge resistors for measuring stand alone and shelter
; raingages to 12.4 ohms and ranges to 250 mv slow to improve resolution of data. FAB
...
;16. Modified 11-29-2004. Dropped new 100CM soil temp probe. Have an intermittent problem with the SAR
; raingage and have been trying a number of things to try and solve problem. Times out after apx. 5 days.
; Changed control port for SAR heater control from 4 to 6. Changed SAR heater flag from 4 to 5. Changed
; SAR Relay Driver connections from 1 to 3. Removed shelter heater control.
;
;17. Modified 12-13-2004. Put back in shelter heater control.
;
...
;MEASURE STAND ALONE RAINGAGE FLOAT
22: Volt (Diff) (P2)
1: 1 Reps
2: 23 200 mV, 60 Hz Reject, Slow Range
3: 7 DIFF Channel
4: 25 Loc [ SA_PRECIP ]
5: 3.7160 Mult
6: -184.31 Offset
;
;MEASURE SHELTER RAINGAGE FLOAT
23: Volt (Diff) (P2)
1: 1 Reps
2: 23 200 mV, 60 Hz Reject, Slow Range
3: 8 DIFF Channel
4: 26 Loc [ SH_PRECIP ]
5: 4.7880 Mult
6: -237.48 Offset
...
Variation on estimates of shelter tank area¶
The solid colored tank is “IPS DR64” which is 63 PSI (1/2 of 125 PSI) irrigation pipe. The notes I could find from Craig use inside diameters that are a little off from nominal diameter. I try them out below and they seem to work a lot better.
[17]:
sh_tank = tank_coef(13.305,10.414,5/8.,6.25)
lt420 = sensor_coef(16,53-5-3)
coef = lt420*sh_tank
print 'UPLO/CENT SH with 53" sensor and irrigation pipe (larger) tank diameters'
print coef
print coef/4.788
UPLO/CENT SH with 53" sensor and irrigation pipe (larger) tank diameters
4.78802243657
1.000004686
Well, with a 53” sensor and irrigation pipe diameters, that’s fantastically close.
Reports also state that 0.1 ft in the tank == 0.1 inch in the shelter orifice. Does that still hold true for the irrigation pipe, whose inside diameter is larger than the nominal diameter?
[15]:
ft2in = 0.1*12
sh_ir = tank_coef(13.3,6.25,5./8.,10.414)
print 'Using irrigation pipe'
print 1-(sh_ir * ft2in)
sh_nom = tank_coef(13.3,6,5./8.,10)
print '\nV.S. nominal pipe (e.g. home plumbing)'
print 1-(sh_nom * ft2in)
sh_no_sense = tank_coef(13.3,6.25,0.,10.414)
print '\nV.S. irrigation pipe, but forgetting to subtract the rod the float travels on'
print 1-(sh_no_sense * ft2in)
Using irrigation pipe
0.00193382780259
V.S. nominal pipe (e.g. home plumbing)
0.0800426818927
V.S. irrigation pipe, but forgetting to subtract the rod the float travels on
-0.000716124144949
It seems fair to assume that when calculating the cross sectional area of the tank, the originators new the non-standard inside diamters used, especially since the numbers in the notes are pretty close to those measured. However, it seems likely that they forgot to subtract the cross sectional area of the rod that the float travels up and down on.
#### Errors from high wire resistance
[83]:
#Maybe loop resistance is an issue
def rlmax(vSupply):
#max resistance of entire ciruit where sensor can still function
#dependent on supply voltage
return (vSupply-10.5)/0.022
def vsupp(rl):
# max operating voltage
# dependent on max resistance
return 24+(rlmax(rl)*0.022)
max11 = rlmax(11.5)
max15 = rlmax(15)
print str(max11) + ' - ' + str(max15) + ' ohms max loop resistance'
max11 = vsupp(11.5)
max15 = vsupp(15)
print str(max11) + ' - ' + str(max15) + ' V max supply voltage'
def loopresistance(length, mm2, english=True, AWG=False):
# Assumes copper
meters = (length/12.)*3.21 if english else legth
m2 = mm2*10**-6
return (meters * 1.7*10**-8)/m2
print loopresistance(100,0.205)#24 AWG
print loopresistance(100, 0.129)#26AWG
sh
45.4545454545 - 204.545454545 ohms max loop resistance
25.0 - 28.5 V max supply voltage
2.21829268293
3.52519379845
[83]:
0.831721810164509
Even after adding the 12.4 \(\Omega\) resistor, we are nowhere near loop resistance issues.OK, so let’s try it with what the website says about the stand alone:
The heated orifice section is a 20” diameter stainless steel funnel with copper tubing
…
The standpipe section is a 10” diameter schedule 40 aluminum pipe 14’ long with a 2’ square piece of aluminum plate welded on one end as an end cap. Triangular stiffeners are also welded between the plate and the pipe. The stand-pipe is bolted to a 4’ square concrete pad. A drain valve is located near the bottom and a filling tube near the top. One inch diameter threaded nipples welded to the pipe in line 3’6” and 12’6” from the bottom are for attachment of a 3” diameter pvc measurement tube to the side of the aluminum pipe.
This results in:
In this gage 1 inch of precipitation causes a rise of 3.67” in the standpipe.