2016年12月31日土曜日

SPICE simulations of regenerative detector sensitivity

This post details simulation results of a 1.2-volt BJT regenerative detector, showing the AF output voltage at the detector for input RF voltages of 1 microvolt, 10 microvolts, and 100 microvolts. These simulations are part of my continuing experiments with 1.2-volt AGC. The AF input level into the AGC detector determines the control voltage and the amount of gain reduction that the AGC can achieve. Therefore, in designing an AGC system, it is important to quantify the amount of AF output that the RF detector can deliver.

Notes on the simulation procedure

  1. The general idea of these simulations is to adjust the regeneration level to be barely oscillating, for above-threshold synchronous reception. Then, an AM signal (100% modulation with a 1 kHz audio frequency) is generated at the oscillator's resonant frequency, and this AM signal is inductively coupled into the tank.
  2. To accurately determine the oscillator's resonant frequency, the simulation must be run at high temporal resolution with no waveform compression. "High temporal resolution" subjectively means that zooming into the traces of the RF signal should show very smooth curves over an entire RF cycle -- in other words, each smooth RF cycle should be approximated by several tens of timesteps. In the below simulations, the radio frequency is around 2 MHz. This means that one cycle of the RF voltage is completed in 0.5 microseconds, or equivalently 500 nanoseconds. By selecting a timestep of 10 nanoseconds, there will be 50 discrete steps available to simulate each RF cycle. In other words, the smooth curve of one RF cycle will be approximated by 50 straight-line segments. 
  3. With a high-temporal-resolution, run a transient simulation and allow the oscillator to barely oscillate. The regeneration level corresponding to "barely oscillating" must be found experimentally. A voltage pulse is used in series with the tank coil to "kick-start" the oscillator. With the oscillator barely oscillating, an FFT is taken on the transient (time-domain) data to give the frequency-domain response. Zooming into the peak on the FFT will give the frequency of the oscillator. The frequency should be determined to better than 1 Hz accuracy.
  4. Given the oscillator's resonant frequency, then an AM signal at that same frequency can be coupled into the tank for regenerative amplification and detection. If the frequency is slightly off, you will get "beating" effects where the oscillator's frequency beats against the slightly-mismatched incoming signal to generate an audio-frequency beat note. This is undesirable and complicates the interpretation of the results; hence, the need to accurately determine the oscillator's frequency as described in step 2. 
  5. The audio-frequency output should be visible at the output of the regenerative detector. 
  6. The first 1 second of simulated circuit's behavior (i.e. the first 100,000,000 timesteps with a timestep of 10 nanoseconds) shows widely varying circuit voltages, as the circuit requires time to reach steady-state (capacitors need to be charged, bias levels need to stabilise, and so forth). Therefore, the first 1 second of simulation data is discarded, and data is saved from 1 second to 1.5 seconds.
  7. The regenerative detector circuit itself is a common-base oscillator at 2 MHz with AF output taken from the collector. Similar circuits can be seen here: http://www.ke3ij.com/bigloop.htmhttp://www.techlib.com/electronics/regen.html. The future plan is to use the 2-MHz regenerative detector as the IF stage in a superheterodyne receiver, with AGC controlling the amount of signal that is fed into the regenerative detector. The regenerative detector's audio-frequency output is fed into a 3-transistor AF amplifier, which will eventually be used to generate a control voltage as part of the AGC scheme.
  8. Using the circuit simulator software LTspice IV, this simulation took between 1 and 2 hours to run. Typical simulation speed was usually such that computing 1 millisecond of simulated time required 1 actual second (wall-clock time) of execution time. Given this simulation speed, three simulation runs, each 1500 ms long, yield an estimated total simulation time of about 1.25 hours. The results occupy 36 gigabytes of disk space.

The circuit under simulation

Q1 is the regenerative detector, running off of 1.2 volts.

Rs (1 ohm) represents series losses in the inductor L1. Oscillation frequency was determined by an FFT to be 2.0178 MHz. With L1=25 uH, this implies a coil Q of 317. This is fairly high and might be difficult to achieve in practice. It might be more realistic to increase Rs to 2 ohms for a coil Q of 158, which is more reasonable for small-form-factor coils like those wound on iron-powder toroidal cores.

Regeneration is controlled by the resistive voltage divider R3/R4.

Unamplified AF output from the regenerative detector is taken from the collector load resistor R1.

Amplified AF output (amplified by Q2, Q3, and Q4) is available at the top of R12. In a later project, the amplified AF output will also be taken from C9 to drive an AGC detector and generate an AGC control voltage.


Simulation results

Amplitude-modulated RF input to the regenerative detector


The simulation is run with three different values for the RF input voltages: 100 uV peak, 10 uV peak, and 1 uV peak, as shown below.


Unamplified AF output from regenerative detector


The unamplified AF output at the detector's collector resistor is as follows. The red trace corresponds to an input RF voltage of 1 microvolt peak; the blue, 10 microvolts; the green, 100 microvolts.


If we zoom in temporally and observe only a 10 ms window of the output, the AF signal becomes clearly visible. We have one cycle per one millisecond -- i.e., a 1 kHz AF output, corresponding to the 1 kHz-modulated AM signal that was fed into the tank.


Zooming in closer to the red trace gives the following result.


Though somewhat difficult to see, the red trace is also varying upward and downward at a rate of 1 kHz. Observing the top edge of the red trace, it can be seen that each small peak (rise in voltage) on the top edge is simultaneously accompanied by a peak (rise in voltage) of the bottom edge. Therefore, the top edge and bottom edge of the red trace, at audio-frequencies, are essentially moving in unison, and therefore to understand the amplitude of the AF component of the red trace, we can simply look at the amplitude variations on the top edge of the red trace.

Zooming in even closer to the top edge of the red trace gives this result, where we can clearly see the 1-kHz audio-frequency variation in output voltage.


Input-to-output linearity of regenerative detector


Observing the above graphs we get the following numerical results:

  • For a 1 uV peak (2 uV peak-peak) 100%-modulated AM signal as input, the detector's AF output is about 15.47 uV peak-peak. This represents about 17.7 dB of gain.
  • For a 10 uV peak (20 uV peak-peak) 100%-modulated AM signal as input, the detector's AF output is about 199 uV peak-peak. This represents about 20 dB of gain. Comparing these results with the previous case, the input has increased only 20 dB from 1 uV to 10 uV, but the output has increased about 22.2 dB from 15.47 uV to 199 uV.
  • For a 100 uV peak (200 uV peak-peak) 100%-modulated AM signal as input, the detector's AF output is about 2.294 mV peak-peak. This represents about 21.2 dB of gain. Comparing these results with the previous case, the input has again increased only 20 dB from 10 uV to 100 uV, but the output has increased about 21.2 dB from 199 uV to 2.294 mV.
So some detector non-linearity is evident. To quantify this further, it would also be possible to run a two-tone test in the simulator to determine third-order intermodulation performance. This goes beyond the scope of this article.

Observing the temporal simulation resolution


Zooming in temporally (observing a less-than-1-millisecond window of the output), we can see that the apparently smooth traces of the AF signal actually still have a radio-frequency component -- a residual of the original RF signal. The RF component is small, but present.


 Zooming in even further, we observe the individual peaks and troughs of the RF component of the AF output.


Zooming in to one peak of the RF component of the AF output, we can begin to see the discrete lines that form the approximation to the smooth curve of the continuous RF signal.


Output of AF amplifier


Q2, Q3, and Q4 amplify the small AF output from Q1. The results are as follows.

Observing a 10-ms window from 490 ms to 500 ms gives the following signal at the "hi" output of the AF amplifier.


We can see in the above diagram that larger input signal levels (blue trace corresponding to 10 uV RF input; green trace corresponding to 100 uV RF input) are distorted after amplification. This is why the planned receiver will use AGC: to attenuate larger input signals before they can drive the AF amplifier (or the regenerative detector) into distortion.

Zooming in closer to the red trace (corresponding to 1 uV RF input) gives the following result, a fairly clean sine wave corresponding to the original 1 kHz modulation on the input RF signal.


