# Trapezoidal Wave Generator Circuit

Discussion in 'General Electronics Discussion' started by OddOne, Feb 26, 2013.

1. ### OddOne

42
0
Feb 26, 2013
Hello everyone,

I've build this circuit:

http://imageshack.us/a/img543/1703/imagesrsv.jpg

Does anyone know how to calculate the values for the variable capacitors? Because when I measure at point A I only see a constant voltage instead of a trapazoidal wave.

2. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
This (the left two transistors of the circuit) is an astable multivibrator. The theory of operation including calculation of component values is here.

Forget about the variable caps. Use fixed caps and variable resistors (potentiometers). Variable capacitors of the values used for typical astab. multivibrators are next to impossible to get.

3. ### OddOne

42
0
Feb 26, 2013
Thank you for the fast reply.

I think I now understand why they used variable caps symbol, because you have to choose the value according to the frequency you want. But those aren't variable caps.

Is this the right calculation?

f = 1 / (0,693 * (((Rp1 + 2.2k) * C1) + ((Rp2 * + 2.2k) * C2)))

if I choose 1uF for C1 and C2:

f = 1 / (0,693 * (((10k + 2.2k) * 1uF) + ((10k + 2.2k) * 1uF)))
f = 1 / (0,693 * ((12.2k * 1uF) + (12.2k * 1uF)))
f = 1/ (0,693 * 0.0244)
f = 59.14 lets say around 60 Hz

T = 1/f = 1/60 = 0,017 s for each trapazoidal wave

4. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
That looks o.k. to me.

The real frequency may be a bit off due to the BAY17 diodes in the base connections of the transistors. But you need these diodes - don't leave them out - because the base-emitter connection will break down at a reverse voltage of approx. 6 V. This in turn would alter the frequency drastically.

Build a test circuit. Use potentiometers for Rp1 and Rp2 to fine-adjust the frequency.

5. ### OddOne

42
0
Feb 26, 2013
Thank you, it worked after I checked the signal from the astable multivibrator and changed the caps. I thought those were protection diodes.

Now I want to remove the astable multivibrator and use an external square signal on the point where the 2N4148 diodes are crossing. Am I right if I say that the right side of the circuit is the amplifier for both flanks of the trapazoidal wave?

6. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
Yes, you are.

7. ### OddOne

42
0
Feb 26, 2013
Thank you Harald. At first I didnt notice the astable multivibrator, because usually they use another circuit diagram representation for the astable multivibrator.

8. ### OddOne

42
0
Feb 26, 2013
Is it possible to change the maximum and minimum voltage of the square signal in the astable multivibrator? I know I can change the maximum and minimum of the trapazoidal wave by replacing the zenerdiode with a variable zeneriode circuit, but I want to change the maximum and minimum voltage in the astable multivibrator circuit.

9. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
You can change the amplitude of the astable MV by changing the supply voltage. However, the trapezoidal effect is generated by the two zener diodes at the output. You can use 2 supply voltages to decouple the oscillator from the trapezoid waveform shaper.

Tell me: why would you want to change the amplitude of the astable MV, but not that of the trapezoid?

10. ### OddOne

42
0
Feb 26, 2013
I thought that the zener diode was used to regulate the maximum voltage of the trapazoidal wave to 8.2V. So if I can make an adjustable zener diode circuit then I can adjust the maximum voltage of the trapazoidal wave.

I want to change the amplitude of the astable MV, because the right side of the circuit uses the signal from the astable MV.

11. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
I suggest you leave the astable MV and trapezoidal wave generator as it is. Add a variable attenuator (potentiometer) to the output and a simple buffer (operational amplifier with gain=1) to restor the power (current).

12. ### OddOne

42
0
Feb 26, 2013
I've found another solution with a voltage divider which uses one potentiometer and a resistor. I haven't tested it yet on a oscilloscoop, but it worked with the multimeter. I'm certain that your solution also works, but does this mean that my solution has some power losses?

13. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
That's not exactly another solution, just another way to describe my tip.

The potentiometer/resistor will introduce a voltage drop aka power loss if you draw current from the output. You therefore need an amplifier to buffer the signal and to be able to draw current from the output.

14. ### OddOne

42
0
Feb 26, 2013
Ah I see, thanks.

I have noticed the voltage drop from 12V from the input to 8V at the output, but that's due to the power losses in the capacitors and resistors of the astable multivibrator I think.

I'm thinking of building a Non-inverting amplifier connecting it to the 12V to amplify the output from 8V to 10V. After that there's the voltage divider.

Can you give me some tips about how I can change the minimum voltage (offset)?

15. ### Harald KappModeratorModerator

11,517
2,651
Nov 17, 2011
Do it the other way round: 1st divider, 2nd amplifier. This way the attenuator is not loaded by the output current of the circuit while the amplifier does all the work.
You can change the offset by using either a summing amplifier of by adding a variable offset voltage (again use a potentiometer) to the negative input of te OpAmp. Read up a bit on OpAmps before. Here's a simple text, others you can Google.

Last edited: Mar 1, 2013
16. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011

Here's a circuit description.

The output waveform voltage is generated across the variable capacitor marked "C", next to ZD2 in the bottom right corner. You can see that the top plate of C is connected to the output. The other parts of the circuit provide the correct waveform shape.

Capacitor C is charged and discharged through constant current sources, to get the rising and falling ramps, respectively. The use of current sources ensures that the edges have a constant slope, i.e. smoothly rising and falling edges.

