From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Touch Screen Data

Good afternoon,

 

I'm working on a personal project to make a Stewart Platform with a touch screen for tracking a ball position. Its also worth prefacing this with I'm a mechanical engineer at heart, with not much electrical background at all. I'm working hard to brush up my electronics skills (which frankly this project is also about!).

 

I've got the platform movement etc all sorted, and am now working on the touch screen IO. I'm using a 5 wire touch screen, and am reading back position, however, I'm getting a 'bouncing' issue when the ball moves across the screen (blue = x, red = y, results are un-calibrated, and are based on scale of max voltage to min voltage, which accounts for any voltage reductions as the servos hit my power supply current limit):

 

Image 1.png

 

If I press on the ball, then any of the bouncing goes away, if I use a lighter ball, the problem gets worse (I don't have a heavier ball, or else that would be a super obvious solution!). The ball position will be used in the control loop to move the ball, so these abrupt changes will results in some big output errors from the controller.

 

Things I've tried so far (all failures / lessons):

 

  • Basic filtering (although might have made a hash of it!)
  • Moving averages (total failure, as the number of incorrect samples are so high)
  • Some logic using a super basic differentiation (x(t)-x(t-1)) to tell when a fast change occurs, and use a threshold to latch the last 'valid' value. Half worked, but either my threshold was to high, and it didn't pick up all changes, or to low, and it would latch when it shouldn't.
  • I've looked at rate limiting, but that the selected limits either give an incorrect reading when the ball is moving fast, or I I still get incorrect readings
  • Annotation 2019-08-22 155622.png

     

I've done some googling about 5 wire touch screen signal bouncing, but don't get much success. 

 

Ultimately, my goal is going to be something like this:

 

Annotation 2019-08-22 155824.png

 

 

 

Note: I've attached the experimental data (logging freq = 1kHz), and can provide the FPGA code if useful, but here are some screenshots of the relevant bits:

Annotation 2019-08-22 160146.png

SubVISubVI

 

 

#

 

So, anyone had any experience with this sort of problem, and how they went about solving it? I'm at a bit of a loss at this point!

 

Thanks,
Peter 

0 Kudos
Message 1 of 3
(1,999 Views)

A Lowpass filter should be able to get rid of most of that. I know you said you tried it, but it's worth looking at again. Your noise spikes have super high dx/dt values, like you said, but you don't have to manually monitor the derivative. Try using a Lowpass recursive filter and play with your cutoff frequency.

 

Since the noise is fairly one directional (it looks like spikes always go down from the correct signal, not up) you could use some logic to check for downward spikes only, not just upward ones.

 

Yet another way to do it would be to use an Alpha beta filter on the data. This type of filter basically takes the previously known position and speed of your ball, then predicts where it's going to be at the next timestep using the previously known speed. The next measured value is then combined with the previously predicted value. The ratio of how much you "trust" the new value versus the old is variable, so you can play around with that as well.

0 Kudos
Message 2 of 3
(1,961 Views)

Hi Bert,

 

Thank you for your message, appreciate you taking the time to reply. 

 

I've had a play with some different cutoff frequency values on the recorded data, but the problem is it starts to lose the true values:

 

Annotation 2019-08-23 081025.png

 

I wonder if I should be differentiating the signal, filtering that and integrating again? 

 

#

 

I'll have a read into the Alpha Beta filters, see what I can find. Thanks! 

 

Cheers,

Peter 

0 Kudos
Message 3 of 3
(1,890 Views)