Zooming in to one peak of the red trace, we again see the residual RF component in the amplified AF signal. For this reason it is important to separate RF and AF wiring in a regenerative receiver; otherwise, some RF from the audio amplifier might couple back into the tank, causing unwanted feedback, difficult-to-control regeneration, and other unpredictable effects.


Appendix

Although my regenerative detector circuit uses a fixed voltage divider to determine the base bias, it should be noted that similar circuits at http://www.ke3ij.com/bigloop.htmhttp://www.techlib.com/electronics/regen.html use collector feedback biasing, whereby the top half of the base's voltage divider is connected not directly to Vcc, but instead to the collector resistor.

It is possible that collector feedback biasing will have an effect on the amount of AF output available at the detector's collector. More simulations are needed to confirm this.

2016年12月24日土曜日

1.2-volt AGC, part 4

This post uses LTspice simulations to illustrate some continuing design work to improve the 1.2-volt AGC circuit, previously described in the following posts:

Please see the first link above to see the original circuit and its analysis.

Design goals: RF attenuation and wider AGC range

This AGC circuit by Courtney Hall (WA5SNZ) was originally designed for audio-only. That is, it takes an input signal at audio, amplifies it, then based on the amplified AF output, finally attenuates the original input AF signal to achieve the automatic-gain-control action. The attenuation of the input signal is achieved by using a transistor as a variable resistance. This variable resistance then forms the bottom half of a a voltage divider with the top resistance having a fixed value. The variable bottom resistance formed by the transistor causes more or less of attenuation of the input signal as required.

This article examines how to modify the circuit to achieve the following goals.
  1. AGC control of RF signals instead of AF signals. The improved circuit should be able to attenuate incoming RF signals (somewhere in the HF range from 2 to 30 MHz), instead of attenuating incoming AF signals. This requires analysis of the frequency response of the attenuator transistor stage, and modification of the transistor's bias.
  2. Increased range of the AGC action, but without increasing the supply voltage (1.2 volts). This can be achieved by using two attenuator stages in cascade. However, this increases the circuit complexity.
The AGC circuit is planned to be used as part of a single-conversion shortwave superheterodyne receiver. The AGC can control the signal strength at either of the following two locations in the signal processing chain:
  1. At the very beginning of the chain, to regulate the strength of the RF signal before it enters the first RF amplifier
  2. Or, after the frequency conversion first stage, to regulate the signal strength at the intermediate frequency, before it enters the first intermediate-frequency amplifier.
In theory the first option would be better, as it attenuates strong signals before they have a chance to overload any of the following stages. The second option has the disadvantage that strong signals are only attenuated after the mixer, meaning that the mixer itself may be subject to overload. However, for a portable receiver with a small whip antenna, signal levels are likely to be low anyway, meaning that either option is probably acceptable.

Design requirements: Only 2N3904s and 1.2 volts


Though many AGC circuits can be found on the Internet, none fits my particular requirements. The primary requirements of my design work are:
  1. Use only 2N3904 transistors.
  2. Use a supply voltage of 1.2 volts.
These are simply personal preferences for my own circuit design work. There aren't many commercial radio receiver circuits designed to work off of only 1.2 volts, so for me it is an interesting and lesser-explored design challenge. Practical benefits of a 1.2-volt supply include the following.
  • 1.2-volt batteries are physically small.
  • 1.2-volt rechargeable batteries and are cheaply and readily available for purchase.
  • Use of only one battery for the power supply makes it easy to replace or recharge the single battery. A higher supply voltage would require either multiple batteries or a larger and/or more-expensive battery.
For the current design work, I am willing to accept an increase in circuit complexity -- even a significant increase in complexity -- to keep the design within these requirements. 

Behavior of the existing circuit

Regarding the original AGC circuit by Hall, the  fundamental design challenge is its operation at the low supply voltage of 1.5 volts. Such a low supply voltage makes it difficult to generate a sufficient AGC control voltage. The variation in the AGC control voltage must be large enough to so that it can generate a sufficiently wide variation in the AGC control current, that is in turn fed into the base of the transistor that is used to attenuate the input signal.

The Hall design is able to achieve a sufficiently wide range of AGC voltage and AGC current, even when running off of only 1.5 volts. But the low-voltage performance of Hall's circuit comes at the expense of circuit complexity; Hall's original 1.5-volt design requires 6 transistors. 

Brief review of Hall's original 1.5-volt design


A small supply voltage of 1.5 volts means the AGC control voltage range is limited. A limited AGC voltage range then means that the AGC control current range is limited. A limited AGC control current then means that the base current of the attenuator transistor can vary only slightly. This finally means that the amount of achievable attenuation by the attenuator transistor is limited, which means that the AGC might not be able to sufficiently attenuate a large input signal.

Hall's original circuit is innovative because it uses a low-voltage detector that requires only 1.5 volts of supply voltage, but is still able to generate a wide-ranging AGC control current that can achieve a wide range of attenuation of the input signal. Again, see the first post in this series for details: http://qrp-gaijin.blogspot.jp/2015/09/12-volt-audio-based-agc-for.html.

However, the low supply voltage requires 3 transistor stages to sufficiently amplify the input AF signal to drive the detector. Furthermore, the low-voltage detector requires 2 transistors and 1 diode. The attenuator transistor is the final transistor required in the original circuit, for a total of 6 transistors.

Brief review of my 1.2-volt version of the AGC circuit (generating maximum 50 uA of AGC current)


By replacing all transistors with 2N3904 transistors, replacing the detector diode with a 1N4148, and reducing the supply voltage to 1.2 volts, I could confirm in a hardware prototype that the circuit still operated with good AGC action.

However, the reduced supply voltage significantly reduced the range of AGC control current, and therefore significantly reduced the range of AGC action. By inserting a microammeter in series with the base of the attenuator transistor, I could measure the generated AGC current in the 1.2-volt case and the 1.5-volt case. In the 1.5-volt case, large input signals generated more than 100 microamps of AGC current. But in the case of my 1.2-volt circuit, even very large input signals generated a maximum of only 50 microamps of AGC current. This maximum of 50 microamps also agreed very well with LTspice simulations of the circuit. 

This 50-microamp maximum AGC current results in a reduced AGC action compared to the 1.5-volt case. Nevertheless, in practice the AGC action was noticeable and well-behaved in terms of attack time, release time, and subjective judgment of the audible AGC action. Therefore, it was decided to use this functioning circuit as a basis for further improvements.

Improving the circuit

Design process using the LTspice circuit simulator


To improve the circuit and achieve the previously-stated goals, the circuit behavior was again analyzed in LTspice. Since we know that the maximum AGC current that can be generated is 50 microamps, we can divide the design process into two parts.
  1. Design of the attenuator stages. Assume that we have a detector capable of generating an AGC current from 0 microamps to 50 microamps. Then, analyze the behavior of the attenuator transistor to determine the attenuation in dB, for a given AGC current. Also analyze the frequency response of the attenuation behavior; as we shall see below, the attenuation changes with frequency.
  2. Design of the detector stages. Analyze the input-vs-output behavior of the detector stages. Determine the required range of input AF voltage, in order to generate the desired range (0 microamps to 50 microamps) of output AGC current.
Given the requirements of the AGC detector and the AGC attenuator, then we can design the rest of the receiver as follows. The design proceeds "backwards" from the AGC detector to earlier signal-processing stages. In other words, the input requirements for the later stages dictate the output requirements for the earlier stages.
  • The AF amplifier (preceding the AGC detector) should be designed to provide enough output voltage to properly drive the AGC detector.
  • The RF detector (preceding the AF amplifier) should be designed to provide enough output voltage to properly drive the AF amplifier.
  • The RF amplifier (preceding the RF detector) should be designed to provide enough RF signal voltage to the detector, so that in turn the detector can provide enough AF output voltage to drive the AF amplifier. 
  • For a superheterodyne receiver, if we want to apply the AGC action to the signals at the Intermediate Frequency (IF), then above-used term "RF" actually refers to signal processing at the fixed-frequency IF. For example, if we are designing a superheterodyne receiver with a 2 MHz IF, then we need to design a 2 MHZ detector stage and 2 MHz RF amplifier stages according to the above guidelines.
