Posts Tagged ‘Analog’

The Joy Demon Cont’d

Sunday, January 10th, 2010

So sometime at the beginning of 2010 the sick children of Chicago set up a fuss looking for their monster again. You could hear them all the way from Brooklyn. Again, my guilt was heavy. Again, I made some stuff.


An introduction of what Remoc does is in order I guess. He’s basically a bigass toy that senses when little kids touch him in different spots and plays various games with them. He laughs, he cries. He may or may not be better than Cats. He also goes to sleep at night, sings songs, and has a weird interactive thermometer. He farts a lot. When he behaves, he’s kind of fun.

His memory and play pattern live on an SBC designed by my buddy Todd Squires which we used at the old toy company and affectionately call the toybrain (version 4). The TB4 was fine.

There was no real way to salvage most of the rest of Remoc’s old brain. There was a crappy class AB audio amp I put in which got way too hot, his touchsensor circuits were noise prone and also temperature sensitive, and his LED supply tended to go out of regulation when too many lights in the thermometer stayed on, and he got confused easily about time-of-day stuff if you turned his supply off. His eyeballs were light bulbs which burnt out (that was a committee decision, but). None of this was good.

His new brain boards (above) dealt with all this stuff. 2010 saw Remoc get new MOSFETs to run all his lights, a new audio amp, and a proper RTC with a ginormous battery for backup. More importantly, he got a bunch of precision opamps and a multichannel ADC to handle input from the touchsensors.

The touchsensors were actually fun to make. They’re an AVR which generates a crystal derived square wave (laziness on my part, and tunability. The generator could have been a logic gate or any crystal clock circuit really, although the programmable chip provided fudge room which I didn’t [and hopefully won’t] need) and drives it through a resistor to whatever gnarly sensor plate you have, and then filters and rectifies what’s left. They use hand capacitance to form a variable RC filter; the output of this device is a voltage which is inversely proportional to the capacitance at the sensing node. Not perfect, but pretty good. These sensors also use 1/8″ cables to carry power, ground, and signal, cause 1/8″ cables are cheap and promised to make wiring the beast a lot easier.

The thermometer. Some SMT LEDs on a stick. Yaaaawn.

All this stuff got packed up to schelp to Chicago.

I Know What Moms Like

Sunday, December 20th, 2009

Though she probably would have been more interested in a Steven King book and some Calphalon pots, I decided to build a video synthesizer for my Mom for Christmas. I also built one for my girl, who is generally more into blacklights than mom and one for me, because, you know, ho ho ho.


There were lots of reasons to do this. Partially because I think it’s cool to give gifts you make and less altruistically because I was still geeked about the little varactor synth that I’d made and wanted to do a new revision of it.

This synth still generates all the housekeeping signals with an AVR (as well as the colorburst) and switches them around with a 4051 multiplexer. However, it adds a clamp circuit which allowed control of color saturation (the old version was fully saturated color all the time) and a DC offset circuit which controlled brightness (that knob was also at 11). Those circuits worked _OK_ but not great, and I found I generally liked the results when everything was full out. There’s also an option to invert the color carrier, which WAS cool, in an epileptic kind of way. The sync signals on this guy were not _quite_ at the right levels either.


The idea is basically the same as the last varactor synth; except there are now multiple stages of RC phase shift. Each stage uses a SMV1255 “Hyperabrupt Junction Tuning Varactor” as the cap in that RC which is driven by a control voltage. Each stage is also buffered by an XOR gate, to square the signal back up after passing through the RC. One thing I also screwed up in this design was running the chain of buffers NON-INVERTING. This meant that with big phase shifts (which also meant big attenuation from the filter) the color carrier would eventually disappear, I assume because of the asymmetrical thresholds in the gates. On a scope you’d just see the duty cycle getting farther and farther from 50% and then just disappear entirely. The big solder mess here shows the workaround I did to fix this, which helped. Using comparators would help even more. Using a different circuit topology entirely would prove to be the most helpful….

