Author Topic: Why does duty cycle affect frequency in this 555 based circuit?  (Read 8881 times)

0 Members and 1 Guest are viewing this topic.

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Hello all.  I've lurked for a long while but am coming out of the shadows to ask a question about a 555 circuit.  I've been around long enough to know about the 55.5kHz "easter egg" ;) but I have a different issue.

I have implemented a circuit like this one that uses steering diodes to allow for a variable duty cycle controlled by a pot (P2).  I breadboarded the circuit using a CMOS 555 powered at 12 volts via a bench supply.  Everything appears to work correctly.  Changing the common pot P1 varies the frequency and changing P2 varies the duty cycle (I've designed it to run at about 60Hz).

However, I am a bit surprised to see that changing the duty cycle also changes the frequency.  I thought that

Th = .0.693 * Rc * C

and

Tl = 0.693 * Rd * C

where Rc is the resistance during the charge cycle and Rd is the resistance during the discharge cycle.  The total cycle time then would be

T = Th + Tl

If I "move" some resitance from Rc to Rd via P2 it seems to me that the total cycle time should remain unchanged.

In the circuit I built

Rc = R1 + P1 + (1 - k) * P2

and

Rd = R1 + P1 + (1 + k) * P2

where k is the position of pot P2 and varies from 0 to 1.  So varying P2 "moves" resistance from Rc to Rd and vice versa.

Obviously I'm missing something and my math is wrong since my Oscilloscope measurements tell me that varying P2 also changes the frequency.

I would be very grateful if someone could enlighten me.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #1 on: June 08, 2017, 01:55:41 am »




The freq does not change if Ra + 2 x Rb does not change.


Regards, Dana.
« Last Edit: June 08, 2017, 01:58:45 am by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #2 on: June 08, 2017, 02:55:56 pm »
Thanks for your reply, but that is my point exactly.  According to the MATH as I know it, the duty cycle should not change.  My observations of an actual circuit, however, contradict that.
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1546
  • Country: gb
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #3 on: June 08, 2017, 07:10:53 pm »
You mentioned that you have breadboarded this. It could easily be some parasitics on the layout that are interferring with timing. Could you post a pictur of it?
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #4 on: June 08, 2017, 07:56:04 pm »
Attached is a picture of the breadboarded circuit.  Note that I have tried using bypass caps from pin 1 to 8 and pin 5 to ground.  They didn't make any difference (and it's a little easier to see what's going on without them).

Discharge is connected to the center of the 200k pot.  Steering diodes connect that to a 50K pot for frequency.  That pot is connected to the timing cap (.1uF), trigger, and threshold.
 

Offline ali6x944

  • Frequent Contributor
  • **
  • Posts: 567
  • Country: sa
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #5 on: June 08, 2017, 08:36:46 pm »
You mentioned that you have breadboarded this. It could easily be some parasitics on the layout that are interferring with timing. Could you post a pictur of it?
Maybe due to the type of timer u r using, NE555 have much higher trigger current of  0.5 to 2 uA compared to the tlc555 with its astonishing 10 to 75 pA, but this is unlikely in my opinion ...
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #6 on: June 08, 2017, 09:02:51 pm »
Quote
The freq does not change if Ra + 2 x Rb does not change.

If you move resistance Rdelta from Ra to Rb, in order to keep Ra + 2 x Rb the same,
then

Let      Ra + 2 x Rb = K
(Ra - Radelta) + 2(Rb + Rrbdelta) = K = Ra - Radelta +2Rb +2Rrbdelta

Therefore Rrbdelta = [K - Ra _+ Radelta - 2Rb] / 2 = (K –K + Radelta) / 2

Rrbdelta = Radelta / 2

Example if Ra = 1K, Rb = 2K, then K = 5K
If I drop Ra by .2K to .8K then I have to add .1K to Rb
Therefore .8K +2 X 2.1k = 5K

What happens to DC.....

Originally = (1K + 2K) / (1K + 4K ) = 60%
New DC = (.8K + 2.1K) / (.8K + 4.2K) = 2.9K/ 5.0K = 58%

So Rrbdelta = Radelta / 2 should keep freq the same.


Regards, Dana.

PS : I had too much time on my hands :)
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #7 on: June 08, 2017, 09:49:37 pm »
Thanks again Dana but unless I am mistaken the steering diodes in the circuit I am using changes that equation slightly.  What I expect is that I have

