Changchun Polytechnic microcontroller course design: simple signal generator design, urgent urgent urgent

Copied, FYI ~ this should be simple!

Function signal generator is a function of the ability to generate a variety of waveforms, such as triangular wave, sawtooth wave, rectangular wave (including square wave), sine wave circuit is known as the function signal generator. Function signal generator has a very wide range of uses in circuit experiments and equipment testing. Now we design a simple generator that can transform triangular, sine and square waves by analyzing the principle and composition of function signal generator. We analyze the circuit and determine the parameters to choose the most suitable solution for this topic. Under the premise of meeting the requirements of the topic to ensure the most economical, convenient and optimized design strategy. In accordance with the design of the program to select the specific original, welding out the specific physical figure, and in the laboratory on the welded physical figure for debugging, to observe the effect and with the subject of the required performance indicators for comparison. Finally, we analyze the reasons for the errors and the influencing factors.

Keywords: program determination, parameter calculation, debugging, error analysis.

1.1 Problem Formulation

Design a function generator to generate hair wave, triangular wave and sine wave.

1. Main technical specifications

Frequency range 10Hz~100Hz, 100Hz~1000Hz, 1kHz~10kHz

Frequency control mode Hand-controlled signal frequency by changing RC time constant

Pressure-controlled frequency VCF by changing the control voltage Uc

Output voltage Sinusoidal waveform. Upp≈3 V amplitude continuously adjustable;

Triangle wave Upp≈5 V amplitude continuously adjustable;

Square wave Upp≈14 V amplitude continuously adjustable.

Waveform Characteristics The rise time of square wave is less than 2s;

Triangle wave nonlinear distortion is less than 1%;

Sine wave harmonic distortion is less than 3%.

2, the design requirements

(1) according to the technical specifications and laboratory conditions of their own choice to design the schematic circuit diagram, analyze the principle of operation, calculate the parameters of the components.

(2) List all the elements and devices to the laboratory spare parts.

(3) Installation and debugging of the designed circuit to meet the design requirements.

(4) Record the results of the experiment.

1.2 Fundamentals

1, the composition of the function generator

Function generator generally refers to the automatic generation of sinusoidal, square, triangular wave voltage waveform circuit or instrument. Circuit form can be used by the operational amplifier and separation of components; can also be used as a monolithic integrated function generator. Depending on the purpose, there are function generators that produce three or more waveforms, and this topic introduces the method of square, triangle, and sine wave function generators.

1.3 put forward to solve the problem of the program and selection

1, triangle wave converted into a sine wave

by operational amplifier single circuit and discrete components, square wave - triangle wave - sine wave function generator circuit Composition as shown in Figure 1, due to technical difficulties in the triangle wave to the sine wave conversion, so the following will be described in detail triangle wave to the sine wave conversion.

Figure 1

(1) Triangle-sine waveform conversion using differential amplifier circuit

The principle of waveform conversion is to take advantage of the nonlinearity of the transmission characteristic curve of the differential amplifier, and the waveform conversion process is shown in Figure 2. As can be seen from the figure, the more symmetrical the transmission characteristic curve, the narrower the linear region, the better; the amplitude of the triangle wave Uim should be just so that the crystal is close to the saturation region or up to the region.

Figure 2

Option 1: Triangle wave to sine wave by differential amplifier circuit and function generator by circuit composed of integrated op-amp

(2) Triangle wave to sine wave by diode folding approximation circuit

Diode Diode Folding Approximation Circuit Figure 3

Based on the schematic diagram of the diode folding approximation circuit to realize the conversion of triangular wave - sinusoidal waveforms, the input and output characteristic curves can be obtained as shown in Input 3.