Still this synth was pretty cool. Because it was for Moms and GFs, it was designed to be standalone and not require any inputs. There’s a little prototyping area where I made some function generators to make repetitive waveforms to drive the various color stuff.

xo
TB

Varactor Based Video Synth Prototype

Saturday, December 5th, 2009

My first winter in Brooklyn I made this biz. It’s a video synth that I put together on a little Narrat1ve-specific protoboard (or as I call it, the Narrat1ve Big Wizard). It’s different than the last one in lots of important ways. It’s NTSC, and generates all its own sync and blanking pulses in software (that mess is coded in C for the AVR). I spend a lot of time looking at Bruce Land’s stuff, as well as the always-on-point Owen Osborn.

More importantly I figured out how to get a continuously variable phase shift of the color carrier (analog color!) using varactor diodes! This was a big step in making stuff that looked cool. Varactors are not ideal in a lot of ways, but they are sure simple.

I slapped this guy together for a talk I gave at La Superette that I got asked to do by the inimitable Kyle and Tali from Lovid. They were really cool about this talk and I had a great time!

This really beautiful and simple proto has since been deprecated by the monsters II’ve made since and is hanging around in some drawer or other. Sad, really. Ask Too $hort about it.

xo
TB

WTPA v0.98 Review and Shakedown!

Wednesday, March 18th, 2009


So I got the test PCBs Monday, bare as the day they were born. The last couple days I’ve been going through all the circuits and checking the hardware for problems, bugs, things to optimize, and stuff that would otherwise be Bad To Deal With in a run of 200 units.
The good news: The third rev of boards does more or less all the stuff it is supposed to, and has most of the performance improvements I’d expected. However, nothing is perfect.

First, let me give you young nerds a piece of advice. Become rich. Then use your dough to buy prototype boards that have a soldermask. Good lord. You will save yourself hours in debugging stupid soldering problems, and gray hair in debugging other problems which you may at first erroneously attribute to solder bridges.
Bare PCBs do offer an advantage in that they’re easy to probe wherever you need to, and all that exposed tin makes it easy to solder fixes in, but in general they will make you crazy at least once with some weird connection that you didn’t mean to make. That was the first round of problems I had to solve.

With those out of the way came the first real, serious, problem: The VCO. The VCO got incorporated in the last board rev and I dutifully wanked on it a few times and then set it aside to deal with other problems. This in retrospect was quite stupid, because if I had paid more attention I could’ve saved myself a lot of time and a little false advertising.
It turns out that the VCO design I used (ripped wholesale, with a few changes, from Horowitz and Hill p. 240, who I’m pretty sure in turn ripped it wholesale-with-changes from the LM324 datasheet) is good in many regards. It is single supply and simple. It requires only opamps and a fairly generic transistor or FET. The problem came in trying to tune the monster over a wide range. Though the TLV2474 opamps I’m using are pretty good at RRIO, they aren’t perfect.
All the drama occurred when the CV was some small number of millivolts from the bottom rail. The ‘2474s don’t really want to drive that low, so I made the little Merce Cunningham looking mess of dancing resistors (pictured above) to help pull them there. Simple enough, but a little ugly.
Approaching REALLY closer to the rail (say within 10mV or less) the VCO stops responding in anything approaching a linear fashion and gets jittery and tends to drop out. Normally I wouldn’t care and would just bias the CVs above 10mV, but that ends up being a significant amount of tuning in the low-sample rate range. Which is silly. _NO_ op amp is that good, really, and no good design should try and expect one to be assuming it isn’t colliding particles or something.
With a marathon all-nighter / all-dayer the best performance I could get from the VCO was a not-so-great 2kHz to 16kHz, a tuning range of 8-to-1. This sucks. In retrospect the humble relaxation oscillator of the first WTPA did something like 60-to-1.

