555 Function Generator

Status
Not open for further replies.

Ron H

Joined Apr 14, 2005
7,063
Use a CMOS 555 instead of the bipolar version. The bipolar 555 output won't swing to the positive rail, so it screws up the duty cycle. The CMOS part can't source/sink as much current, so you might want to change the 4.7k to 47k or more (the CMOS 555 still doesn't have symmetrical pull up/pull down capability), and lose the LEDs or drive them with some emitter followers or some other arrangement. Your duty cycle should get closer to 50%.
Alternately (or in addition), you could put a pot in your "synthesized ground" divider, but the bipolar 555 output level is still somewhat sensitive to temperature.
 

RmACK

Joined Nov 23, 2007
54
A very good point regarding the symmetry of the 555 output stage.
I have been having similar issues with high speed opamps in my class D amp not creating a symmetrical triangle wave. The solution for me too was to put in a pot for the half vcc reference.

An alternative might be a parallel pullup resistor to assist the output a bit. This is no silver bullet though and with temperature, not sure if it would make it better or worse...
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Another way to do it is to use a couple of diodes on the output, The problem is with the basic 555 schematic, it uses a Darlington configuration on the drivers. Never realized it was a problem, but for a Class D amp I don't think the triangle duty cycle is important, just good linearity on the slopes.
 

RmACK

Joined Nov 23, 2007
54
If you have a very unsymmetrical triangle wave, you put a big DC offset on your output. Adjusting dc bias on the audio can compensate but reduces headroom so you can't put out as much power as it will clip much sooner one way than the other.

Adjusting the dc bias of the triangle on the other hand as mentioned helps symmetry but it gets close to clipping the triangle because the opamp was THAT bad.
 

Ron H

Joined Apr 14, 2005
7,063
If you have a very unsymmetrical triangle wave, you put a big DC offset on your output. Adjusting dc bias on the audio can compensate but reduces headroom so you can't put out as much power as it will clip much sooner one way than the other.

Adjusting the dc bias of the triangle on the other hand as mentioned helps symmetry but it gets close to clipping the triangle because the opamp was THAT bad.
I haven't used PWM much, but it seems to me that both a sawtooth (unsymmetrical duty cycle) and a triangle wave (symmetrical) will yield a linear relationship between slicing level and output "square" wave duty cycle. Am I missing something?
 

RmACK

Joined Nov 23, 2007
54
You're absolutely right, but there was a reason for my crazy misconception (Thought I'd lost my mind for a moment!:eek:).

The previous full bridge pwm circuit I designed employed a variable dead time by having either 2 versions of the triangle wave or alternatively, two copies of the control signal, with slightly different DC offsets. By varying the difference in DC offset, it allowed me to control the dead time. A saw tooth would give zero dead time on one of the transitions. Hence my misconception that it was related to having a full vs half bridge.

In a normal PWM arrangement as you quite correctly point out, it makes no difference whether you use a tri or a saw. Thanks guys! :)
 

Ron H

Joined Apr 14, 2005
7,063
You're absolutely right, but there was a reason for my crazy misconception (Thought I'd lost my mind for a moment!:eek:).

The previous full bridge pwm circuit I designed employed a variable dead time by having either 2 versions of the triangle wave or alternatively, two copies of the control signal, with slightly different DC offsets. By varying the difference in DC offset, it allowed me to control the dead time. A saw tooth would give zero dead time on one of the transitions. Hence my misconception that it was related to having a full vs half bridge.

In a normal PWM arrangement as you quite correctly point out, it makes no difference whether you use a tri or a saw. Thanks guys! :)
That's a good idea for controlling dead time.:)
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Not a clue if this will work, but it will be worth a shot.



U2c might be used to make an amp with several inputs, each with its own gain, to equalize the various signals.
 

Ron H

Joined Apr 14, 2005
7,063
Not a clue if this will work, but it will be worth a shot.



U2c might be used to make an amp with several inputs, each with its own gain, to equalize the various signals.
Bill, the feedback to the 555 needs to come from the output of U2a. The phase of U2b is wrong, and the diodes don't allow enough swing to trip the 555 (at 1/3 vcc and 2/3 vcc). The transistors will have shoot-thru current due to base storage time. You can minimize this by using high-speed saturating switches. I would choose 2N5771 and PN2369. I would also add about 150Ω from base to emitter of each transistor, to speed up the discharge of the excess base charge, and 100Ω in series with each collector to limit the shoot-thru current amplitude.
I simulated it, and it looks pretty good. It might be better to use a 100k pot and 10k resistor in the integrator, because you get a little blow-by of the fast edges of the square wave, causing a little impulse at each peak (positive and negative) of the triangle. This is because the feedback in the integrator op amp is slower than the risetimes of the square wave. I guess you could intentionally slow down the square wave rise times, but this seems counterproductive.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
You are right about the feedback path, brain fart on my part. A revision is in the works. I'm going to try the rest pretty much as is, since the LEDs do have a current limit, and are there to limit shoot through time. Some shoot through is OK, as it helps create cleaner square wave edges (theory according to Bill). In this design it will be a 1 to 3 volt overlap, depending on battery voltage. If I use white LEDs all of it would be eliminated.

