10-29-2013 01:03 AM
How to make derivative of a position signal acquiring using AI module of cRIO to get the velocity signal.
I got one example in forum and i m attaching that, bt i need to implement this in FPGA.
Note : The position is varying at 30Hz to 80Hz Freq.
10-29-2013 03:26 AM
You can use a numerical method to differentiate your signal - i.e. by calculating the change in voltage between one sample and the next divided by the difference in time between the two. Using Shift Registers in a while loop to retain the previous sample's value is the way forward.
Community member Rialter showed a simple example of how to do this on the FPGA here. The previous sample, held in a shift register, is subtracted from the current sample, and the difference divided by the interval between samples.
10-29-2013 03:58 AM
Thank u sir. This is gud, bt i m still having some doubt, I m using cRIO 9025, with NI 9215 AI module , how to find the sampling time in it, Also there is some high freq noise signal is added to that position signal, i ve to filter that too, how could i do that?
10-29-2013 04:44 AM
I forgot to mention that one problem with numerical differentiation is that if you have a noisy signal, the noise is amplified! 🙂
You can try implementing a moving average or median filter in the FPGA code. There are a number of previous threads and Community posts on these, ranging from simple implementations to more complex ones. Try using the search function at the top of the page to look for them.
Of course, it's easier to acquire the raw data, send it to the RT host and do your processing there, depending on resources.
Regarding the sampling time, you have hopefully set this via the tick delay you set in the FPGA acquisition loop.