I fiddled around trying to get another VCO design breadboarded for a little while, but all the good ones I know use an OTA. I’ve seen some designs with analog switches and of course plenty with specialized VCO ICs, but I had three op amp sections and a dream. The final decision was to drop the VCO, return to the traditional relaxation oscillator, and reduce the opamp from a quad to a dual. Even Saving You Money(tm) in the process.

For those of you crying “Noooo! How will I make it talk to my Modular?” first let me say — samplers usually don’t talk to modular synthesizers, you’re spoilt. Second, let me say, because I love you, and because that’s a weird and cool idea, I’ve worked out a way to make the sampler’s oscillator clock sync up to audio inputs — so you’re losing a VCO, but you’re gaining a sync! This means that now you can synchronize your samples to your vocal line, synth line, guitar, or any signal in the audio frequency range.
This should work pretty reliably — I’ll know soon. I can no longer say “The only sampler with a VCO” but I think the new effect will probably be cooler anyway.

Everything else: I found a hardware bug in the in-circuit serial programming section related to changing around the data bus. I fixed with some pullup resistors. After that I made sure the switches and LEDs worked with the new bus structure. It’s technically still possible to PWM the LEDs and maybe I’ll do that sometime before release, but it’s low on the list. Next I quantified the bus-turnaround time related to the bus routing changes, and they’re almost invisible. It took some NOPs in the ISR, but I bet I can optimize those out later. I tested the MIDI output — so far WTPA has only received midi messages. But today it took charge, such as it can.
Finally, I took a look at the audio path. This was important and enlightening. Using a function generator and a fancypants benchtop meter set to take dB readings, I figured out the f3dB points for all the different audio paths through the system. They were pretty good — the first reading showed the audio range of the sampler’s pass-through and DAC paths to be about 14Hz-356kHz (pictured above). Not bad!
Still, as a rule of thumb (also ganked from H&H) I try and position f3dB points 10 times greater or less than the frequency of interest to avoid phase shifts in the audio range. You know what they say about phase shifts, right? “They make for weak ass west coast bass, not that Miami shit.” That’s what I heard them say.
Anyway, I got the range for those paths to be more like 2.8Hz to 370kHz with a few changes. In the overdub path I managed to actually DC couple some of the connections which means that there should be no loss in that path relative to the rest of the sampler.
Giving it the listen test, it sounds Really Good. I’m happy with the audio quality. It’s nice and quiet where it should be, with good frequency response, leaving it free to Expose Da Crust in all the important parts.

Finally, there was one more valid thing I found. In an effort to keep impedances (and costs) low I settled on two values of potentiometer for the final thing — a 500k audio taper for the input and output amp gain controls and 1k linear pots for everything else. In all the audio controls on the board, the 1k pots have a resistor from the wiper to ground to approximate a logarithmic curve (and make your life silky smooth). This means that the total resistance in some places in circuit ends up being pretty darn low. Although this does keep noise pickup low and the top f3dB point high, it also ends up working out the driving opamps something fierce. My hot rail-to-rail output doesn’t swing nearly as rail-to-rail as it used to. This of course means less usable bits in our sample. I can fix this a little by chaning the tapering resistors on the pots, but the right thing to do would be to bump the pots up to 10k and scale their related circuits. Easy enough, if I didn’t have a boatload of pots on the way from China already. The ENOB isn’t terrible, but it could be a little better. Hey, what’s a design if there isn’t room for revision?

Lastly, before I leave the soapbox, I’d like to take this opportunity to show this off as yet another example of an old TMB truism: Analog Be Harder Than Digital. Not better, but harder, and perhaps by association more noble and romantic.
While I was frantically breadboarding crappy VCOs, I came across this app note in which that continuous font of inspiration, Jim Williams, designs like 10 analog circuits which are complicated enough that they make my head spin even after reading his explanations, and he figures them out for shits in his garage or something, while on vacation. There’s a badass VCO in there which tests my understanding, and whose makeup is also (or consequently?) not quite right for WTPA.

