element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Power & Energy
  • Technologies
  • More
Power & Energy
Forum Why PWM generate circuit can not adjust the duty cycle to 10%?
  • Blog
  • Forum
  • Quiz
  • Documents
  • Polls
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 288 subscribers
  • Views 1866 views
  • Users 0 members are here
  • duty
  • pwm
  • led
  • cycle
  • dimming
Related

Why PWM generate circuit can not adjust the duty cycle to 10%?

Jason
Jason over 15 years ago

I have a problem when I am debuging. My PWM generate circuit can not adjust the duty cycle to 10%! It just 46% when I modulate Rp_Potentiometer.SCH.jpg

 

But I have checked the circuit by a software called EWB and the follow images are test result.

 

1 R_potentiometer =100k Ohm  100%

   Duty cycle=10%

image

 

2 R_potentiometer =100k Ohm   50%

   Duty cycle=50%

image

 

3 R_potentiometer =100k Ohm      0%

   Duty cycle=90%

image

 

Why? Can anyone tell me why!

  • Sign in to reply
  • Cancel
Parents
  • michaelkellett
    michaelkellett over 15 years ago

    Hello,

     

    I have already answered you on this one in the Analogue group where you also asked.

     

    The LM311 is NOT an op amp - it's a comparator with an OPEN COLLECTOR output.

     

    It can only sink current not source it. You need a pull up resistor to 5V (I'm assuming that is the value of your Vcc). The resistor should be a low value compared with the load ie which is 10k in your case so the pull up should be 1k.

     

    If EWB does not correctly simulate the LM311 I suggest you use a simulator that works in future (try LTspice which is a free download at www.linear.com).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • michaelkellett
    michaelkellett over 15 years ago

    Hello,

     

    I have already answered you on this one in the Analogue group where you also asked.

     

    The LM311 is NOT an op amp - it's a comparator with an OPEN COLLECTOR output.

     

    It can only sink current not source it. You need a pull up resistor to 5V (I'm assuming that is the value of your Vcc). The resistor should be a low value compared with the load ie which is 10k in your case so the pull up should be 1k.

     

    If EWB does not correctly simulate the LM311 I suggest you use a simulator that works in future (try LTspice which is a free download at www.linear.com).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • albertosombri
    albertosombri over 15 years ago in reply to michaelkellett

    OK,

    the LM311 is not an op amp but it is a comparator, but when you close in a reaction loop a comparator with open collector it appears just like an op amp, then it doesn't need to sink or source high current to uP.

     

    In order to solve this problem is necessary to focalize on the time of charge and time of discharge of the capacitor, this is the real core of the ocsillator.

    This time is depending by the resistance value, if you are using a 100K potentiometer, the R7 must be 1K if you want to reach 1% and 99%.

    If you will use a R7 of 100 ohm, you can reach 0,1% and 99,9 %.

    I also believe the voltage reference circuit should be improved.

     

    Alberto.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 15 years ago in reply to albertosombri

    Alberto - you are not quite right about open collector outputs. They can only sink current and not source it. If you refer to the last diagram in Jason's post you see he has resistors of 100k and 1k in series to the 5V supply. When the pot is set to the lower extreme the output of the comparator is trying to charge the capacitor though a 10k resistor - but the only path for current into the capacitor is though the 100k, the 1k and the 10k resistor - that's why the ciruit doesn't work properly. All that is needed is 1k from the output of the comp. to the 5V supply and he will get his 10/90 (approximately) range in duty cycle

     

    Reducing the feedback fixed resistor to 1k won't help at all.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • albertosombri
    albertosombri over 15 years ago in reply to michaelkellett

    Hi Michael,

    Yes, you are completly right about the comparator with open collector, expecially with that polarization, 100K resistence are too high for that device, but the timing problem around the duty cyle is depending by R7 value, and this is not my opinion.

    The frequency (1/T) of the oscillator is coming from the constant time of charge and the constant time of discharge of the capacitors.
    The comparator's output switch from a state to its complement when the voltage on the capacitor reaches the same value of the voltage of other comparator input.

     

    So:

    T = C * R (during the charge) + C * R (during the discharge)

    T= (C * (Rpot(x)+R7)) + (C * (Rpot(1-x)+R7))

     

    where:
    T = 1/Foscillator
    C = C4 = 1[nF]
    Rpot = 100[Kohm]
    R7 = 10[Kohm]
    X = potentiometer position ( from 0 to 1, 0% to 100%)


    How you can see, when X=0 and x=1 the only influence on the shorter half periods is due to R7 value.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 15 years ago in reply to albertosombri

    Hello Alberto,

     

    We can improve your formula to show the effect of the open collector output with 101k pull up:

     

    T = C * R (during the charge) + C * R (during the discharge) - your formula

    actually there is an additional constant:

     

    T = K(C * R (during the charge) + C * R (during the discharge)) - K is determined by the values of the bias and feedback on the positive input. Actually even this is not totally accurate because the diodes have an effect but we wont go into that here.

     

    If we now put in the effect of the OC stage:

     

         T=  K(C * (Rpot(x)+R7+101k)) + (C * (Rpot(1-x)+R7))

     

    and the charge period range is:

              K(C* 111k) to K(C*211k)

    the discharge period is:

         K(C* 100k) to K(C*10k)

    so the PW range is 111/(111+100) to 211/(211+10) = 52.6% to 95.5%

     

    I can't make any sense out of the EWB simulation.

     

    I've simulated it with LTSpice and used an LTC1841 comaprator (still has open collector style output).

    First with 100k pull up and second with 1k pull up.

     

    In case the pictures are illegible (they look too small as I'm doing this) I have  attached the jpeg files.

     

    imageimage
    Attachments:
    image
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • albertosombri
    albertosombri over 15 years ago in reply to michaelkellett

    Yes, I absolutely agree with you.

    I was only trying to explain why it can't regulate < 10%.

     

    Think to use the right op amp or comparator without open collector, with that configuration the low limit and high limit of duty cycle is depending from R7 value.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Jason
    Jason over 15 years ago in reply to albertosombri

    Hi, Alberto & Michael,

     

    Thanks for you help.

     

    You show me how the circuit really work and give me very useful advices. At the same time you show me a very professional discuss. As you said, I decrease the value of the pull up resister from 100k to 10k, the duty cycle can be adjusted to 10%. And, I change the R7 from 10k to 1k, the duty cycle can be adjusted to 1%.

     

    By the way, Michael, thanks for recommending the LTspice to me, It's powerful.

     

    Jason

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube