DIY Open.Theremin.UNO - Please Help!

Posted: 4/24/2016 1:27:32 AM
DocSunset

From: Montreal, QC, Canada

Joined: 4/24/2016

Hello world,

I'm a newcomer to the theremin, and to these forums. It seems like a very welcoming community full of helpful and knowledgeable people, so I'm hoping someone out there might be able to help me with my current project.

Since about a week ago I've been working on building an Open.Theremin.UNO from scratch based on the schematic on github using through hole components. At first I thought it should be easy, that I would just have to closely follow the schematic and everything should just work. As the project has gone on, I've realized that that is not the case, and instead it seems that the switch to breadboard and through hole components appears to have a significant enough effect on the design for most of it not to work at all. Either that or I'm just doing something horribly wrong, also distinctly possible.

I was wondering if anyone here might be able to offer some help. In particular, I need help getting on the right track with my research efforts; I'm not an engineer by trade (I am an electroacoustic music composer and pianist), so I don't know the names of the circuits well enough to read more about them. When I found out that the crystal oscillator used in the Open.Theremin.UNO is called a Pierce oscillator, for example, I was able to work out that mine probably wasn't working because stray capacitance in my breadboard was overloading the crystal. Now the pitch antenna oscillator isn't working as expected, but I don't know where to start looking for information because I don't know how to describe the oscillator other than by saying that it has a 4069 IC and some resistors, capacitors, and an inductor...

Any advice anyone has to offer is welcome, and thanks for reading my post! I hope I'll be able to finish this project soon, and that my experience and this discussion might help others one day who might be interested in building a through-hole version of the Open.Theremin.UNO.

Posted: 4/24/2016 12:48:59 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

DocSunset, are you using a plastic breadboard?  Or are you soldering the components to a phenolic / fiberglass printed circuit board with a generic pattern?  Posting a picture of your efforts would be helpful, the "photo albums" feature works pretty good here.

Posted: 4/24/2016 3:15:51 PM
DocSunset

From: Montreal, QC, Canada

Joined: 4/24/2016

Dewster: I am using a solderless breadboard of the white plastic variety, which I've started to realize is a source of problems like "parasitic capacitance" and "stray inductance" and "piles of tiny jumper cables everywhere". Here is a picture of my monstrosity. The circuits for the antennae are on the left, followed by the "digital mixer" (flip flops?), the pitch reference / sampling clock, and the DAC. For an antenna, I've been attaching a kitchen fork with an alligator clip. I imagine this is the sort of thing electrical engineers have nightmares about:

As far as I can tell everything is hooked up according to the schematic. I haven't connected the amplitude antenna to anything, but ideally the device should be a functional pitch only theremin at this point. While the reference oscillator appears to be working, I'm uncertain how the antenna oscillators function, so I'm not sure where to start tweaking to try to eek out better performance. I believe they are currently oscillating too fast and therefore being rejected by the debouncing routine in the firmware, but this is really just a wild guess, since I have no idea how the oscillators function except that the pitch should change when the capacitance between me and the antenna changes.

Christopher: I've often felt that the analog/digital distinction is overly sensational. In this case, demonstrations I've seen of both the Open.Theremin.UNO and the Moog Etherwave have shown both to be very capable instruments accomplishing similar functions and performance. The Etherwave has a much nicer theremin timbre, but I'm more interested in using the theremin as a CV source to play my eurorack. The OTU seems like it will do this admirably, and the open source hardware and software means that I might be able to improve the system to suit my needs better (if I ever get it working), and building it myself forces me to learn more about electronics which is a skillset I'm interested in developing unto itself. I'm interested in playing musical instruments, certainly, but I'm also interested in designing and building them. The difference in cost ($50CAD for components vs $650CAD for an EWP) is also a significant factor for a poor undergraduate such as myself, especially with the canadian dollar what it is right now. The music in the video is very nice :)

Posted: 4/24/2016 4:05:36 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

DocSunset, thanks for the pic, it's worth >1k words!  ;-)

Plastic breadboards have several pF between rows, and this can be aggravated by anything the breadboard is sitting on.  I set mine on top of a small plastic box (a school pencil box, an empty first aid box, or similar) to minimize capacitive interaction with my wooden workbench top (wood is slightly conductive).  Get it a couple of inches above your work surface with something plastic.

You have a better chance of getting things to work with a better layout.  Those jumpers are OK for some signals, but not for those that rely on capacitance.  Those small pre-made point-to-point jumpers they make out of solid wire (Elenco JW-350, got mine from ebay) can be a problem too if they lay too close to the breadboard.  Your best bet is to get some solid insulated hookup wire and make your own jumpers for the oscillators, make them short and "U" shaped (or take a pre-made solid jumper that is a bit too long and bend it into a shallow "U").  No need for a "U" shape with power jumpers or digital signals, here I use the pre-made ones that lay on the breadboard.

When I'm playing with transistor-based oscillators on my breadboard I stagger the leads so that they have a blank row between them, which gets the parasitic capacitance down to 1pF or less.  The power rails probably add a little parasitic C as well.  You can't use this trick with ICs though.

