D-trigger as heterodine mixer: aliasing

Posted: 3/27/2017 8:58:42 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"In your LTSpice model there is no series resistance specified for inductor. Does it affect performance?"  - Vadim

Yes, series R will always lower Q, and therefore lower the tank voltage swing (i.e. at the antenna).  Phase error often lowers tank swing too.

"These unbuffered inverter oscillators are evil. Lots of low frequent phase modulation because of the RC components in the feedback path which adds a second oscillation."  - Thierry

I imagine this is a function of the inductor parasitics?  I don't necessarily like these oscillators, but the Theremini and the open.theremin both employ them, seemingly sufficiently successfully.  Though they add way too much C padding and actively kill the Q by adding lots of drive resistance.  Better to let the tank swing and reduce the sense side than reduce the drive side IMO.

"You might get these somewhat better by biasing the input at VDD/2 from a buffered voltage divider instead of using that xMeg resistor from the output back to the input."

Threshold voltage is poorly defined in these parts (though not nearly as bad as FETs) so you really want to bias to whatever VT actually is, so you don't get duty cycle modulation with input amplitude changes.  The easiest way to do this is with a high value feedback resistor.

Posted: 3/28/2017 10:35:31 AM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

Dewster,

I've played a bit with your oscillator version in LTSpice, and tried to make it work in linear mode.

My LTSpice model:

It is powered from 5V, but I believe it should not affect SNR.

Voltage swing on antenna is 60V. Frequency - 1.155MHz.

I believe linear mode may improve precision of output measurement.

FFT of my modified schematics:

I believe it can be tweaked to get even better results.

FFT of your version:

I believe linear version output has 20 dB less noise, and it shouild be more easy to process.

Posted: 3/28/2017 10:39:33 AM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

"These unbuffered inverter oscillators are evil. Lots of low frequent phase modulation because of the RC components in the feedback path which adds a second oscillation. You might get these somewhat better by biasing the input at VDD/2 from a buffered voltage divider instead of using that xMeg resistor from the output back to the input."

 Yes, it looks like transistor based oscillator is much better.

Will move in this direction.

 

My recent idea: if there are two (almost) sines - from variable pitch and reference pitch oscillators, why not build heterodine based on analog multiplication circuit. It should produce much better results than Add-detect-filter, or XOR schemes.

Posted: 3/28/2017 2:10:47 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I've played a bit with your oscillator version in LTSpice, and tried to make it work in linear mode."  - Vadim

Examining your changes, you removed Rant (2meg) which isn't a real component but models antenna emission losses.  You have to use this to approximate real swing at the antenna, otherwise you will get an unrealistically large swing in simulation.  And sometimes the 2meg completely swamps oscillation in simulation, which is one clue as to whether you have a viable oscillator or not.

You increased R2 from 4.7k to 47k, which reduces the tank drive quite a bit, so the circuit is much more dependent on Q to get a large swing.  If it oscillates at all in reality, you will see a large decrease in amplitude as your hand approaches the antenna, and oscillation will probably stop before your hand touches the antenna.

If you want spectral purity you should be buffering the tank swing itself via a capacitive divider.  1pF from the antenna to 33pF (change this to get the amplitude you want) to ground, pick off the intersection of the 1pF and 33pF and you will see a much nicer sine wave.

There will always be some discrepancy between simulation and reality.  Usually the simulation works better than reality, often to the point where the simulation oscillates and the reality doesn't.  I've found that I have to test circuits on a breadboard to get the full truth.  This helps me fine-tune the parasitics (Rant and inductor DCR) to make the simulation better match reality.

"It is powered from 5V, but I believe it should not affect SNR."

Increasing the supply voltage is one way to increase the antenna swing, but I've found that I can usually get a sufficiently large swing with lower supply voltages.  5V is usually available, and regulating this down to a very stable 3.3V can give a very stable oscillator.  I don't think I'd want to power these oscillators off of a shared, digitally noisy, and relatively unregulated 5V supply.  Voltage regulation is an extremely effective and inexpensive way to obtain oscillator stability.

"Yes, it looks like transistor based oscillator is much better."

I don't necessarily agree.  You can make a nice oscillator with CMOS, but most people don't for some reason.  Could you post your CMOS oscillator in LTSpice format?

