LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Polynomial Scale

I've never scaled input from a DAQ, so I'm not sure if I'm approaching this the right way.  I'm trying to scale the output of a wind velocity sensor using the data provided by the manufacturer, which is as follows:

 

Flow Velocity (m/s)           0                2                4                  6               8                10
Output Voltage (VDC) 1.00±0.24    1.94±0.24    3.23±0.24    4.25±0.24    4.73±0.24    5.00±0.24

 

So I think what I need to do is generate polynomial coefficients and use those to create a scale for use with DAQmx.  

 

My problem relates to the x vs y values.  I assume that the scale works by taking a reading, putting it on the x axis, and finding the y intercept of the polynomial equeation.  To generate those coefficients I am using the Curve Fitting VI.  If I put Flow Velocity on the X axis and Output Voltage on the Y, the VI generates a curve that looks just like the curve from the data sheet of the sensor.  But if I need to use the X axis as the input I have to reverse this.  When I use Voltage as the X axis, the Curve Fitting VI doesn't seem to put out a curve that looks right.  I've messed around with the power or the polynomial or other curve fits but it doesn't seem correct. I've attached a VI to show what I mean.

 

Not sure if I'm even going about this the right way.

0 Kudos
Message 1 of 7
(3,327 Views)

I don't use express VIs, and you failed to attach all subVIs, so here's what you could do instead. (LV 8.2)

 

 

Message 2 of 7
(3,310 Views)

Thanks you very much for the response and for building that VI.  Very helpful. I'm going to need to study this for a while to understand it.  The program can't seem to find a subvi "Ramp Pattern by Samples".  Any chance you could post it?

0 Kudos
Message 3 of 7
(3,298 Views)

By the way, why don't you use express VI's?

0 Kudos
Message 4 of 7
(3,297 Views)

@LiveEveryDay wrote:

By the way, why don't you use express VI's?


 

...because I don't use dynamic data. 😄

 

(... and vice versa 🐵

0 Kudos
Message 5 of 7
(3,290 Views)

The program can't seem to find a subvi "Ramp Pattern by Samples".  Any chance you could post it?

0 Kudos
Message 6 of 7
(3,274 Views)

Hi Live,

 

it seems you use a Base version of LabVIEW or your old version didn't know those Ramp function yet...

 

See attachment for a simple replacement (no error checking included)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(3,266 Views)