Programmable solutions enabling the frequency to be adjusted via an appropriate interface are extremely helpful in such designs and, in some cases, can greatly facilitate development. A method of relatively easily constructing a programmable oscillator in which the oscillation frequency and amplitude can be adjusted independently of each other by using digiPOTs is described in this article.
Figure 1. Programmable Wien-bridge oscillator with amplitude stabilisation wherein the resistors are replaced by digiPOTs.
Figure 1 shows a typical diode-stabilised Wien-bridge oscillator with which precise sinusoidal signals in the range of approximately 10kHz to 200kHz can be realised at the output (VOUTPUT). Wien-bridge oscillators are characterised by the fact that one bridge path is formed by a band-pass filter and the other by a voltage divider. This example uses - in addition to the ADA4610-1 rail-to-rail precision amplifier - the AD5142 digiPOT, which contains two independently controllable potentiometers, each with a resolution of 256 steps. The programming of the resistance values is done via an SPI, as shown in Figure 2. Alternatively, the AD5142A, which can be controlled via an I²C, can be used. Both variants are available as 10kΩ or 100kΩ potentiometers.
Figure 2. Block diagram of the AD5142.
In the classic oscillator circuit shown in Figure 1, the path with R1A, R1B, C1, and C2 forms the positive feedback, whereas negative feedback is provided via R2A, R2B, and the two parallel diodes D1 and D2, or their resistance RDIODE. Here, Equation 1 applies:
To achieve sustained stable oscillation, it is necessary to eliminate the phase shift of the loop gain. Expressed by formulas, the following term is yielded for the oscillator frequency:
Here, R is the programmable resistance value on the AD5142:
D is the decimal equivalent of the digital code programmed in the AD5142, and RAB is the total resistance of the potentiometer.
To sustain oscillation, the Wien-bridge should be relatively balanced - that is, the gain of the positive feedback and the gain of the negative feedback must be coordinated. If the positive feedback (gain) is too large, the oscillation amplitude or VOUTPUT will increase until the amplifier saturates. If the negative feedback dominates, then the amplitude will accordingly be damped out.
For the circuit shown here, the gain R2/R1 should be set to approximately 2 or somewhat higher. This ensures that the signal starts oscillating.
However, the alternate turn-on of the diodes in the negative feedback loop also causes the gain to be temporarily less than 2 and thereby stabilises the oscillation.
Once the desired oscillation frequency is determined, the amplitude of oscillation can be tuned independently of the frequency via R2. This can be calculated as follows:
The variables ID and VD thereby, respectively, represent the diode forward current and diode forward voltage across D1 and D2. If R2B is shorted, an oscillation amplitude of approximately ±0.6V is yielded. With the correct order of magnitude for R2B, equilibrium can be achieved so that VOUTPUT converges. In the circuit shown in Figure 1, a separate 100kΩ digiPOT is used for R2B.
With the described circuit and a 10kΩ dual digiPOT, oscillation frequencies of 8.8kHz, 17.6kHz, and 102kHz can be tuned with resistance values of 8kΩ, 4kΩ, and 670Ω, respectively, with a low frequency error of just ±3%. Higher output frequencies are also possible with an effect on the frequency error. For example, at 200kHz, the frequency error will increase to 6%.
When using such circuits in frequency-dependent applications, it is also important not to violate the bandwidth limit of a digiPOT as it is a function of the programmed resistance.
In addition, the frequency tuning in Figure 1 requires that the resistance values for R1A and R1B be the same. However, the two channels can only be set successively and lead to a momentary critical intermediate state. This might be unacceptable for certain applications. In such cases, it is possible to use digiPOTs with daisy-chain mode (for example, AD5204) to allow both resistance values changing at the same time.
Author details: Thomas Brand, Senior Field Applications Engineer, Analog Devices can be reached at:
This is the eighth in a series of Design Tips from ADI.
Follow the link below to read:
Design Tips from ADI: What actually is a hot loop?
Design Tips from ADI: Overvoltage protection for sensitive electronic signal inputs
Design Tips from ADI: Bypass Capacitor and Coupling Capacitor: Stabilising Voltage the Right Way
Design Tips from ADI: Temperature Measurement Technologies
Design Tips from ADI: Generation of Low Noise Voltages
Design Tips from ADI: When the Flyback Converter reaches its limits
Design Tips from ADI: When the Supply Voltage is Dynamic