Frequency regulation part of the design, you can first give three frequency bands according to the three capacitance values: 1000pF, 0.01Μf, 0.1μF and then calculate the size of R. Hand control and pressure control part of the line requires easy replacement. In order to meet the requirements of the other side of the wave before and after the edge time, as well as the requirements of the highest operating frequency of the sine wave (10kHz), in the integrator, comparator, sine wave converter and the output stage should be used in the Sr value of a larger op-amp (such as the LF353). In order to ensure that the sine wave has less distortion, the resistance parameters of the diode network should be correctly calculated, and attention should be paid to adjusting the amplitude and symmetry of the output triangle wave. The input waveform should not contain DC components.

Scheme 2: diode folding approximation circuit and integrated op-amp circuit to realize the function generator

(3) The figure is a precision voltage-controlled oscillator composed of μA741 and 5G8038, when pin 8 is connected to a continuously adjustable DC voltage, the output frequency is also continuously adjustable. When this voltage is a minimum (approximately 0). Output frequency is the lowest, when the voltage is the maximum value, the output frequency is the highest; 5G8038 control voltage effective range is 0-3 V. Because the 5G8038 itself is only in the scanning frequency range of 10: 1 when the linearity of 0.2%, a larger range (such as 1000: 1) when the linearity of the consequent deterioration, so the control voltage through the μA741 and then fed into the 5G8038 pin 8, so the control voltage through the μA741 and then sent to the 5G8038 pin 8, which will effectively improve the voltage control linearity (better than 1%). If 4, 5 feet of the external resistance is equal and R, the output frequency can be determined by the following formula:

f=0.3/RC4

Set the function generator's maximum operating frequency of 2kHz, timing capacitance C4 can be obtained by the above formula.

RP3 in the circuit is used to adjust the symmetry of the waveform at the high frequency end, while RP2 is used to adjust the symmetry of the waveform at the low frequency end, adjusting RP3 and RP2 can improve the distortion of the sine wave. Voltage regulator VDz is set to avoid excessive negative voltage on pin 8 to make the 5G8038 work abnormally.

Program 3: monolithic integrated function generator 5G8038

Feasibility analysis:

The above three programs, program one and program two in the triangle wave - sine wave part of the principle is not the same, but they have a **** common place is that they all have to think of building the waveform conversion The circuit diagram. And program three using integrated chip makes the circuit greatly simplified, but due to laboratory conditions and cost constraints, we first discarded the third program, because it is sacrificed for the convenience of the cost. Second is a comparison of program one and program two, program one with capacitors and resistors op-amps and transistors and other electrical components, program two is to use diodes, resistors, transistors, op-amps and other electrical components, so from the premise of simplicity and ease of purchase we chose to choose the program one for our final design program.

1.4 Determination of parameters

1, from the design process of the circuit is divided into three parts: ① sinusoidal part ② square wave part ③ triangular wave part

2, sinusoidal part

Because we choose a differential amplifier circuit for the triangular wave - sinusoidal

The first thing to do is to complete the conversion of a triangular wave - sinusoidal

2, the first thing to do is to complete the conversion of a triangular wave - sinusoidal. p>To transform, the first work to be done is to select the transistor, I

We now choose the KSP2222A type of transistor, its static curve

Like the figure shown on the right.

Based on the static characteristic curve of the KSP2222A, the center of the static

working area is selected

By the direct current path there are:

20 k

k

Because the static operating point has been determined, the static current becomes known. According to the KVL equation can be calculated in the mirror current source of the size of each resistance value:

Can be obtained

3, the determination of the parameters of the square wave part and triangular wave part

According to the performance indicators can be known

By ,it can be seen that f is proportional to the c, if you want to get 1Hz ~ 10Hz, C is 10 . 10Hz ~ 100Hz,C is 1 .

Then =7.5k ~75k , then =5.1k

Then =2.4k or =69.9 k

∴ Take 100 k

From the output triangular amplitude and the amplitude of the output square wave of 5v and 14v, respectively, there are

=

∴ =10k

then ≈ 47 k , =20 k

Based on the rise time of the square wave of two milliseconds, querying the speed of the operational amplifier, you can choose the 74141 model op-amp.

