05-22-2013 12:03 PM - edited 05-22-2013 12:06 PM
I have a requirement to convert the voltage across a thermistor to its corresponding temperature. There are a couple of ways to do this, one way is to use the steinhart-hart equation and calculate the temperature based upon the calculated resistance of the therminstor. This method comes with a number of issues since the equation requires the ln() function and the LabVIEW FPGA natural log node is only capable of taking input between [1/e, 1). There is a known work around but it just adds more complexity to the problem.
The other way is to precompute a LUT with (voltage,temperature) pairs and this seems to be the most preferred way. However, this method brings to light a few implementation details that I have yet to iron out:
Lets assume the following table:
Voltage Temperature (*C)
4.10 32
4.20 35
4.30 38
4.40 41
4.50 43
1) Can I make a LUT who's index is a fixed-point number rather than a whole number?
2) If no to #1, lets say I convert the fixed-point voltages to a U16 representation first. Can I create a sparse LUT or will LabVIEW FPGA create a LUT with size 65K (2^16)?
3) The precision that I'm getting from the analog-in card is much higher than 100mV, so I will want to be doing some form of interpolation between the pre-calculated points in the LUT, how best to do this?
Thanks for your help.
05-24-2013 03:14 PM
Hi,
1) Think of the LUT as an array of values, that being said...why would you like to use a Fixed-point data type to handle the index? It should be easier to find the stored values with an integer pointer.
2) Regarding space, that depends on the FPGA you are using. When finished with the programming you can click on the build specifications and select estimate resources to check the LUT is going to fit.
3) I found this forum that can work as a reference.
Need more references...check the NI Example Finder, there is a project example called "Using a LUT - R Series.lvproj". You can find it by typing LUT on the search tab. Plus, here is the detailed help of the Look-Up Table 1D Express VI, this tutorial and a related Forum.
I hope this helps