TH = 0.693 * (Ra + n * Rb) * C
TL = 0.693 * (Ra + (1 - n) * Rb) * C


Where n is the position of pot R2 (200K in my circuit) and varies from 0 to 1.  So

T = TH + TL
  = 0.693 * (Ra + n * Rb) * C + 0.693 * (Ra + (1 - n) * Rb) * C
  = 0.693 * C * (Ra + n * Rb + Ra + (1 - n) * Rb)
  = 0.693 * C * (2 * Ra + Rb * (n + 1 - n))
  = 0.693 * C * (2 * Ra + Rb)


Hence the period (and thus frequency) should be independent of the position of pot Rb.

Simulating in LTSpice seems to support this (see attached).  I used fix resistors rather than a pot in LTSpice.  In the LTSpice schematic R2 and R3 make up the pot.  I can swap the two values (simulating moving the pot center arm from one side to the other) and the duty cycle changes as I would expect but frequency changes very little (about 1Hz in the current configuration).

However, in my actual circuit the frequency changes significantly with the duty cycle.  In the attached screen captures from my scope you can see the frequency varies from 64.10 Hz to 78.74 Hz as I vary R2 from a 3k/195k split (as measured with my multimeter) to a 195k/3k split.
 
 

Offline onlooker

  • Frequent Contributor
  • **
  • Posts: 395
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #8 on: June 09, 2017, 03:48:52 am »
Maybe, your 2 diodes are not matching. Swap the two and see anything changes.

A side point is: 0.693 needs correction for the diodes. 0.693 is from ln(2). Now, it is ln((V+ * 2/3 - 0.7)/(V+/3 - 0.7)).  The 0.7s are for the voltage drop on the diode.
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #9 on: June 09, 2017, 10:52:05 pm »
Maybe, your 2 diodes are not matching. Swap the two and see anything changes.

This certainly seems plausible - these are two unknown diodes from a junk pile.  I did test them on a multimeter and found they both had a voltage drop of about .7 volts.  I've swapped them out for two more unknown diodes each with a voltage drop of about .6 volts and there is no difference.
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #10 on: June 10, 2017, 01:01:58 am »
One more data point:  The frequency varies with supply voltage.  At 5V I'm getting 43.48Hz with .1uF and about 150K resistance.  At 12V that goes to 58.48 without any changes to the circuit.  This is true in my variable duty cycle circuit and in the more "traditional" configuration with fixed resistors.

Is this to be expected?  In theory (as I understand it) the frequency shouldn't change with supply voltage since trigger and threshold are set relative to Vcc (1/3 and 2/3).
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4539
  • Country: gb
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #11 on: June 10, 2017, 01:52:55 am »
One more data point:  The frequency varies with supply voltage.  At 5V I'm getting 43.48Hz with .1uF and about 150K resistance.  At 12V that goes to 58.48 without any changes to the circuit.  This is true in my variable duty cycle circuit and in the more "traditional" configuration with fixed resistors.

Is this to be expected?  In theory (as I understand it) the frequency shouldn't change with supply voltage since trigger and threshold are set relative to Vcc (1/3 and 2/3).

A quick look at your photograph of the circuit, seems to show a disc ceramic capacitor, used as the timing element. These exhibit significant changes of capacitance with temperature, voltage and other factors. Hence the change in frequency of your 555 circuit.
http://www.murata.com/en-eu/support/faqs/products/capacitor/mlcc/char/0005
 

Offline onlooker

  • Frequent Contributor
  • **
  • Posts: 395
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #12 on: June 10, 2017, 02:33:10 am »
Period = a x (Rc+Rd)C.
 
with diodes,      a = ln((V+ * 2/3 - 0.7)/(V+/3 - 0.7)). [no longer a = 0.693]