"My recent idea: if there are two (almost) sines - from variable pitch and reference pitch oscillators, why not build heterodine based on analog multiplication circuit. It should produce much better results than Add-detect-filter, or XOR schemes."

Yes, multiplying real sines is a much easier filtering scenario, but getting an analog multiplier to work at these higher frequencies is problematic.  Moving your operating point up in frequency also separates the images more.

Posted: 3/28/2017 3:46:06 PM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

""I've played a bit with your oscillator version in LTSpice, and tried to make it work in linear mode."  - Vadim Examining your changes, you removed Rant (2meg) which isn't a real component but models antenna emission losses.  You have to use this to approximate real swing at the antenna, otherwise you will get an unrealistically large swing in simulation.  And sometimes the 2meg completely swamps oscillation in simulation, which is one clue as to whether you have a viable oscillator or not. You increased R2 from 4.7k to 47k, which reduces the tank drive quite a bit, so the circuit is much more dependent on Q to get a large swing.  If it oscillates at all in reality, you will see a large decrease in amplitude as your hand approaches the antenna, and oscillation will probably stop before your hand touches the antenna. If you want spectral purity you should be buffering the tank swing itself via a capacitive divider.  1pF from the antenna to 33pF (change this to get the amplitude you want) to ground, pick off the intersection of the 1pF and 33pF and you will see a much nicer sine wave. There will always be some discrepancy between simulation and reality.  Usually the simulation works better than reality, often to the point where the simulation oscillates and the reality doesn't.  I've found that I have to test circuits on a breadboard to get the full truth.  This helps me fine-tune the parasitics (Rant and inductor DCR) to make the simulation better match reality. "It is powered from 5V, but I believe it should not affect SNR." Increasing the supply voltage is one way to increase the antenna swing, but I've found that I can usually get a sufficiently large swing with lower supply voltages.  5V is usually available, and regulating this down to a very stable 3.3V can give a very stable oscillator.  I don't think I'd want to power these oscillators off of a shared, digitally noisy, and relatively unregulated 5V supply.  Voltage regulation is an extremely effective and inexpensive way to obtain oscillator stability. "Yes, it looks like transistor based oscillator is much better." I don't necessarily agree.  You can make a nice oscillator with CMOS, but most people don't for some reason.  Could you post your CMOS oscillator in LTSpice format? "My recent idea: if there are two (almost) sines - from variable pitch and reference pitch oscillators, why not build heterodine based on analog multiplication circuit. It should produce much better results than Add-detect-filter, or XOR schemes." Yes, multiplying real sines is a much easier filtering scenario, but getting an analog multiplier to work at these higher frequencies is problematic.  Moving your operating point up in frequency also separates the images more."

Added Rant back into my recent oscillator design. Inductor has serial resistance set to 2.1 Ohm as bad inductor I have. Voltage swing fell to 16V (with 5V power supply). But FFT still shows good peak about 110 - 120dB.

Did you actually see Rant effect on real hardware?

 

Two additional transistors are for limiting output voltage range - keep sine wave in 0..Vcc range.

 

I'm trying simulation with part nominals +/- 50% to get at least some confidence that model will work in real hardware. Breadboard helps a lot.

 

Schematics for my last experiment with unbuffered hex inverter:

 Working in hardware, but not as well as I expected. Difference from simulation: each passive RC filter cascade in real life loses about %30 of voltage.

FFT peak of oscillator is about 90dB, but not as narrow as in my recent schematics on transistors.

 

I have no idea how to implement hardware analog multiplication, but it will be interesting task :)

 

 BTW, it's very strange quotation support on this forum. Is there some tutorial? :)

 

Posted: 3/28/2017 6:27:41 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Did you actually see Rant effect on real hardware?"  - Vadim

Yes, absolutely.  Even though the radiator is electrically short for an antenna, some RF is emitted and absorbed by the surroundings.  And dynamically, as the hand approaches the antenna, the C between the hand and the antenna increases, which increases the transmission to the body's R to ground, which makes the oscillation amplitude get smaller.  That's my theory anyway.

"Two additional transistors are for limiting output voltage range - keep sine wave in 0..Vcc range."

IMO you're trying to hard to get spectral purity from the drive side.  You're better off simply buffering the LC directly.  High Q cleans everything up by making the drive insignificant.  Have you studied Ham radio LC oscillators?  They can teach a person quite a bit.

"BTW, it's very strange quotation support on this forum. Is there some tutorial? :)"

I just copy and paste, using italics and font coloring.

Posted: 3/30/2017 5:26:42 AM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

"Two additional transistors are for limiting output voltage range - keep sine wave in 0..Vcc range."

IMO you're trying to hard to get spectral purity from the drive side.  You're better off simply buffering the LC directly.  High Q cleans everything up by making the drive insignificant.  Have you studied Ham radio LC oscillators?  They can teach a person quite a bit.

Dewster,

I still think that having better signal (close to pure sine) would help a lot in further processing.

If you put crap into LC, and then it filters out 99% of crap with its high Q, you would still deal with 1% of crap smelling in output signal.

In ADC (300MHz?) some strange effects may appear.

In oscillator LTSpice model you've provided, I see that signal on antenna is about 100dB peak, lower frequencies are -100dB, second harmonic is -45dB. On Q1 base and emitter - peak is about 85dB, but at lower frequencies you will see -60dB noise. Second harmonic is -20dB. The same you can observe in output signal. I believe all this stuff harms your detection results a lot. Even if you filtered out low freq components before ADC, you still have 85dB signal. But you can have it at least 20dB better just by tuning of some passive component parameters, and maybe adding 1-2 more parts.

Getting signal directly from LC? Base and emitter are connected to LC. Different part of LC contour which has better characteristics has much lower capacity, and I'm afraid it may be affected by connected amplifier input. As well, it would require additional transistors for amplification.

 

 

Posted: 3/30/2017 1:18:51 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"I still think that having better signal (close to pure sine) would help a lot in further processing."  - Vadim

I don't disagree.

"In oscillator LTSpice model you've provided, I see that signal on antenna is about 100dB peak, lower frequencies are -100dB, second harmonic is -45dB. On Q1 base and emitter - peak is about 85dB, but at lower frequencies you will see -60dB noise. Second harmonic is -20dB. The same you can observe in output signal. I believe all this stuff harms your detection results a lot. Even if you filtered out low freq components before ADC, you still have 85dB signal. But you can have it at least 20dB better just by tuning of some passive component parameters, and maybe adding 1-2 more parts."

I don't actually use this circuit in my Theremin prototype, I use a phase locked numerically controlled digital oscillator. But the buffer here is designed more for digital use than analog.

IMO you're relying too heavily on FFT analysis, it is useful but doesn't tell you the whole story.  Other issues such as peak voltage swing, long-term stability, start-up, etc. are probably more important.  But if you want more spectral purity you might look at how ham radio designers accomplish this.  Like this for instance (but don't take it all as gospel):

http://www.qsl.net/va3diw/vackar.html

Maybe do buffering something like this:

Adjust C6 to get the output amplitude you want.  I haven't actually built this buffer so it might not work as simulated.

And you really need a decent scope to do this kind of work.

Posted: 4/2/2017 8:35:12 AM
Buggins

From: Porto, Portugal

Joined: 3/16/2017

Found good oscillator.

Can be tuned to have good sine on emitter.

If LC contour is rearranged, gives an ability to have 100-200V voltage swing on  antenna, almost independent on Rant.

Not yet tested on breadboard.

 

Posted: 4/3/2017 3:07:59 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"If LC contour is rearranged, gives an ability to have 100-200V voltage swing on  antenna, almost independent on Rant." - Vadim

I played with it for a wee bit, and didn't try anything much, but couldn't get the voltage swing very high in simulation.

The triple Darlington is highly suspicious.  There are no emitter pull-downs, and in general the more active devices you cascade in a high frequency oscillator the more drive phase error you get.

And if you are trying to maximize absolute sensitivity, you need to keep all extraneous capacitance (any C that isn't antenna intrinsic C) that the L in the tank "sees" to a minimum.  So the choice for tank drive is either via low impedance on the otherwise grounded end of the L ("series tank"), or via high impedance on the antenna end of the L ("parallel tank").  If you are going to heterodyne then absolute sensitivity isn't as important, though low sensitivity can easily lower overall SNR (because oscillator noise can dominate).

 

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