Showing posts with label VCO. Show all posts
Showing posts with label VCO. Show all posts

Monday, August 31, 2015

A PIC-based audio source for locking a VHF oscillator

Several years ago I decided to build a weather satellite receiver from scratch.  It is described here - link.

I didn't really need a weather satellite receiver, and I could have easily bought a kit somewhere else - or bought a second-hand one via EvilBay, but I just wanted to go through the exercise of throwing everything together and making it work using parts on hand - and I wanted to try out some ideas.

Locking a VCO to an audio DDS reference:
Figure 1:
The front panel of the VHF weather satellite receiver.
This receiver has been in continuous operation for several years, working
flawlessly in that time.
Click on the image for a larger version.

One of these ideas was to use a PIC to lock the VHF local oscillator.  On the face of it, this isn't unique - except that the PIC was to be the sole source of the precise frequency to which the PLL (Phase Locked Loop) for the local oscillator:  No divide-by-N chips here!

For this receiver the local oscillator operated 10.7 MHz below the receive frequency nominally at about 126 MHz.  Since I was already using a 100 MHz oscillator (a VCXO) that I'd pulled from some scrapped commercial satellite gear, I used a simple 3-transistor mixer/amplifier circuit to convert this to about 26 MHz (137 MHz-10.7 MHz-100 MHz) and this allowed me to use a 74HC4040 12-stage binary ripple counter to bring a representation of the local oscillator down to the audio range - about 6.3 kHz.

As it so-happened, I'd chosen the 100 MHz oscillator on purpose - mostly because it was free, but it also provided a nice, stable 20 MHz clock for the PIC by dividing its output by 5 using a 74F191 so both the down-conversion and the PIC's clock were referenced from the same source.

The goal was to provide a minimum tuning step size of at least 1 kHz, and because I'd already divided the local oscillator by 4096 this meant that my audio-frequency step size was on the order of 1/4 of one Hz - but that was no problem since I was going to use DDS techniques in the PIC.

The DDS:

