555 timer, PWM circuit failure

Wendy

Joined Mar 24, 2008
23,797
You will note that design is extremely similar to the DARP version, to the point that they lifted it entirely, with all the flaws intact. At the bottom of the site they even attribute where they got it (which is cool). The lack of a diode is one such flaw, as is the scheme used to turn on and off the MOSFET. I've been tempted to contact the guy who made it to point it out (they are local to me).
 

Wendy

Joined Mar 24, 2008
23,797
The design I drew and DPRG uses a similar principle, the freq should be stable. If you need a variable freq there are other ways to do the same thing. Like I said earlier, I think MOSFETs are better overall, but when I draw BJT is generally what I stick in there. I know a lot more about BJTs than MOSFETs.
 

elRey

Joined Feb 23, 2009
65
I just completed the last circuit HiProfile posted and I get quite a bit of Freq change when changing duty via R2.

Is there a way to keep Freq rock solid when changing duty?

I guess a straight rising edge saw tooth and comparator, right?
 
Last edited:

Wendy

Joined Mar 24, 2008
23,797
Are you talking about this one?



Some frequency shift is normal, but it shouldn't be too much. The ratio of charge RC to discharge RC is pretty constant. How much shift are you seeing?

If it is more than 10% then I would recheck your layout for errors. I have another article in the works, you could use it's layout.

555 PWM Oscillator
 

elRey

Joined Feb 23, 2009
65
Yes, with the exception of a 1uf instead of 0.1uf for C1 for lowering the Freq. Did that change allow for a great Freq variation during duty change?
 

SgtWookie

Joined Jul 17, 2007
22,230
One of the reasons for the change in frequency is due to the use of standard silicon rectifier diodes instead of "perfect" diodes for CR1 and CR2. Unfortunately, "perfect" diodes don't exist. However, Schottky diodes exist (like the 1N5817 through 1N5819 for example), and they have a much lower Vf than standard diodes do. This will result in less of a frequency change over the PWM range. It won't completely fix the problem, but it will improve it.

A BIG reason for the change in frequency is the upper threshold level, set by pin 5. Internal to the 555 timer, there are three 5k resistors forming a voltage divider network from Vcc to GND, to get the 1/3 and 2/3 Vcc threshold/trigger levels. Pin 5 is connected to the 2/3 Vcc junction in that network.

Since C1 is charged via pin 3, R4, CR1 and R2, and pin 3 never goes higher than Vcc-1.3v, it takes longer for C1 to reach the upper threshold than it does when discharging via pin 3, R4, CR2 and R2, as pin 3 does reach near ground when low.

To compensate for that, you can add resistance to ground from pin 5 to decrease the upper threshold level. With a Vcc of 12v, in a perfect world a resistance of 27.4k from pin 5 to ground would be just about right. But it's an imperfect world, so a better option would be to use a 22k fixed resistor in series with a 10k 21-turn trimpot from pin 5 to ground so that you can "tweak" for minimum frequency variation.

The capacitive load presented by the MOSFET gate is another problem. If the ON time is very small, it will take a while for the output of the 555 to get high enough to charge C1. If this is really troublesome, you could add a gate driver circuit that would present a more consistent (resistive) load to the output of the 555 timer, but would add some complexity.
 

elRey

Joined Feb 23, 2009
65
However, Schottky diodes exist (like the 1N5817 through 1N5819 for example), and they have a much lower Vf than standard diodes do. This will result in less of a frequency change over the PWM range. It won't completely fix the problem, but it will improve it.
I'll see if my nearest Fry's has some.

To compensate for that, you can add resistance to ground from pin 5 to decrease the upper threshold level. With a Vcc of 12v, in a perfect world a resistance of 27.4k from pin 5 to ground would be just about right. But it's an imperfect world, so a better option would be to use a 22k fixed resistor in series with a 10k 21-turn trimpot from pin 5 to ground so that you can "tweak" for minimum frequency variation.
And if Vcc is 5v (+ LL MOSFET)? what would the target resistance b/t pin5 and gnd?

Thanks for the help from all and sorry to hickjack HiProfile's thread. I did get the circuit to drive the solenoid for my application.