This can be adjusted resistor:

VII, the welding and debugging of the practice diagram

1, according to the circuit diagram of the first program to weld the circuit board.

2, before debugging, the circuit board into ± 12 volts, ground and power supply at the public **** ground connection.

(1) frequency range:

For easy measurement, the circuit board will be accessed on the square wave signal oscilloscope, and close the C1 = 10?F switch, disconnect the C2 = 1uF switch, and then adjust the RP2, and measured at this time the frequency of the square wave signal range of change;

Disconnect the switch of C1, close the switch of the C2, in accordance with the same method of adjusting the RP2 and record the frequency range of the square wave signal, the results are as follows:

Capacitor Frequency

10?F 1Hz~30Hz

1uF 27.47~316Hz

The above frequency does not fully reach the required range of indicators, after analyzing the reasons:

Through the comparison, it is found that the frequency range of the overall downward movement, here There may be two reasons, the first is the feedback channel on the existence of wear and tear, so that the resistance value does not reach the calculated value. The second is that the resistor on the reverse side of the delta wave op amp also has the same problem.

(2) Output Voltage:

① Square Wave:

The wave signal on the board is connected to the oscilloscope, and RP1 is adjusted to get the square wave peak Vpp=14V, which can be seen as the same as that in the performance specification.

② Triangle wave:

Remove the square wave signal and access the triangle wave signal, adjust RP1, measured triangle wave peak Upp = 5V can also meet the requirements of the subject.

3 Sine wave:

The sine wave signal into the oscilloscope, adjust RP3 and RP4, measured sine wave peak value Upp = 2.8V. basically can reach the subject requirements.

3, the waveform characteristics of the determination:

① Square wave rise time:

Square wave signals on the board into the oscilloscope, adjust the oscilloscope on the period adjustment knob, until it can be clearly observed along the rising edge of the square wave signal at the leap, measured square wave rise time:

tr=6.4?s

Analysis: the rise time does not meet the requirements, this can be used to change the op-amp. This can be solved by changing the type of op-amp. This can be solved by changing the type of op-amp, and changing the rise time by changing the speed of the op-amp.

① Triangle wave nonlinear distortion:

Remove the square wave signal, the board on the triangle wave signal into the oscilloscope channel 1, measured at this time the triangle wave signal parameters are as follows:

Frequency: f = 98.42Hz

Peak-to-peak: Upp = 5V

This time, the experimental bench function generator to generate a triangle wave as the standard Signal into the oscilloscope channel 2, and adjust its frequency and peak-to-peak value, so that it is consistent with the parameters of the triangle wave signal to be tested (f = 98.42Hz, Upp = 5V).

In the dual-trace mode on the oscilloscope, it is found that the triangular waveforms of the two channels are exactly the same, indicating that there is no non-linear distortion.

② Serious distortion of sine wave:

Analysis: Because one of the pins of the sliding resistor for adjusting the balance was broken, I took a wire to connect it by myself, so it led to the misalignment of the circuit, which made the static working point deviate from the original position, and thus led to this result.

1.5Experience

Through the design of the function signal generator, I y realized the importance and truth of the phrase "linking theory to practice". Moreover, through the design of this course, I not only know the theoretical knowledge that I didn't know before, but also consolidate the knowledge that I knew before. The most important thing is to understand the book knowledge in practice, and understand the true meaning of learning by doing. I also understand why the teacher asked us to do a good job in this course design. He is to teach us how to use the knowledge we have learned to solve practical problems and improve our hands-on ability. In the whole design to the circuit welding and debugging process, I personally feel that the debugging part is the most difficult, because the value of your theoretical calculations in practice is not necessarily the best parameters, we must observe the effect of changing the value of parameters in order to achieve the best. The debugging of parameters is an accumulation of experience, no experience is not possible in a short period of time to complete, and this may also be the teacher asked us to improve an important aspect of it!