Legacy Hardware and Apps
Polynomial scaling issue on DT50

Hi

I'm using a DT50 to measure the stage height in a flume and calculate the flow rate in order to mtrigger water samples based on discharge.

I'm using a second order polynomial x = 0.36375y + 0.000965y^2.

I've entered the coeficients as follows:

Y11=0,0.36375,0.000965"L/Sec"

The level data is stored in 7CV and the flowrate calculated using:

7CV("Flow (l/sec)",Y11,=11CV)

When I've tested the output at known levels there seems to be an issue with the conversion as the output values are not as expected from the equation.

e.g.
level 0mm Flow as calculated by DT50 0L/sec flow calculated using equation 0L/sec
level 150mm Flow as calculated by DT50 196L/sec flow calculated using equation 76L/sec
level 300mm Flow as calculated by DT50 565L/sec flow calculated using equation 195L/sec
level 450mm Flow as calculated by DT50 1115L/sec flow calculated using equation 359L/sec
level 600mm Flow as calculated by DT50 567L/sec flow calculated using equation 565L/sec
level 150mm Flow as calculated by DT50 815L/sec flow calculated using equation 815L/sec

The values highlighted in red are all clearly incorrect. What am I doing wrong?

Hi I'm using a DT50 to measure the stage height in a flume and calculate the flow rate in order to mtrigger water samples based on discharge. I'm using a second order polynomial x = 0.36375y + 0.000965y^2. I've entered the coeficients as follows: Y11=0,0.36375,0.000965"L/Sec" The level data is stored in 7CV and the flowrate calculated using: 7CV("Flow (l/sec)",Y11,=11CV) When I've tested the output at known levels there seems to be an issue with the conversion as the output values are not as expected from the equation. e.g. level 0mm Flow as calculated by DT50 0L/sec flow calculated using equation 0L/sec level 150mm Flow as calculated by DT50 196L/sec flow calculated using equation 76L/sec level 300mm Flow as calculated by DT50 565L/sec flow calculated using equation 195L/sec level 450mm Flow as calculated by DT50 1115L/sec flow calculated using equation 359L/sec level 600mm Flow as calculated by DT50 567L/sec flow calculated using equation 565L/sec level 150mm Flow as calculated by DT50 815L/sec flow calculated using equation 815L/sec The values highlighted in red are all clearly incorrect. What am I doing wrong?

Good morning Jeff,

It looks as if you have applied the terms correctly.
Just make sure you are mapping X to Y and not the other way around.
Also check you have enough precision in your terms.

Cheers,
Roger

Good morning Jeff, It looks as if you have applied the terms correctly. Just make sure you are mapping X to Y and not the other way around. Also check you have enough precision in your terms. Cheers, Roger

Hi Roger,

The precision is sufficient for our application,which is to trigger a water sampler at a nominal discharge and I've tried the same equation in excel and on a Campbell data logger and get the correct results.

I'm using a calibrated fluke loop calibrator so simulate the output from the level device (4-20mA). The input is scaled into mm and this is recording correctly, the polynomial Y11 is then applied to the scaled input but the result is clearly incorrect.

Here is the full code that I'm using:

' stage 1 - reset actions
H

CLEAR
\W1
RESET
\W4
/e
' stage 2 - switches, parameters
/H
/e /R
/S
P14=600 P17=120 P26=30
99CV(W)=98989
P30=6
P36=0
' stage 3 - Date, Time
D=\d
T=\t
' stage 4 - start of job
' Set up span for conversion of 4 to 20 mA output from Ultrasonic and polynomial for flow calculation
S1=0,750,4,20"mm" ' Working range of flume = 0mm to 750mm
Y11=0,0.36375,0.00096516"L/Sec"
' stage 5 - user entered commands
' stage 6 - immediate schedule initialisation
' Initialise storage variables
1CV("Sampling Threshold smile",W)=1
2CV("Catchment Area (m2)",W)=1381000
3DSO=0

$="NVZ111.cmd"
' stage 7 - schedule list

BEGIN
RA15S HA '15 minute schedule

     1DSO=1 'Turn on ultrasonic
     7SV=15000 5#I(W) 5#I(W) 1#I("Ultrasonic",S1,=6CV(W)) 'Read output from ultrasonic and apply span
     7SV=10

1DSO=0 'Turn off ultrasonic
6CV(W)=(6CV(6CV<600))
7CV(W)=(6CV
(6CV>1)) 'Ignore stage height less than 1.0 mm
7CV("Flow (l/sec)",Y11,=11CV) 'Calculate and log flow
12CV("Discharge (litres)")=12CV+11CV*900 'Calculate and log Discharge
13CV("Discharge smile")=12CV/2CV 'Calculate and log Discharge in mm
2+V("Battery",U,0.013) 'Read and log battery voltage
2HSC("Cum Rain")
P15=1

