Using sample-and-hold for 100% analog tap-tempo?

Started by earthtonesaudio, August 29, 2008, 01:15:21 PM

Previous topic - Next topic

earthtonesaudio

In particular the ramp-and-hold variety such as can be found in National Semi's AN-72, figures 85 and 86.

Seems like you could just set the ramp slope to a convenient value with a resistor and then the voltage would be dependent on how long you held down a spst momentary switch.  So not really "tap" tempo, but more like "hold for tempo time."

So I'm wondering if anyone has tried this and also what is the maximum "hold" time of a circuit like this?  Could it hold the output voltage steady for minutes? Hours? 
There's a little snippet at the end of the accompanying text that says something about using an extra "loop" to maintain the Vout condition.  That sounds like what I want but I have no idea how to do it.  Any help would be great!  I know a microcontroller would be easier, but all-analog would have much more mojo.

The link:
http://www.national.com/an/AN/AN-72.pdf

bioroids

Supose you succeed at obtaning the voltage proportional to the amount of time the switch is hold.
How does that voltage translate to a delay time that corresponds to that amount of time? (I assume you want a tap-tempo delay). That I think is the hardest part...

Greetings

Miguel
Eramos tan pobres!

The Tone God

The problem has never really been how to find the rate of tap which is the only thing you have looked at this point. It is the interface of the rate of tap to the effect's parameter control that is the issue. It is VERY difficult to calibrate the tap time to the parameter.

In the world of control circuitry analog "mojo" means squat. There is a reason why the microcontroller is almost always the answer to this problem. It is the better if not the correct technology to use.

Andrew

Paul Perry (Frostwave)

All the purely analog solutions I can think of, involve ultra low leakage caps and awkward high-precision analog voltage dividers.
(unless you cheat by using a pair of binary counter chips & having one as a "memory"!* but really, it is indeed a problem that screams PIC)

*what I mean here, is that when the period starts, the clocks start to count pulses from a 100KHz oscillator. Then when the period end is signalled, the clocks stop, and one counts backwards to give the next period, then reloads from the 'memory' clock.

R.G.

It's not like smart people haven't thought about that one for a long time.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

frequencycentral

Damn! .........I thought there was some really little guy inside clicking his fingers................ :icon_lol:
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

StephenGiles

Quote from: frequencycentral on August 30, 2008, 04:15:41 AM
Damn! .........I thought there was some really little guy inside clicking his fingers................ :icon_lol:

That's what I thought!

Think about the word "thought" - who in their right mind would invent such a word pronounced thawt, and spell it like that?? ::)
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

earthtonesaudio

The interface shouldn't be too hard.  Just PWM an LED.

R.G.

QuoteThe interface shouldn't be too hard.  Just PWM an LED.

You're right - it should not be hard. But in the face of such wishful expectation, Mother Nature seems to say that in fact, it is.

Here's the dreary reality behind your PWM an LED approach.

1. Presumably the LED is controlling something that then controls the whatever you're doing tap-tempo for. What exactly is that something? How does it then control the whatever? It's probably an oscillator, either LFO (for tremolo) or ultrasonic (for delays). In which case, you have to worry about the next step in conversion - how much circuitry is needed to convert either an LED frequency or a light intensity into just the right LFO or HFO to make the delay come out to be what you tapped in?

2. Given that you can make up that amount of circuitry (its a bit more than a television sweep circuit or a radar range gate, which do similar things, or used to when they were analog) what is its accuracy? That is, when you tap in 0.75 seconds, does the LFO or resulting delay equal 0.75 seconds? Is it instead 0.743S or 0.76S, which are probably OK, or worse 0.62S to 0.95S, which are completely unusable? Linearity matters A LOT in a circuit where you're expecting the circuit to reproduce the rhythm you are tapping in. If you get out, for example, always 0.8 times what you tap in, then you can turn up the internal gain by 1.0/0.8 and have done with it.

But if the "correction factor" needed is different for different times, you cannot apply a correction internally. The human tapping will have to know that short taps aways come out even shorter, mid-side taps come out longer, and long taps come out shorter again, and try to correct for it. Humans are in fact GREAT at doing that kind of thing by long practice; unfortunately, the whole purpose of a tap tempo is to not make the human have to mess with the controls, and now we have them in the middle of it, and a complicated one, not a knob.