The circuit is controlled by the oscillator, whose output is on the collector of the second transistor at the junction of the diodes. (These are 1N4148 not 2N4148). The output controls both current sources - you can see the paths from the oscillator's output to the bases of the two transistors. The PNP at the top sources a positive current and charges C up, and the NPN at the bottom sinks current and discharges C. The potentiometers in the emitter leads can be adjusted to vary the slopes of the rising and falling edges separately, or to try to set them the same.

The final piece to the puzzle is the two zeners. These are connected so that their centre point, which is also connected to C, can never go more than 8.2V away from either 0V or +12V. So measuring relative to the 0V rail, that circuit point is clipped to the voltage range of 3.8~8.2V; it cannot go outside that range (4.4V pk-pk). This obviously provides the flat top and bottom of the trapezoidal waveform.

So the circuit surrounding "C" consists of a positive current source and a negative current sink that are enabled alternately, as controlled by the oscillator, which provide the rising and falling edges, and the two zener diodes which clip the waveform and provide the flat tops and bottoms.

The important parameters are the rise and fall times. These are determined by the output voltage swing (which I assume is fixed at 4.4V) and the rise and fall rates. These rates can be calculated using this formula:

I / C = dV / dT

dV is the change in voltage, which here is 4.4V;
dT is the duration of the rising or falling edge;
I is the current flowing from or into the active current source/sink, expressed in amps;
C is the capacitance of C, expressed in farads.

This formula can be restated as:
dT = 4.4 C / I

So the duration of the edges on the trapezoidal wave is determined by the value of C and the current from the respective current source/sink.

The constant current source/sink circuit used here is widely used, and is described at http://en.wikipedia.org/wiki/Current_source#Zener_diode_current_source. In this arrangement, only one current source is on at a time. Pairs of resistors are used instead of a zener or other regulator to establish the base voltage because the circuit voltages in both states of the oscillator are pretty well-defined. (And an exact supply voltage is specified.)

You can change the high and low output voltage levels by varying the zener voltages (don't ever use two voltages that add up to less than 12V though!) and the rising and falling edges will comply up to the voltage where the current source/sink transistor finds its collector-emitter voltage less than its base-emitter voltage and it begins to saturate.

The output of this circuit should be considered moderately high-impedance and may need subsequent buffering by an op-amp or perhaps just an emitter follower.

The problem with this solution is that it doesn't track the input frequency. The way it works, it simply converts input state changes into rising and falling edges with settable durations, and applies a voltage range limit. If you double the input frequency, the edges will take the same amount of time, so the waveshape will change. If the input frequency gets too fast, the output may not be able to reach one or both of its voltage limits!

That's enough 'splainin' for one evening.

Can you tell us about your application? What is the frequency range? What are you going to use the trapezoidal waveform for? And so on...

#### Attached Files:

• ###### epoint oddone.jpg
File size:
22.3 KB
Views:
1,697
Last edited: Mar 1, 2013
17. ### OddOne

42
0
Feb 26, 2013
Harald, thank you for the advice, I'll do some more research on the opamps.

KrisBlueNZ, thank you for taking the time for writing all that and explaining it to me.

I've tested it on the oscilloscoop and the voltage divider works, but the rise and falling edges doesn't show or works at lower voltages. But I'll do some more research about that too.

18. ### OddOne

42
0
Feb 26, 2013
I know now that the rise and falling edges won't changes with the voltage divider in the circuit, but the voltage divider works.

I don't know why it doesn't change with the voltage divider, but perhaps I can try it with a variable zenerdiode circuit instead of the voltage divider. From KrisBlueNZ post I read that it's important that the two voltages that add up has to be 12V. Any tips on this or another solution?

19. ### KrisBlueNZSadly passed away in 2015

8,393
1,271
Nov 28, 2011
No, that's not what I said. I said that the voltages of the two zener diodes must add up to AT LEAST 12V. Otherwise they'll both be damaged!

I'm not sure I understand what you want to do.

You say you want to change the voltage swing at the output of the multivibrator? There are many fairly simple ways to do this using a transistor connected as an emitter follower to buffer the output. I don't think you need an op-amp.

This is only relevant if you need the rectangular wave for use somewhere else. The right side of the circuit, which generates your trapezoidal waveform, is driven by the collector of the right hand multivibrator transistor. This point in the circuit will swing over nearly the full power supply voltage range - from nearly 0V (about 0.2V) to +12V - because of the way the other parts of the circuit are connected to it (using diodes). And you need that full swing at that point, so that the current source and sink will turn on and off properly.

If you want a variable-voltage rectangular wave, I would take the signal from the anode of the right-most 1N4148 diode. That's the end that connects to the two 1k2 resistors and drives the bottom current sink. That point will alternate between about 0.8V and 8V and you can connect a potentiometer (e.g. 10k) from that point to ground and feed the wiper into the base of an NPN with its collector connected to +12V. With a diode from the emitter to the output point, and a 10k pulldown on the output, you should get a squarewave adjustable from 0V to about 7.5V peak.

Can you give us some background into how you want to use this circuit?

Last edited: Mar 4, 2013
20. ### OddOne

42
0
Feb 26, 2013
I want to add a circuit so I can change the maximum and minimum voltage of the trapazoidal wave. The voltage divider at the output works, but then I can't change the rise and falling edges.