A multi-channel sine wave signal generator
Through the amplitude control circuit and switching capacitor filter controlled by a microcontroller, flexible adjustment of phase, amplitude and frequency of the multi-channel sine wave generator is achieved, solving the complexity and cost problems in the prior art, and is suitable for waveform distortion In the event of low degree requirements, efficient sine wave output is provided.
Patent Information
- Application Number
- CN202010213484.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-24
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-03-24
AI Technical Summary
The existing multi-channel sinusoidal signal generators adopt direct digital frequency synthesis technology. Although they can improve frequency stability and accuracy, they are relatively complex and costly, and do not have the best choice in occasions where waveform distortion is not required.
Design a multi-channel sine wave generator controlled by a microcontroller, adopting amplitude control circuit, a single-pole double-throw electronic switching circuit and a switching capacitor filter to realize a sine wave output with free and adjustable phase and amplitude, and highly stable frequency, simplifying the circuit structure , avoid waveform storage and waveform calculation, and do not require expensive DAC digital-to-analog converters.
A simple and flexible multi-channel sine wave generator is realized, suitable for occasions where waveform distortion is not high, reducing costs, and providing fine frequency adjustment within the frequency range, improving the application adaptability of signal generators .
Smart Images

Figure CN111371408B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of electric signal generation and processing, and in particular to a multi-channel sine wave signal generator. Background Art
[0002] Sinusoidal signal generator is a signal generating device and signal source widely used in electronic circuit design, automatic control system and instrument measurement, correction and debugging. It belongs to digital signal generator. Because it can generate sinusoidal signals with variable amplitude, frequency and phase, it is usually widely used as an excitation source in electronic test systems. In power system simulation, sonar excitation, medical diagnosis and other applications, it is necessary to apply multiple sinusoidal signals, and sometimes it is necessary to keep synchronization and a certain phase relationship between the signals, which requires the use of a multi-channel output sinusoidal signal generator.
[0003] The existing multi-channel output sine signal generator uses direct digital synthesis (DDS) technology to improve the frequency stability and accuracy of the signal generator to the same level as the reference frequency, and can perform fine frequency adjustment in a wide frequency range. However, this technology is relatively complex and costly, and DDS digital frequency synthesizer is not the best choice when the waveform distortion requirement is not very high. Summary of the invention
[0004] The purpose of the present invention is to provide a simple multi-channel sine wave generator controlled by a single chip microcomputer, which can output several channels of sine waves with freely adjustable phases and amplitudes and highly stable frequencies.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] A multi-channel sine wave signal generator comprises a single-chip microcomputer and at least one sine wave generating circuit; the sine wave generating circuit comprises an amplitude control circuit, a single-pole double-throw electronic switch circuit and a switch capacitor filter; the input end of the amplitude control circuit is connected to the control signal of the single-chip microcomputer, the output end of the amplitude control circuit is connected to one input end of the single-pole double-throw electronic switch circuit, the other input end of the single-pole double-throw electronic switch circuit is grounded, the common end of the single-pole double-throw electronic switch circuit is connected to the input end of the filter, and the output end of the filter outputs a sine wave; the control end of the single-pole double-throw electronic switch circuit is connected to the single-chip microcomputer.
[0007] Furthermore, the multi-channel sinusoidal wave signal generator also includes a sampling feedback circuit, which includes a channel selection switch, a precision rectifier circuit and a low-pass filter circuit. The actual output sinusoidal wave passes through the channel selection switch, the precision rectifier circuit and the low-pass filter circuit in sequence, and its amplitude is fed back to the microcontroller (collected by the DAC on the microcontroller), and the microcontroller selects the channel through the control bus.
[0008] Furthermore, the filter is an active or passive low-pass filter, or an active or passive band-pass filter.
[0009] Furthermore, the filter is a switched capacitor filter, and a control end of the switched capacitor filter is connected to a clock signal output by a single chip microcomputer.
[0010] Furthermore, the amplitude control circuit includes a reference voltage source, a digital potentiometer, a first resistor, a first voltage follower, a second voltage follower, a first capacitor and a third capacitor; the first end of the reference voltage source is connected to the voltage VCC5, the third end of the reference voltage source is grounded, the second end of the reference voltage source is connected to one end of the digital potentiometer after passing through the first voltage follower, and the other end of the digital potentiometer is connected to the filter after passing through the second voltage follower; the potential control signal output by the single-chip microcomputer controls the resistance value of the digital potentiometer; one end of the first capacitor, one end of the third capacitor, and one end of the first resistor are connected to the other end of the digital potentiometer; the other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to a single-pole double-throw electronic switch circuit.
[0011] Furthermore, the amplitude control circuit includes a reference voltage source, a first resistor, a third resistor, a first capacitor, a third capacitor, a first voltage follower and a second voltage follower; the first end of the reference voltage source is connected to the voltage VCC5, the third end of the reference voltage source is grounded, the second end of the reference voltage source is connected to one end of the third resistor through the first voltage follower, and the other end of the third resistor is connected to the filter through the second voltage follower; one end of the first capacitor, one end of the third capacitor, and one end of the first resistor are connected to the other end of the third resistor; the other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to a single-pole double-throw electronic switch circuit.
[0012] Furthermore, the amplitude control circuit includes a first resistor, a third resistor, a first capacitor, a third capacitor, a first voltage follower and a second voltage follower; the DC voltage signal output by the DAC in the single-chip microcomputer is connected to one end of the third resistor after passing through the first voltage follower, and the other end of the third resistor is connected to the filter after passing through the second voltage follower; one end of the first capacitor, one end of the third capacitor, and one end of the first resistor are connected to the other end of the third resistor; the other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to a single-pole double-throw electronic switch circuit.
[0013] Furthermore, the single-pole double-throw electronic switch circuit includes a second resistor, a transistor, a fourth resistor, and a second capacitor; one end of the fourth resistor is connected to the square wave signal output by the single-chip microcomputer, and the other end of the fourth resistor is respectively connected to one end of the second capacitor, one end of the second resistor, and the base of the transistor; the other end of the second capacitor, the other end of the second resistor, and the emitter of the transistor are grounded; and the collector of the transistor is connected to the amplitude control circuit.
[0014] The multi-channel sine wave generator of the present invention is simple and flexible, does not require waveform storage and waveform calculation, does not need to adopt DDS technology, and does not require expensive DAC (digital-to-analog converter), and is very suitable for occasions where the waveform distortion requirement is not very high. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 One of the circuit block diagrams of the multi-channel sine wave generator of the present invention;
[0016] Figure 2 The second circuit block diagram of the multi-channel sine wave generator of the present invention;
[0017] Figure 3 is a circuit block diagram of an amplitude control circuit according to Embodiment 1 of the present invention;
[0018] Figure 4 is a circuit schematic diagram of an amplitude control circuit according to Embodiment 1 of the present invention;
[0019] Figure 5 This is the circuit schematic diagram of the switched capacitor filter;
[0020] Figure 6 is a circuit block diagram of an amplitude control circuit according to a second embodiment of the present invention;
[0021] Figure 7 is a circuit schematic diagram of an amplitude control circuit according to a second embodiment of the present invention;
[0022] Figure 8 is a circuit block diagram of an amplitude control circuit according to a third embodiment of the present invention;
[0023] Fig. 9 4 is a circuit diagram of an amplitude control circuit according to a third embodiment of the present invention. Specific embodiments
[0024] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0025] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0026] Embodiment 1
[0027] The multi-channel sine wave signal generator of the present invention can output at least one sine wave signal. The circuit block diagram thereof is as follows: Figure 1 As shown, the present invention is described by taking two-way output as an example, but it does not mean that the present invention can only have two-way output. The sine wave generator of the present invention can output more than one sine wave signal.
[0028] A multi-channel sine wave generator comprises a single-chip microcomputer (MCU) and at least one sine wave generating circuit, wherein the sine wave generating circuit comprises an amplitude control circuit, a single-pole double-throw electronic switch circuit and a switch capacitor filter; the input end of the amplitude control circuit is connected to a control signal of the MCU, the output end of the amplitude control circuit is connected to one input end of the single-pole double-throw electronic switch circuit, the other input end of the single-pole double-throw electronic switch circuit is grounded, the common end of the single-pole double-throw electronic switch circuit is connected to the input end of the switch capacitor filter, and the output end of the switch capacitor filter outputs a sine wave.
[0029] The single-chip microcomputer MCU outputs at least one control signal, and the control signal controls the amplitude control circuit to generate a controlled DC voltage source. The control signal includes but is not limited to a controlled DC voltage signal (DAC pin output), a square wave signal (PH pin output), a clock signal (CLK pin output) and a potential control signal (AM pin output).
[0030] by Figure 1Take the AM0 pin of the MCU as an example to explain the principle: the AM0 pin of the MCU outputs a potential control signal, which controls the amplitude control circuit to generate a controlled DC voltage source. The DC voltage source is buffered by the voltage follower and periodically truncated by a square wave signal with a 50% duty cycle output by the PH0 pin of the MCU, thereby generating an amplitude-controlled square wave. The phase of the square wave determines the phase of the sine wave. After the controlled square wave enters the switched capacitor filter, the third and higher harmonics are filtered out, and only the baseband sine wave signal is retained. The amplitude and phase of the sine wave signal are both controlled by the MCU. The cutoff frequency (or center frequency) of the switched capacitor filter is only controlled by the clock signal output by the CLK0 pin of the MCU, so its passband frequency can be easily changed by the MCU, so that the multi-channel sine wave signal generator of the present invention can change the frequency of the output sine signal online in real time.
[0031] Preferably, a sampling feedback circuit is added to realize closed-loop control of the amplitude of the actual output sine wave. The block diagram is as follows: Figure 2 shown.
[0032] The sampling feedback circuit includes an n:1 channel selection switch, a precision rectifier circuit and a low-pass filter circuit. The actual output sine wave is fed back to the feedback pin ADC of the MCU after passing through the channel selection switch, the precision rectifier circuit and the low-pass filter circuit in turn. After the MCU converts the analog signal fed back into a digital signal, it compares it with the expected sine wave amplitude. According to the difference between the actual output sine wave amplitude and the expected amplitude, the DC voltage source output by the amplitude control circuit is adjusted in real time, thereby achieving the purpose of stabilizing the actual output sine wave amplitude. The n:1 channel selection switch controls only one actual output sine wave to be sampled each time, and the MCU realizes the channel selection by controlling the bus. It is also possible to simultaneously collect multiple actual output sine waves by adding a multi-channel sampling feedback circuit, which is the same as the closed-loop control idea of the present invention and also falls within the protection scope of the present invention.
[0033] The key to the implementation of the present invention is a switched capacitor filter, which can also be replaced by other active or passive low-pass filters or bandpass filters with a center frequency at the base frequency. When using other active or passive low-pass filters or bandpass filters, there is no need for the clock signal of the MCU to control. In order to filter out the harmonics cleanly, a low-pass filter with a steeper cut-off frequency is required, and the cut-off frequency can accurately fall between the base frequency and the triple frequency. The performance of the filter determines the distortion of the output signal. In order to make the circuit have better adaptability and higher precision, using a monolithic switched capacitor filter is the best choice. The switched capacitor filter is a special analog signal filter, which is special in that its center frequency can be controlled by a clock signal, and the bandwidth and Q value can be controlled by a set of digital signals. This allows the passband frequency of the filter to be controlled by the single-chip microcomputer MCU in real time. The use of a switched capacitor filter can make the output signal of the sine wave signal generator change within a continuous frequency range (the cut-off frequency of the commonly used switched capacitor filter can reach up to about 100kHz) without changing the hardware parameters. Of course, relatively speaking, the cost of the switched capacitor filter is high. In order to save costs, other active or passive filters can be used to replace the fixed frequency of the sine signal. For applications where the required sine wave frequency is higher, the switched capacitor filter may not respond quickly enough, and other active or passive filters are needed.
[0034] The single-pole double-throw electronic switch circuit can be realized using a simple transistor.
[0035] The amplitude control circuit can be implemented in different forms according to different application requirements. For applications with high accuracy requirements and the need to change the signal amplitude in real time, a high-precision voltage reference source and a digital potentiometer can be used to implement it. Figure 3 is a block diagram of an amplitude control circuit implemented by using a digital potentiometer and a voltage reference source in this embodiment, Figure 4 4 is a circuit schematic diagram of an amplitude control circuit implemented by using a digital potentiometer and a voltage reference source according to this embodiment.
[0036] The amplitude control circuit of this embodiment includes a reference voltage source U2, a digital potentiometer U3, a resistor R1, a capacitor C1, a capacitor C3, and voltage followers U1-A and U1-B; a single-pole double-throw electronic switch circuit includes a resistor R11, a transistor Q1, a resistor R2, and a capacitor C2; a first end 1 of U2 is connected to a voltage VCC5, a third end 3 of U2 is grounded, a second end 2 of U2 is connected to one end of the digital potentiometer U3 through the voltage follower U1-A, and the other end of the digital potentiometer is connected to the filter through the voltage follower U1-B; one end of the resistor R11 The first end is connected to the square wave signal output by the PH pin of the single-chip microcomputer MUC, and the other end of R11 is connected to one end of the capacitor C2, one end of the resistor R2 and the base of the transistor Q1; the other end of the capacitor C2, the other end of the resistor R2 and the emitter of the transistor Q1 are grounded; the collector of the transistor Q1 is connected to the other end of the digital potentiometer U3 through the resistor R1; one end of the capacitors C1 and C3 are connected in parallel to the other end of U3, and the other end of the capacitors C1 and C3 are connected in parallel to the ground; the potential control signal output by the AM pin of the single-chip microcomputer controls the cursor W of the digital potentiometer U3 and the resistance values at both ends through the SPI bus.
[0037] The working principle of the above circuit is: the voltage VCC5 outputs a DC voltage source after passing through the reference voltage source U2, and the DC voltage source is output to the digital potentiometer U3 after passing through the voltage follower U1-A. The potential control signal output by the AM pin of the single-chip microcomputer controls the cursor W of the digital potentiometer U3 and the resistance value at both ends through the SPI bus, thereby outputting an amplitude-controlled DC voltage source to the filter; at the same time, the PH pin of the single-chip microcomputer outputs a square wave signal with a duty cycle of 50%, which periodically controls the conduction and shutdown of the transistor Q1. When Q1 is turned on, the controlled DC voltage source output by U3 is input to the ground after Q1, and when Q1 is turned off, the controlled DC voltage source output by U3 is connected to the filter after the voltage follower U1-B.
[0038] In actual operation, the phase control signal can be connected to the PWM channel of the MCU. Generally, modern microcontrollers have several independent PWM ports, which can be used as phase control pins (i.e. PH pins). Phase control can be achieved through the high-precision timer inside the microcontroller. Digital potentiometers generally have SPI or IIC bus interfaces, which can be easily controlled by the microcontroller MCU, so the signal amplitude is also easy to control.
[0039] The frequency stability of the signal generator depends on the MCU timer. The clock source of the MCU timer comes from the crystal oscillator. Currently, crystal oscillators with a frequency stability of 10ppm can be easily purchased on the market. This level of frequency stability is difficult to achieve with traditional sine signal generators such as Wien oscillators.
[0040] The amplitude stability of the output waveform is determined by the output accuracy of the reference voltage source. A high-precision reference voltage source can provide a stable signal amplitude.
[0041] For applications with high amplitude accuracy requirements, the waveform amplitude drift caused by temperature changes and filter component tolerances needs to be noted. Especially for bandpass filters, component tolerances can cause the center frequency to deviate from the design value, causing changes in signal gain. A precision rectifier circuit and low-pass filter circuit can be added to sample the output signal amplitude in real time, and then the output signal amplitude is continuously corrected according to the sampled value, thereby completing the closed-loop control of the signal amplitude.
[0042] Using the switched capacitor filter LTC1264 to build a filter can achieve a bandpass filter with a center frequency of up to 250kHz. Figure 5 is a circuit diagram of a switched capacitor filter, which belongs to the prior art and its specific working principle will not be described again. Figure 5 The clock signal FQ_CLK in the filter comes from the clock signal output by the CLK pin of the microcontroller. Adjusting the frequency of the clock signal can change the center frequency of the filter. It should be noted that for applications with strict phase requirements, the delay of the filter needs to be considered when adjusting the phase. The Q value of the filter can be changed by the value of the external resistor. If a monolithic integrated switched capacitor filter from MAXIM is used, no external resistor or capacitor components are required, and the center frequency or cutoff frequency and Q value of the filter can be set by programming the microcontroller. This can make the signal generator have a better application adaptability range.
[0043] Embodiment 2
[0044] For applications where the amplitude of the sine wave signal output by the sine wave signal generator is fixed, a fixed resistor can be used to replace the digital potentiometer U3 of the first embodiment, such as Figure 6 As shown in the figure, it is a block diagram of using fixed resistance and voltage reference source to realize signal amplitude control. Figure 7 A specific circuit diagram.
[0045] Different from the first embodiment, the digital potentiometer U3 is replaced by a fixed resistor R3, and R3 is connected between the output end of the voltage follower U1-A and the collector of the transistor Q1.
[0046] Assuming that the duty cycle of the square wave is 50%, after Fourier expansion, the expression of the output signal can be intuitively obtained. For the above two implementation methods, the nth signal is:
[0047]
[0048] Vref is the voltage reference source, k is the attenuation coefficient, which can be set by the digital potentiometer program or fixed resistance value. Assume that the phase of the first signal is The phase of the nth signal is This can be achieved by controlling the phase of the square wave signal.
[0049] The other circuit connection relationships and working principles of this embodiment are the same as those of the first embodiment and will not be described in detail.
[0050] Embodiment 3
[0051] Modern single-chip microcomputers often integrate multiple digital-to-analog converters (DACs). If the signal amplitude accuracy is not required, the on-chip DAC can be used to output a controlled DC voltage source without using a reference voltage source, digital potentiometer or fixed resistor to generate a DC voltage source. The block diagram of using the on-chip DAC of a single-chip microcomputer to achieve signal amplitude control is shown below. Figure 8 As shown, the specific circuit diagram is as follows Fig. 9 shown.
[0052] The DAC pin of the MCU outputs a controlled DC voltage source, which is output to the filter after passing through U1-A, resistor R3 and U1-B. The other circuit connection relationships and working principles of this embodiment are the same as those of the first embodiment, and will not be repeated here.
[0053] The above is only for explaining the implementation mode of the present invention and is not intended to limit the present invention. For those skilled in the art, any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention without creative work should be included in the protection scope of the present invention.
Claims
1. A multi-channel sine wave signal generator, characterized in that: It includes a single chip microcomputer and at least one sine wave generating circuit; The sine wave generating circuit comprises an amplitude control circuit, a single-pole double-throw electronic switch circuit and a filter; the input end of the amplitude control circuit is connected to the control signal of the single-chip microcomputer, the output end of the amplitude control circuit is connected to one input end of the single-pole double-throw electronic switch circuit, the other input end of the single-pole double-throw electronic switch is grounded, the common end of the single-pole double-throw electronic switch circuit is connected to the input end of the filter, and the output end of the filter outputs a sine wave; the control end of the single-pole double-throw electronic switch circuit is connected to the single-chip microcomputer, Wherein, the filter is an active or passive low-pass filter, or an active or passive band-pass filter; Among them, the single-pole double-throw electronic switch circuit includes a second resistor, a transistor, a fourth resistor, and a second capacitor; one end of the fourth resistor is connected to the square wave signal output by the single-chip microcomputer, and the other end of the fourth resistor is respectively connected to one end of the second capacitor, one end of the second resistor and the base of the transistor; the other end of the second capacitor, the other end of the second resistor and the emitter of the transistor are grounded; the collector of the transistor is connected to the amplitude control circuit.
2. A multi-channel sine wave signal generator according to claim 1, characterized in that: The multi-channel sine wave signal generator further includes a sampling feedback circuit, which includes a channel selection switch, a precision rectifier circuit and a low-pass filter circuit. The amplitude of the sine wave actually outputted is fed back to the single-chip microcomputer after passing through the channel selection switch, the precision rectifier circuit and the low-pass filter circuit in sequence. The microcontroller selects the channel by controlling the bus.
3. A multi-channel sine wave signal generator according to claim 1, characterized in that: The filter is a switched capacitor filter, and the control end of the switched capacitor filter is connected to a clock signal output by a single chip microcomputer.
4. A multi-channel sine wave signal generator according to claim 1 or 2, characterized in that: The amplitude control circuit includes a reference voltage source, a digital potentiometer, a first resistor, a first voltage follower, a second voltage follower, a first capacitor and a third capacitor; the first end of the reference voltage source is connected to the voltage VCC5, the third end of the reference voltage source is grounded, the second end of the reference voltage source is connected to one end of the digital potentiometer after passing through the first voltage follower, and the other end of the digital potentiometer is connected to the filter after passing through the second voltage follower; the potential control signal output by the single-chip microcomputer controls the resistance value of the digital potentiometer; one end of the first capacitor, one end of the third capacitor, and one end of the first resistor are connected to the other end of the digital potentiometer; the other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to a single-pole double-throw electronic switch circuit.
5. A multi-channel sine wave signal generator according to claim 1 or 2, characterized in that: The amplitude control circuit includes a reference voltage source, a first resistor, a third resistor, a first capacitor, a third capacitor, a first voltage follower and a second voltage follower; the first end of the reference voltage source is connected to the voltage VCC5, the third end of the reference voltage source is grounded, the second end of the reference voltage source is connected to one end of the third resistor through the first voltage follower, and the other end of the third resistor is connected to the filter through the second voltage follower; one end of the first capacitor, one end of the third capacitor and one end of the first resistor are connected to the other end of the third resistor; The other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to the single-pole double-throw electronic switch circuit.
6. A multi-channel sine wave signal generator according to claim 1 or 2, characterized in that: The amplitude control circuit comprises a first resistor, a third resistor, a first capacitor, a third capacitor, a first voltage follower and a second voltage follower; The DC voltage signal output by the DAC in the single-chip microcomputer is connected to one end of the third resistor after passing through the first voltage follower, and the other end of the third resistor is connected to the filter after passing through the second voltage follower; one end of the first capacitor, one end of the third capacitor, and one end of the first resistor are connected to the other end of the third resistor; the other end of the first capacitor and the other end of the third capacitor are grounded; the other end of the first resistor is connected to a single-pole double-throw electronic switch circuit.
Citation Information
Patent Citations
Multi-channel sinusoidal signal generator and method for generating multi-channel sinusoidal signals
CN103607174A
Acoustic-optical modulator driving system
CN106773151A
High-precision three-phase sinusoidal signal generator
CN203608157U
Multi-channel sine wave signal generator
CN211579934U