3. That nonlinearity thing is a problem at every step. How linear is your tap-to-ramp period? Probably very good indeed. And how good is your ramp period to PWM conversion? Probably OK. How about PWM to light intensity? Probably OK again. Light to LDR? Terrible. Light-to-frequency? Medium to terrible, depending on the method. And for the things that are just OK, moderate or terrible, do the nonlinearities offset one another, or add? Or BOTH offset AND add at different points on the control?

Before microcontrollers, linearity was the Holy Grail of control structures. The controls guys who could linearize stuff down to the point where the remaining nonlinearities didn't matter were the the Big Dudes of the systems world. They made huge salaries for squashing out nonlinearities with a whole toolbox of tricks which got ensconced in weighty textbooks. When the $20, then the $5, then the $1 microcontroller entered the world, the Top Guns were suddenly tap dancing for a living. Microcontrollers let you linearize essentially anything you can describe, even - and especially - if the description can be made in a table of numbers inside the uC. Industry took one look at zillion dollar linearization circuits and uCs and never looked back. Microcontrollers ARE the elegant, genius-like step sideways outside the box that lets these kinds of things work. 

So, bottom line time.
1. Can someone design an all-analog tap tempo controller that works OK?
Yes. It's been done backwards with analog radar sets.
2. Can someone design an all analog tap tempo controller that fits inside a stompbox?
Probably. Surface mount lets you get a lot of stuff inside these things. But it's definitely maybe, not "yes, sure".
3. Can YOU design an all analog tap tempo controller that fits inside a stompbox?
I don't know. I think I might be able to, but I also assess it as a "just barely, maybe" not a "yes, sure".

I also know that I will not do so. I would (and have done) take one look at the requirements, and reach over into the cabinet for a $1.50 PIC or AVR and have the code running tomorrow.

I do not mean to be harsh, and I do not mean to be picking on you. I'm trying to save you a lot of trouble, expense, and frustration that I think would go along with a serious effort to design one of these. I could be full of it, and sometimes am. But this is really meant as friendly advice explaining what I think is a deeper topic than you may have dug so far.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

SISKO

Thats why an expression pedal controlling the delay time is soo usefull  :icon_lol:
Very nice post RG
--Is there any body out there??--

earthtonesaudio

Thanks for your input so far, everybody.  Sorry if my initial post and response came off overly naive and/or %^&*y.  I know people have asked "is there an easy DIY tap tempo for the Rebote?" and I know there's not.  But I still want to do it without a microcontroller.  I'll have to check out that radar thing by the way, that sounds neat.

Basically I want to make my own tap-tempo for my Fab Echo (based on the PT2399 like the Rebote and Echo Base).  I already have it modded so the delay time is controlled by an LED/LDR combo and a potentiometer in parallel (potentiometer sets max resistance, LDR can make it less) so the output of my tap tempo will have to be a PWM if I want to have a shred of hope for linearity, in that stage anyway.

Linearity is not a huge concern for me ...yet.  The LDR I'm using is linear enough that I can't perceive any nonlinearity.  I figure I can fine tune at the LED/LDR end by adjusting the rise/fall times of the pulse or building in some frequency dependent limiting. You know, trimpots and fine-tuning to the specific device used, that sort of thing.  A no-go for mass production, but okay for DIY.  So that part is on the back burner.  

The first hurdle I'm focusing on is the actual sample-hold circuit, and the footswitch.  The ramp and hold circuit works pretty well, but the up and down ramps aren't exactly the same speed, so I'm thinking of using dual ramp circuits, and using only the "ramp up" of each one, and tuning the "ramp down" to be near-instantaneous, which would work better anyway.  So then it becomes more of a switching problem.  So I need a heavy duty momentary switch to simultaneously switch four inputs AND keep holding it down to ramp up voltage.  I think there's a circuit to make a triggered flip-flop with a single amp on an LM3900, so that brings the tally up to one or two chips.

Next is the VCO/PWM circuitry, and I'm confident I can do that with another dual or quad op-amp.


Anyway, I appreciate the advice so far, and I'm sure someone looking for an "easy DIY tap tempo" will benefit from this thread and go straight for the microcontroller.  But I'm not looking for the easy, or even necessarily a good solution.  I just want to see if I can do it.  


earthtonesaudio