Current thought is 2N2222A and 2N2907A for the transistors on the breadboard (or plastic equivalents), and a LM324 for the op amp. If this works it is destined to be another experiment in the book.
 

Ron H

Joined Apr 14, 2005
7,063
You are right about the feedback path, brain fart on my part. A revision is in the works. I'm going to try the rest pretty much as is, since the LEDs do have a current limit, and are there to limit shoot through time. Some shoot through is OK, as it helps create cleaner square wave edges (theory according to Bill). In this design it will be a 1 to 3 volt overlap, depending on battery voltage. If I use white LEDs all of it would be eliminated.

Current thought is 2N2222A and 2N2907A for the transistors on the breadboard (or plastic equivalents), and a LM324 for the op amp. If this works it is destined to be another experiment in the book.
I'm talking about shoot-thru in the discrete transistors. Reread my post with this in mind.
 

Ron H

Joined Apr 14, 2005
7,063
Simulated collector current peaks (shoot-thru) are on the order of 500mA for hundreds of nanoseconds in your circuit.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
What does it show for a 555? No resistors there either.

I took another look at the math for drivers, for a 9V power supply (which isn't likely over time) you have 2.8V per transistor base-emitter/LED, and 1.4V for the Darlington pair in the 555, which adds up to 7V. This leaves a 2V crossover, for 7V (a used 9V battery) there would be no shoot through. I may use some white LEDs to see what this looks like, I suspect the edges of the square wave will suffer somewhat.

I may add another 0.1µF capacitor across the power supply rails to address this though. If the sine wave looks decent I'll measure R6 for a fixed resistor, the emperical approach to design.

I'll start laying out the protoboard for this here.
 

RmACK

Joined Nov 23, 2007
54
It might be better to use a 100k pot and 10k resistor in the integrator, because you get a little blow-by of the fast edges of the square wave, causing a little impulse at each peak (positive and negative) of the triangle. This is because the feedback in the integrator op amp is slower than the risetimes of the square wave. I guess you could intentionally slow down the square wave rise times, but this seems counterproductive.
This is very interesting. I had this issue with my simple 30MHz opamp schmitt and TL071 integrator. I must revisit whether I higher impedance would help although from memory I think I tried experimenting with some changes like this but to no avail, the issue being the output impedance of the opamp being too high?? It was a long time ago. I want to resume class D amp work later this year so I'm glad you guys dredged this thread up (I'm subscribed to it still).

By the way, Bill, what software did you use, it has much clearer diagrams than the version of protel my uni has.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Would you believe M/S Paint? :D You can download my templates I use from my blog, I keep improving and revising them. Look for my introduction.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
Bill, the feedback to the 555 needs to come from the output of U2a. The phase of U2b is wrong, and the diodes don't allow enough swing to trip the 555 (at 1/3 vcc and 2/3 vcc). The transistors will have shoot-thru current due to base storage time. You can minimize this by using high-speed saturating switches. I would choose 2N5771 and PN2369. I would also add about 150Ω from base to emitter of each transistor, to speed up the discharge of the excess base charge, and 100Ω in series with each collector to limit the shoot-thru current amplitude.
I simulated it, and it looks pretty good. It might be better to use a 100k pot and 10k resistor in the integrator, because you get a little blow-by of the fast edges of the square wave, causing a little impulse at each peak (positive and negative) of the triangle. This is because the feedback in the integrator op amp is slower than the risetimes of the square wave. I guess you could intentionally slow down the square wave rise times, but this seems counterproductive.
I reread your post, I'm trying to keep part count low, so I'll keep the B-E resistors in reserve, if I need them.

Same for the collector resistors, although I would think a 10Ω or 1Ω on each emitter would accomplish much the same thing.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
OK, I've added the changes, some of which are designed to reduce current requirements. I'll put the protoboard drawings on this post too.





Now to build the sucker.
 

Attachments

Thread Starter

Wendy

Joined Mar 24, 2008
23,415
OK, it works, with some problems. The drawings have been revised several times, helps when you label the correct op amp pins, that and simple wiring errors. The drawings are verified though.

I owe Ron one he told me so. The op amps can't keep up with the square wave edges. I'll work on that one in a bit. First I'll put some Oscope pictures up, when I get the time. The sine wave looks pretty good. It isn't perfect, but very close. The only flaw I see is the point from the triangle wave comes through a little, but it is very usable.
 
Last edited:
Status
Not open for further replies.
Top