Oh, and it also made me always remember to refer to VCOs as “Voltage to Frequency Converters” again. Saying VCO makes you sound like Jean-Michel Jarre; saying VFC makes you sound like a curmudgeon with a white beard and a bunch of Teflon caps and bandgaps. Who would you rather be?

Hello, big bag of Chinese boards? Perhaps you would like to come over?

Xoxoxo, TMB

WTPA v0.95 ISR Speed Characterized, Code Revs, H/W Changes

Thursday, January 8th, 2009

Online in 2k9, my ducks.

So sometimes, contrary to common blogline belief there are times when I’m quite busy even when I’m not posting. This New Year / Holiday period was one of them. There are some big advances on the WTPA front:

First, all circuits and modes are totally functional. The resampling problem I was having had two roots. First (and lesser of the two) the input impedance of the AVR’s A/D converter is actually a lot lower than I ever realized. In the datasheet Atmel recommends that you don’t drive the ADC with anything less than a 10k impedance but I actually found that an input resistance as small as 470 Ohms still
produced a noticeably smaller waveform at the ADC input pin than driving the pin directly from the output of an opamp. This was easy (though annoying) to fix — it requires another op-amp section and a redesign of the summing amp into the resampling ADC input. The only unfortunate thing about this is that it will drive the cost of the final device up for you, dear customer, and this kit is already, as they say in France, tres cher.
Still, I made a decision a long time ago that when I design things for me (as opposed to the toy world) I will always err on the side of badassery rather than cost, because I can. And because everybody wants to be a baller, right?

The other (more significant) problem was a Read-Modify-Write issue in the audio ISR. OMGWTFBBQ, was it hard to find! When is a NOP not just a NOP? When it lets you sync an output port you’ve just written to with its input latch. Weird, weird bugs from that one, to be sure. And fixing bugs in my code is, like, totally free!

In other important news I bothered to scope out the speed of the audio IRQs and compare them to the old WTPA. As I had hoped, there was mondo improvement on that front:

  • WTPA 0.9, Time in IRQ:
    • Recording / Playback: 22-24uS
  • WTPA 0.95, Time in IRQ:
    • Recording: 5.8uS
    • Playback: 7.5uS
    • Resampling/Overdubbing: 9.0uS

This means that we could now sample at 44kHz (CD quality — remember CDs?) without breaking a sweat if we wanted to! Of course, I’m not sure how much good that would do us since the ADC on the AVR is already “not-so-accurate” at the paltry 24kHz I’ve got it set to now. But hey, the headroom is there if you all want to get your overclock on.
Practically this means that the processor now actually has some time to get some work done other than audio, which is good.

So the final hardware related issue in this animal is the jitter generator. The way it was originally designed the jitter generator used a PRBS white noise source to mess up the clock signal, and it worked! Sort of.
It became apparent that when the “jitter” control was at maximum, the knee frequency of the filter on the white noise became the dominant interrupt frequency. In English: The fastest noise waveform actually determined the clock frequency in a totally deterministic sounding way.
Since this frequency was different than the clock frequency, you would hear a “jump” in sample rates when adjusting the jitter. This sucked. Right now I’m trying to get the jitter to mess up clocks of all frequencies equally well without inserting a dominant frequency of its own. Meaning a jittered-up 600Hz clock will still have a frequency of 600Hz, it will simply have a totally random duty cycle. (You know, like peak-to-peak displacement, like Wikipedia says under “Jitter”).
After fiddling around with another analog solution (pictured above) and then with some circuit sketches using AND gates and JK flipflops I realized that the best way to do this (everybody all together now) was IN SOFTWARE. I can’t decide if it’s sad or not that it always seems to be that way. Anyhoo, once I’m done with that it’s time for new boards.
Oh, and my birthday is coming up in a little less than a week. Send me naked pictures, or LOLCATs or something. Xoxoxox.