Alright, if the flip-flop doesn't bounce, and if the PWM I'm planning on using works, I think I can get it done with two chips, plus one amp left over for buffering the 1/2 voltage supply.  After that it's the hard part that R.G. and everyone was warning about, the whole linearity/interface business.

earthtonesaudio

Refined the basic idea:

1. Active-low spst switch with r-c debouncing
2. into inverting schmitt trigger (1/4 of an LM3900 chip, i.e. one amp)
3. fan out into: (a) flip flop (2 amps), which outputs into the ramp down inputs (2 amps) (which are biased by one more amp);
and (b) both ramp-up inputs with series diode "gates" to prevent the "off" position of the schmitt trigger from bleeding through (output of the trigger doesn't quite go down to zero volts).
4. Output of both ramp-hold circuits are mixed with resistors into a voltage controlled pwm (one amp), which feeds the LED.
4. (alternate) voltage output could go to some effect which requires a CV input.

That brings the tally up to 7 amps, or two LM3900 chips with one amplifier unused.

Putting it all together... not quite yet, but I'm getting there.  Dealing with currents instead of voltages takes more thought.

bioroids

This is a little over my head, but about the led, I reccomend you to use waterclear with high brigthness (6000mC) for a wider range of sweep.

It will take a lot of tweaking in any case, and I don't know if it's is possible to achieve a usefull amount of timing exactitude with the optocoupler aproach, but go for it anyway!

Greetings

Miguel

Eramos tan pobres!

earthtonesaudio

Very true, high efficiency LEDs are always a must in my book, usually mainly for power consumption reasons.

I'm not sure, but I think that the PWM will source and sink current equally well up to 10mA or so, so it might be possible to get out-of phase LED dimming with one connected to +V and the other to ground... not useful for this project, but potentially something else in the future.


Step 1: tweaking the switch debounce/Schmitt trigger section.  Hopefully I'll get to spend some time on it tonight.  If it proves too tricky with the Norton amp, I'm not too proud to move some of the circuit duties to a regular op-amp or comparator type chip.  Time will tell.

R.G.

Go get yourself a couple of CD40106 or 74C14 CMOS hex schmitt trigger inverters for switch debouncing.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

earthtonesaudio

Part of my aesthetic vision for this project is to use as few chips as possible (excluding a single microcontroller chip, of course), so I was happy that making a schmitt trigger out of one of the LM3900 amps wasn't too hard.

I've been slogging away at this and I've got the switch/trigger working and adjusted right, and the flip-flop, and the ramp-hold circuits.  I was able to get away with one amplifier to bias both the ramp amplifiers, and a single trimpot, nice.

Next up is a low, regulated voltage for the slow ramp inputs, and of course the voltage-controlled pwm is lurking on the horizon.

earthtonesaudio

I was just looking at the ASMOP article on GEO, and it occurred to me that, since I'm planning on producing a PWM output signal anyway, the switched resistor might be a lot easier to adjust than an optocoupler.  I hadn't seen that article before.  Thanks, R.G.!

Paul Perry (Frostwave)

I find it difficult to get a very wide range with PWM methods. Look at it this way - a 1000 to 1 range is not much, for many applications. But, if your PWM is operating at 100KHz, then when it is at 1/1000, the pulse is going to be only one hundred millionth of a second, if my maths is right.
And that pulse needs to be a proper rectangle.. and any analog switch is going to have to respond significantly faster than that.. we are getting well up into RF regions there.
To say nothing of the need to keep any noise out of the circuitry.

earthtonesaudio

I think I understand what you mean... like if the resistance of the pot I'm using goes from 100 ohms to 100k ohms, then it's a 1:1000 ratio, right?  That's a good thing to keep in mind for a lot of PWM applications.

But for the application I'm thinking of (100k resistor to ground in a Rebote-style delay) the actual useful range for play-along tempo has to be a lot less than that.  Maybe 10k to 100k, a 1:10 ratio.  Less than 10k in my Fab Echo is way faster than you could possibly tap your foot.

I'm not too familiar with the "switched resistor" approach, so I don't know much about its limitations in terms of speed vs. performance... I suppose if it's not practical to use the 3900's output itself to switch, then it wouldn't help much to use a 4066, cause it's not gonna make it any faster... Based on the slew rate, I figure the max useful frequency at 9V to be around 30kHz.  Also I plan on housing this thing in its own enclosure.