Function Generator 1

Not rated 27,268

Circuit Image

At some point, one may have encountered the function generator in a laboratory setting. By simply adjusting the waveform selector knob, a triangle, square, or sine wave is generated at the output. Another knob allows for the frequency of the signal to be altered. This capability is useful for testing amplifiers, such as determining the response time of a square wave or assessing distortion in an audio amplifier with a 1 kHz sine wave. Curiosity about the circuit design behind these waveforms leads to various schematic diagrams found online. Despite different approaches, they share a common topology centered around a triangle wave generator. The most prevalent method for generating a triangle wave involves charging and discharging a capacitor. The linear ramp across the capacitor is achieved by using a constant current source for charging and discharging. Mathematically, a capacitor integrates a current, denoted as i. Function generator schematics display various implementations of constant current sources and integrators. One common design employs a classic operational amplifier (op-amp) integrator. The negative ramp is produced by a specific circuit configuration. In the SPICE circuit, the voltage source vs and resistor R1 (10k) establish the current I1. An inverter (XOP2) generates -vs from vs. The current I2 is created using voltage -vs and resistor R2 (5k), which is activated by a voltage-controlled switch (S1). The integrator is formed by op-amp XOP1 and capacitor CI. Switching between positive and negative ramps typically involves two voltage thresholds (high and low) that define the ramp voltage limits. Resistors RTH1 and RTH2 set the positive threshold (Vth_HI = +2.5V), while RTH3 and RTH4 establish the negative threshold. Comparator XCMP1 compares the ramp voltage to Vth_HI, changing its output from low to high when the output voltage (vo) reaches Vth_HI. Similarly, XCMP2's output transitions from low to high when vo reaches Vth_LO (-2.5V). The outputs of XCMP1 and XCMP2 are connected to the Set and Reset inputs of an SR flip-flop, which determines the square wave output. The state of the flip-flop also controls switch S1, influencing whether op-amp XOP1 generates a positive or negative ramp. The classic cross-coupled NAND gate configuration serves as a model for the RS Flip-Flop, allowing for simulation without requiring a mixed-mode simulator. To design a function generator, consider generating a 1 kHz triangle wave (To = 1.0 ms). Initially, set VS = 1V, R = 10k, R2 = 5k, Vth_HI = +2.5V, and Vth_LO = -2.5V. The thresholds indicate that the negative ramp will vary accordingly. To determine the necessary capacitance (C) for vo to change -5V within the time interval of To/2 (0.5 ms), the equation starting from vo = vs / R · dt / C can be utilized. Running a transient simulation and plotting the output V(3) will reveal whether the output ramps linearly between the thresholds of +2.5V and -2.5V. Additionally, plotting the comparator outputs V(11) and V(12) will show the outputs toggling states as the ramp surpasses the upper or lower thresholds. The rapid changes in ramp direction and comparator output state will result in narrow pulses. The flip-flop output V(15) controls switch S1; when V(15) is low, S1 activates to create a positive ramp, and when V(15) is high, S1 deactivates to produce a negative ramp. Adjusting CI by 10 times or to 0.1 times its original value will influence the ramp speed.

The function generator circuit primarily comprises a triangle wave generator, which is essential for producing the desired waveforms. The triangle wave is generated through a capacitor that is charged and discharged at a constant current, ensuring a linear ramp. The integration of the current by the capacitor results in a ramp voltage that oscillates between defined thresholds, which are monitored by comparators. These comparators trigger the SR flip-flop that controls the output waveform. The use of an op-amp integrator in the circuit allows for precise control over the ramp characteristics. The voltage-controlled switch enables smooth transitions between positive and negative ramps based on the flip-flop's output state. This configuration facilitates the generation of various waveforms, making the function generator a versatile tool in electronic testing and experimentation. By manipulating component values, such as resistors and capacitance, the frequency and amplitude of the generated waveforms can be adjusted to meet specific testing requirements. The ability to visualize output signals through simulation aids in understanding the circuit's behavior and performance, providing valuable insights into the operation of the function generator.At some time, you`ve probably run into this magical instrument in the lab - the function generator. Just turn the waveform selector knob and a triangle, square or sine wave appears at the output! Turn another knob and the frequency of the signal changes. Now you can feed the square wave into an amplifier you`re testing to see how quickly it respon ds. Is there any over shoot or ringing Or maybe you`re testing an audio amplifier and you feed it a 1 kHz sine wave. Is there any distortion at the output I looked at my handy function generator and wondered what kind of circuit creates these waveforms A search on the web produced a few schematics.

Although they all took different circuit approaches, the essence of each one resembled the overall topology shown above. At the core of the function generator is a triangle wave generator. How do you generate a triangle wave The most common way is to get a capacitor and then alternate charging it and discharging it.

But how to you get a nice linear ramp across the capacitor The key here is to charge and discharge it with a constant current source. Mathematically, here`s how it works. A capacitor integrates a current, i. Looking at function generator schematics you`ll find different ways to implement constant current sources and integrators.

One circuit uses the classic op amp integrator. To create the negative ramp, the circuit looks like this. In the SPICE circuit, vs and R1=10k set up I1. An inverter XOP2 creates -vs from vs. I2 is created using voltage -vs and with R2=5k. R2 is switched into the circuit by voltage-controlled switch S1. The integrator is created by XOP1 and CI. The next challenge is switching between the positive and negative ramps. Typically, two voltage thresholds (high and low) are created to set the boundaries of the ramp voltages. RTH1 and RTH2 set the positive threshold Vth_HI=+2. 5V, while RTH3 and RTH3 set the negative threshold Comparator XCMP1 compares the ramp voltage to Vth_HI.

XCMP1`s output goes from LO to HI when vo reaches Vth_HI=+2. 5V. Likewise, XCMP2`s output goes from LO to HI to high when vo reaches to Vth_LO=-2. 5V. The outputs of XCMP1 and XCMP2 are fed to the Set and Reset input of the flip-flop. Positive edges at the Set and Reset inputs will set the flip-flop output HI or LO, respectively. Why use the SR flip-flop The Flip-Flop`s output serves as the square wave output. It also controls the S1. The state of of S1 (ON or OFF) determines if op amp XOP1 is generating a positive or negative ramp. Although the RS Flip-Flop can be modeled in many ways, the classic cross-coupled NAND gate defines this function. Furthermore, the NANDs were created from simple switches so running the SPICE file does not require a mixed-mode (analog / digital) simulator.

Let`s design a function generator and take it out for a spin. Suppose you are asked to generate a 1 kHz triangle wave (To=1. 0 ms). Initially set VS=1V, R=10k, R2=5k, Vth_HI=+2. 5V, Vth_LO=-2. 5V. The thresholds imply that the negative ramp will change by Now the big question is this: what C do we need such that vo will change -5V in †t = To/2 = 0. 5 ms Starting with †vo = vs / R · †t / C we solve for C. CIRCUIT INSIGHT Run a transient simulation and plot the output V(3). Does the output ramp linearly up and down between the thresholds +2. 5V and -2. 5V Way cool! I still get a kick out of seeing signal generators do their thing. In the same window, plot the comparator`s outputs V(11) and V(12). You can see the outputs flip state as the ramp exceeds the upper or lower threshold. However, the ramp quickly direction and the comparator output changes state, leaving only a narrow pulse.

The flip-flop`s output V(15) controls the state of the switch S1. When V(15) goes LO, S1 turns ON creating a POS ramp. When V(15) goes HI, S1 turns OFF creating a NEG ramp. Try changing CI by 10x or 0. 1x of its value. Will this create a faster or slower ramp This i 🔗 External reference