A DDS (Direct Digital Synthesis - see the Wikipedia article about DDS techniques here - link) is fairly simple in operation:  Typically, one takes a register (called an "accumulator") and on every clock cycle you add to it a constant number (we'll call it a "frequency word") allowing it to "wrap around" once the accumulator's capacity is exceeded or, in other words, you do unsigned binary addition.

If you were to keep track of how often the accumulator overflows you'd notice that if you added a smaller number to it, it would overflow less often which makes sense since it would take more clock cycles to overflow!  What you might notice is that one can easily predict the rate at which it will overflow:

( (frequency word) / (maximum accumulator value) ) * clock frequency

Typically, the "maximum accumulator value" is the maximum number (plus one) that can be represented by the number of bits used by the accumulator (e.g. 8 bits = 256, 16 bits = 65536, 32 bits = 4294967296).

In my case, it was easy to make the PIC do 32 bit unsigned addition.

The last step is to take the upper-most bits of the accumulator and apply them to a D/A converter via a sine-wave lookup table.  To take a table that is "8 bits" in size (256 entries) one would take the top byte of our exemplar 32 bit accumulator, use those bits to point to a sine wave and then send the output of that sine wave lookup to the D/A converter.  Clearly, the more bits of lookup (e.g. the larger the sine wave table) and the more resolution that one has available for the D/A converter, the better!

Figure 2:
The PIC controller board that generates the precise audio frequency
based on a PIC16F88 and driven from a 20 MHz clock source.  This PIC
also drives the LCD and does the serial data communications,
receiving frequency tuning commands from the host computer.
Click on the image for a larger version.

Hardware:

The PIC that I used (a PIC16F88) can be clocked to 20 MHz and among other things it contains a PWM generator that can operate as a simple D/A (Digital-to-Analog) converter with as much as 10 bits of resolution.  As such, it has a 10-bit timer and with the PWM operating at (up to) 10 bits of resolution it will sample at up to 1/1024th of the clock frequency, or:

20 MHz / 1024 = 19.53125 kHz

Since we have 232 (4 billion+) counts in our 32 bit accumulator, and we clock it at as high as 19.53125 kHz, that means that our frequency resolution is about one four-billionth of 19.53125, or:

19.53125 kHz / (232) = 0.000004547 Hz - or about one five-millionths of one Hertz resolution!

There's one more step in generating a useful frequency output.  If one watches the MSB (most-significant bit) of the accumulator, we can see that it flips between 0 and 1 at the desired frequency, but we don't want a digital output:  Even if we did take the MSB which is, on average, at the desired frequency, it typically has a lot of phase jitter that makes it unsuitable for most frequency control purposes.

If, instead, as noted above, we take the top several bits of the accumulator and feed them to a lookup table that has a sine wave and then outputting that value to a D/A converter, we get a more analog-looking signal with much less phase jitter:  The more bits we have, the better job we can do in representing a sine wave.

Now, remember that we divided our mixed-down local oscillator by 4096, so this means that our effective resolution would be reduced by that much, but if you do the math, that still means that we have - when multiplied by 4096 - a step size of 0.0186 Hz or so at the VHF LO frequency!

If you've been following along, you might noticed that I skipped several steps, so let me explain:

The idea was to divide down a representation of the 126 MHz local oscillator to audio and we did this by first subtracting 100 MHz from it and then dividing-down the 26 MHz by 4096 to audio.  We would then generate a precise audio frequency at one-4096th of that 26 MHz frequency and using a PLL, lock our local oscillator to it!

Simple - almost.

The DDS technique is imperfect when implemented using hardware that doesn't have infinite resolution - and the PIC's hardware and software capabilities are rather limited - in my case, I managed to implement the equivalent of a 1 "ksample" sine wave with 10 bits of resolution.  (Actually, it was just 1/4th of a sine wave - which is enough if you flip the pieces upside-down and/or play it backwards in the right order as needed!)

So now I had a precision audio generator that could output a reasonable facsimile of a sine wave at any frequency from about 5 milliHertz (including DC, if you want to be pedantic) to something less than 1/2 of the sample rate - about 9 kHz!  The PWM output from the PIC is really a bunch of samples of a 19 kHz variable duty-cycle digital waveform and it needed to be filtered a bit so I ran it through a simple op-amp bandpass filter - and then converted it back into a square wave - before passing it on to the a 4046 chip and into the edge-triggered phase detector.  In the 4046 this was compared with the converted/divided signal from my local oscillator and with the magic of the PLL, my VHF oscillator was nicely locked to the precise audio frequency from the PIC!

Almost...

At this point, the imperfection of the DDS became apparent.

One of the satellite frequencies is 137.62 MHz with a local oscillator frequency of 26.92 MHz.  When this was divided by 4096, this yielded a frequency of 6.5723 kHz approximately.

If one takes a close look at the spectrum produced by any DDS-type synthesizer, a myriad of low-level (and some not-so-low-level) spurious signals will be generated because of rounding-off errors related to the finite resolution of the D/A converter, the size of the sine table, and the relationship between the desired frequency and the clock frequency.  As one approaches frequencies that are related to an integer sub-multiple of the higher order bits (e.g. multiples of 1/2, n/4, n/8, n/16, n/32, n/64, etc. of the clock frequency) these low-level spurs get closer and closer to those multiples mentioned above.  As these sub-multiples get "smaller", the amplitude of these spurious components decrease as well.

In the case of the 6.5723 kHz signal required to synthesize 137.62 MHz frequency, this was very close to 43/128ths of the clock frequency - or about 10.986 Hz off.  What this caused was a very low-level 11-ish Hz modulation of the generated frequency which, when effectively multiplied upwards by the 4096 division - which increased the apparent loop gain - appeared as a very obvious tone (more of a buzz, actually!) at the local oscillator frequency.

Normally, loop filtering would take care of this, but this rather low frequency (just 11 Hz!) could get through the filter too well - and further-slowing of the loop filter wasn't particularly attractive - but this is software and we can do sleight-of-hand to fix this!  What I did was to pick a slightly different clock frequency - 20 MHz / 896 = 22.32142857... kHz instead and this moved the spurious signals from the DDS far enough away that they were effectively removed by the loop filtering.

The end result was a VCO that would tune anywhere within the designed range in less than a second and have very low-level spurious signal content from the DDS!

Locking a VCXO to an audio DDS reference:

As it turns out, locking a VCO - essentially a free-running oscillator with an implied, wide tuning range - is a comparatively "worst-case" scenario when it comes to the minimization of things like "reference sidebands" - the frequency/phase modulation of the generated carrier from residual AC on the tuning line - owing to the very high loop gain involved which can arise from both the "tuning sensitivity" of the VCO itself and if high divisor ratios are used.  If one starts out with an oscillator with a comparatively narrow tuning range - such as a VCXO (Voltage Controlled Crystal Oscillator) - in which the tuning sensitivity can be orders of magnitude smaller - and the lock time may be longer, particularly if high divisor ratios are used since it may take some time for the phase fo the comparison signal to "slide" into alignment - it is much easier to keep those already low-level spurious signals down to levels that may be ignored in typical applications.

A practical implementation of this technique has been employed in the W7SP Synchronous/Voting repeater system operated by the Utah Amateur Radio Club (described here - link) in which the transmit frequency is referenced from 10 MHz OCXOs (Oven Controlled Crystal Oscillators) and held within 1-2 Hz of the intended frequency.  Using DDS techniques with 32 bit accumulators operating at approximately 3.2 kHz, the transmit frequency can be controlled - via the audio frequency - to a resolution of 0.0023 Hz at the two meter transmit frequency - an accuracy that far exceeds the accuracy and stability of the reference oscillators themselves!

Producing exact frequencies:

The difficulty with using DDS techniques arises when an exact frequency is desired, such as for a frequency standard - at least unless one is willing to crunch a few numbers and/or make a few compromises.  For example, since the typical DDS algorithm is based on binary counters and thus has denominators of 2n power, one will likely not end up with the precise frequency desired.  In our example, above, with a 32 bit counter, we can likely get the frequency to with a fraction of a Hertz, but not exactly where it should be.

There are several ways around this, including one or more of the following:
  • Extending the resolution of the binary counter used in the DDS with even more bits to get ridiculous resolution so that the resulting frequency is "good enough."  If enough processor time is available and 32 bits of resolution is not enough, 48 or even 64 bits of addition may be implemented to do unsigned math.
  • The careful selection of a clock frequency such that the divisors result in the exact frequency desired.  The difficulty here is that if it is an "exact" frequency that is desired, many reference frequencies - such as 10 MHz - are not "binary friendly", requiring a bit of clever math to come up with exact relationships with the target frequency.
  • Designing the DDS counter to use something other than a binary (2n) counter.  If, say, a 10 MHz clock is used, the software DDS may be implemented using counters that will roll over at 10n instead of 2n, driven by a hardware divisor set to a base-10 relatable value to yield exact frequencies.
  • Implementing "dithering" of the DDS count to achieve fractional tuning.  This involves switching between two or more frequencies at a specific rate to achieve a third, averaged frequency.

 The last method, dithering, must be used with care as it will, by its nature, introduce spectral components that are necessarily lower in frequency than that of the reference being generated by the DDS - possibly very much lower if the fraction being represented by the dithering is complex - and these lower frequencies can greatly complicate effective loop filtering!  In most cases it would be more beneficial to simply extend the resolution of the software DDS (e.g. more bits) rather than implement dithering making this technique most useful if one us using a hardware-based DDS.

Comment:
If one needed to provide exactly 1 Hz steps, a DDS reference frequency based on 2^n Hz would be appropriate.  For example, if you chose 2^24 Hz (16.777216 MHz) you can lock that (awkward) frequency to 10 MHz as follows using only a few chips:
  • Divide 10 MHz by 625 to obtain 16 kHz (using a 74HC103 as a divide-by-125 and a 4017 to further divide-by-five.)
  • Using a PLL, multiply 16 kHz by 32 to yield 512 kHz (the lowly 4046 and a 4040 binary counter work well for this.)
  • Divide 512 kHz by 125 to yield 4096 Hz (using another 74HC103 to divide by 125)
  • Divide the 16.777216 MHz DDS reference oscillator by 4096 using a binary counter to 4096 Hz for the frequency comparison (a 74HC4040 works well as the divider here.)
The above steps may be done many different ways to get different frequencies, but the above is one example as to how to tie the two disparate frequency references together.

Final thoughts:

While there are definite limitations in using a DDS reference to lock a high frequency oscillator, namely the need to suppress the inevitable reference sidebands that result from the DDS synthesis itself by filtering, careful selection of reference frequencies and/or choice of the type of oscillator, but appropriate application of these methods can produce a reliable, versatile - even simple - frequency source.

[End]

This page stolen from "ka7oei.blogspot.com".

Monday, March 31, 2014

Examining the Glencom VC510 UHF to L-Band Upconverter

This is a curious little device - of which several have fallen into my hands.

Often available on EvilBay for fairly cheap, these are in some nice, die-cast Hammond (tm) aluminum boxes approximately 7.25"L x 4.5625"W x 2.125"H (185mm x 118mm x 54mm) in size with two good-quality "N" type connectors connected with short lengths of UT-141 PTFE cable and an board-mounted "F" connector.

The question that seems to be asked by others who run across these devices on the GoogleWeb is "What are these for?"

Well, I can answer that.
Figure 1:
The case of the VC510 "Upconverter"
Click on the image for a larger version.

From the early 90's and into the mid 2000's Hughes Network Systems had a VSAT (Very Small Aperture Terminal Satellite) product referred to as "ISBN" - and an early version of this was called the "Type 2" with much of the hardware being made by NEC in Japan.  Connecting the rooftop satellite transceiver - typically operating in the U.S. market on the Ku band - to the indoor data interface unit was a single coaxial cable that carried not only the power, but all of the myriad control signals used for transmitting - but also the entire 500 MHz of the satellite passband.

Now, you would think that, like everything else satellite that the receive signal would occupy the "L-Band" range of 950-1450 MHz, being down-converted from 11700-12200 - but you would be wrong.  For various and sundry technical reasons, the receive signals were conveyed on the cable from 1000 to 500 MHz - "upside-down" owing to a "high-side" local oscillator within the rooftop unit itself, making it incompatible with L-band gear.

Except that NEC/Hughes had thought of that:  They'd handily included a simple converter within the unit that, using a 1950 MHz oscillator, converted that "upside-down" signal to the proper 950-1450 MHz L-band signal again.

Except that it didn't really work all that well.

Figure 2:
The circuit board of the VC510.  There is also a version that has a
surface-mount 74LS parts instead of the DIP parts shown that is
(pretty much) electrically identical in all other ways.
Click on the image for a larger version.
You see, at about this time, digital signals - data, voice and video - were starting to appear on the satellite bands and this built in L-band converter - while adequate for wideband analog video signals was too unstable and inaccurate for digital signals so the device pictured above was devised to fit the bill, doing what the built-in converter should have done correctly in the first place!

Dissecting the VC510:

Essentially, the VC510 does the same thing as the converter in the original NEC unit should have done:  Mix the 1000-500 MHz signals with a 1950 MHz local oscillator to yield a stable, clean 950-1450 MHz L-band signal - but how did they do it?

To answer this question, I decided "reverse-engineer" the board and came up with the diagram, below.

Figure 3:
A reconstructed circuit diagram of the VC510.
The component designations are arbitrary and are not marked on the board anywhere but with a a circuit this straightforward, it should be pretty easy to work out what's what!
Click on the image for a larger version.
How it works - The frequency converter portion:

The signal from the rooftop unit is coupled via the "line sampler" - a stripline directional coupler etched onto the circuit board that also extracts a bit of the DC power from the coaxial cable as well:  This directional coupler has a negligible effect on the signals passing through it.

From this directional coupler is an elliptical-type low-pass filter that removes signals above approximately 1000 MHz (there may have been a signal at around 1350 MHz - I don't know this for certain) and is amplified by U1 by about 12dB which is then applied to U2, an RMS-11X doubly-balanced mixer which causes a loss of approximately 7 dB.  Mixed with the 1950 MHz signal from the local oscillator the output is passed through an attenuator and then another low-pass filter with a cut-off frequency of approximately 1800-2000 MHz and then amplified by U3 by for another 12dB gain which is the L-Band output.

The local oscillator:

Q1, an AT-41511 transistor along with varactor diode D1 forms a VCO, the output of which is coupled via an attenuator pad to U4, a MMIC that amplifies the signal by 10 dB - some of which is siphoned off and applied to U6, an MB506 divide-by-256 prescaler that takes the 1950 MHz signal down to 7.6171875 MHz (when the PLL is locked) - while the remainder goes to U5 to be amplified again and applied to U2, the RMS-11X mixer.

The main reference oscillator is based around a 7.6171875 MHz (approximately!) crystal, using a 74LS00 NAND gate and fed to a pair of 74LS74 D-type flip-flops wired as a "charge-pump":  If the frequency is too high, a bit of charge is subtracted from C28 and added to C29 and vice-versa if the frequency is too low. U9, a TL071 op amp which is used as a loop filter/integrator and does the phase/frequency control, locking the VCO to the frequency reference provided by the crystal.

In all, there's nothing about the above circuitry that is particularly fancy or requires exotic components - just the application of fairly inexpensive, standard components using designs that had been around since the late 60's or early 70's - except, perhaps, for U6, the prescaler.

Notes:
  • U1 and U2 are very similar to the MSA-2086 (but a different package) and good from DC to at least 2.5 GHz and typically have 10-12 dB gain over this range and a 6-7 dB noise figure with a 1dB compression power output of around +4dBm  The typical bias current is 25 mA with 5.0 volts at the output terminal.   This device is generally equivalent to the Mini-Circuits MAR-2.
  • The MSA-1105 used for U4 and U5 is good from below 50 MHz to 1300 MHz at the -3dB points with a typical gain of 10-12 dB and usable to over 2 GHz with a gain reduction to around 6dB.  Up to 1.3 GHz the 1dB compression power output is typically +18dBm dropping to around +15 dBm at 2 GHz with the noise figure below 1 GHz typically being below 4 dB and rising to around 5.5 dB at 2 GHz.  The typical bias current is 60 mA with 5.5 volts at the output terminal.  This device is generally equivalent to the Mini-Circuits MAV-11.

Testing on the workbench:

Surprisingly, the unit produced a fairly good CW "note" - almost suitable for CW/SSB operation - something that could have probably been cleaned up had a better crystal reference oscillator used.  With no modification at all, the VCO's lock range turned out to be approximately 1600-2150 MHz by varying the frequency fed to the crystal oscillator from 6.25-8.398 MHz - but it could probably extended by modification of the cutting/bridging some traces in the VCO section.

As it is, the "gate-type" crystal oscillator based on the '7400 is not accurate/thermally stable enough for SSB/CW operation - or even narrowband FM operation - so if this sort of operation is anticipated, a different, more thermally-stable oscillator is likely required!

So, what's it good for?

It's hard to say, but some of the ATV folks seem to have found use of these devices as 23cm and/or 13cm ATV converters and in theory it could be used to convert 2 gig WiFi to other frequency ranges or even be the front end of a simple spectrum analyzer for the low GHz range.

Because the RMS-11X mixer is rated for as low as 5 MHz on all ports, up to 1000 MHz on the IF port (to which the F-connector sends the signal) and to 1900 MHz on the LO and RF ports, it should be perfectly usable to at least 2500 MHz - perhaps higher, especially if preceded with a low-noise amplifier.


A few comments about modification:

- L1/L2/L3 are circuit board inductor traces that can be sliced.  If the accompanying capacitors are removed, the low-pass response of this filter is eliminated and useful response is extended well past 2 GHz.

- L4 is a circuit board inductor and its low-pass response is also eliminated if its accompanying capacitors are removed.

- If the L1-L4 filtering is removed, additional (narrowband) filtering for the frequencies of interest should be added to the input and output to prevent/minimize spurious responses.

- As noted on the schematic, there are also some traces that could be sliced/jumpered in the VCO section.  It is likely that modification of these could change the VCO tuning range from that noted above.

Please note that the rating of the prescaler, MMIC amplifiers and the mixer would limit the upper end of the useful range of the VCO to something in the 2.2-2.4 GHz range at most, but it should be possible - in theory - to take the VCO down to well below 1 GHz with the addition of a physically larger inductor.  If this is done, one might want to rewire the prescaler as well to give a different divisor ratio (e.g. divide-by-128 or even divide-by-64) using the information on the diagram.


Now you know!

[End]

This page stolen from ka7oei.blogspot.com