Digitally controlled square tremolo with programmable pattern

Started by eeppeliteloop, November 11, 2010, 01:36:38 AM

Previous topic - Next topic

eeppeliteloop

Hi guys.

I'm new to this forum, but I really enjoy everything I read here! I'm a student in computer engineering (third year), so I'm not that good in electric engineering, but I try to do my best, reading a lot of documentation here and there.

Over the last weeks, I designed a guitar digitally controlled square tremolo, with a programmable pattern (steps creating a rhythm). Here are the schematics to this date : http://0x3b.org/img/sq_trem_v0.3.png.

I'm trying to keep the analog part to be as simple as possible. If you want me to change anything, please explain why so that I can at least learn a bit! Since I want a single-supplied circuit, I created a regulated virtual ground for audio. This seems to allow me to correctly use op-amps for buffering. The volume control is done using a digital potentiometer, controlled by the microcontroller. I'm using this instead of a simple "mute/demute" to eliminate clicks/pops, creating a smooth but fast volume envelope. The pot. wiper is sent to a buffer for short circuit protection (the wiper's max current is only a few milliamps), as this op-amp may be shorted at will (any other suggestion?). By using a DPDT footswitch, I think I'm achieving "true bypass".

The digital logic part is already done (of course I'm better at this). I'm waiting for the op-amps, the digital pot. and the voltage regulators from DigiKey. The op-amps are rail-to-rail and support a supply of ±2.5V. I think my guitar signal should not go out of this range (when I play really hard, my multimeter reads an rms voltage of about 0.3V).

Any suggestion?

Gurner

Your reasoning all seems sound but your schematic is hard to follow - to my eye it looks like a load of disjointed elements ...& if it wasn't for your accompanying text, I would have struggled to make head nor tail of it.

Re mute/demute - personally, I would have gone with a simple jfet with a square wave to the jfet gate - pops & clicks only happen when DC levels shift suddenly, but if everything is designed/biased correctly, you shouldn't get them.

Neverthesss, a digital pot is a rolls royce way of achieveing what you seek - one comment woulkd be since you've put in all this extra silicon, is don't stop at a square wave tremelo, if you modulate the digipot wiper from your mcu correctly (a lut in your code), you can get some sine wave tremelo-ing, sawtooth gng on etc etc.

You're fine with ±2.5V ....as you've already observed, most passive guitar pickups have small voltage output - a strat something like 250mV when plucked hard, and a humbucker about twice that - so plenty of headroom available.

cloudscapes

I once built something very similar. programable tremolo, etc. I used a vactrol instead of a digital pot or fet to keep the analog circuit isolated from the digital.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

eeppeliteloop

Thank you guys.

Gurner, sorry for my schematics, I don't quite a master schematics software yet... what do you propose me? TinyCAD? Also, of course I will eventually add features concerning the volume waveform. As you noted, since I put digitally controlled variable things in the circuit, it's only a matter of software modification (which I'm better at) if I want to change something to the sound behavior.

Also, why wouldn't I have a suddent DC level shift with a JFET? As I understand, you would only "cut" the hot signal when muting and not ground it to achieve silence? If it is so, I heard such a "floating" silence is not ideal and can dammage an amp. or a speaker.

Otherwise, thanks again.

Gurner

Quote from: eeppeliteloop on November 11, 2010, 08:02:52 AM

Also, why wouldn't I have a suddent DC level shift with a JFET? As I understand, you would only "cut" the hot signal when muting and not ground it to achieve silence? If it is so, I heard such a "floating" silence is not ideal and can dammage an amp. or a speaker.


Don't make the mistake of assuming that the only way to mute a signal, is to shunt it to true ground. You can shunt your AC signal away it to any convenient low impedance source (ie a well regulated supply line etc)  - if your virtual ground is well regulated (& by the looks of it - you're using a 2.5V regulator?), then you can simply simply shunt your AC signal to it.

For example...

JFET 'drain' leg connected to your signal line (ie somewhere mid-circuit where the quiescent DC level is at your virtual ground potential of  2.5V)

JFET 'Gate' leg connected to your MCU

JFET 'source' leg connected to your virtual ground (again at 2.5V)

When the Jfet is gated on/off, there is no abrupt DC level shift (becuase you've got 2.5V on both sides of the Jfet - you are shorting 2.5V DC to 2.5V DC),  but the AC signal still gets shunted away to your low impedance 2.5V line (virtual ground)

Note: For that arrangement above, you'd need to select a JFET that totally 'cuts off' with just 2.5V DC applied to the gate (either P Channel & take the gate to 5V, or N Channel & take the gate to 0V).

versus a digipot, a jfet is far cheaper,  much simpler, uses smaller pcb real estate & has lower current draw - plus if you get clever with your MCU & it has PWM, rather than slam/gate the JFET hard on/off, you could use the MCU PWM into an LPF & control the JFET gate voltage in the JFET's 'neither off no on region' for more sinusoisdal-esque tremolo. But hey, I understand you wanting to have a dabble with digipots - they're great fun to play with & offer a lot more 'easy to implement' creativity.

I don't know what you mean by floating silence - your whole circuit is going to be floating at 2.5V & when there's no AC signal...that's the quiescent DC level it will be at - this 2.5V is  obviously stripped away again by the DC blocking cap at the output of your circuit.

For schematics...I recommend Eagle (it's free for small projects)- one helluva steep learning curve (like the worst I've ever encountered of any software package in fact!), but worth it - one you've learnt how to make your own library parts, you're 'off to the races'.

eeppeliteloop

All right, thanks again.

I will try both solutions and see (actually, hear) the difference. By "floating", I meant having the signal completely disconnected (no shunted to virtual ground). I guess this is what happens when using something like a CD4016.

You guessed right assuming I want to play with digital pots. I think it's pretty fun. Any somewhat digital chip makes me happy :).

Also, your arguments for using a JFET do not convince me. As this is a personal project (just to have fun and learn), I just don't consider the "cost" parameter (when the difference is about 1-2$). I also do not really care about the amout of surface used by a JFET vs a digital pot... it's not like I lost a square inch. But I would surely consider all those parameters if I was to mass produce, so thanks for noticing me.

Have a good day,

PRR

> your schematic is hard to follow - to my eye it looks like a load of disjointed elements

It's power supplies, a CPU, and some analog glue.

> I don't quite a master schematics software yet...

soft-tip pen is as good as software, maybe better. 

As a weak-thinking AUDIO technician, I like to see audio input on the left flowing across to audio output on the right. Power-supply details off in a corner or a second sheet. And when very tired, I like to see volume pots drawn as volume pots (see most any guitar amp or pedal plan), top - wiper -ground up and down.

You have input near the middle going right through buffer to a pot drawn sideways. There's cryptic TLAs all over. It took a while to find and connect the dots SIG0 and SIG1. SIG1 goes over to the left edge and signal comes out the middle, almost. There's an eye-catching fish-hook rising out of the CPU here which turns out to be literally eye-catching but not part of the audio.

Once the breadcrumb trail is found and followed, it appears to (almost) do what you want. But by this point my dim mind was so tired I missed a big glitch.

I have to accept that you can program the CPU and wire the legs. Stuffing a bit-sequence out a port is fairly tame code.

GLITCH: you only have the one +5V supply? Then your audio path "idle" level must be referenced to half supply. You have a 2.5V point. But what is the DC idle level at the input of (and give key parts names, "IC1" or "fred" so's we can talk) your first audio opamp? Appears to be whatEVER wanders in the Audio In jack. Could be anything, is most likely zero volts DC. (I'll name it...) IC1 is a follower so its output is likely to be zero DC. With a positive signal it rises up using +5V power. With a negative signal it goes down below zero..... but there is no negative power source!

It's rail-to-rail, but you are asking to go outside zero and +5V rails.

Also IC1's output is (supposedly) zero V DC, but the other end of the pot it tied to +2.5V. As you turn the pot there's a big DC shift, thumping your audio.

You study general single-supply _AC/Audio_ amp plans. Input comes through a blocking cap. Amp input is biased through a large resistor to half-supply. Now you can swing 2V either way of that point. Your digi-pot will also reference half-supply. (There's an issue if IC1 follower action is not perfect, but this is a very minor thing.) When you are ready (after IC2) to go out of the box, you must block that 2.5V DC level with a blocking cap and bleed resistor.

This is all basic analog audio. Plagiarize single 9V pedal plans. The change from 9V/4.5V to 5V/2.5V does not change  the beasic ideas.
  • SUPPORTER

eeppeliteloop

Thank you for your time, PRR.

As you noticed, I'm not that good in schematics. I'll try to learn and use softwares you suggest me as of now. I guess what you missed in my schematics (because of my poor talent and knowledge) was that I have two grounds: the "real" one, which is a reversed triangle, and the "virtual" one (connected to +2.5V) is a reversed triangle with a 'v' subscript. So: the audio is referenced to virtual ground so that it swings around it, being the middle point between +5V and 0V in the op-amps and for the digital potentiometer.

I understand this plan is plain shite..! I think I'm able to read it because I drew it, but otherwise it's very hard to follow, the signal path randomly switching from right to left. Sorry about that; should have drawn a better one before asking for a review!