Since you got a frequency ratio of ~0.75 for V+ = 5v and 12v. It corresponds to a voltage drop of ~0.85v on each diode. That is, the  0.7 used for calculating "a" above should be 0.85.

0.85v is a little too high for a normal diode. But the discharge pin may remain a few hundred mV about ground during discharging. This can be "equivalent"  to have the voltage drop of each diode raised 100 mV or so from 0.7v to 0.85v for a simplistic view.  (Though, the real equivalent is to add the whole discharge pin voltage to the voltage drop of the discharge diode.)

If I read your pictures correctly, I think this discharge pin voltage also contributes to the period change when you turned P2 since the effect lengthens only the discharge interval. Though, it seems it can't cause the change as large as you saw.

Showing us  the waveforms of different pins of 555 should help to see these effects or other possible causes  in details.

 
« Last Edit: June 10, 2017, 12:48:04 pm by onlooker »
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #13 on: June 10, 2017, 11:15:41 pm »
A quick look at your photograph of the circuit, seems to show a disc ceramic capacitor, used as the timing element. These exhibit significant changes of capacitance with temperature, voltage and other factors. Hence the change in frequency of your 555 circuit.

This is interesting and new to me.  I've attempted to measure the capacitor at two different voltages.  Check me to see if I have done this correctly.  I put resistor (21k) in series with the capacitor and ran a 40Hz square wave through the circuit.  I probed across the circuit (to see the square wave) and at junction between the resistor and cap (to see the voltage across the cap).  I used the scope's cursors to measure from the start of the rising edge of the square wave to the point at which the capacitor reached .63V.

With a 3 volt PP square wave I measured the time at 2.4ms.  If I have done my math right that puts the capacitance at about .11428uF.

With a 10 volt PP square wave I measured the time at 2.36ms.  If I have done my math right that puts the capacitance at about .11238uF.

At .11428uF and 150K ohms I would expect a frequency of about 58.33Hz.  At .11238uF and 150K ohms I would expect a frequency of about 59.32Hz.  So it definitely introduces some error, but on the order of about 2% or less.  The differences I am measuring are an order of magnitude larger. Assuming of course that I have done my measuring and math correctly.

Have I analyzed this correctly?

 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #14 on: June 10, 2017, 11:54:27 pm »
Sorry to split this and my previous reply into two posts - I couldn't figure out how to quote two messages and so I took the easy way out.

Period = a x (Rc+Rd)C.
with diodes,      a = ln((V+ * 2/3 - 0.7)/(V+/3 - 0.7)). [no longer a = 0.693]

...

Showing us  the waveforms of different pins of 555 should help to see these effects or other possible causes  in details.

I don't understand this.  Not disagreeing - I just literally don't understand.  The cap is charging to 2/3 Vcc and discharging to 1/3 Vcc as it should.  See the attached screen captures (this is at Vcc = 12 volts).  The cap is connected directly to Threshold and Trigger.  The frequency swing is about 11% here even at a constant supply voltage.
« Last Edit: June 10, 2017, 11:56:08 pm by raw_circuits »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4539
  • Country: gb
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #15 on: June 11, 2017, 12:38:56 am »
A quick look at your photograph of the circuit, seems to show a disc ceramic capacitor, used as the timing element. These exhibit significant changes of capacitance with temperature, voltage and other factors. Hence the change in frequency of your 555 circuit.

This is interesting and new to me.  I've attempted to measure the capacitor at two different voltages.  Check me to see if I have done this correctly.  I put resistor (21k) in series with the capacitor and ran a 40Hz square wave through the circuit.  I probed across the circuit (to see the square wave) and at junction between the resistor and cap (to see the voltage across the cap).  I used the scope's cursors to measure from the start of the rising edge of the square wave to the point at which the capacitor reached .63V.

With a 3 volt PP square wave I measured the time at 2.4ms.  If I have done my math right that puts the capacitance at about .11428uF.

With a 10 volt PP square wave I measured the time at 2.36ms.  If I have done my math right that puts the capacitance at about .11238uF.

