Types of Digital Generators

    In this article I want to give a brief overview of the different methods of frequency generation, but first I will tell you a few words about myself. This is my first article. I am a graduate student at the Moscow Energy Institute. He studied the specialty "Metrology standardization and certification." This article was written primarily for myself, in order to figure out what methods of signal generation are available, and since I did not find the information extract in one place, I decided to do it myself and publish it here. All this is done for self-educational purposes. I will be happy to receive comments in the personal mail on the text, in essence and on the style, and I will answer all your questions in the comments. I tried to write the article in the most accessible and simple language. So types, but rather even methods of generating a sinusoidal (and generally analog) signal. The first one is called direct digital synthesis,
    image



    The sinusoidal signal is, in fact, the solution of the equation Y = Sin (X), with the linear value of the argument X. To obtain a digital signal from the microcontroller, we need to submit the function values ​​to a digital-to-analog converter (DAC). This means that in order to obtain a sinusoidal signal, we need to know the values ​​of the function Y for each value of the argument X (in fact, X determines the value of the phase of the signal). You can calculate all the values ​​of the function directly in the microcontroller, but to ensure high accuracy of the calculated values, you need a high-performance processor, or a module for working with a floating point. The calculation of values ​​in the microcontroller can take a long time, therefore, to ensure the speed of calculation, they take ready-made function values ​​and load them into memory. To ensure smooth output, to reduce the error associated with the nonlinearity of the characteristics of the digital-to-analog Converter, you need as many values ​​of the sine. Thus, in memory there will be ready samples of a sine. In order for these samples to turn into a sine, they need to be stretched in some way in time, so that each sample is fed to the DAC after a certain period of time after the previous one. This requires a reference frequency generator. Such a generator will give pulses of constant duty cycle. These pulses, in the simplest case, are sent to the counter, and the counter, in turn, produces a sequence of increasing codes at the output. The code at the output of the counter will indicate the address of the next count in memory (ROM). The ROM, according to the codes, gives at its output the values ​​of the function contained in the memory at these addresses, which are transmitted to the DAC and at the output of the DAC there will be a sine with an ideal frequency. The sine frequency will correspond to the clock frequency. To ensure frequency tuning, you need to somehow adjust the frequency of the reference oscillator. In the simplest case, a frequency divider is placed between the counter and the generator. Such a divider allows you to rearrange the frequency within certain limits. The tuning limit depends on the capacity of the adder and the frequency of the reference oscillator. Reconfiguration in this case will be possible only on certain values, since division is possible only on numbers that are multiples of 2. In the simplest case, a frequency divider is placed between the counter and the generator. Such a divider allows you to rearrange the frequency within certain limits. The tuning limit depends on the capacity of the adder and the frequency of the reference oscillator. Reconfiguration in this case will be possible only on certain values, since division is possible only on numbers that are multiples of 2. In the simplest case, a frequency divider is placed between the counter and the generator. Such a divider allows you to rearrange the frequency within certain limits. The tuning limit depends on the capacity of the adder and the frequency of the reference oscillator. Reconfiguration in this case will be possible only on certain values, since division is possible only on numbers that are multiples of 2.
    image

    The simplest circuit of such a generator is shown in Figure 1. It includes a reference frequency generator (G). The divider into which the frequency code (division coefficient), counter (CT), ROM, DAC and filter are loaded. The filter in this case is necessary in order to smooth the digital signal at the output. DAC is a digital device that provides only a certain signal level. The lower the sampling frequency, the more pronounced is the stepwise characteristic of the output signal. In order to remove the error introduced by the sampling frequency, a signal filter is used at the output. In the simplest case, this is a simple RC chain, but it is necessary to take into account the speed characteristics of the DAC, since a useful signal can be filtered out at high frequencies.

    Here is the simplest DDS schema. Many elements in it can be replaced and finalized. For example, if you replace the counter with a more complex device, the so-called phase accumulator, then we will have more opportunities, such as frequency tuning without phase shift or, for example, the ability to use a quarter of the period of sine values, instead of the full period, but within the framework of this article such complications will not be considered.

    Now DDS are run as separate chips. It is enough to load the parameters of the desired signal into such a chip and connect the reference frequency generator, and at the output we get a digital sine wave, which is enough to filter with the given parameters. Such generators allow obtaining frequencies up to 1.4 GHz. They, in turn, have one drawback. Direct digital synthesis generators are most often used precisely as frequency generators, so the amplitude of the output signal is not stable.

    Another way to generate a sinusoidal waveform using a controller is the PWM + passive RC filter method. PWM - pulse width modulation. It allows, by adjusting the duty cycle of the pulses, to obtain the desired constant signal amplitude. The wider the pulse, the higher the output voltage across the filter. The voltage can be changed from zero to the supply voltage. imageThus, if you set a specific program for regulating the duty cycle of the pulses, then at the output you can get a signal of any shape, including a sinusoidal one. In the simplest case, the circuit is shown in Figure 2.

    Such a generator is a cheap, and most importantly, the most easily implemented way of converting a digital signal into analog using a microcontroller. It does not require special microcircuits or any complex circuitry solutions. The only thing that is necessary when creating such a generator is the calculation of the output filter at a given cutoff frequency so that it does not cut off the useful signal. True, it is impossible to achieve high metrological characteristics on such a generator, since it is difficult to achieve a low harmonic distortion coefficient. A low level of harmonic distortion can be achieved using another version of the generator.

    The third version of the generator is based on a scheme called the “Wien Bridge”. The essence of this circuit is that an amplifier with two RC circuits in feedback is used. One serial and one parallel. A diagram of such a generator is shown in Figure 3.
    image
    For this scheme, it is necessary to take into account that the elements in the RC chain must be strictly identical. Otherwise, the circuit will not be stable. Various tricks are used to reduce these effects, such as automatic gain control and other tricks. In the simplest case, automatic control is carried out by some non-linear element, such as a light bulb. But the restructuring of such a generator in frequency is difficult. It is necessary to use variable capacitors, which complicates the circuit by an order of magnitude. This method is good, but mainly for generating a specific frequency, or a frequency with a small adjustment range.

    There are various options and modifications of the above schemes. In addition to these schemes, there are analog solutions that were not described here due to inconsistencies with the subject of the article. In conclusion, I want to say that each scheme should be selected and its possible implementation worked out, depending on the task that needs to be performed. My task is to create a precision sinusoidal signal generator that can simultaneously produce a highly stable sinusoidal signal and add a higher order harmonic to the signal. To accomplish this task, the best way out is to calculate the values ​​of the sine function directly in the microcontroller with the values ​​transferred to the DAC. Such an implementation will allow me to take into account the shortcomings of each scheme and work out the technical implementation necessary specifically for my task. You can simultaneously make a stable amplitude, remove the harmonic distortion introduced by the circuit feature and get a fairly stable generator. And the final errors will depend only on which elements will be selected, and what degree of simplification of the algorithm is taken. Thus, while the basic structure remains unchanged, a flexible solution to a certain class of problems can be obtained.

    If you are interested in any material on a similar topic, or in general something from the field of measuring instruments and their design, then I could try to write some material to illuminate your question in a simpler and more understandable way

    Sources:

    1. DDS : direct digital frequency synthesis. Author: Ridiko L.I. [Electronic resource]: Article - http://www.digit-el.com/files/articles/dds.pdf - 12.25.2013

    2. Test signal generator with a low level of harmonics on the Wien bridge [Electronic resource]: Article - http : //myelectrons.ru/wien-bridge-oscillator-low-thd/ - 12/26/2013

    Also popular now: