Forums > MaxMSP

digital filter, to exclude noisy touch data?

May 26, 2011 | 3:55 pm

Hallo
I’m afraid i’m still losing sleep over this one:

When one presses on a resistive touchpanel, there is a minute ramp up to the ‘exact’ or real XY location value; this is mainly due to the mechanics of this type of sensor implementation, but also caused in some part by a function i have implemented to simply detect touch: when the device is ‘dormant’, the sensors are forced back to ground, giving me a zero. Nice. And in Processing I’ve got a little averaging array. But the ramping-up noise is still there and giving me nightmares etc, so I’ve implemented three different algorithms in Max to try to address this issue; 1. a simple gate for discrete touches; 2. a lowpass onepole filter + zl stream/zl median; 3. downsampling.

I hope to be able to access both discrete and continuous touch data accurately, and, having pounded this forum and others mercilessly, still no success……..please have a glance at the commented patch below and suggest anything (except [lbyl], it does lowfreq noise very well but not applicable in this instance): capacitors, welding rods, a hammer whatever!

– Pasted Max Patch, click to expand. –

That’s two queries then i suppose; how to deal with ramping to, and vacillation around the ‘real’ touch value; and, how to access both discrete and continuous touch data.

Brendan (the ‘touchpanel-noise guy’, that’s me)



k9
May 27, 2011 | 6:44 pm

Maybe you should look at the slide/slide~ objects. I believe that does what you are looking for.


May 27, 2011 | 9:51 pm

Hmm, with IR sensors a capacitor near the sensor will smooth that junk. I can’t recall the exact circuit off hand, but easy to find.

hth


May 28, 2011 | 12:27 pm

@k9 thanks for the suggestion, but as I understand it, [slide] does logarithmic smoothing, and lowpass filtering, both of which perform a type of interpolation on the number stream; in effect, the noise is merely delayed or interpolated, not ignored. But I haven’t applied [slide] yet so i’ll get back to you.

@Simon thanks also, but i’m using a resistive touch panel; I have various capacitor values and most texts I’ve referred to mention capacitors in the context of 50/60Hz mains interference and electronic interference from other devices, but again, I’ll try the capacitor trick too.

Brendan


June 1, 2011 | 4:03 am

Hi :)

sorry probably wont be able to help out much. Just interested in what your doing. What is it that you’re actually making? A DIY touchpad or something? Like what you’ll get in an iphone? Plus can you detect multitouch?


June 1, 2011 | 4:54 am

Have you looked at the smoothing numbers thread to see if there might be some ideas you could use?

http://cycling74.com/forums/topic.php?id=15180


June 1, 2011 | 12:43 pm

@Anneke
this is one of the core elements of my current PhD in accessible interaction design – I’m designing and prototyping a digital musical instrument interface for musician-performers with cerebral palsy; the touchscreen will control a variety of synthesis engines in MaxMSP, hopefully resulting in an interface/instrument similar to Roger Linn’s Linnstrument, but, due to the limited capabilities of my participants, not availing of any multitouch functionality.

@Chris
was hoping you’d drop by; of course, the solutions in your link form the core of my ‘max utilities’ folder – signal processing is where my project often gets stuck. I have resolved to ‘ameliorate’ rather than solve this issue as it is a perennial and fundamental issue with resistive touchpanels. Sometimes you just gotta put your hands up and say "Ok, I give up, you win".
The solution? Bigger pulldown resistors on all the inputs, a large for-loop ‘averaging array’ in Arduino, and finally [zl stream 3] ->[zl median]. Seems to be a good trade-off between noisy responsiveness and latent accuracy.
Watch this space……

Brendan


June 1, 2011 | 5:53 pm

FWIW, I’ve put a milder version of my [Flatline] solution into the firmware of some hardware products that I sell, with pretty good results when used for knob smoothing.

In the case of the touch screen, perhaps a simple passive lowpass filter before it hits the A/D of the Arduino would be good. Also, have you grounded any unused A/D inputs of the Arduino?


June 2, 2011 | 1:10 pm

Hi Chris

if you are suggesting capacitors on the inputs, which values would you recommend? The touchpanel is rated at around 300-900 Ohms resistance I believe. In the past I’ve never had to force unused inputs to ground, but then I’ve never encountered such jitter before – but when the panel is dormant i.e. untouched, there is no noise or jitter whatsoever; the jitter stems purely from the minute fluctuations in fingertip contact location due to finger pressure and movement. While I’m here…..how should I connect the caps to the inputs; they are currently all pulled to ground via 10k.

Best wishes
Brendan


June 2, 2011 | 6:07 pm

It’s sort of hard to guess at a filter without knowing what the rest circuit looks like.

It may be to "steppy" for your liking, but [flatline] comes close to meeting your requirements, otherwise.

– Pasted Max Patch, click to expand. –

June 3, 2011 | 9:56 am

Chris
Thanks; you're quite right – for discrete triggers [flatline] is ok, but less so for continuous data. Hmmm. I have a variety of caps here, from .01uF to .47uF, which I could try – despite much googling I can't find an example circuit. My circuit looks like this; do you know if the caps should be placed before or after the pulldown resistor on each read line?

Cheers
Brendan

[attachment=163606,2324]

Attachments:
  1. circuit.jpg

June 17, 2011 | 9:31 am

A wild guess here but have you tried hooking up a coil/inductor. Definitely no expert but i believe this is the electronical equivalent of [rampsmooth]


Viewing 12 posts - 1 through 12 (of 12 total)