Wednesday, July 22, 2009

Rebuilding a Super Psycho

A couple of years ago I bought a partially completed Catgirl Synth Super Psycho LFO from someone. The circuit board itself was complete, but none of the panel connections had been made. The person who built it had bought a panel for it from Cynthia, and all of the panel components, still in the bags, came with it.

I set about completing the build, and ran into a problem: This board has a zillion connections to the panel, and when I did the soldering, a couple of pads lifted off of the board. No biggie, I thought at the time; I put in a few jumpers to bypass the damaged pads and completed the build.


Well, when I started testing, a lot of things were flaky. Some of the oscillators worked some of the time and not at other times. There were lots of random oscillation rate changes. When I investigated, I found several other pads that had lifted when the original builder was soldering in the parts. And I noticed that the original builder had had to put in a few bypass jumpers himself. When I set about unsoldering a few parts so I could put in more jumpers, more pads lifted! Pretty much anyplace where the copper wasn't covered with solder mask, it was coming off.

I finally threw in the towel. I ordered a new board from CGS, and Tuesday night, I set about stripping the parts from the old board. Here is what I started with:




I started by just cutting all of the lines to the panel. It was a big rat's nest anyway. When I put it back together, I'm going to put headers on the board and use MTA-100 connectors to connect the panel wiring, a la Dotcom.




Big pile of indicator LEDs, which I never secured to the panel. They are a mix of white, blue, and violet types. Obtained from lsdiodes.com (RIP).




The board, ready to strip. The original builder was nice enough to socket all of the ICs. Most of the panel connections, now cut, were along the bottom edge.




The solder side of the board. Note the numerous workarounds and hacks, including the cap hanging off the board:




A bunch more of the pads came up as I was desoldering. I don't know what happened to this one; I've never seen a circuit board shed copper so badly. Although I wasn't being quite as careful as I would be when soldering normally, I certainly wasn't trying to be destructive, and I don't think I used excessive heat on anything. Nonetheless, this is what happened:




So the board's obviously a goner. At this point, I've removed everything except the resistors:




Below: the new board, together with the old. The new one is a rev 2 which accounts for the slightly larger size and somewhat different layout.





Why didn't I remove the resistors? Lot of trouble. I just laid in a large stock of resistors, so I'll probably assemble the new board from my stock. I'll only go back to the old board for a resistor if I don't have one of the right value. I got everything else off the board: capacitors, transistors, ferrite beads, IC sockets, and the MTA-156 power connector. I'm not sure if I'll be able to reuse that last item; those MTA headers always get distorted and the pins come loose if you apply too much heat to them, and owing to the size of the pins it's hard to desolder one without using lots of heat. I damaged one of the IC sockets; I may replace them all anyway, just in case. Everthing else that survived will be re-used; I'll test the caps and transistors first.