At .11428uF and 150K ohms I would expect a frequency of about 58.33Hz.  At .11238uF and 150K ohms I would expect a frequency of about 59.32Hz.  So it definitely introduces some error, but on the order of about 2% or less.  The differences I am measuring are an order of magnitude larger. Assuming of course that I have done my measuring and math correctly.

Have I analyzed this correctly?

I think you have analysed it correctly, as I can't see anything wrong, when I read through it. 2% is not that much of a variation, when you were experiencing a considerably higher frequency variation with supply voltage.

I've noticed it is NOT an original 555, but a CMOS equivalent one. Did you buy it on Ebay/China or does it come from a mainstream/reliable supplier, such as Digikey/Mouser etc ?
I.e. If it was from Ebay/China, it could be substandard/faulty/fake/bad and hence cause your frequency variations (but if your scope confirms the threshold is remaining 1/3 and 2/3, then I guess it is NOT too bad, anyway).

Quick messing with a similar circuit to yours with LTSpice, seems to show approximately an 11% frequency variation (because of the diodes), between 5V and 12V. So I still don't know why you got something more like a 34% variation over that voltage range.

Period = a x (Rc+Rd)C.
 ...Shortened post...

In principal I agree with you. The diodes will cause a significant variation with supply voltage, which seems to be about 11% (5V to 12V), when I messed around with it in LTSpice.

I just originally thought it was mainly because of the timing capacitance's variation with voltage, but that seems to have been mostly ruled out now.
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #16 on: June 11, 2017, 12:57:45 am »
I've noticed it is NOT an original 555, but a CMOS equivalent one. Did you buy it on Ebay/China or does it come from a mainstream/reliable supplier, such as Digikey/Mouser etc ?

It would be from a reputable source, likely Mouser or at worst Fry's.  It's ancient though - been around for a while. I'll get a new one to test with but it will likely be several days.

I really appreciate all the help.  This is a good learning exercise for me.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7000
  • Country: ca
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #17 on: June 11, 2017, 01:11:55 am »
I suggest having a power supply bypass capacitor.
Your diodes look like zener diodes. Check their part number.
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4539
  • Country: gb
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #18 on: June 11, 2017, 01:13:26 am »
I've noticed it is NOT an original 555, but a CMOS equivalent one. Did you buy it on Ebay/China or does it come from a mainstream/reliable supplier, such as Digikey/Mouser etc ?

It would be from a reputable source, likely Mouser or at worst Fry's.  It's ancient though - been around for a while. I'll get a new one to test with but it will likely be several days.

I really appreciate all the help.  This is a good learning exercise for me.

That is a good idea (trying a different/new one). In all probability, it won't make any difference (based on other, similar threads), but it is nice to eliminate that source of error.

In general CMOS parts are more susceptible to damage, from ESD (static) and overvoltaging than some other types (bipolar), but the modern ones are much improved compared to the ancient ones, which were notoriously easily damageable (the original ones tended to have NO protection at all).
You just had to look at them funny, and they would break  :-DD

tl;dr
The CMOS version of your 555 may have got inadvertently damaged somewhere along the line, so it is nice to eliminate it as a source of the errors, even if it is only a 10 or 20% chance.
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4539
  • Country: gb
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #19 on: June 11, 2017, 01:44:46 am »
I suggest having a power supply bypass capacitor.
Your diodes look like zener diodes. Check their part number.

Now you mention it, they do look a bit odd. That would/could explain the strange larger than expected variation in frequency with supply voltage, so well worth checking out.
If that is the case (they are zeners or something), well spotted  :)
 

Offline onlooker

  • Frequent Contributor
  • **
  • Posts: 395
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #20 on: June 11, 2017, 02:49:37 am »
Quote
Quote
Quote from: onlooker on Yesterday at 12:33:10 PM

    Period = a x (Rc+Rd)C.
    with diodes,      a = ln((V+ * 2/3 - 0.7)/(V+/3 - 0.7)). [no longer a = 0.693]

    ...

    Showing us  the waveforms of different pins of 555 should help to see these effects or other possible causes  in details.

