Page 1 of 16

Positional sensing testing

PostPosted: Sat May 08, 2010 12:40 am
by dmitri
This is a version of MegaDrum firmware for testing positional sensing on mesh type pads. There are a few prerequisites and limitations:

1. Test means test. Don't expect it to work with everything, with default settings, in all circumstances. It can be buggy and may cause your MegaDrum to explode.
2. It will only work on a snare input.
3. The pad must not be too hot. If it is too hot it must be "cooled" with a voltage divider.
4. The first half wave of a signal from a pad should be positive, e.g my Pintech mesh snare is such pad. Most of other mesh pads out there, like Roland, Drumtec and etc, produce a negative first half wave. This is a schematic of a precision rectifier required for such pads (a Pintech mesh snare will of course work with it as well):
precision rectifier 1.png

precision rectifier1.pdf

As you can see, this precision rectifier works with a single +5 power supply. To achieve this the opamp must meet these requirements:
1. able to operate at below zero input
2. rail-to-rail output
3. has no phase inversion

I've tested it with LMC6034, ~£1.00 at Farnell (LMC6032 will also work of course but the pinout is different)
If the opamp is also "unity gain stable", e.g. LM6134 (~£3.00 at Farnell), then C3 and C4 can be omitted.
(Can you suggest a cheaper alternative to LM6134?)

This is the firmware to use for the test:
megadrum_20100515.zip


It has 3 new options added:
1. Positional. (Default is No).
2. PositionalLow. (Default is 5).
3. PositionalHigh. (Default is 15).

To enable positional sensing on the snare input set Positional to 1, 2 or 3 (corresponding to three variations of the positional sensing).
PositionalLow and PositionalHigh are adjusted so that to get a full range of detected positions (and MIDI CC messages) from a rim (PositionalLow) to a centre (PositionalHigh). The default PositionalLow and PositionalHigh are good starting values for Roland PD-125X with Positional set to 1.

When Positional set to 2 the good starting values for Roland PD-125x are 16 and 30. With Positional set to 2, MinScan must be set so that to cover a full half wave which is 40 (4ms) for Roland PD-125X.

Positional set to 3 is almost the same as 2 but with slightly different algorithm so you may need to set PositionalLow and PositionalHigh slightly higher.

For the Drumtec snare the good starting values for PositionalLow and PositionalHigh are 5-10 higher than for Roland PD-125X.

You can also enable some debugging if you set Latency to an odd value (...,37,39,41,... ) . In the top row of the LCD it will show relative position of the hit as calculated by MegaDrum: ^ symbol shown more to the left for centre hits and more to the right for close to rim hits.
In the bottom row it will show 3 values with every hit: the first is used for calculating position when Positional is set to 1, second - when Positional is set to 2 and third - when Positional set to 3. Use these values to adjust PositionalLow and PositionHigh.

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 1:21 am
by mackanov
Great great great news! Will be testing it very soon! Thank you very much Dmitri!

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 8:05 am
by zaklinacz
Dmitri,
changing head piezo wires on input is not enough to get first half-wave positive from roland pad?
Do we need a dual-zone pad to make this work or a pad without active rim will also work?
BR
Michal

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 11:38 am
by dmitri
zaklinacz wrote:changing head piezo wires on input is not enough to get first half-wave positive from roland pad?

Should be enough. Are you willing to dig inside a Roland pad?

Do we need a dual-zone pad to make this work or a pad without active rim will also work?

One zone/piezo on a mesh type pad is enough.

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 11:56 am
by zaklinacz
Should be enough. Are you willing to dig inside a Roland pad?

No, I have my PCB without any case right now, so I will only change wires coming from jack input to analogue board.
BR
Michal

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 12:03 pm
by dmitri
zaklinacz wrote:
Should be enough. Are you willing to dig inside a Roland pad?

No, I have my PCB without any case right now, so I will only change wires coming from jack input to analogue board.

You won't be able to use the rim piezo in this case.

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 12:10 pm
by zaklinacz
You won't be able to use the rim piezo in this case.

Yes I know, but I can test PS immediately:-)
BR
Michal

Re: Positional sensing testing

PostPosted: Sat May 08, 2010 11:54 pm
by Ken Forgettable
YeeeeaAHHH,
It seems to me that there are 3 terminating conditions:
1. peak detection.
2. threshold level.
and
3. zero crossing.
where option one is twice as fast as option 3.

FYI my DIY 14" single ply (at my medium to high tension) does indeed do a half wave in < 4ms :D

Re: Positional sensing testing

PostPosted: Sun May 09, 2010 1:21 am
by dmitri
I've made some improvements and updated the firmware in the first post.
Note, at the moment I'm doing all the positional sensing tests using a Roland PD-125X and a full wave precision rectifier. I will post schematics for the rectifier very soon, I just want to find best values for the resistors before posting them.

Re: Positional sensing testing

PostPosted: Sun May 09, 2010 9:03 am
by r0bbie
Hi Dmitri,

Great you continued working on this feature!!

Could you please explain what variation in waveform you are looking for to determen proper PS?
This might help me to setup/finetune my snare using my scope.

Thanks.

Rob.