This article will only cover the design of the AGC attenuator stages and the AGC detector stages. Design of the other stages like the AF amplifier, RF (IF) detector, and RF (IF) amplifier will perhaps be covered in a future article.

Analysis and design of the attenuator stages

Let's start with the analysis of the attenuator transistor stage from the original Hall circuit. The variable voltage divider is formed by R1 as the top resistance and Q1 as the variable bottom resistance. The input voltage is applied at the top of R1, and the output voltage is taken at the junction of R1 and Q1. R2 serves to bleed off excess charge from the Q1 emitter, which accumulates due to C1 and C2. Note that the NPN transistor is connected "reversed", with the collector grounded instead of the emitter. This gives better AGC performance due to a lower offset voltage in this configuration (see Hall's original article for details).

Original attenuator circuit behavior


In the below circuit simulation, the input AGC current into the Q1 base is varied from 0 microamps to 50 microamps to observe the amount of signal attenuation. An AC (frequency-domain) analysis is performed, sweeping from 100 kHz to 30 MHz. The results are shown in the following image.


The top-most green line represents the attenuation when the AGC current is 0 microamps. The bottom-most line represents the attenuation when the AGC current is 50 microamps.

Attenuation increases with increasing AGC current, as is expected.

As previously mentioned, the Hall circuit was designed for attenuation of AF signals. At 100 kHz (extreme left-edge of the graph) and lower frequencies in the audible range, in the case of no AGC current (green line, corresponding to 0 microamps) the input signal is practically fully available with almost 0 dB attenuation. For increasing AGC current, the attenuation steadily increases up to a maximum of almost 40 dB. This is a moderately good AGC range for AF signals.

However, the frequency response of the circuit is not ideal for attenuation of RF signals. At higher frequencies, even with no AGC current (0 microamps), the attenuation increases with increasing frequency. This is due to the parasitic capacitances of the bipolar transistor Q1. These parasitic capacitances provide an alternative path to ground for the RF signals, and therefore reduce the RF resistance of Q1. The lower RF resistance of Q1, in comparison with the fixed top resistance R1, leads to lower voltage at the R1/Q1 junction, which therefore results in increased attenuation (even with no AGC current) at higher frequencies. This is undesirable and will lead to reduced sensitivity at higher RF frequencies.

More uniform attenuation from 100 kHz to 30 MHz


To increase the uniformity of the RF attenuation, we can reduce the value of R1. Then, the lower RF resistance of Q1 will be proportionally less, leading to more uniformity in the frequency response. However, this also means that the range of attenuation that can be achieved is reduced. In the below simulation, we have reduced R1 to 100 ohms. The attenuation behavior is then almost constant from 100 kHz to 30 MHz. However, the range of attenuation has been severely reduced: only about 5 dB of attenuation can be achieved over the full range of the AGC control current. Nevertheless, this approach might be acceptable for an AGC-controlled RF stage. The range of attenuation can be increased by cascading several attenuator stages in sequence, as will be seen below.


Attenuation at the specific frequency of 2 MHz 


For a superheterodyne receiver, we can choose to apply the AGC only at the intermediate frequency. In this case, we do not need to worry about the attenuation behavior at all frequencies from 100 kHz to 30 MHz. We only need to worry about the attenuation behavior at the specific intermediate frequency. For example, assume we choose an IF of 2 MHz. Then, if we change R1 to 10k, the simulation shows the following attenuation behavior at 2 MHz.


With zero microamps of AGC current, the input signal suffers almost no attenuation at 2 MHz. Increasing AGC current leads to full attenuation of almost 40 dB -- which is about the same range of AGC behavior as the original attenuator circuit achieved at audio frequencies.

Of course, at higher frequencies the attenuation again suffers the undesired increase in attenuation, as shown below, where the attenuation behavior with R1=10k is plotted from 100 kHz to 30 MHz.


But again, because for a superheterodyne we are interested only in the behavior at the IF of 2 MHz, we do not need to worry about the degraded response at higher frequencies.

Increasing the AGC range by cascading 2 attenuator stages


We can increase the range of the AGC by connecting 2 attenuator stages in cascade as follows. The initially attenuated signal -- attenuated by the R1/Q1 voltage divider -- is then fed into the R3/Q2 voltage divider for further attenuation.


In this cascade circuit, the condition with no AGC current nevertheless results in a small attenuation of about 3 dB. This is undesirable, but the zero-AGC-current attenuation is small enough to be acceptable.

Advantageously, the maximum attenuation has approximately doubled, to around 75 dB, giving an attenuation range from 3 dB to 75 dB, representing about a 72 dB range. This is a good AGC range that should be able to adequately attenuate the majority of signals that are expected (for a shortwave receiver) to arrive into the IF amplifier stage.

Note that we require two separate control currents -- one to drive each of the attenuator transistors Q1 and Q3. We cannot split the small AGC current among both transistors, because the low-voltage AGC detector (when powered by a 1.2-volt power supply) cannot generate enough current to drive both attenuator transistors. Therefore, we require two separate AGC detectors (both driven from the same AF amplifier). This results in a considerable increase in circuit complexity, because each AGC detector requires two transistors, for a total of 6 transistors to implement the AGC: 2 attenuator transistors, and 4 transistors for the required 2 AGC detectors.

If we are willing to cascade three attenuator transistors, then we can achieve a more than 100 dB range of attenuation at 2 MHz from the same 50 microamps of control current -- again, using a separate control current (and a separate 2-transistor AGC detector) to drive each of the three attenuator transistors. The zero-AGC-current attenuation increases to around 7 dB in this case, with the maximum attenuation being about 113 dB, for a more-than-100 dB range of attenuation. The simulation results for the three-cascaded-attenuator case are shown below.


Analysis and design of the AGC detector stages

The second design step (and the last to be considered in this article) concerns the design of the AGC detector stage. One AGC stage requires two transistors: one to sense the incoming AF voltage, and a second one that serves as a voltage buffer and current amplifier, to drive the attenuator transistor.

As mentioned in the previous section, we require one AGC detector stage (2 transistors) for each attenuator transistor. Since each attenuator stage is driven by its own AGC detector, and since each AGC detector is driven from the same AF amplifier, we can consider each AGC detector as operating independently of the other AGC detectors, since they all fan-out from the same AF amplifier and should operate independently and in parallel. Therefore, the further analysis presented below will only consider the design of a single AGC detector, as the behavior should not change even if we add additional AGC detectors that fan-out from the same AF amplifier. Note however that later, when we design the AF amplifier (a topic for a future article), we must ensure that it has enough power to drive all of the connected AGC detector stages.

Again, we know (based on previous microammeter measurements on the physical prototype circuit) that the AGC current ranges from 0 microamps to 50 microamps. The goal of this design step is to determine the required AF input voltage to generate generate AGC currents ranging from 0 to 50 microamps. Furthermore, the generated AGC current must be generated very quickly (on the order of tens of milliseconds), so that the AGC circuit responds quickly to strong incoming signals. A short response time (i.e. a fast attack time) is important to enable the AGC to attenuate strong signals quickly before they have a chance to overload the AF amplifier, and before they have a chance to produce dangerously-loud audio output for the listener. 

Required AF input voltage


