LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

URGENT HELP: A model to convert pressure to milivolts

I need to find a suitable model to convert voltage to pressure and use this to produce a program that can display an incoming voltage into a pressure. The variation is calibrated and gives a voltage output in relation to pressure according to: Pressure= cotan (voltage), where the voltage varies from 0 milivolts corresponding to 0 rad and 100 milivolts to pi radians. This is the image of the variation of pressure to voltage. It was my idea that this resembles a cotan function. Assuming it is, could you help me make suitable program.

 

P.S. Additional tasks are: You will be provided with a VI that will simulate a voltage output. How should this pressure be presented? Can you include high/ low pressure alarm? What other features might be useful?      

 

 

 

 

function12471230_974137109319347_115547568_o (1).jpg

0 Kudos
Message 1 of 8
(3,332 Views)

Hi Jessica,

 

create a lookup table from the values given in the datasheet. (I don't see any "pi radians" in that value table, 100mV = 1E-3 mbar)

 

Then use Threshold1DArray to get pressure from voltage. (It uses linear interpolation, this might be quite ok for a first guess of your logarithmically scaled curve…)

 

P.S. Additional tasks are

This really sounds like homework: Do you think we will solve your problems for you and present ready-to-use VIs?

Do this stuff on your own - it helps to learn LabVIEW! 😉

 

To present that pressure I would use a simple numeric indicator. Using a gauge might be "nicer" to the occasional viewer…

Yes, you can create high/low alarms.

Other useful features depend on your use case…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,308 Views)
Spoiler
mV to mbar.png

See GerdW's remark about the interpolation. 

0 Kudos
Message 3 of 8
(3,289 Views)

Lookup table with interpolation is a pretty good universal solution.

 

You could also try working out an equation that converts the pressure to millivolts - using curve fitting / identification techniques to find the characteristic equation/curve to generate an equation that fits the data pretty well. This would have the advantage of using less memory (as you don't need to hold the lookup table in memory) and give slightly better results between points.

 

For even more marks, you could try both methods and then see which is better (e.g. by calculating the errors).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 8
(3,285 Views)

Hi JB,

 

I got a somewhat easier implementation in mind… 😄

Spoiler
check.png
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,254 Views)

As incredible this might sound, I think that I have never used the Index & Bundle Cluster Array function !

I'm now afraid to find useless loops in some of my applications...

 

Thank you very much.

0 Kudos
Message 6 of 8
(3,230 Views)

@JB wrote:

As incredible this might sound, I think that I have never used the Index & Bundle Cluster Array function !

I'm now afraid to find useless loops in some of my applications...

 

Thank you very much.


I hadn't even known of its existence until just now!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(3,166 Views)

Its uses are somewhat limited, but not having the reverse (unindex and unbundle) is a bit odd to me, but there is an XNode for it if you are super curious.

 

https://lavag.org/topic/10303-cr-array-function-xnodes/

 

Another useful one is if you have two arrays and you reorder one based on the sort of the other.  You can index and bundle, perform the sort 1D array, then unindex, and unbundle.

Message 8 of 8
(3,086 Views)