LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controling the cursor position

Hi all,

 

I have two x, and y signal outputs from a dll module and I plan to use them to control the cursor position. One problem I'm facing is that my signals are variable enough to cause the cursor to vibrate in stationary setting. So, I use hysterysis (putting threshold) to eliminate these fluctuations but the drawback is that keeping the treshold high enough to eliminate the fluctuations keeps me from getting a nice, smooth movement when the speed of movement (rate of x and y changing) is low. Any ideas or suggestions will be appreciated.

 

p.s. I am using "SetCursorPos".dll as you might have already guessed.

 

Thank you,

Elnaz

0 Kudos
Message 1 of 5
(2,446 Views)
I would suggest a simple exponential average with a low degree, it acts as a low pass filter.
0 Kudos
Message 2 of 5
(2,440 Views)

Actually, I just realized that the vibration is pure sensor noise (magneto-resistive sensors whose data are used to calculate X and Y signals). This changes the body of the question a little bit:
How to cancel out sensor noise (high frequency vibrations) from actual data which can also be high frequency ? Because If I filter the noise out that will affect the sensitivity of the cursor position produced by the real data as well.

0 Kudos
Message 3 of 5
(2,433 Views)

Darin,

Could you please clarify what do you mean by average exponential with low degree? Can it be applied online?

0 Kudos
Message 4 of 5
(2,422 Views)

The formula for an exponential filter of degree D is the following:

 

New Average = (New Value + (D-1)*Old Average)/D

 

I usually add a special case for startup so that D is never greater than the number of points. 

 

As I said, it is a low-pass filter, much like using a running average.  I usually like it because the state is simply a single value (Old Average) instead of the array of values you have to keep around to do a running average.

 

As to the new question of separating high-frequency noise from your high-frequency signal, that is a bit more complicated (obviously).  You should take a power spectrum of the noise to see if there is a characteristic feature you can use (cutoff frequency, strong peaks).

0 Kudos
Message 5 of 5
(2,419 Views)