2
\$\begingroup\$

I assembled this circuit on a breadboard. As is well known, the oscillation frequency changes with the duty cycle.

I've used a couple of different capacitor values and resistors. Some work better, but they all have some variation in frequency.

555 timer PWM generator R3L and R3H represent a potentiometer.

I would like to understand what causes this change in frequency.

Here is what I have so far:

With no R2, I notice that the capacitor will discharge below 1/3 VCC all the way to ground. I think it makes sense since the comparator doesn't have infinite speed. But there must be something else because the frequency varies no matter how big R1 and R2 are.

Capacitor voltage The power supply is 5v. The red line is 1/3 of VCC. C1=1nF, R1=1k, R2=0, R3H=50k, R3L=1ohm

I wrote down some values for Duty cycle x frequency, and this is the result:

Duty cycle x Frequency The measurement is taken from a real circuit. C1=1nF, R1=R2=3.3k, R3=50k pot.

Something significant happens at the far ends of the duty cycle, but the frequency also fluctuates in the middle.

To me, it looks like something gets in and out of resonance.

What do you guys think?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ There are few options. Voltage drop over D1 and D2 can change with adjusting your pot due to change in current flowing through them. Higher current leads to higher forward voltage drop and that can "shift" C1 voltage from 555 point of view. Also voltage drop on DIS pin can lead to reduce discharge current in cases where R3L is low. \$\endgroup\$ Commented Jan 5 at 19:01
  • \$\begingroup\$ Is C1=1nF mentioned twice a typo? Isn't it 1 uF? \$\endgroup\$ Commented Jan 5 at 19:05
  • 1
    \$\begingroup\$ @devnull I tested it with different values. With 1uF the frequency is very stable. The frequency chart was taken with a 1nF cap. \$\endgroup\$ Commented Jan 5 at 19:22
  • 1
    \$\begingroup\$ Can you replace the diodes with signal diodes (1N4148) and test with the 1 nF capacitor? I'd also kindly suggest that you update the question mentioning the differences with capacitor values. \$\endgroup\$ Commented Jan 5 at 19:41
  • 2
    \$\begingroup\$ I don't have a physical 1N4148 to test with. But this frequency variation is well known with this particular setup, so it is not just this implementation. But I will change the text to reflect that I used different values for the capacitor. \$\endgroup\$ Commented Jan 5 at 19:50

5 Answers 5

5
\$\begingroup\$

With 1uF the frequency is very stable. The frequency chart was taken with a 1nF cap

Besides non-linearities in the diode voltage drops and the discharge transistor which must handle the discharge current and the current from the fixed resistor connected to Vcc, the Schottky diodes may also influence at higher frequencies:

enter image description here

Small capacitors will charge a bit more from the leaky diodes, but what may have a larger influence is the fact that the diode which is conducting (on the charge or discharge path) takes longer to stop conducting, so the beginning of the next cycle takes both paths.

\$\endgroup\$
1
\$\begingroup\$

I decided to take another deep dive into this problem, and this is what I found:

This formula is taken directly from the 555 timer datasheet page 11, A-stable Operation:

TH = 0.693(RA +2RB)C TL = 0.693(RB)C period = TH + TL

From that, it figures that the frequency is 1/period.

The circuit there is not the same as this one, but it is very similar when R2=0. In fact, this formula works fantastically as a predictor of the frequency at minimum duty cycle.

The formula for the minimum duty frequency is 1/0.693(R3L+R1)C1.

Frequency x Capacitance - min duty cycle R3H=0, R3L=50k, VCC=6V, R1=3.3k, R2=0, C1 is the X axis; The frequency is the y axis

However, it does not predict the frequency at maximum duty cycle when R2 is absent.

As I mentioned in the question, I noticed that the voltage in the capacitor would drop below 1/3 VCC in the extreme case where the pot is turned all the way to the charging side (R3H=50k R3L=0). I decided to assume this is what is happening and update the formula. The value at the beginning, 0.693, represents the time constant for the capacitor to discharge from 2/3 to 1/3 VCC. What is the value for 2/3 VCC to ground? Well, I calculated it as being 1.1.

Replacing that into the formula, this is the result (Frequency=1/1.1(R3H+R1)C1):

Frequency x Capacitance - max duty cycle R3H=50k, R3L=0, VCC=6V, R1=3.3k, R2=0, C1 is the X axis; The frequency is the y axis

As you can see, it does a decent job predicting the frequency, but it is not as good as the one from the datasheet. This is where the Diodes really show up, I think. The Voltage drop across the diode (Vf) will not let the capacitor go all the way to ground. For my experiments, Vf was around 250mV in both Diodes. A greater Vf will disturb the results even more.

Also, the formula gets less accurate as the capacitances increase. My guess is that as the capacitance increases, the RC time also increases, and at some point, the comparator will catch up with the RC timing.

I could go on, but I think I will stop here.

\$\endgroup\$
1
\$\begingroup\$

I think your best bet is to use a CMOS 555 such as LMC555 or TLC555 and use @hacktastical's suggestion of feedback from the output. The bipolar 555 output does not swing symmetrically to the rails and it is getting pretty pokey (the propagation delays start to matter) when you get into the tens of kHz). It also adds much bigger spikes to the power supply.

The 555 is not that stable anyway- the pot element and capacitors will also have their own temperature coefficients etc.

enter image description here

In simulation I get 22.78kHz at 12%, 22.67kHz at 50% and 22.76kHz at 88%, corresponding to pot at positions 0.1/0.5/0.9. An NP0 or film capacitor is recommended for the timing cap.

\$\endgroup\$
1
\$\begingroup\$

I'm going to infer that since you're trying to hit 25 kHz, your interest is in running a fan PWM, yes?

I think you will get better results if you use OUT instead of DISCH to run the astable. This answer shows how to do that, and how it uses DISCH to drive fan PWM: 12V to 5V regulator for PWM fan controller

Try the sim in the answer. You'll see that the frequency varies almost not at all between min and max duty cycle. The Falstad sim model is simplified with a full swing on OUT, which will be closer to the CMOS 555 behavior than the bipolar version.

At any rate, the fan PWM frequency isn't that critical. 25 kHz was chosen so that it will be inaudible, at least to humans. If it shifts a bit the fan will still work just fine because the PWM chop only affects the coil drives, not the control circuitry.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for your comment. I'm not really driving anything in particular. I'm just trying to understand the variation in the circuit. I know the frequency doesn't matter much, but it's good to know upper and lower limits to target a particular speed, like 20Khz, to avoid audible noise, for example. \$\endgroup\$ Commented Jan 10 at 22:35
0
\$\begingroup\$

If you don't want the frequency to vary with a change in the PWM duty-cycle, then use an astable 555 to trigger a 555 one-shot with variable pulse width.

That will give a variable PWM duty-cycle, with the frequency stability determined by the fixed-frequency astable.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.