I don't understand this.  ...

1). the multiplier to RC is,

     a=ln(start_voltage_cross_resistor/end_voltage_cross_resistor)

Or simply,
   
     a=ln(resistor_voltage_ratio_at_2_time_points)

With the diode, the flip of 555 still occurs at the voltages of the capacitor reach 1/3 x V+  and 2/3 x V+, but the corresponding voltages over the resistor will need to subtract the voltage drop on the diode to calculate the "a" constant.

2). Thanks for the waveform pictures. It will be helpful to show the waveform of the discharge pin together with the other waveforms of yours. The purpose is to see how close it is driving to the ground.  LT datasheet gives 300mV max.

With your newer smaller frequency variation (53.2HZ@14.9% and 59.2Hz@80.5%). A relatively bad saturation voltage of the discharge pin may explain it. In fact, for such cases, the problem can be compensated by adding a Schottky diode in series with the diode on the charging path (or better to also change all the diodes to Schottky).

On the other hand, your output pin (?yellow) was very close to the ground when low.  You may try to use the output pin to drive charging and discharging (google helps) and to see if it works better .
« Last Edit: June 11, 2017, 02:56:29 am by onlooker »
 

Offline raw_circuitsTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #21 on: June 11, 2017, 04:04:50 am »
The yellow trace in the previous scope captures was indeed output.  The attached captures here show the cap and discharge.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #22 on: June 11, 2017, 10:32:56 am »
Another way of doing this, with more precision is to use a PSOC.
See attached screenshot. You could use a 2 turn, 5 turn, 10 turn
pot in this design to produce more resolution.

The design has no external components except for the pot, and bypass
caps for the PSOC Vdd pin.

With ~ 20 lines of code you can have a more repeatable stable accurate solution
to the problem. And tons of other capability on the same part/chip.

Just a thought.


Regards, Dana.
« Last Edit: June 11, 2017, 03:38:25 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: MK14

Offline onlooker

  • Frequent Contributor
  • **
  • Posts: 395
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #23 on: June 11, 2017, 02:46:39 pm »
The yellow trace in the previous scope captures was indeed output.  The attached captures here show the cap and discharge.

Let us 1st list some numbers from your waveforms:(assuming the scope is in calibration)

1). The flip voltages on the capacitor are not really at 1/3*V+=4V and 2/3*V+=8V. They are about 3.8V  (4-0.15)=3.85V and (8-0.2) = 7.8 V.

2). The 1st picture (duty=13.30%) shows the saturation voltage of the discharge pin is about 360 mV for the most part.

Now we can calculate the "a" values for the charging and discharging paths:

--For charging,      a=ln([7.8-0.7]/[3.8-0.7]) = 0.8287
Correction: need to use voltage ratio on  the charging resistor and  with more accurate numbers
                                a=ln([8.15-0.7]/[4.2-0.7]) = 0.755

--For discharging, a=([7.8-0.7-0.36]/[3.8-0.7-0.36]) = 0.900
                                  a=([7.8-0.7-0.36]/[3.85-0.7-0.36]) = 0.882

Edited below:
That is, the frequency ratio for duty=100% vs duty=0% is 0.882/0.755 = 1.17, or a 17% increase from duty=0%. After correct for your waveforms that have duty=80% and 13.3%, the 17% becomes about 15%, which is close to the 11% you observed as a 1st order approximation.

A simple sensitivity calculation indicates that a parameter (flip Vs, discharge saturation, diode v drop) change of 100mV can cause 0.4% to 2.6% change in the frequency variation between duty=100% and 0%.

Using more accurate measured discharge saturation voltage and the capacitor flip voltage should give a number matching better with the observed 11%.




« Last Edit: June 11, 2017, 05:56:06 pm by onlooker »
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7000
  • Country: ca
Re: Why does duty cycle affect frequency in this 555 based circuit?
« Reply #24 on: June 12, 2017, 07:50:57 pm »
I say they are Motorola zeners, 1N52xx parts. I have a bunch. Never seen ordinary diodes in silver case.
All this math here...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf