01-04-2016 06:42 AM
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?
function
01-04-2016 07:09 AM - edited 01-04-2016 07:10 AM
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…
01-04-2016 07:27 AM - edited 01-04-2016 07:30 AM
See GerdW's remark about the interpolation.
01-04-2016 07:29 AM
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).
01-04-2016 08:08 AM
Hi JB,
I got a somewhat easier implementation in mind… 😄
01-04-2016 09:11 AM
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.
01-04-2016 10:00 PM
@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!
01-07-2016 01:46 PM - edited 01-07-2016 01:47 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord