Example Code

LVDT Input Measurement Using LabVIEW FPGA

Code and Documents

Attachment

Download All

This VI shows how to measure signals from a LVDT sensor and process the data to calculate the position of the LVDT. The important configuration in this code is to match the sample rate and the size of the FIFOs to the frequency of the excitation signal. The sample rate and FIFO size need to be selected to represent one-half period of the excitation waveform.

The example integrates a half cycle of the excitation signal and the LVDT output signal to get a more accurate representation of the amplitude of each waveform. Be calculating the ratio between these two amplitudes we calculate the position.

The example includes code to generate the excitation signal and also simulate the LVDT output signal. Using AO and AI channel you can test the code for its performance.

The example is written and configured for a 7831R FPGA board, but can be updated for other RIO hardware that includes analog input and analog output channels. The analog output channels are only required for the excitation signal and simulated LVDT output generation.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors