12-13-2017 08:52 AM
Hallo all,
I am using Inclination sensor through sbRio-9636 board. I am getting the output voltage from the sensor ranging from 0 to 10 V. I want to convert the output voltage to angle of inclination in the indicator. The relation between the output voltage and angle is not linear. It is given as a table value by the manufacturer of the sensor. I have attach the table below. Please let me know what kind of function or array should I use to solve this problem?
I am new in the LabVIEW. I also attached the block diagram of the project.
Thank you
Solved! Go to Solution.
12-13-2017 09:26 AM
Hi Sazzad,
you could use a look-up table in the FPGA. You will find a "LUT 1D" function in the Math -> Utilities palette.
A different attempt is to find a reasonable interpolation function to convert from voltage to angle.
12-13-2017 09:54 AM
Instead of a Lookup Table, you could think about the following -- how would you build an Inclinometer? You might also look at the numbers you show -- they go from 0 to 10 v, look symmetric about 0° = 5v, have a big change around 0°, and small changes at ±90°.
Does this make you think of a Well-Known Function? And what does an "inclinometer" measure? How about "angle with respect to the vertical"? What does "angle" suggest? What defines a "vertical"?
Your inclinometer is a single-axis accelerometer, and your function is a sine function. I will leave as an Exercise to the Reader figuring out the formula (and do not use a Formula node to do this!) between Angle of Inclination and Output Voltage.
Bob Schor
12-19-2017 08:15 AM
Hallo GerdW,
Thanks for your suggestion. I was trying to use the LUT 1D. From there I open the Define table (picture) to create the output according to my need. But there I can not change the value from Element and value. My idea was to put the value from the sensor data sheet in the table. then the LUT will change the data according to the define table. So I need to know how can I define the table to solve it.
May be this problem is really simple. But I am new in LabVIEW.
Thank you.
Best Regards
Sazzad
12-19-2017 08:24 AM
Hallo Bob Schor,
Thanks for your suggestion. It is really helpful. So as I understood the function looks like Sine wave from the interval of -π/2 to π/2. So my problem is now how can I build a function LabVIEW FPGA according to this? I tried it in LUT 1D. But there I can not change the value as I desire. What other option do I have? I attached the LUT where I tried to make a sine wave.
Thank you. I am new in LabVIEW. So May be the solution is simple, but I am not getting it.
Best Regards
Sazzad
12-19-2017 08:25 AM - edited 12-19-2017 08:27 AM
Hi Sazzad,
don't you think reading the LabVIEW help for this LUT function will help you to solve your problems?
In the help you will find explanations how to create the LUT!
- You could define the LUT data by typing in "segment" by "segment". I don't recommend this way.
- You could define the LUT data using an initialization VI. The help explains how to create such a VI! In this VI you will find an explanation how your data needs to be supplied…
12-19-2017 08:42 AM
Oops. I've done very little with FPGAs, and am blissfully unaware of their limitations. I do have experience building Look-Up Tables -- several decades (i.e. before PCs) ago, I wrote code that produced a "random-appearing" waveform from a sum of 8-10 sinusoids whose frequencies were relatively-prime multiples of a very low frequency fundamental (from 0.001 to 0.01 Hz, typically), which I did by keeping an array of 8-10 indices into my LUT, looking up the 8-10 Sine components, adding them, and outputting my waveform at around 60 points/second (which makes a nice smooth "random" stimulus.
GerdW notes that there is Help for creating LUTs. Since I don't have FPGA software installed, I can't read this help, but you should be able to develop a 1000-point tabulation of Sin(x) as x goes from 0 to 2 pi in steps of 2 pi/1000 using LabVIEW on the PC, then move that LUT data (as a Constant) to the FPGA side, I would think ...
Bob Schor
12-30-2017 07:44 AM
Hallo everyone,
I am using sbRio-9636 board to interface with some sensor. I am new in the LabVIEW.
One of the sensor output function is non linear. So I am planning to use a look up table 1D. I am following an example of LUT which I have attached below. This example has a VI(Create Look-up Table for Nonlinear Waveform Output), which will generate the value in the Look up table. I am having problem in this VI. In this VI they are using a block name "FPGA" (red circle in the screeenshot). What is this block doing? Is this mean I have to connect it with a FPGA?
Another problem is what is the function of the "calibration" function (blue circle)?
Thank you for your help.
Best Regards
Sazzad
12-30-2017 10:26 AM
Hi Sazzad,
what's the reason to start a new thread for the very same problem? You still want to create that LUT, so keep things in one place…
- Unfortunately you forgot to attach this subVI "Convert to Binary (cRIO-9263)" you marked in your image. How can we help then?
- The item on the left side is a cluster constant with two elements inside. Open the context help and move the mouse over all those items (cluster or cluster wire) to read about their contents!
You found a very old example - I never heard of those "lep" files before. Now I learned about "LabVIEW Embedded project" files, back from those LabVIEW7.1 times…
Why don't you try to find more recent examples in the LabVIEW example finder? Or from reading the LabVIEW help?
01-04-2018 09:41 AM
Hi GerdW,
I was looking for someone who have used this exact kind of same example.That's why I opened a new thread.
I understood this example is really old. The execute.vi is broken.
Anyway i found the solution of my problem. Instead of LUT i put a equation which is directly convirting the voltage into angle.
Thank you for your help.
Best Regards
Sazzad