I'm having a bit more fun with the capacitive sensor. As mentioned, it didn't work very well. I first ran a series of tests to examine whether changing the configuration of the touch sensing module would improve the sensor's performance. There are about half a dozen parameters to play with. From what I saw, it seems that the parameters are about as good as they get.
However, I noticed that one of the two channels occasionally just went dead for a while. Closer examination revealed that bending the cables between the two boards had something to do with that failure, but when I touched the cable at either end with tweezers, the sensor responded normally (any direct contact just makes it go off the scale). I then suspected the battery holder. As one can see in the middle image on http://downloads.qi-hardware.com/people/werner/anelok/tmp/anelok-20140712.png one of the traces is very close to a pad. So I moved the holder a bit, but to no avail. I then removed it completely and began to probe the trace. Turns out that there was a tiny invisible fracture in the trace that probably responded to bending forces from the cable. A bit of solder bridged that gap. Then DFU (USB) started to fail occasionally, with an increasing frequency. Also here, twisting the connector one way makes things work while twisting it the other way makes them fail. I haven't looked into that any further yet, but it'll be interesting to find out what's happening there. A boring finding would be another broken trace or a bad solder joint. If the receptacle is damaged, that would indicate that either the build quality of that AB connector isn't so good, or that AB in general is not the best idea (in AB, the plug will not be stopped by the shield when reversed and the only thing stopping it seems to be the plastic tongue holding the contacts. Not the most confidence-inspiring design, but who am I to question the wisdom of the mighty masters of USB ...) But my principal suspect is the cheap plug. Maybe it's already worn out after a few hundred cycles. We'll see. Next, the daughter board failed completely. That one was easy to find: one of the wires resented all the bending and snapped. Maybe using a stranded wire (30 AWG, 7/38) wasn't such a great choice after all. In any case, this kind of connection will want at least an FPC in the end. With all the little nuisances fixed, I could get back to wrestling with the touch sensor. To get a better idea of what it really measured, I marked distances on the sensor, like this ... http://downloads.qi-hardware.com/people/werner/anelok/tmp/brd2-touch-mm.jpg (The cable coming out from the back replaces the battery holder I had removed for better access to troubled traces.) ... and put my index finger at various positions. This is what the results looked like: http://downloads.qi-hardware.com/people/werner/anelok/tmp/touch-eval.png The red line is the value of the A channel (minus the long-term average, i.e., the level when no finger is present), the green line shows the B channel. They both look nice and linear on the respective lower half, but each has that ugly peak about 7 mm from the top end. This corresponds to the finger overshooting the sensor area, i.e., the area of finger over the sensor plates decreases. But hey, this is roughly what the sum of A and B (blue) shows. So let's normalize the channels with the sum. This yields the magenta and cyan lines. They look almost too good to be true. If we add them together, we get an even stronger signal (black). When I added normalization to the algorithm, the result was quite a bit more useful than before. The change is small enough (I also had to cheat a bit, scale up and add a small offset, or it wouldn't feel right): https://gitorious.org/anelok/anelok/commit/e568b81f074e2678cd512cb6af0e664c47ed21f8 The result was still quite noisy. I then put an averaging filter operating on positions on top of everything, and this now yields pretty acceptable performance: https://gitorious.org/anelok/anelok/commit/e225efadded2d25c8dd9c01d8fa873287bb57457 The filter is a bit awkward (I could probably have used an EWMA which doesn't need to record multiple values), but it's easily extended to chopping off samples from the beginning and the end of the press interval, in case we get false positions when the finger is still at a distance from the sensor. The touch sensor still isn't perfect but it's good enough for going back to teaching the UI a few more tricks. Curious what they are ? Try the simulator ! http://lists.en.qi-hardware.com/pipermail/discussion/2014-August/010693.html - Werner _______________________________________________ Qi Hardware Discussion List Mail to list (members only): [email protected] Subscribe or Unsubscribe: http://lists.en.qi-hardware.com/mailman/listinfo/discussion