You should add decoupling capacitors directly across each IC right at the power pins.  Ceramic, somewhere between 0.01uF and 0.1uF should work.

I've never played with an UNO myself, but it might not function at all if the volume side isn't kosher.  Some folks here have said the tuning process can be pretty touchy.  Having the trimmer right at the antenna gives it 3x the sensitivity to adjustment it would normally have.  FYI, antennas tend to be around 10pF to ground, and delta hand capacitance is around 1pF over the full range of playing distance (quite remarkable if you think about it).  You can use any kind of wire for the antenna, it doesn't need something like a fork on the end.

I assume you don't have a scope?  Scopes can make short work of diagnosing this stuff.  Do you have a DMM or frequency counter?

"I've often felt that the analog/digital distinction is overly sensational."

Ya, my feeling too.  We're living in a hysterically retro period where using the right tool for the job is often frowned upon.

Posted: 4/24/2016 5:13:09 PM
oldtemecula

From: 60 Miles North of San Diego, CA

Joined: 10/1/2014

TW needs conversations:

OK, I am back and maybe on track this time, you used the word theremin, it always throws me off.

Control voltages are something I have never explored not being a musician, but maybe I have.. but not using the CV term. I have boxes and boxes of experiments and a CV method might be in there. 

I have taught many, maybe the student can teach me, dewster too. (-:

After seeing your construction makes me curious in where this setup would go. I am guessing you want to use the "proximity effect" to slide a voltage from 0 to 5 volts (or 12v) continuous without any stepping in the voltage?

The Arduino does which tasks in the setup or it is being controlled by the CV.

Is CV with your use almost like a potentiometer that you control up and down in value without touching?

You want the voltage to go in which direction approaching the capacitive sensor, up or down?

If my thinking were correct over what distance would be ideal for the proximity effect.  6” or 12” or 18”.

Is there a DC load on this CV output?  10K or 100K resistance?

I hope to learn watching this thread. 

Christopher

Edit: I see this individual trying to sell this device in my neighborhood for $700, does this relate to what you are wanting to achieve in any way?  The product is here. I use to control the intensity of light shining on the Thereminist by way of PWM proximity volume control. Quiet sound was a much dimmer light if not off. I would consider this effect voltage control? The fundamentals could easily cross over to what you want if I understand correctly. I have several PCB's to give away at no cost to anyone that wants to experiment with this. (stuff in a box) I would have to refresh that particular webpage as I have hundreds.

Posted: 4/24/2016 11:45:11 PM
DocSunset

From: Montreal, QC, Canada

Joined: 4/24/2016

Serendipitous breakthrough: On a whim I decided to try using the amplitude antenna oscillator as the pitch antenna oscillator; the only difference between the circuits is a single capacitor which is larger in the amplitude antenna oscillator. After fooling with the trimmer capacitor for a while, I now have a pitch only theremin with a four octave range. It doesn't have very good linearity, but it seems to be halfway functional.

I imagine the antenna oscillators are both supposed to oscillate within specific frequency ranges, but without knowing anything about the oscillator circuits it's impossible for me to guess, which makes it difficult to gauge how close my breadboard prototype is to the real deal. 

If I knew what frequencies they were supposed to have, and which components to adjust to change those frequencies, then presumably I could tweak my breadboard version of the circuit to work. Here's the schematic for the oscillators. Anyone understand what's going on with them?

dewster: Decoupling oscillators added. I'll have to drop by the store and pick up some solid hook-up wire, all I've got around is stranded. No scope :(, so I've been listening to any audible signals and extrapolating about how the rest of the circuit is functioning from there, e.g. I verified that the 8Mhz reference oscillator was working by listening to the 14th division by 2 (nearly exactly B4). Thanks for your advice!

Christopher:

"Is CV with your use almost like a potentiometer that you control up and down in value without touching?"

Often, yes, but not necessarily. Control voltages... well, control things. It could be the frequency of an oscillator, cutoff of a filter, resonance, amount of feedback in a delay line, any of these and countless other things, or all of them at once. A potentiometer could be considered a particular way of generating control voltages which is used internally by many modules because of its small size, low cost, and convenient implementation. Unfortunately, potentiometers are relatively impoverished as gestural controllers, and almost always only control one parameter. The theremin presents a whole new world of gestural possibilities, a world which I am interested in exploring.

"You want the voltage to go in which direction approaching the capacitive sensor, up or down?"

Probably up, but it doesn't really matter since the CV could always be inverted later.

"If my thinking were correct over what distance would be ideal for the proximity effect.  6” or 12” or 18”."

I'm not sure. What is the "standard" responsive distance for a theremin? I guess on the side of 18" would probably be more useful, if not perhaps even longer.

"Is there a DC load on this CV output?  10K or 100K resistance?"

Not certain, but I believe most if not all eurorack inputs have very high impedance for reasons such as those described in this wikipedia article on impedance bridging.

"I hope to learn watching this thread. "

Me too!

Posted: 4/25/2016 12:59:23 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Here's the schematic for the oscillators. Anyone understand what's going on with them?"  - DocSunset

Yes, the capacitances on either side of the inductor to ground are in series with the inductor, so they are in series with themselves.  Using the series C formula (where those in parallel merely add) along with the LC resonance equation:

Volume side nominal (with 10pF antenna):

  10pF + 17pF + 100pF + 33pF = 160pF

  1/[1/160pF + 1/330pf] = 107.8pF

  f = 1/[2 * pi * sqrt(L * C)] = 485 kHz

Pitch side nominal (with 10pF antenna):

  10pF + 17pF + 100pF + 33pF = 160pF

  1/[1/160pF + 1/220pf] = 92.6pF

  f = 1/[2 * pi * sqrt(L * C)] = 523 kHz

Though it isn't entirely this simple because there is a phase delay caused by the RC drive (R7 & C7; R8 & C8).  Ideally this delay would be 90 degrees, but if it were then the amplitude at the junction would be zero and the tank wouldn't be stimulated.  Probably easiest to simulate or build and see what's going on.  There has to be 360 degrees phase change around the loop, the inverter provides 180 due to inversion, plus some transport delay, plus some inertial delay, the RC provides ~90, and the LC tank another 90.  If the gain is >1 @ 360 degrees total delay then you've got oscillation.

A 500kHz cycle is 2us, and delay through a 4069 at 5V can be 100ns or more, which is ~1/20 the total cycle budget, and this delay is temperature sensitive.  This is one of the main reasons (drift and deviation from the LC Q peak) I don't recommend 4000 series CMOS for Theremin use, though it should work fine for experimental stuff.

If the volume oscillator works better for the pitch side then I'm kind of confused.  Did you put the whole thing up on a plastic spacer of some sort?

[EDIT] I'm kind of surprised the volume and pitch side operating points are so close to each other in frequency, given the antennas and oscillators themselves are so close to each other physically.  The Theremini approach uses 1x and 2x inductor values here, which gives a square root of two frequency ratio (1.414). 

I'm also a bit surprised the pitch side operating frequency is above that of the volume side.  Most Theremins position the pitch side below the volume side - presumably so that harmonics from the volume side don't / can't interfere with the pitch side?

Posted: 4/27/2016 12:04:27 AM
DocSunset

From: Montreal, QC, Canada

Joined: 4/24/2016

You know dewster, I think this is exactly the sort of information I was hoping to find here. I haven't had any time to work on this project in the last couple days, but as soon as I do I'll let y'all know how it goes.

I'm not sure why the volume antenna with its higher valued capacitor would work better than the other one either. I think knowing what the frequencies are "supposed" to be as well as what they actually are in my case should clear things up a bit. 

I think the closeness in frequencies is less relevant in this circuit than in a traditional theremin, since the output of these oscillators are never heard in even a round-about way. The microcontroller monitors the heterodyne frequencies and interprets them to derive the actual pitch and amplitude. So for example, when I was playing with pitch only the other afternoon I was listening to the heterodyne frequency from the pitch antenna and its reference oscillator on one speaker while listening to the output from the DAC on another speaker. Depending on where I was positioned during the calibration routine after booting up the Arduino, a high heterodyne frequency might correspond to a very low output frequency, since whatever the heterodyne period is during calibration is interpreted by the firmware as being the lowest note, i.e. the farthest distance of the user from the antenna.

I would guess that the issue of harmonics is greatly mitigated by the fact that both signals are square waves being read digitally.

Thanks a bunch for your help! I'll report back as soon as I have some time to hunker down (this weekend at the latest for sure).

Posted: 4/27/2016 3:05:49 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I think the closeness in frequencies is less relevant in this circuit than in a traditional theremin, since the output of these oscillators are never heard in even a round-about way." - DocSunset

Except for the ability to average multiple measurements in software - which is itself quite a powerful technique that the UNO code does a bit (and the Theremini does too much) - it's pretty much garbage in, garbage out regardless of analog or digital.

"I would guess that the issue of harmonics is greatly mitigated by the fact that both signals are square waves being read digitally."

In my mind it's more of a thing where any harmonics spewed out by one oscillator disturb the other oscillator.  Worst case here is having the fundamental get low enough to super mess with the other oscillator.  I imagine the line of reasoning is if the volume oscillator is significantly above the pitch oscillator, when the player puts their hand on the volume antenna the antenna amplitude will markedly decrease, an the pitch side will be muted anyway so who cares.  If the pitch oscillator is higher then when the player touches the pitch antenna the interaction might be easily heard.

I did an experiment a while back that looked at the oscillator frequency difference and the corresponding minimum physical distance necessary to mitigate interference.

Posted: 11/4/2016 8:04:40 PM
gaudi

From: Switzerland (CH)

Joined: 8/6/2010

@dewster I read you have never played with an Open.Theremin. For all the support you give to people here on the forum and for good technical inspiration I would like to send you one of the new Open.Theremin V3. Just PM me where to send it.

You must be logged in to post a reply. Please log in or register for a new account.