The below image shows the AGC detector circuit. Q2 and D1 form the detector itself, while Q3 is a voltage follower amplifier that amplifies the current to drive the attenuator transistor Q1. The operation of the detector, whereby C3 accumulates voltage and D1 allows that voltage to further increase the base bias, has already been explained in a previous posting (http://qrp-gaijin.blogspot.jp/2015/09/12-volt-audio-based-agc-for.html). 

Here, we are interested in analyzing the input-vs-output behavior of the AGC detector.

In the below diagram, the area within the dotted box represents circuit components that have been omitted. These omitted circuit components must convert the incoming RF signal to an AF signal; that is, the RF signal must be detected. Furthermore, the resulting detected AF signal must then be amplified, to produce the AF voltage that is then fed into the input of the AGC detector Q2. The details of the RF detection and AF amplification do not concern us at the moment. Therefore these components are omitted, and in the simulation, the voltage source V2 generates a sine wave having frequency 1 kHz to simulate the output of the AF amplifier.

In order to measure the input-to-output behavior of the detector Q2/Q3, the amplitude of the signal generated by V2 is varied over a range from 350 mV to 600 mV. The lower bound of 350 mV was chosen somewhat arbitrarily. The upper bound is chosen as the maximum peak AC signal voltage that can be generated by a 1.2-volt supply; assuming the final AF amplifier transistor is biased to have 600 mV at the collector with no input signal, then the collector voltage can swing a maximum of 600 mV in either the positive or the negative direction.

The resulting AGC control current, measured at the base of V1, is shown below.


As can be seen, the maximum possible AGC current -- generated by the maximum Q2 input AF voltage of 600 mV -- is around 50 uA. Lower values of input AF voltage result in correspondingly slower build-up of AGC current and a lower final value of AGC current. At the lowest levels of input AF voltage (350 mV), essentially no AGC current is generated even after 5 seconds.

Attack time of the AGC detector


Although the previous graph shows the input-vs-output behavior of the AGC detector over a time span of 5 seconds, we are actually not interested in the behavior over such a long time span. Instead, we are interested in the AGC detector behavior after a few tens of milliseconds, because for a fast AGC response time (fast AGC attack time) we want a sufficiently-large AGC current to be developed after only a few tens of milliseconds, so that large signals are very quickly attenuated.

By zooming into the above graph we can observe the AGC behavior at the millisecond timescale.


The above graph shows that for the maximum AF input signal voltage (corresponding to the upper-most blue trace), the full AGC current is generated after approximately 80 ms. So we can conclude that the attack time of this AGC detector is about 80 ms, which is reasonably fast.

Zooming in the graph further around the 80 ms mark, we can then more closely observe the input-to-output behavior, shown in the below graph.


The top-most trace in the above graph corresponds to an input AF voltage of 600 mV. Each subsequently lower trace corresponds to an AF input voltage that is 10 mV lower. Therefore, the bottom-most, non-zero trace (the purple trace) corresponds to an AF input voltage of 510 mV. All other traces -- corresponding to AF input voltages between 350 mV and 500 mV -- yield essentially zero AGC current after 80 ms.

Therefore, we can conclude that for an attack time of 80 ms, the input AF voltage that is fed into the AGC detector should lie between 500 mV and 600 mV (but see the next paragraph about delayed AGC). This range of input AF voltages will result in the full range of AGC current from 0 uA to 50 uA. And as we saw previously, by cascading two attenuator stages, each driven with an AGC current of 0 uA to 50 uA, we can achieve an effective AGC range of 72 dB.

Furthermore, input AF voltages below 500 mV will not be attenuated at all. This useful property allows implementing delayed AGC. Delayed AGC means that weak signals are subject to no attenuation at all, whereas strong signals are attenuated. This is desirable, because when listening to weak signals we want no attenuation applied. By designing the AF amplifier appropriately, we can arrange for "weak" signals (for an arbitrary definition of weak) lie below the 500 mV threshold, whereas "strong" signals (for an arbitrary definition of strong) lie above the 500 mV threshold and are attenuated. 

Release time of the AGC detector


By slightly modifying the above simulation, we can also measure the release time of the AGC detector. The simulation is modified as follows:
  1. The input AF signal voltage is varied from 500 mV to 600 mV.
  2. The input AF signal is cut off (set to zero amplitude) after 2 seconds. 
After 2 seconds, with the AF input signal cut off, the AGC control current slowly returns to zero as the bias on the Q2 base slowly leaks off through R3. By measuring the amount of time it takes for the AGC current to drop back to zero, we can determine the AGC release time.




As can be seen in the above graph, after 2 seconds, the AGC control current slowly decreases and drops to zero at about 4 seconds. In other words, after reaching its maximum, the AGC control current takes 2 seconds to recover (drop to zero). So the AGC release time is about 2 seconds.

The AGC release time can be changed by altering R3 and/or C3. However, this will also affect the AGC attack time.

Conclusion and future work

This article analyzed my 1.2-volt version of Hall's low-voltage AGC circuit, and modified the circuit for improved performance at 2 MHz. The results are:
  1. When using the AGC circuit to attenuate higher-frequency RF signals, to reduce unwanted attenuation in the zero-AGC-current condition, the top resistor R1 of the voltage divider R1/Q1 should be reduced to compensate for the lower RF resistance of Q1.
  2. 72 dB of AGC range at 2 MHz can be achieved by cascading two input attenuator stages. More cascaded stages can achieve even greater attenuation.
  3. AF input voltages (fed into the AGC detector) that lie between 500 mV and 600 mV will be attenuated, with 500 mV resulting in almost no attenuation, and 600 mV resulting in maximum attenuation.
  4. AF input voltages below 500 mV will result in almost no attenuation (over a time span of several seconds). This allows implementing delayed AGC and preventing attenuation of weak signals.
  5. AGC attack time is around 80 milliseconds.
  6. AGC release time is around 2 seconds.
Future design work will concentrate on the omitted circuit components in this article: design of the RF (IF) detector and the AF amplifier.

Appendix

The following additional information will be worked into this article in the future. For now, this is just a brief list of notes.
  1. Discussion of one AF amplifier driving several fanned-out detectors: the AGC detectors draw minimal current, so a fairly standard AF amp should have no problem driving several AGC detectors.
  2. Attack time of AGC depends on frequency of input AF signal; higher frequency=faster attack. But for typical AF frequencies (100 Hz to 10,000 Hz) the attack time is always less than one second.
  3. Onset of delayed AGC is complicated to calculate. An estimate of 500 mV was given, based on the AGC attenuator behavior after 80 ms. However, weak signals generating less than 500 mV AF voltage will still, given enough time, develop an AGC control current that will eventually attenuate the signal. A better estimate can be found by analysis of the 5-second behavior (not the 80 ms behavior) of the attenuator: follow each individual input trace individually to determine exactly the threshold input AF voltage that generates a greater-than-1 uA control current after 5 seconds (where 1 uA is arbitrarily chosen as the smallest AGC current that will begin to attenuate the input signal).
  4. Transient (time-domain) simulations should be used to double-check the AC (frequency-domain) simulations presented in this article. Transient analyses can capture non-linear effects and distortion and are more representative of the actual behavior of the circuit -- but they take much longer to run.
  5. The attenuation figures calculated by the above simulations assume that the input impedance of the following stage is infinite and does not load the attenuator transistor at all. This is of course impossible. A too-low input impedance of the post-attenuator amplifier stage will further attenuate the signal and will reduce the range of possible attenuation (because it provides an alternate current path around the attenuator transistor, thereby "bypassing" some of the attenuation effect).
  6. The suggested strategy -- of reducing the top resistor of the R1/Q1 divider to adapt the audio-frequency attenuator circuit to a good attenuation range at the radio-frequency of 2 MHz -- may not be the only way to improve the 2-MHz response. An additional amplifier stage might be used instead, and simulations are being run to check this. Again, this article presents a simplified view of the AGC by omitting the surrounding circuitry. A future article will include simulations of a more complete circuit, with the eventual goal being to simulate the behavior of an entire AGC-controlled IF strip.

2016年12月4日日曜日

Noise generator for finding LC tank resonant frequency

I've been using the following simple circuit to determine the resonant frequency of LC tanks.


The forward-biased LED generates broadband RF noise, which is then amplified by the 2N3904 transistors. The amplified noise is magnetically coupled via link winding L_in into the unknown LC tank formed by L_test and C_test. Link winding L_in is simply one or a few turns on the unknown inductor L_test. Another link winding L_out couples the signal from the LC tank into a monitoring receiver.

At the resonant frequency of the LC tank (which is what we are trying to determine), a peak in the noise will be observed in the monitoring receiver. Therefore, to find the resonant frequency of the tank, we can either tune the monitoring receiver across its range searching for the noise peak, or we can use a variable capacitor for C_test and vary C_test while listening for a noise peak on the monitoring receiver.

As a particular example application, I am building a shortwave superheterodyne receiver with a ferrite rod antenna of unknown inductance, which will serve as the inductor in the front-end RF tank of the receiver. The RF tank is tuned with one gang of a dual-gang variable capacitor (the other gang will tune the LO tank). By coupling the noise generator into the front-end RF tank, I am easily able to determine the tuning range of the front-end RF tank.

Given the tuning range of the RF tank, I can then proceed to design the LO tank for the local oscillator, and also proceed to implement the ganged tuning such that the RF tank and the LO tank always maintain a fixed frequency offset as they are simultaneously tuned.

Also, if we know only one of either C_test or L_test, and want to find the other unknown value, then we can use known value in combination with the observed resonant frequency f to determine the unknown value, by solving the standard resonance formula f=1/(2*pi*sqrt(L*C)) for the unknown value. For example, if we know the value of C_test and the resonant frequency of the tank (as measured with the noise generator and a monitoring receiver), then we can determine the value of L_test. In practice, depending on the required accuracy, it may be necessary to take into account issues such as measurement uncertainty in the "known" value of C_test (which can be compensated for by taking several frequency measurements with several different and known C_test values and performing a least-squares fit to the data to determine the value of L that best explains the observed resonant frequency), or stray capacitance inherent to the inductor (which would need to be estimated and included in the resonant-frequency formula).

2016年11月13日日曜日

Some experiments with a varactor-tuned regenerative preselector

This is a brief note to document some experiments done today with a regenerative preselector.

A regenerative preselector is a regenerative amplifier connected to an antenna, where the regeneratively-amplified RF output is then fed into the rest of the receiver chain for detection.

In my experiment, I wanted to see if a short wire antenna, amplified by a varactor-tuned regenerative preselector, would be able to give a strong and clear signal. The result is that it was not able to do so.

The experimental setup was to take my latest varactor-tuned regenerative receiver (documented elsewhere on this blog at http://qrp-gaijin.blogspot.jp/2015/08/a-12-volt-vackar-style-minimalist.html, though any regenerative receiver will do), and to connect a short wire antenna of about 20 cm length to the hot end of the tank. Incoming RF from the short wire antenna would therefore be fed into the varactor-tuned tank and be regeneratively amplified by the regenerative stage.

The amplified RF was fed into a separate, portable commercial shortwave receiver with a high-impedance whip antenna. The whip antenna was completely retracted and folded downwards to ensure minimum signal could enter the receiver's original whip antenna. Then, the short wire antenna from the regenerative amplifier was simply laid on top of the commercial receiver's retracted whip antenna. The high impedance of the commercial receiver's whip antenna, combined with the high-impedance of the regeneratively-amplified short wire antenna, allowed for capacitive signal transfer between the regenerative amplifier and the commercial receiver.

The commercial receiver and the regenerative amplifier were tuned to the same frequency, somewhere within the 41-meter band. Tests were done at night (when 41-m propagation should be good) and inside of a concrete building (which greatly attenuates signal levels).

Regeneration for the regenerative amplifier was adjusted just beneath the oscillation threshold. In this condition, it was possible to weakly discern an AM signal in the 41-meter band. Signal-to-noise ratio was poor.

Then as a comparison, I turned off the regenerative amplifier and disconnected the short wire antenna from the regenerative amplifier. Then, I connected the same short wire antenna directly to the retracted whip antenna of the commercial receiver. The wire antenna was positioned identically as in the previous case. In this condition, reception of the same AM signal in the 41-meter band, while still weak, was noticeably clearer, with a much-improved signal-to-noise ratio.

My conclusion is that my particular regenerative amplifier (used as a regenerative preselector) introduces more noise into the signal chain than does the front-end RF amplifier of the commercial receiver. My particular regenerative amplifier has 3 factors that may contribute to its noisiness: its use of a low-Q varactor 1SV149 for tuning at HF, its use of a garden-variety BJT that is coupled strongly into the LC tank (which exposes the tank to varying parasitic capacitances of the BJT), and its low-voltage biasing technique where base and collector are both tied to Vcc (which may make the parasitic capacitances larger than they otherwise would be with a normal biasing technique where collector voltage higher is held higher than base voltage).

This experiment was done within the context of deciding on the front-end design for my shortwave superhet. I have now decided against using a regenerative preselector. However, it may be possible to build a quieter regenerative preselector with more attention to the above-mentioned factors.

2016年9月12日月曜日

Ferrite transformers and small- to mid-sized loop antennas

I've been doing experiments with a large wire loop (using ordinary zip cord as used for electrical appliances) on my concrete balcony for receiving and, eventually, QRP transmitting purposes. The wire loop is a vertical rectangle, approximately 4 meters wide by 2 meters high, and fed in a corner. The corner feed is not optimal from a balance perspective, but is the most convenient mechanical location for the feedpoint.

Noisy loop 1: Untuned active loop antenna


At first I tried using the wire as a receive-only, active loop antenna along the lines of M0AYF's untuned active loop antenna. I had previously had good experience with this active loop antenna, using a long, 3cm-wide copper strap formed into a square shape having approximately 0.75 meters per side. However, when I now tried the same loop amplifier with the larger 4m x 2m wire loop antenna, the noise was much higher than I expected.

Noisy loop 2: Tuned, passive loop antenna with large air-core transformer (auxiliary coupling loop)


Next I tried tuning the antenna with a small variable capacitor. To get the signal to the receiver, I used a random-length of 2mm-diameter wire, probably about 1 meter long, formed it into a loop, and clipped it to the main antenna element. The coaxial cable going to the receiver was then connected to the ends of the smaller auxiliary coupling loop. This is a common way to feed small transmitting loop antennas. Though this antenna does not qualify as "small", the principle is the same -- a loosely coupled auxiliary loop serves to transfer energy from and to the main resonant loop.

Compared with the untuned active loop antenna, I expected much quieter performance with the tuned loop. However, performance only marginally improved. The noise level was consistently high across the entire tuning range, though strong signals could be brought up out of the noise by peaking the signal with the variable capacitor. Overall performance was very poor.

I then noticed that simply connecting the auxiliary coupling loop to the receiver, even without the coupling loop near the main resonant loop, resulted in an increase in the noise level of the receiver. Therefore, the auxiliary coupling loop -- all by itself -- was picking up some kind of local noise, through electric or magnetic coupling. The noise is probably ambient electric-field and possibly magnetic-field noise produced by electrical appliances of other nearby residents.

A quiet loop: Tuned, passive loop antenna with small ferrite-core toroidal transformer


I decided to try to prevent this stray coupling into the feed system by using a ferrite toroidal core to form a transformer. I am not an expert on the physical mechanisms of noise ingress. However, I thought that using a ferrite transformer could have two potential benefits: first, a smaller physical area occupied by the transformer (compared to the air-cored auxiliary coupling loop transformer), that hopefully would reduced the induced noise; and second, the self-shielding nature of toroidal transformers that keeps the magnetic flux mainly confined to within the core.

I wound the resonant loop's wire element twice through the ferrite core, and made a secondary winding of three turns, that then connected to the coaxial cable leading to the receiver.  For mechanical convenience, the ferrite transformer was located next to the corner-mounted tuning capacitor; such a location for the transformer increases (compared to the typical transformer location diametrically opposite the capacitor) the impedance seen looking into the transformer. Considering both the higher-impedance location of the transformer, and the ad-hoc turns ratio on the transformer, it is certain that the resulting impedance transformation is incorrect (i.e. it does not match exactly to 50 ohms) and will need to be corrected when I adapt the antenna for transmitting. But for receiving, we can tolerate some degree of impedance mismatch.

The result of using the transformer, for receiving, was as hoped: a dramatic decrease in noise levels, along with high signal levels when the capacitor was peaked to the reception frequency. Though the loop balance is compromised by the asymmetrical construction (due to the corner-mounted capacitor, and the capacitor-sited transformer), the loop was nevertheless comparatively quite immune to the local noise, meaning that there was not significant noise ingress via common-mode current.

Therefore, in an environment with high levels of nearby electromagnetic noise, the ferrite transformer method for coupling to a loop antenna may be more immune against near-field noise than a larger, air-core transformer formed with the traditional auxiliary loop.

Analysis: Balance, common-mode currents, chokes


For the other two antenna configurations that were comparatively noisy -- the untuned active loop antenna configuration, or the passive tuned loop antenna with air-core auxiliary coupling loop --  if we assume the cause of the noise is imbalance in the loop, and that the imbalance is allowing the noise to induce common-mode currents, then it is possible that using a common-mode choke on the feedline might be able to reduce the noise to acceptable levels. Due to the geometry of the balcony, perfect symmetry in the loop construction is impossible, and even if it were possible to construct the loop with maximum physical symmetry, the environmental asymmetry will always unbalance the antenna to some extent.

Regarding the auxiliary coupling loop: perhaps one intuitive explanation would be to say that as the auxiliary loop becomes large (due to the main resonant loop also being large), then the auxiliary coupling loop itself starts to become more sensitive to balance, and any imbalance in the construction of or environment around the coupling loop itself will allow common-mode currents to flow. There may also be other mechanisms at play that could explain the noise ingress. There is a construction method that involves shielding the coupling loop; this technique may improve balance within the coupling loop and may reduce the common-mode currents and hence the noise ingress. An experiment, comparing the noise ingress in an isolated coupling loop and in an isolated and shielded coupling loop, could determine if shielding the coupling loop would help. But in this particular case, with this large 4m x 2m wire antenna, there seems to be no practical advantage of continuing to investigate the use of a comparatively large auxiliary coupling loop; a ferrite transformer is more convenient and seems to have no disadvantages.

2016年9月3日土曜日

Varactor-tuned shortwave superhet design, part 1

He who knows, does not speak. He who speaks, does not know. -- Lao Tzu

For several years now I have been meaning to design and build a shortwave superheterodyne receiver that covers 3-30 MHz. I have started and stopped the design process several times, every time hitting up against some problem that seemed too difficult or too tedious to solve. Along the way, I have built a few prototypes, which ended up with unsatisfying performance.

In performing online research for this topic, I have not found much online material that covers the design process for a superheterodyne receiver that fulfills my specifications. My specifications are rather unique (more on that in a moment), and given my chosen specifications, there are a number of rather tricky issues in making a good implementation. 

However, a recent posting on TheRadioBoard (Reference 1) showcased one individual's homebrew shortwave superheterodyne receiver. That posting includes a link to a YouTube video of the set in operation. The set is obviously a good performer, and it is designed with some similar goals as my envisioned design. That inspired me to again resume my own design work.

Reading through that author's description of his set, it is clear that there are a number of subtle issues (like the alignment of the double-tuned front-end RF filter) that need require some experience and intuition to solve. That author obviously has the knowledge to design, build, and align a shortwave superhet. However, that article does not go step-by-step into the construction and alignment process, and also does not explain the design process for the receiver. Hence, I chose the Lao Tzu quote to open this section. Those who know how to design a shortwave superhet don't tend to describe the design process from conception to completion, as I imagine the required skills are already second-nature to such experienced individuals. They just do it. On the other hand, those -- such as myself -- who don't thoroughly know the design process must ask questions, make tentative statements, and seek feedback from others -- to eventually become one who knows, and needs no longer to speak.

Enough philosophy -- on with the design.

My requirements for a shortwave superheterodyne receiver

  1. It must cover 3-30 MHz.
  2. It must use plug-in coils for bandswitching.
  3. It must use toroidal-core inductors for the RF and LO coils, to enable a compact build. Air-core solenoidal coils would require much more physical space.
  4. It must use a first intermediate frequency of 2 MHz. The current design will be single-conversion, but a future design may be double-conversion. The chosen IF places the image signal 4 MHz away from the desired signal.
  5. It must use a double-tuned front-end RF filter for good image rejection, even at the upper-end of the tuning range (30 MHz). At 30 MHz, an image signal that is only 4 MHz away requires at least a double-tuned filter for acceptable (~50 dB) attenuation of the image signal.
  6. It must use varactors (variable capacitance diodes) for tuning of both the front-end RF filter and the local oscillator. This allows simpler mechanical construction than using large air variable capacitors, and opens up future possibilities for remote control of the receiver via control voltages.
  7. It must implement proper tracking between the front-end RF filter and the local oscillator. It must not be necessary to separately tune the RF and LO stages; single-knob tuning is required.
  8. It must be able to be aligned with no test equipment other than a general-coverage receiver. In particular, no oscilloscope or spectrum analyser is available.

The difficulties posed by my requirements

At first glance, these requirements don't seem so daunting, but once the actual work begins several difficulties arise.

Problem: Adjustment of the toroidal inductors


Traditional superheterodyne receivers (that have a low intermediate frequency) must solve the tracking problem, where a tuned front end always has a peak frequency response that is at a fixed frequency offset from the local oscillator. The fixed frequency offset is, of course, equal to the intermediate frequency of the receiver. To achieve this tracking, typically it is required to adjust not only the tank capacitance but also the tank inductance. Commercial superheterodyne receivers tended to use slug-tuned inductors that could be tuned precisely. However, my set will be using toroidal inductors, that do not allow easy adjustment like slug-tuned inductors. However, even when using toroidal inductors, some degree of adjustment of the tank inductance can be done by adjusting the spacing between turns. Hopefully, this small degree of adjustment will be enough for the RF-LO alignment.

Solution


Stretch or squeeze turns on the toroid to make minor adjustments in the inductance as needed for tracking.

Problem: aligning the two front-end RF tanks without test equipment


To achieve good image rejection, we have not one, but two front-end RF tanks. These both must be aligned with each other, and furthermore they must be aligned with (and at a fixed 2 MHz offset from) the local oscillator. 

Without test equipment like a spectrum analyser, it is difficult to know the exact filter response of the double-tuned RF filter. In particular, we must be very careful not to over-couple the two RF tanks. If we do, we will have a double-humped response that allows unwanted signals to pass through the filter, and that makes filter alignment difficult and confusing (Reference 2).

Therefore we need some way of ensuring the tanks are not over-coupled, and also of ensuring the tanks are in alignment -- without the use of a spectrum analyser.

I ran several LTspice simulations to determine a feasible filter design that could be aligned step-by-step. A future article will cover this topic. For now, I shall summarize my results as follows.

Solution


Use bottom-coupled, capacitive coupling of the tanks to avoid over-coupling and avoid any chance of a double-humped response. For alignment, excite the filter with a broadband noise source and find the peak noise response on a monitoring receiver. Tweak the L and/or C values of the two RF tanks for maximum noise response at the highest frequency tunable by the filter. Because we know the tanks are not over-coupled and will not exhibit a double-humped response, we can be sure that the filter's noise peak occurs only at one frequency and not two frequencies. Then, this peaked response at the highest frequency ensures the best filter alignment between the two RF tanks at the highest filter frequency (where it is most critical for good image rejection), with possible misalignment at the lower filter frequencies (where misalignment is less critical). Finally, align the LO with the RF front-end using a trimmer capacitor, padder capacitor, and inductance adjustment of the LO inductor.

Problem: How to physically switch 3 coils


Using plug-in coils for bandswitching requires switching not one, but three coils -- two front-end coils, and one local oscillator coil. Physically, how should this be accomplished? Each coil could be plugged-in separately, but it would be more convenient to make a combined coil assembly containing all 3 coils required to cover a single band. But, a combined coil assembly with three coils requires a physical connector that has enough pins to switch all three coils.

Solution


Use an 8-pin IC socket for bandswitching. With careful design of the local oscillator, 8 pins are just enough to switch all 3 required coils.

Even when using an 8-pin IC socket, there are physical issues of how to layout the 3-coil assembly to ensure minimum length of the coil leads, which is necessary to minimise stray couplings and ensure good HF performance of the RF filter and the local oscillator. The coil layout should also be physically stable while still allowing access to and adjustment of the coils for tank alignment. A future article will cover this topic.

Problem: Finding high-Q, wide-range varactors for the front-end RF filter


A general observation about varactors is that wide-tuning-range varactors tend to have lower Q. For example, I have used a 1SV149 varactor, which can vary from about 35 pF to 500 pF, in a widely-tuning regenerative receiver that covered several MHz. However, for RF filter use, this varactor has too low Q and will degrade the filter response. We want a varactor that has a Q of at least several hundred at 30 MHz. Most toroidal-core inductors at HF will have Q of around 100-200 (Reference 3, Reference 4, and Reference 5), and we want the varactor Q to be higher than this -- ideally, much higher -- to avoid loading down the resonant tank. Excessive loading of the resonant tanks in the filter would flatten the peak response of the filter and reduce the desired signal's strength in comparison to the undesired image signal's strength, thereby effectively reducing the image rejection of the receiver.

Varactors designed for VHF/UHF use have acceptable Q values at HF, as a perusal of their datasheets will reveal. They however have the disadvantage that their capacitance values are much smaller. The maximum-to-minimum capacitance ratio is also smaller, meaning that VHF/UHF varactors have a smaller tuning range than lower-frequency varactors like the 1SV149.

If the varactor datasheet specifies the varactor Q at VHF, we can estimate with a simple formula the varactor Q at any other frequency (reference: Reference 6, p. 5), and thereby estimate if the Q is high enough for HF filter use. A future article will cover this topic. For now, my results are summarised as follows.

Solution


Use the VHF varactor FV1043 (Reference 7), which has a capacitance range of 10-20 pF and Q of 100 at 100 MHz, giving an extrapolated Q of 333 at 30 MHz, which roughly agrees with the datasheet-given Q value of approximately 650 at 30 MHz. For tuning each of the 3 tanks (2 RF tanks and 1 LO tank), use 5 such varactors in parallel (15 varactors required in total) for a capacitance swing of 50-100 pF for each tank. These capacitance values are reasonable for HF use and allow smaller inductors (than would otherwise be needed with only a 10-20 pF capacitance swing of only one varactor diode) to be used in the RF and LO tanks, requiring less wire and reducing the burden of winding these inductors.

The resulting tuning range of 50-100 pF is not a very wide tuning range, but for HF use it is barely acceptable as it will allow the tank to be tuned over a span ranging from about 1 MHz (at a frequency of 3 MHz) to several MHz (at the highest frequency of 30 MHz). With the 50-100 pF capacitance swing for one band of the receiver, some calculations (to be covered in a future article) reveal that the receiver's entire tuning range of 3-30 MHz can be covered in 8 frequency bands, which is somewhat large but still a reasonable number.

Though I have decided on using FV1043 varactors for this project, ZL2PD has some interesting results on using Zener diodes as varactors at HF (Reference 8).


Problem: Preventing excessive tank voltage in the local oscillator


A significant difficulty with varactor-tuned oscillators is that the varactor itself, providing the tank's resonating capacitance, is a voltage-controlled device. The control voltage is supplied externally by a separate bias voltage to tune the tank. But the oscillating signal voltage in the tank due to can also, to a degree, influence the voltage seen by the varactor and hence influences the tank frequency as well. If the tank voltage is too large, the tank's own signal voltage can significantly affect the varactor's bias and hence lead to waveform distortion. As a rule of thumb, the RF signal voltage should be kept less than 15% of the varactor's bias voltage (Reference 9, p. 10).

An often-used solution to this problem is to use an automatic gain control (AGC) circuit after the oscillator, to keep the oscillator's tank voltages in check. However, the design of AGC control loops is tricky and if we are not careful, the AGC will not operate properly and may become unstable, resulting in periodic and interrupted bursts of oscillator activity (squegging) as the AGC repeatedly tries and fails to regulate the quickly-changing oscillator amplitude. Another difficulty is that the envisioned receiver should work over 3-30 MHz, which means that an AGC control loop would need to be designed that works properly over this entire range with all of the different coils that are used to cover this wide frequency range. I expect this is not an easy task to design a stable AGC that works over this entire range with a variety of coils. I consider it too risky to attempt oscillator AGC in the first receiver design. I may attempt this in a future receiver design, however.

Another solution is to use a hybrid-feedback oscillator design that passively tries to equalise the amount of oscillator feedback across the entire tuning range (Reference 10, p. 15). Unfortunately, this approach is also difficult. (Note added 2016-09-04: but I believe I found a solution; see section "Alternative solution" below.) First, there is the above-mentioned difficulty of supporting a wide frequency range with several coils. Second, the hybrid feedback approach, when applied to an LC tank that is tracked as part of a superheterodyne receiver, has an inherent limitation that one of the capacitors must serve a dual role both as the padder capacitor (to limit the capacitance swing of the tuning capacitance) and as the Vackar feedback capacitor (providing Vackar-oscillator-style capacitive feedback in addition to the tickler feedback). This dual-use makes it difficult to select an appropriate value for the capacitor that both provides the proper amount of feedback (not too much or too little) and properly limits the capacitance swing as required for RF-LO tracking. 

Finally, another solution -- also mentioned Reference 10 -- is simply to damp the tank. This is not ideal, as it reduces the Q of the tank and hence compromises the oscillator's signal purity. But it is a simple solution, it can be applied easily to any LC tank at any frequency, and LTspice simulations show that it is able to keep the tank oscillation amplitude mostly low and mostly constant over the range of the oscillator. A future article will cover this topic.

Solution


Use an Armstrong oscillator, and damp the tank with a low-value parallel resistance. Decrease the resistance (increasing the damping) until, at the lowest oscillator frequency, the oscillator just barely starts. This ensures a very small oscillator amplitude (ideally less than 15% of the varactor bias voltage) at the lowest frequency, where varactor bias will be the lowest (around 1 volt). As the varactor bias increases, tuning the oscillator upwards in frequency, the Armstrong oscillator will show an increased oscillation amplitude, though the damping resistor will largely keep this in check, ensuring the amplitude only grows slightly. Furthermore, even if the amplitude does grow slightly with increasing frequency, the varactor bias is also greater at higher frequencies, and therefore the varactor is more resistant to detuning by the oscillating signal voltage.

Alternative solution (2016-09-04)


After extensive LTspice simulation I believe I have found a better solution than tank damping for keeping the oscillator's tank voltages low. The solution outline is as follows.

  1.  Use a BJT oscillator instead of a JFET oscillator. A JFET may have too little gain in the desired oscillator configuration.
  2. Configure the oscillator to be a Seiler-Vackar hybrid feedback oscillator (Reference 10, p. 16). Do not attempt to re-use the padder capacitor as part of the feedback network; use it only for tracking purposes (to limit the oscillator tuning range).

    As mentioned above, circuit simulations indicated that in this oscillator configuration, the JFET (using a 2N4416 in the simulation) did not always have sufficient gain for oscillation at some frequencies, but a BJT did.

    The reason for the Seiler-Vackar hybrid instead of the Armstrong-Vackar hybrid is that Armstrong feedback requires a tickler coil, and the number of turns on the tickler coil cannot be reduced to less than one. This might lead to an excess of Armstrong-style feedback, especially at higher frequencies, and when using a tickler it would be impossible to reduce this feedback below one turn (especially when using a toroidal-core inductor that has a high coupling coefficient). On the other hand, using capacitive feedback only as in the Seiler-Vackar allows both the Seiler (Colpitts-style) feedback path and the Vackar feedback path to be adjusted finely, by altering the capacitance values. Trimmer capacitors or gimmick capacitors can be used for very fine adjustments of the feedback.
  3. Control base bias with a potentiometer as a temporary gain control (similar to the regeneration control on a regenerative receiver), to gauge the oscillation threshold as the LC tank is tuned across its range.
  4. Using the base bias potentiometer to gauge the oscillation threshold, tune the LC tank across its tuning range and balance the Seiler feedback path and the Vackar feedback path such that a uniform, weak oscillation amplitude is achieved across the entire tuning range.
  5. Finally, the capacitive divider C3/C4 (Reference 10, p. 16) can be used to tweak the oscillator's loop gain (independently of the transistor's base bias) so that oscillation just barely commences. Because this capacitive divider will be part of the plug-in coil assembly, this allows the loop gain to be tweaked individually for each set of plug-in coils (independently of the transistor's base bias), thereby ensuring that every set of plug-in coils will exhibit uniform, weak oscillation across its entire tuning range. Tweaking the feedback with the C3/C4 divider therefore allows setting the transistor bias to a fixed value that need not be adjusted when the plug-in coils are changed to switch bands.

Other issues to consider


In addition to the above problems, the following are additional design issues that must be decided.
  1. Choice of mixer. A mixer that is less prone to distortion (such as a level-7 diode ring mixer) will require higher output power from the local oscillator.
  2. Ensuring adequate LO power for the mixer. This may require amplifiers and buffers after the LO, especially considering that we are intentionally keeping the LO tank voltages low to avoid distortion from the varactor.
  3. IF filtering. Following a strong mixer with a broadband amplifier and a crystal filter will allow good basic receiver performance and reception of weak signals near strong signals (Reference 11). A future version of this receiver may investigate use of a single-crystal filter. A multiple-crystal filter would allow better filter response and broader bandwidth (for less critical tuning), but requires precise measurements of crystal parameters which may be difficult with my limited test equipment.
  4. Detection. The first version of this receiver will use a 2 MHz regenerative detector. This will serve both as an IF filter and as a detector. It may be necessary to precede this stage with a buffer amplifier. For best performance, that buffer amplifier may also need to be tuned.
  5. AGC. The first verison of the receiver will likely not use AGC, but a future version may incorporate AGC, by reducing the gain or attenuating the input of either the IF or the RF stage.

Next steps

This was a long article -- and this only covers the basics of the design.

Future articles will go into more detail about each stage's design, analysis, construction, and alignment. I plan to start with the double-tuned RF filter.

References

  1. User "sixtynine." Discussion topic titled "superhet regen." TheRadioBoard forums. http://theradioboard.com/rb/viewtopic.php?f=3&t=7163. August 26, 2016.
  2. Hayward, W. "The double-tuned Circuit: An experimenter's tutorial." http://www.robkalmeijer.nl/techniek/electronica/radiotechniek/hambladen/qst/1991/12/page29/index.html. December, 1991.
  3. Cox, J. "Iron Powder Cores for High Q Inductors." http://www.micrometals.com/appnotes/appnotedownloads/ipc4hqi.pdf. Undated.
  4. Amidon Associates, Inc. "Iron-powder toroidal cores Q-curves." http://www.amidoncorp.com/product_images/specifications/1-18.pdf. Undated.
  5. Amidon, Inc. "Iron powder toroidal curves, Typical 'Q' curves." http://www.amidoncorp.com/product_images/specifications/1-11.pdf
  6. Skyworks Solutions, Inc. "Application Note, Varactor Diodes." http://www.skyworksinc.com/uploads/documents/200824A.pdf. August 15, 2008.
  7. Semtech Electronics Ltd. "FV 1043 Tuner AFC Diode." http://radio-hobby.org/uploads/datasheet/659/fv10/fv1043.pdf. Undated.
  8. Woodfield, A. "ZL2PD Hunts for Varicap Diodes." http://www.zl2pd.com/Varicaps.html. January/February 2007.
  9. Hollos, S., and Hollos, R. "Using varactors." http://www.exstrom.com/journal/varac/varac.pdf. 2001.
  10. N., Vlad. "Frequency compensated LC networks for oscillators with the wide tuning range." http://www.kearman.com/vladn/hybrid_feedback.pdf. February 1, 2012.
  11. Newkirk, D. Discussion topic titled "OOPS!" Regenrx forums. https://beta.groups.yahoo.com/neo/groups/regenrx/conversations/messages/23026. March 1, 2015.

2016年5月8日日曜日

Wireless audio and remote rig control

This post describes using wifi for (1) remote control of a receiver and (2) wireless streaming of the receiver's audio to a remotely-located computer. This post is merely an outline rather than a step-by-step guide, intended to show one combination of computer technologies that can solve the problems of wireless receiver control and wireless audio streaming.

The problem is that I want to place an antenna and receiver on a balcony where RF reception is good. Then I want to wirelessly transmit that audio to my radio room, which is a far-away room with poor RF reception. The reason for wireless transmission is that I don't want to run any cables -- no antenna cables, no power cables, no audio cables -- from the indoor radio room to the outdoor balcony. I want a completely self-contained balcony radio station (with no cables snaked across rooms and onto the balcony) that can wirelessly transmit its audio to my radio room.

Furthermore, I of course need the ability to remotely tune the balcony-sited radio, from my operating position in the radio room.

This problem has already been solved by by hams connecting their rigs to the Internet with appropriate control software. But rather than investigating existing solutions I did it all based on the technologies I was familiar with and that I had on hand.

Here's how I solved it.

  1. The balcony fortunately has a 100V AC power outlet, so I don't need to run anything off of batteries.
  2. On the balcony, I have an commercial Yaesu transceiver whose audio output goes into the microphone input of a laptop PC, called the controller PC.
  3. The controller PC also has a USB-serial cable that connects to a CAT cable for PC-based tuning of the Yaesu transceiver.
  4. The controller PC runs under the Linux OS and the fldigi program is used to control the tuning frequency of the receiver (via hamlib) and to provide a waterfall display of the rig's audio.
  5. The PC uses the JACK audio system software for real-time routing of audio input and output sources.
  6. In addition to enabling the radio-to-fldigi audio connection, JACK allows me to additionally duplicate/redirect the radio's audio signal into a separate digital data stream for network streaming.
  7. The ffmpeg program is used to capture the duplicated audio signal from JACK and to encode and stream the audio via RTP over a local-area wifi network.
  8. Due to the great distance between the balcony and the radio room, the controller PC cannot make a direct wifi connection to the client PC in the radio room. Therefore, I had to set up a wifi router located at an intermediate position between the controller PC and the client PC. The wifi router is not a dedicated unit, but is instead a re-purposed old PC (running Linux) with two wifi cards. Theoretically I should have needed to setup a network bridge and/or some Network Address Translation in order to allow network traffic to cross from one wifi card to another, but it worked without any explicit bridge or NAT setup. I'm not complaining. :-)
  9. On the client PC in the radio room, I run the VLC media player to play the RTP audio stream from the controller PC. When using ffmpeg as the streaming source on the controller PC, the streaming connection is reliable, latency (the time lag between audio output being generated at the radio, and the final audio being heard on the client PC in the radio room) is somewhere between 1 and 2 seconds, and (importantly) the latency does not increase over time. (Some other streaming solutions I investigated, such as using VLC as the stream source and/or using HTTP as the transport, had higher latency that would increase over time.)
  10. In order to control the radio tuning from the radio room, I run a VNC client on the client PC in order to remotely access the desktop of the controller PC, which gives me a real-time display of the fldigi program running on the controller PC. Though remote desktop displays are never animated as smoothly as the original desktop display, in this case the remote desktop display on the controller PC is updated fast enough such that even the scrolling waterfall display is usable.
  11. Finally, the antenna on the balcony is a broadband active loop antenna (requiring no tuning). I found that it was quite noisy when powered from the same AC adapter used to power the radio, but it became much quieter when powered off of a separate battery. So currently I'm running it off of a separate rechargeable laptop battery.

The result is that I can tune the radio from my radio room by clicking/scrolling/typing in the fldigi program, and I can hear the audio with only 1-2s delay. Not perfect, but it's as close as I'm going to get. And there are no ugly wires routed through windows or doors to the outdoor balcony.

Since the whole solution above is a home-rolled audio-over-wifi solution, I next can play with various audio quality parameters like

  • Codec
  • Bitrate
  • Sound card (maybe investigate using an external USB soundcard).


Future plans include

  • Devising some hardware and software to allow the controller PC to control relays
  • Using those relays to drive motors for remote tuning of a small transmitting loop antenna
  • Investigating how to allow the controller PC to control a regenerative receiver (either via motors turning knobs, or by direct generation of control voltages for tuning and regeneration). This would then allow the indoor-located client PC to remotely and wirelessly control a balcony-sited, homebrew regenerative receiver (a problem I previously investigated and solved with a CAT-5 cable).