RZ15S HZ 'Alarms

IF1(13CV>1CV)"[2DSO=1 7SV=500 5#I(W) 2DSO=0 7SV=10 12CV(W)=0 14CV=14CV+1]"

END
' stage 8 - logging options
/O
LOGON
' stage 9 - post schedule options
' stage 10 - run commands
G
/q

The results are fully repeatable on several different DT50s

Hi Roger, The precision is sufficient for our application,which is to trigger a water sampler at a nominal discharge and I&#039;ve tried the same equation in excel and on a Campbell data logger and get the correct results. I&#039;m using a calibrated fluke loop calibrator so simulate the output from the level device (4-20mA). The input is scaled into mm and this is recording correctly, the polynomial Y11 is then applied to the scaled input but the result is clearly incorrect. Here is the full code that I&#039;m using: &#039; stage 1 - reset actions H CLEAR \W1 RESET \W4 /e &#039; stage 2 - switches, parameters /H /e /R /S P14=600 P17=120 P26=30 99CV(W)=98989 P30=6 P36=0 &#039; stage 3 - Date, Time D=\d T=\t &#039; stage 4 - start of job &#039; Set up span for conversion of 4 to 20 mA output from Ultrasonic and polynomial for flow calculation S1=0,750,4,20&quot;mm&quot; &#039; Working range of flume = 0mm to 750mm Y11=0,0.36375,0.00096516&quot;L/Sec&quot; &#039; stage 5 - user entered commands &#039; stage 6 - immediate schedule initialisation &#039; Initialise storage variables 1CV(&quot;Sampling Threshold (mm)&quot;,W)=1 2CV(&quot;Catchment Area (m2)&quot;,W)=1381000 3DSO=0 $=&quot;NVZ111.cmd&quot; &#039; stage 7 - schedule list BEGIN RA15S HA &#039;15 minute schedule 1DSO=1 &#039;Turn on ultrasonic 7SV=15000 5#I(W) 5#I(W) 1#I(&quot;Ultrasonic&quot;,S1,=6CV(W)) &#039;Read output from ultrasonic and apply span 7SV=10 1DSO=0 &#039;Turn off ultrasonic 6CV(W)=(6CV*(6CV&lt;600)) 7CV(W)=(6CV*(6CV&gt;1)) &#039;Ignore stage height less than 1.0 mm 7CV(&quot;Flow (l/sec)&quot;,Y11,=11CV) &#039;Calculate and log flow 12CV(&quot;Discharge (litres)&quot;)=12CV+11CV*900 &#039;Calculate and log Discharge 13CV(&quot;Discharge (mm)&quot;)=12CV/2CV &#039;Calculate and log Discharge in mm 2+V(&quot;Battery&quot;,U,0.013) &#039;Read and log battery voltage 2HSC(&quot;Cum Rain&quot;) P15=1 RZ15S HZ &#039;Alarms IF1(13CV&gt;1CV)&quot;[2DSO=1 7SV=500 5#I(W) 2DSO=0 7SV=10 12CV(W)=0 14CV=14CV+1]&quot; END &#039; stage 8 - logging options /O LOGON &#039; stage 9 - post schedule options &#039; stage 10 - run commands G /q The results are fully repeatable on several different DT50s

Good morning Jeff,

I can't see anything wrong with your code and I know the maths in the DT500 range is correct. We have been using the same maths for the past 30 years in all models of dataTaker released.

How did you derive the factors for the polynomial?
It's either that or something wrong with the sponsors or calibrator.

Cheers,
Roger

Good morning Jeff, I can&#039;t see anything wrong with your code and I know the maths in the DT500 range is correct. We have been using the same maths for the past 30 years in all models of dataTaker released. How did you derive the factors for the polynomial? It&#039;s either that or something wrong with the sponsors or calibrator. Cheers, Roger

Hi Roger,

Thanks for looking into this but I've isolated the problem to 2 DT50's, the code works fine on all the others. They are fairly old units (2003) and we'll replace them. It does seem to be a fairly strange failure mode though.

Hi Roger, Thanks for looking into this but I&#039;ve isolated the problem to 2 DT50&#039;s, the code works fine on all the others. They are fairly old units (2003) and we&#039;ll replace them. It does seem to be a fairly strange failure mode though.
21
4
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft