Streaming quad encoder, analog in (filter)

Recommended Posts

I am steraming a quad encoder input and a 0 - 10V ain @ 1000hz and want to apply a filter on my 0 -10V ain0.What's the best way to make a filter when streaming?

I am logging the data into a text file, degree (360/8192) vs position of a linearsensor on ain0.

like this:

0.023 V and 0.044 degree

0.054 V and 0.087 degree

Then presenting this trigonometric funktion in excel, but the singal @ ain0 has too much noise.

This would be the function of the filter. mm is the ain0 channel name.

First a want to do: mm[3] + mm[2] + mm[1] /3

The next thing is to take mm[0] and use a filter expression like: if mm[0] is not mor than 0.002 times larger/smaller than the average of mm[3],[2],[1] it should not be added to history of my filtered channel.

Any other way?


Link to comment
Share on other sites

You can do basic averaging directly in the channel. There is a parameter called Avg? that enables it. But in stream mode, because the data comes in in blocks, I'm not sure if there are limits to the number of points you can average. Give it a try and see what happens. You could also use a conversion.

But getting data not to appear in the history if its out of bounds requires you to write a script that cycles through the data and performs the analysis adding only good data to another, dummy channel.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.