Here is the panel. (EDIT: It's right side up now.) The panel is obviously from Cynthia, although the circuit board is not. I've done a couple of things to the panel: the stock Cynthia design has hi/low speed switches for oscillators 1, 2, 5, and 6, but the square/triangle switches occupy those positions for oscs 3 and 4. I've added speed switches for those two oscs, which are on the left. I changed the banana jacks for 1/4" jacks, since most of my stuff is MOTM and Dotcom.





Before I put it all back together, I'm contemplating some mods. The first thing I want to do is add control voltage capability for the osc rates. You'll note that the Cynthia panel has a jack for this. However, the circuitry isn't on the stock CGS board. On the version of the Super Psycho they sell, Cynthia adds a mod that uses vactrols to add CV capability to the oscillators. I'm going to do that too, but I may make some changes. I want to do the same basic thing, but I'm not sure if I'm going to use vactrols or a Fairchild optoisolator IC. I've got some Fairchild H11F1's, which I'm going to experiment with; I've read that their response curve is not very linear. Since I bought those, Fairchild has released a bunch of new parts, some of which are specifically labeled as being for analog applications. If I'm not happy with the H11F1's, I may order some of those and give them a try. (Note that Fairchild has since discontinued the H11F1.) Why not just use vactrols? Well, I do have some 5C3/2's on hand. But six vactrols takes up a lot of room on the circuit board, and the design of the oscillator circuits necessitates having a separate optoisolator channel for each oscillator.

Where will that board go? Well, I'm going to build an auxiliary panel. That panel will have a daughter board on standoffs, which will contain all necessary circuitry for my mods. And since I have extra panel space, I'm going to extend things a bit. Since each oscillator has to have its own optoisolator channel to have CV capability, instead of just one CV input, I'm going to have two, and each oscillator will have a switch to select CV input A, B, or neither. The extra switches and jacks will go on the auxiliary panel.

The other idea in my mind is to provide some capability to split out some of the oscillators. At first, I thought about just providing individual outs for each oscillator. I can pick off the individual signals from the main board, but they aren't well buffered. And anyway, I thought of something that will be more fun: the ability to have a second mix output, which individual oscs can be added to or removed from at will. The controls and the output will be on the auxiliary panel. I'm not sure how I want to do it yet: should I just have switches to choose one output or the other for each oscillator? Or should I have pots to mix the oscs into a second mix out? I'll have to think about that bit a little more. I might also add a DC offset capability to the second mix.


Saturday, July 18, 2009

It's all VSE's fault

Remember this photo I put in my last blog post?


Something's wrong with this picture. And it was about to cause me a bunch of extra work. We'll revisit this...

I received the MTA-156 connectors from Mouser and made the harnesses to connect the +5V supply to the distro board, like so:

The DC output:



The AC input:



Here's the completed wiring to the distro board. The jumper wire is tying the returns together for the two supplies:



Next, I soldered the AC-side connections. For this module, I used 18-gauge zip cord as the power cord. On past modules, I've use 16-gauge, but that's really overkill; these things don't draw much power. Below you see the fuse holder, which is connected to the AC hot; the neutral is connected directly to the transformer, and there are some jumpers per Condor's installation instructions. There are also smaller jumpers that go over to the +5 supply. In the photo, the connections are complete, and I'm gooping all of the exposed terminals with insulating RTV.



The connections are complete, and I'm about to install the fuse. I'll start with a 0.25A fuse. Note the cable staple retaining the end of the power cord on the base.



Putting a plug on the end of the cord, being careful to get the hot side of the cord on the correct prong. (The hot side is the brass screw; the neutral side is the silver screw.) This is an "old fashioned" one that uses screw terminals; I don't trust the quick-connect plugs. In the second photo, note the built-in grommet for strain relief.




Now, it's time to test. But first, let's go back and look at something again. Remember from the last post, when I said that I always wire the +15 with a red wire, and the -15 with a green wire? Well, note carefully the silkscreen designation next to the red wire below.



Yes, I connected them backwards. And no, I didn't catch it before I powered it on. And yes, the smoke test succeeded -- in producing smoke. When I applied power the first time, I got nothing. Checking, I found that the fuse was open. It didn't appear to be actually blown, so I figured it was a defective fuse. I didn't have another 0.25A one, so I put in the next highest amperage I had, which was a 0.75A. I powered it up and I was initially encouraged to see voltage. But then I was puzzled as to why my voltmeter was indicating a negative voltage when I had it connected to the +15 side. Then the voltage started to drop. Then I heard a fizzing noise and saw smoke coming from the distro board's filter caps...

The result. Note the capacitor in the center, and compare to the one on the right. (The one on the right is for the +5V, which wasn't effected.)



So I had to replace them. 330 uF, which of course I don't have. Another order to Mouser. While I was at it, I ordered 35V, 105C types (the originals were 25V). Here, the two failed ones have been replaced; note that they are a bit taller than the remaining original:



Screw the distro board back down, power it up, and everything works. I didn't even have to adjust the voltages; they were all dead on.

Here's the (nearly) completed Block 4, with an MOTM-820 VC lag processor installed. The slot to the left of it is awaiting my MOTM-650. I still need to put on the top, but that's easy; it's just another piece of wood, held on with Velcro at the corners.



So why did I forget to verify the power supply connections? Probably because, just before I worked on it, I was reading this VSE thread on stupid accidents with gear. They jinxed me.

Sunday, July 5, 2009

Continuing on Discombobulator Block 4

The adhesive is dry and the bottom rail is secure on the base. Time to add the side rails and the rear posts. I drive in flat-head screws through the bottom of the base (after drilling pilot holes first).




A couple of brads from the nail gun keep the side rails and rear posts from wanting to rotate.




At this point, all the woodwork is complete, except that I haven't put the top rail on yet:




Now it's time to add the power components. The three items you see here are: at left rear, the tall item is a Condor dual-voltage linear power supply that will provide the ±15V. The small object in front of it is the +5V switching supply. This is a return to the power supply configuration that I used for block 1. For blocks 2 and 3; I used a Condor triple-voltage linear to supply all three voltages, but the tri-voltage supply is large, heavy, and expensive, and I haven't noticed any difference in audio quality using a linear for the +5V vs. using a switcher. (Most modules, if they use +5 at all, will use it for noisy things like logic circuits or LEDs anyway.) At right is the MOTM-990 triple-voltage distribution board:




The Condor has posts for soldering on the wires to connect it to the distribution board. Below, the soldering is done: the red wire is the +15V, the green is the -15V, and the black is the return. Note in the photo above that the distribution board has terminals at both ends. You want to make sure you put the power in at the end of the board where the filter caps are; the terminals at the other end are for expansion. The photo below shows this. The MOTM-990 board is new to me; all of the previous Discombobulator blocks used a MOTM-960 for the ±15V, and a separate terminal strip for the +5V. That's kind of a pain in the rear to connect if you need the +5. One of the modules intended to go into this block is an MOTM-650 MIDI interface, which is one of the new series of MOTM modules that needs +5, and it will come with the six-pin power cable that mates with the 990.




A closeup of the +5V switcher. I didn't know until I unwrapped it that it needs a three-position MTA-156 connector for the AC input, and a two-position MTA-156 to connect the output. I considered just soldering directly to the header pins, but thought better of that. Unfortunately, the only MTA-156 connectors I have on hand at the moment are four-position. Yes, I know I can just let them hang off the ends, but I want this to be a clean installation. So off to Mouser to order some. And until they come in next week, I'm at a stopping point on the electrical work.




Now to put on the top rail. The distance between the bottom and top rails is a critical measurement. It needs to be just barely tall enough to allow the stiffening tabs on a Dotcom-format module to slip in between. If it's more than about 1/4-inch taller than that, the mounting holes on MOTM modules won't line up with the rails. And if it's short, of course, Dotcom modules won't fit. So I test-fit before I put the top rail on:




It turns out my side rails are very slightly short, about 1/16 inch. So for spacing, I'll insert these little split lock washers in between the side rail and the top rail; the mounting screw will hold it in place.




Here's the result; a pilot hole is drilled through the top rail and then into the end of the side rail, and a flat-head screw driven. Later, a piece of Velcro will go over the screw to hold the top on, which is why we use a flat-head screw that can be turned down flush.




And the Dotcom module just fits:




Meanwhile, my supervisor DJ keeps a close eye on things. Or not.

Thursday, July 2, 2009

Discombobulator, Block 4

Started construction on the fourth block of the Discombobulator modular. With an MOTM-650 and a couple of other things on the way, plus wanting to build some of my own panels, it's time for more space.

I started with pieces that I pre-cut some time ago and put away, at the time I built block 3. The basic frame consists of five pieces -- a plywood base, a bottom rail, two side rails, and the top rail. This is what it will look like when it's done:



It's hard to see in the photo above, but the bottom rail is shorter than the top rail. The ends of the side rails are on the base, with the sides butted up against the ends of the bottom rail. This way, the bottom rail helps stabilize the side rails a bit. The top rail sits on top of the upper ends of the side rails. When it's done, modules will be fastened to the top and bottom rails, by drilling holes in the faces of the rails wherever needed, and using wood screws. The power supplies and distribution will be fastened to the base, behind the modules.

It begins with gluing the bottom rail to the base. A nice bead of construction adhesive:



Press it on there and clamp it down. It's centered at the front edge; there's a clamp on the base at each end to keep it from wanting to slide sideways while the adhesive is setting up.



Admittedly it's not much to look at so far.

Sunday, June 28, 2009

Updating Akai MPD24 Firmware

Two weeks ago, I set out to do something that I thought was going to be simple: update the firmware on my Akai MPD24. Mine still had 1.05, which is what it came with from the factory. I wanted to update to the latest, 1.10, mainly to get a new feature of this version: the ability to set the transport buttons to send MIDI Continuous Controller commands instead of MIDI Machine Control (which, for reasons not clear to me, hardly any DAW software recognizes). This all started because several weeks ago, I was asked to record a spoken-word piece for someone on VSE. While in the process of doing this, I kept having to run back and forth to the computer to start and stop recording -- it would have been a lot easier if I could have taken the MPD24 over to the mic location, which I could have done easily, and used its transport controls.

Anyway... I thought this was going to be pretty easy. Akai has a software package called Vyzex, which can edit MPD24 presets and also has a function for downloading arbitrary sysex (the firmware update comes in the form of one, very long sysex string). Both PC and Mac OSX versions are available. I downloaded the Mac version of Vyzex, installed it, downloaded the firmware update, fired up Vyzex, and sent the update. And... it didn't work. The data appeared to be sending too fast for the MPD24; it would stop receiving data mid-update, at some random point which was different each time. At first I thought it had to do with the USB hub I was using, so I tried my other one. No difference. Then I tried bypassing the hub and plugging it directly into one of the USB ports in the back of the Mac. That didn't work either. Bad USB cable? I tried a different one. No difference.

I then tried slowing down the transmission using some rate throttling parameters in Vyzex. They were hard to figure out, but I managed to figure out how to get some delays put in. No help. I went through the routine with the different USB ports and cables again, with no results.

So at this point I figured maybe I needed to try using my laptop PC for the update. It certainly wouldn't be the first time a vendor released a "dual platform" app with a botched Mac version. Oops... the old boot ROMs on my MPD24 aren't compatible with the Vista SP1 USB class driver. So Vyzex couldn't find the MPD24 port. So I started thinking: Since the firmware update was in the form of a big sysex, couldn't it be sent using the actual MIDI ports on the MPD24? I got out my little Edirol 1x1 interface, connected its USB to the laptop, and its MIDI connections to the MPD24.

And downloaded. It took a while at MIDI cable speeds, but eventually it finished, and the display told me it was done and to press ENTER to bring up the new firmware. So I pressed ENTER and... nothing. Absolutely nothing happened. It just sat there, telling me to press ENTER. I figured maybe it just needed to be power cycled at this point, but when I did so, it went back to asking for an update again.

Of which I should elaborate on... the update process for the MPD24 begins with erasing the existing firmware from its flash memory. So once you've done this, the MPD24 is unusuable until you succeed at getting a firmware update loaded. So at this point, my MPD24 was bricked. After a bunch of Googling, I found a post claiming that the MIDI cable method could be made to work by switching from USB power to external power after the update loads. I got a universal, voltage-selectable wall wart (which I normally use with my Roland DR-202 drum box) and connected it after the update finished, disconnected the USB, and pressed ENTER. Nothing.

At this point I was desparate. I decided to try some different software. I tried a bunch of things -- using my DAW (Metro) on the Mac, a version of Uniquest on the PC, another PC freeware application. Nothing helped. I even considered writing my own app on the Mac just to do this, but I eventually convinced myself that the software that was doing the sending wasn't the problem. After all, it really doesn't have to do much -- open a port, send one sysex string to it. The problem seemed to be in the connections to the MPD24. But I had tried all kinds of connection combinations.

Out of sheer desparation, I decided to try something random. Because my printer is away from the Mac, I have a USB cord with an extender to reach it. With the extender, the cord is actually a few feet longer than the maximum length allowed in the USB standard. But it works with the printer. I decided to try that one. Going back to Vyzex on the Mac, I sent the sysex without any special parameter settings. It ran and at the end, the MPD24's display showed "ERROR 0010", and the "press ENTER" light lit on the display. Well, at least this was different. I pressed ENTER, prepared to try something else, and...

The new firmware came up! I checked in the global edit mode and verified that 1.10 was running. Then I went to edit the transport controls. This part of the code appears to be a quick-n-dirty hack; when you go into edit mode and then press a transport key, it tells you to press ENTER. When you do, the display goes blank. To change the controls from MIDI machine control mode to MIDI CC mode, you turn the data knob to the right; to change it back, you turn it to the left. The display gives you no indication of what mode you have selected while in edit mode. To verify it, you go back to preset mode, press a transport button, and then look at the display to see what it sent. Unlike all of the other controls on the MPD24, you have no choice as to what CC sequences it sends; they are fixed in the CC mode. Fortunately, Akai chose some CC numbers high in the range that are seldom used, and I had no conflicts. The CC numbers used are:

  • Reverse: 115
  • Forward: 116
  • Stop: 117
  • Play: 118
  • Record: 119

So that was quite an adventure. And I'm not sure what the lesson is, other than that before you do a firmware update on your MPD24, you should think long and hard about whether you really need the features of the firmware update, considering that there appears to be a non-trivial chance that you could wind up with a bricked unit. Doing some further reading on the net, it appears that the only reliable platforms for doing the update with are a Windows machine running XP, or a Mac running OSX 10.4. Apparently, with Windows 98/2000/Me, there is a driver incompatibility that will blue-screen the computer if the MPD24's USB is connected to it; Vista cannot see the boot port on MPD24's with older boot ROMs, and there is some kind of port compatibility problem with OSX 10.5. (Some users report that they have been able to do the update with OSX 10.5 by using Sysex Librarian. Note that there is a problem with 10.5.6 in which Audio Midi Setup will see the MPD24 itself, but not its external MIDI ports.)

Sunday, June 14, 2009

Unbalanced Diode Mixer

I've just posted a Youtube video of a circuit I built -- a signal modulator based on an RF unbalanced diode mixer. This circuit uses the small non-linear response area of a single diode to create combinations of sum and difference frequencies of two input signals (or one input signal containing multiple overtones). Radio designers use this type of circuit to "downconvert" received RF signals to a lower intermediate frequency, which makes it a lot easier to design the radio's signal processing circuitry. We can use the same circuit for electronic music to generate non-harmonic overtones. (In the RF circuitry literature, there is a class of related circuits that all use diodes to do frequency mixing functions. What we call a "ring modulator" originated as a more sophisticated version of the circuit presented here.)

Note that this circuit is not a clipping circuit. We are not allowing the input signal to make excursions to either the fully-off or fully-on regions of the diode's response. All of the effects you hear on the video stem from the signal being in the diode's non-linear response corner. If you watch the scope in the video, you will notice that there is no clipping visible.

Here is a schematic of the circuit, as built. Double click to see a larger version:


How it works: The two 33K resistors serve as a passive audio combiner (okay, a mixer, but don't let that usage get you confused). The 100K pot is used to reduce the signal to a low level; the circuit is designed to take signals at up to modular-synth voltage ranges. The pot has to trim the input level down to the neighborhood of 0.2V peak-to-peak. In the center of the circuit, the 22K and 220 ohm resistors and the 5K pot form a voltage divider, which adds an offset voltage to the signal passing into that part of the circuit through the leftmost capacitor.

The 5K pot is used to trim the voltage divider to about 0.5V, which puts it in the center of the "corner" area of the diode's response, which ranges from about 0.35V up to the 0.65V level at which the diode is fully conducting. The input signal, if properly attenuated, will be 0.4 to 0.6V peak-to-peak when added to this offset. It then excites the non-linear response range of the diode, generating various sum and difference frequencies.

The opamp is just to boost the signal back up to modular voltage levels. The cap on the right keeps the DC offset out of the opamp's input. The two resistors in the feedback loop set the opamp's gain at 10. The 100K resistor on the input is to bleed off the opamp's input leakage current, which would create a DC offset in the output otherwise (found this out the hard way). There is no particular reason why I used a LM358, other than that's what I had; a TL07x would probably do just as well.

There are a couple of things that I would have done differently if I had had the parts available. Both of the pots had little useable adjustment range, and the input attenuator really needs an audio taper pot. Before I built the circuit, I had calculated 50K for that pot, which might still be too much. The bottom end of the voltage divider was supposed to consist of a 400-ohm fixed resistor and a 1K pot. A 220-ohm resistor was the nearest value I had for the fixed resistor; with that value, the pot is right at 1K for 0.5V, and some of the pot's range is above the diode's conducting voltage at 0.65V. The 4.7 uF DC blocking caps are a bit large; when the voltage divider is adjusted, it takes the circuit several seconds to settle down.

Here's the breadboard. Signal flow is from right to left:



Next step: panelize this. I'll built it on a piece of stripboard, and figure out a way to mount it to a panel. The panel will have two inputs and one output. Controls will consist of the input attenuation and voltage divider adjustment; I might put in a bar graph display for the latter.

Monday, June 8, 2009

Electricity for Synth-DIY'ers: Diodes

At this point in the series, we leave the old-school electrical engineers' world of resistors and capacitors and inductors, and begin to delve into semiconductor devices. The word "semiconductor" is somewhat of a misnomer, and over the years it has dragged many EE students down a wrong path; it suggests a material that conducts electricity, just not very well. The truth is, a semiconductor may conduct electricity very well, or not at all, or anything in between -- depending on the circumstances of the moment.

A semiconductor consists of a base material to which a certain amount of an impurity has been added. The pure base material is often an insulator; for example, silicon (still the most common base material for semiconductor devices) is a very good insulator in its pure form. When small amount of impurities such as phosphorous or arsenic are added to silcon, it becomes a semiconductor.

Semiconductor materials are divided into two categories, referred to as positive or P-type, and negative or N-type. There is a temptation to assume that "positive" and "negative" in these definitions mean something like the poles of a battery, where the materials have an indicated electric charge. That is incorrect; P-type and N-type refer to how the two types of materials conduct electricity internally. When they aren't in a working device, P-type and N-type semiconductors are neutral in charge. (I'm not going to go into semiconductor physics here. It's way too big a topic. Maybe later.)

Diodes

A diode is a semiconductor device that consists of a slab of P-type semiconductor material joined to a slab of N-type material. The interface where the two types of materials join is usually called the junction, and it is what happens at the junction that gives the diode its properties. Basically, any time you join a piece of P-type to a piece of N-type, the junction has a very strong preference to allow current to flow in one direction versus the other. In fact, it acts like a one-way valve for electricity: conventional current will flow from the P-type end to the N-type end, but not (usually) in the other direction. The symbol for a diode in electrical schematics looks like this:



The arrow points in the direction that conventional current will flow through the diode. Here are a few small-signal diodes:





The glass casing is not uncommon in diodes. The band around one end indicates which end is the negative end (where the current comes out). This end is sometimes referred to as the "cathode", a term that got carried over from vacuum-tube techology. (In fact, the word "diode" itself was also borrowed from the vacuum-tube equivalent.)

The first and most obvious use for a diode is as a rectifier, a device that changes alternating currrent into direct current. Power distribution uses the form of alternating current; however, electronics circuits usually require direct current power supplies, so the first place where diodes are generally found will be in the power supply. Here's an example of a very simple, unregulated power supply:



The transformer changes the distribution voltage into the voltage that we need to power our circuit; note that this must take place before the rectification, since transformers don't work on DC. The diode allows only the positive-going half of the AC power to flow through; it blocks the negative-going half. Note that, although the diode removes the negative-going part of the AC waveform, by itself it does not have any means to produce a "smooth" DC output; its output will still look like an AC waveform with the bottom half chopped off. That gets fixed by putting a big capacitor in series with the diode; it stores up current during the positive half of the AC waveform, and releases it during the negative half, to produce a more or less constant DC voltage.


You may have notice the weasel wording in that last sentence. It's "more or less" smooth because the circuit above is only using half of the incoming AC waveform, and the capacitor has to store enough energy to bridge the gaps between the missing halves. This is called a "half-wave" rectifier for this reason. It isn't very efficient, and it is very difficult to prevent this design of power supply from having "ripple" in its output. What we need is a full-wave rectifier that will use both halves of the AC waveform. Here is an improved design with a full-wave rectifier:





Note the four diodes. This is called a "bridge" rectifier, and this is the way it's usually drawn, with the diodes in the diamond shape, to make it easy to spot in a schematic. Follow the directions that the current takes through the positive and negative halves of the incoming AC waveform, and you will see that the bridge not only lets through the positive half, but it also "turns around" the negative half and makes it positive. So this circuit has now filled in the waveform gaps that the half-wave rectifier created. Note that it still doesn't by itself produce a "flat" continuous output, so we still have to have the capacitors to make the output smooth and even. However, it's a lot easier to clean up this output than the half-wave's output. Although the output is still unregulated (output voltage will vary with the input voltage and the load on the output), it's a practical circuit, and in fact, most solid-state audio amplifiers from about 1960 to 1990 used this basic circuit, with a bit of additional filtering.


A similar use for diodes is in protecting circuits against incorrect voltages. For example, a common problem in battery-powered equipment is the user inserting the batteries backwards. A diode, in series with either the positive or negative terminal, will protect the circuit against reverse voltage. Similarly, in a circuit which takes a control voltage of only one polarity (such as the CV input on many VCAs), a diode prevents control voltage of the wrong polarity from causing the circuit to malfunction or damaging components.

Diode Clamp


A neat trick that you can do with a diode and a capacitor is offset an AC waveform so that it stays above or below the axis. It's a simple circuit:




Charge Pumps and Voltage Doublers


If you fully charge a capacitor, the voltage across it becomes equal to the charging voltage. If you can then switch the capacitor to be in series with another charged capacitor or other voltage source, you can achieve a higher output voltage until the capacitor discharges. Here's a trick circuit that, using diodes to do the switching, doubles the voltage of an AC source without using a transformer:



How this circuit works: On the positive half of the AC cycle, the voltage charges the upper capacitor, while the lower capacitor is isolated from the circuit by the diode. On the negative half of the cycle, the charged upper capacitor contributes its voltage to the AC voltage through its diode, while the lower capacitor gets charged. On the next positive-going half cycle, the lower capacitor contributes its voltage, while the upper capacitor gets recharged. The capacitors have to chosen so that they won't completely discharge before the half-cycle ends, in order to get a reasonably smooth waveform.

The concept can be extended to make a voltage tripler, quadrupler, etc.


Diode Drop and Schottky Diodes


We've implied above that a diode will begin to conduct whenever a forward voltage is applied to it. That isn't quite true; inherent in the physics of the P-N junction is a phemonen called diode drop. Basically, what the diode drop does is establish a constant voltage across the diode when current is flowing. If the voltage across the diode is less than the diode drop voltage, then current will not flow even though it is trying to go in the forward direction. The forward voltage must rise to higher than the diode drop before current will flow. Designers have to keep this in mind when designing a diode into a circuit.


The diode drop is a property of the semiconductor base material. For silicon, it is 0.6V. This is why, often, a modern digital multimeter will measure a perfectly good diode as being open -- it doesn't apply enough voltage to the diode to overcome the diode drop. Other types of base material have different diode drops; if you spend time inside of antique radio or certain guitar stomp box circuits, you will probably come across germanium diodes. These have a diode drop of about 0.2V.


You can use the diode drop to derive lower voltages from higher ones. For example, if you have a 5V power supply but need 3.2V for some new-fangled low-power IC, you can derive the voltage you need (assuming the IC doesn't need too much current) like this:





The three diodes in series give a total drop of 1.8V. At this point, you might ask, "what happened to Ohm's Law here? How can the diode always have the right resistance to produce exactly 0.6V across it?" The short answer is that, yes, you can treat the diode drop as a resistor, if you realize this implication: In a normal resistor, the ohms value of the resistor is (excluding thermal effects) constant; that is, in the Ohm's Law equation E = IR, for a given resistor, R is always constant. So if you vary one of E or I, you know what happens to the other one, since R isn't changing. On the other hand, with a diode, E is constant and R varies. It is easily seen from the equation than if E is constant, and I goes up, then R must go down in order to maintain the constant value of E, and in fact that's exactly what happens. The diode's resistance varies inversely with the current flowing through it. This is why you never want to wire a diode directly across the poles of a battery or power supply, without a resistor in series to limit the current. Once the current starts flowing through the diode, the resistance will go down, which will allow more current to flow, etc., until something melts. Electrical engineers refer to things that behave like diodes as "non-ohmic", and say that they don't obey Ohm's Law. This isn't really true; they do obey Ohm's Law if you allow for the fact that the resistance is not constant. (They say it for another reason too: the particle-physics mechanism that produces the diode-drop resistance is not the same as the mechanism that produces resistance in an ordinary resistor.)

There is something called a Schottky diode, which operates on a different physical principle (it does not use a P-N junction). Its main use is in high-frequency circuits, because it can switch from the non-conducting state to the conducting state faster than a normal diode. For most synth applications, we don't care about that, since synth circuits don't use high enough frequencies

RF Mixers and Ring Modulators

Radio people use the word "mixer" to refer to a circuit that is used to shift a signal to a higher or lower frequency. (This use of the word has nothing to do with audio mixers.) The mixer accepts a signal to be converted, and a sine wave at a given frequency from a local oscillator. The mixer either raises or lowers the frequency of the input signal by the frequency of the local oscillator signal.

Although a well-designed RF mixer contains a number of components and functional blocks, the basic frequency-changing function can, believe it not, be performed by a simple diode. How can it do that when it is nothing but a simple one-way valve for electricity? Well, as we've just seen in the above discussion about diode drops, that isn't totally true. When the voltage applied to the diode is below the diode-drop threshold, and when it is considerably above the threshold, the diode's behavior is linear. However, right at the threshold and just a little above, there is the "corner" region when the resistance of the diode is neither infinite nor very low. And further, it is varying inversely with the current flow. So this part of the diode's response graph is not straight; it's curved.

We now have to discuss some math, so bear with me. Any simple curve can be described (or at least approximated) by a polynomial, of the general form:

Output = A*V + B*V^2 + C*V^3 + ...

where V is the input voltage, and A, B, & C are constants. Now, let's assume for a moment that the signal to be converted is a simple sine wave. When it is added to the signal from the local oscillator (also a sine wave), and run through the polynomial, the B*V^2 term (after doing a bunch of algebra) produces, among other things, two terms in the frequency domain. One of them is a new signal whose frequency is the sum of the input signal and the local oscillator. The other is a new signal whose frequence is the difference of the input signal and the local oscillator.

Do those last two sentences sound familiar? Yes, that's what a ring modulator does. However, the output has other combinations of frequencies in it -- the polynomial has other terms that are generating other multiples of the frequencies involved, plus there is some interaction between the output and the input. Radio RF mixers use filters to eliminate the unwanted frequences, and leave only the desired on, which is usually either the difference frequency or the sum frequency, depending on what the purpose of the mixer is. But there are other frequency combinations that could be selected instead.

Now, for synth use, there is no reason why the "local oscillator" has to be a sine wave. In fact, it could be some other signal. And depending on the particulars of the circuit, it could produce various combinations of frequencies. Here is a simple mixer circuit that will produce several bands of frequency combinations:



Note that this circuit does not eliminate the two original input signals, as a properly balanced ring modulator does. Here is the classic diode-ring modulator circuit:



This circuit does a good job of supressing the input signals, assuming that the diodes are closely matched. There are other types of diode-based modulator and mixer circuits. If you are interested in exploring this further, here is an excellent paper (PDF) the describes various types of RF mixer circuits, how they work, and their characteristics. (If you aren't interested in the theory, skip down to section 4.)

It's worth noting at this point that most synth "ring modulator" circuits do not use the above circuit. Although it works well at radio frequencies, the diode ring modulator has some practical problems at audio frequencies. Distortion due to saturation in the transformer cores is difficult to avoid, and the output level is very low. Most synths do ring modulation using a VCA as an analog multiplier, or else they do the multiplication directly in the digital domain. These techniques will produce a somewhat different sound than a true balanced modulator, since they do not produce the frequencies corresponding to the higher terms of the polynomial.

Reverse Breakdown and Zener Diodes

We say that a diode prevents current from flowing in the reverse direction. The truth is, it can only prevent this up to a certain reverse voltage. Beyond that point, the diode goes into reverse breakdown, and current flows in the reverse direction. In a normal diode, reverse breakdown is something to be avoided, since it usually damages the diode. A small-signal diode such as the commonplace 1N4001 will usually have a reverse breakdown voltage in the 50-200V range. So you want to avoid using such a diode in a circuit where it may be exposed to a reverse voltage in this range or higher.

However, there is such a thing as a diode that is designed to not only tolerate reverse breakdown, but to go into and out of reverse breakdown at a specific voltage. This is called a zener diode. One of the most common uses for a zener diode is that of a quick-and-dirty voltage regulator. For example, we could take the unregulated bridge rectifier power supply that we built above and add regulation to it using a zener:



Note the symbol for the zener, and the current-limiting resistor above and left of it. How does this work? Let's say that the unregulated output of the supply is in the 18-22V range, and the zener has a reverse breakdown voltage of 15V. When the power supply is switched on, the voltage rises above the zener's reverse breakdown voltage, and current begins to flow through the zener. As it pulls current, voltage develops across the current-limiting resistor, which means the voltage on the output side of the resistor drops. When it drops to 15V, the zener will reach a stable state where it conducts just enough to keep the voltage right at that point. If the load begins drawing more current from the supply, the voltage will drop, and as it drops below the zener will stop conducting until the voltage rises back to 15V. It will then stabilize there again.

Note that this actually isn't a very efficient way of regulating a power supply. At times when the load is not drawing much current, the zener and the current-limiting resistor will dissipate a significant amount of the power supply's output as heat. And the current-limiting resistor means that the load cannot draw up to 100% of the supply's output capacity without the voltage sagging. Nonetheless, zeners are often used to develop lower voltages from higher ones, particularly in a situation where a circuit designer needs a specific voltage for a specific purpose (such as a reference voltage) in a particular place in a circuit, and the current demand is not high. The designer will simply put a zener and current limiting resistor on the board at the place where it is needed, drawing from the board's primary power.


Distortion Circuits with Zener Diodes

Here's a use for a zener diode that's a lot more fun. Consider the following circuit:




Note the two zeners back-to-back. What will this circuit do? Well, when the voltage exceeds the reverse breakdown voltage of the upper zener, that zener will start conducting. The second zener, having voltage applied to it in the forward direction, hasn't started conducting, though. It will as soon as the voltage rises a little further, far enough to overcome its diode drop. What happens then? The two zeners clamp the voltage, to the sum of the zener reverse breakdown voltage of the upper zener and the diode drop of the lower zener. Now, what about negative voltages? The same thing happens in the opposite direction: the zeners clamp to the reverse breakdown voltage of the lower zener, plus the diode drop of the upper one. If we assume that both zeners are of the same type, then this circuit's output will be restricted to a +/- voltage range that is determined by the zeners. Any peaks of any waveform that exceed this range will be chopped off.


This is a clipping circuit, aka a distortion or fuzz box. There have been, in fact, guitar distortion pedals that use this circuit. If you run a sine wave through it, the output comes out looking like this:




Suppose we put the zeners in series in the circuit instead of across it?




The zeners now conspire to let through only the portion of the waveform that they clipped off in the previous circuit. Let's call this "anti-clipping"; instead of knocking off the waveform peaks, it rips out the portion of the waveform near the axis, leaving only the peaks. The anti-clipped waveform looks like this:




Light-Emitting Diodes

A light-emitting diode is a diode made from materials such that the P-N junction emits light, at a specific wavelength, when current passes through the diode in the forwards direction. That's straightfowarde enough. LEDs are like normal diodes in that they have a diode drop, which is a resistance that varies inversely with the current flow; hence they are subject to the same current runaway issues as normal diodes. So an LED usually needs a current-limiting resistor ahead of it; a rule of thumb is to use a 1K resistor when in doubt.



LEDs are made from base materials other than silicon; gallium arsenide and gallium nitride are two common ones. The color that the LED emits depends mainly on the base material. The first LEDs produced in the 1970s were all deep red. Green and infrared ones came shortly after, but for various reasons, it took a surprisingly long time to develop a good blue LED. Nowdays, they are available in red, orange, yellow (usually made by putting a red and a green in the same package), green, blue, and violet. There are also any-color LEDs which consist of red, green, and blue all in the same case, each with its own lead; you can produce any desired color by varying the current to each of the three primary colors. Be careful with violet LEDs; they can emit a fair amount of near-UV if they are driven hard.

At this point, the EE student will usually ask: Can an LED be used like an ordinary diode, exclusive of its light-emitting capability? The answer is that it's not a good idea to subject LEDs to reverse voltage. Most LEDs have a reverse breakdown voltage of only a few volts, and they are permanently damaged by reverse current flow. However, there is one common non-light-associated use for LEDs. Because they are made out of materials other than silicon or germanium, they have different diode drop voltages. Different color LEDs have diode drop thresholds of up to 3V, depending on the base material. This can make them very useful in situations where diode drops of several volts, or diode drops that aren't multiples of 0.6V, are called for.

Specifying Diodes

For small-signal processing with ordinary silicon P-N junction diodes, the only really important parameter is the reverse breakdown voltage. The diode drop is a function of the base material and will be the same for all silicon diodes. If the diode is made of some other material, it will have a different diode drop. LEDs have different diode drops depending on the material they are made from. Information on diode drops of specific types is surprisingly hard to find; a quick survey with Google shows that you can't make an assumption based on the LED color alone. Schottky diodes are available in a range of diode drops from 0.2 to 0.8V.

For power applications, the maximum current or maximum power dissipation becomes an important factor. Diodes and integrated bridge rectifiers are available specifically for power applications, and they usually have provisions to be mounted to a heat sink to increase the power handling capacity. Note that really large power diodes will have a non-trivial amount of parasitic capacitance as a consequence of the way the P-N junction works.

There is a JEDEC standard for how diode part numbers are to be formatted; they always start with "1N", which indicates a diode, followed by a part number in a certain series. For example, ordinary P-N junction diodes are numbered 4000-4999, and zener diodes are numbered 5000-5999. However, manufacturers these days seem to be getting away from the standard, particularly with surface-mount parts, which are all over the place.

Summary

Diodes can do some surprising things, which aren't always obvious from the basic functional description. There are a lot of other circuit ideas out there, and I simply don't have space to sum it all up. So do some Web searches and read some books.

Next time, we'll make a start at taking on the transistor.