In addition to this circuit, how would I turn the PWM on/off (not just 0%)? AND gate somewhere?
 

Wendy

Joined Mar 24, 2008
23,797
If you are in the Dallas area both Tanner's or BG Micro have Schottky diodes. Reason I say this is the DFW area has several Fry's, which is one of my favorite stores though they ignore their fairly extensive electronics area shamefully. Comes of using minimum wage people to sort parts, they really don't have a clue. I know there are Fry's in several states, though not I'm not sure how many.

There are other PWM circuits that will work, and do what you want, with only a modest increase in parts.



This circuit will be relatively rock solid on frequency, and by tweaking the resistors be used to generate a true 0% to 100% signal. Most comparitors, such as a LM339, will require at least a 10KΩ pull up resistor. I believe this could be bumped down to 1KΩ, maybe less, and merged with the previous concept to drive a MOSFET.

This circuit has the added benifet of allowing you to vary the frequency independent of the PWM, as well as the PWM being independent of the frequency. The pot won't quite be linear, since the sawtooth waveform the 555 generates is only an approximation of a triangle wave. With a true triangle wave (which would require either 2 more op amps, or an inverter and an op am) this linearity could be made perfect. As is it will be very close though.
 
Last edited:

Wendy

Joined Mar 24, 2008
23,797
Uh, you did notice a 555 was still in this design, right?

If you make a op amp hysteresys oscillator you'll need more op amps.
 

elRey

Joined Feb 23, 2009
65
Yes, I noticed. And you said for a more linear ramp on the triangle wave (thus a more linear voltage to duty selection) I would need a dual op-amp tri-wave generator. I understand it would require more components. I assumed the dual op-amps would replace the 555 in the circuit you posted.

Did I misunderstand you?
 

Wendy

Joined Mar 24, 2008
23,797
Not really, the dual op amps can also be used in this design, but the 555 has the advantage of it's trip points being independent of the power supplies. I think you'll find the linearity is a minor issue, sawtooths are very close to a triangle wave. I've been thinking about making a Class D amp and seeing how bad it really is (but I think it is going to work).

You'll need the stable trip points to keep it stable. The other will work, if you want to go down that path, you'll just run into different issues.
 

bountyhunter

Joined Sep 7, 2009
2,512
I think I know the issue, but it the evidence just seems conflicting.

I built a PWM circuit based on a 555 timer (link to circuit) and it worked well enough the few times I tried it, except it suddenly would not turn back on after turning it off. It's running 4 fuel injectors (4-5 amps) at a relatively low frequency.

I originally designed it to run a single 5.4 watt solenoid, but later addapted it to run 4 injectors (~12-15 watts each). However I was thinking of the flyback diode in terms of voltage, not current - so I ran 4-5 amps using a single 1 amp diode (1n4003). Could that have fried the 555 chip?

I've already checked the mosfet and flyback & steering diodes, all seem fine. The 555 chip is won't come out easily, so I can't readily test it. One last thing is the injector +12vdc wire was unsoldered when I initially inspected after failure, but resoldering it didn't fix anything. [It had to have happened as I picked it up, since it initially turned off as I turned the switch off]


So all I can guess atm is a voltage spike killed something from the flyback diode not rated for enough current, or the possitive lead on the motor coming off induced some destruction...:(
If you have a 555 in an automotive circuit, you need a series resistor and a 14V Zener with a good cap across it at least for protection of the 555. I recall 555's are only good for maybe 16V or something like that?
 

Wendy

Joined Mar 24, 2008
23,797
Regular 555's, 15V. CMOS are good for 18V.

I've never heard people needing to protect them against cars electrical systems, they are pretty rugged little chippies, automotive is one of their listed uses.
 

Thread Starter

HiProfile

Joined Mar 15, 2009
33
The revised circuit I posted also worked great. I haven't tested it for very long, but so far so good. I even used it to test another project, as a r/c servo controller at a lower voltage. All I did was hook the servo up to +/-, then the signal wire where the mosfet/resistor were on pin 3.

I also tested the previous 555's and both were dead, so frying them was indeed the problem. Hopefully the new circuit has all the kinks worked out for my use.

Thanks guys, 2x!
 
Top