Driving a Voltage Regulator with PWM


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Driving a Voltage Regulator with PWM

    Hello,

    Does anyone have a very simple example on how to drive (adjust) a Voltage Regulator with PWM?

    I have a +5V LM340 VR and don't know how to connect it to make it Current driven.

    This is what I built (simplified here) and this won't work for sure.
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1793&stc=1&d=118289009 9">

    How do I do this a correct way?
    Attached Images Attached Images  
    Roger

  2. #2


    Did you find this post helpful? Yes | No

    Default Needs RC filter

    I assume the PIC pin joining the 12F683 to the junction of the 10k, 2k2 and 100nF is the PWM out of the PIC.

    What you need from the PIC HPWM is a series resistor - say 1K, then a large cap to ground, say 100 uF. This time constant is 100 mSecs so the HPWM frequency should be at least 1 kHz. The junction of the 1k/100uF then goes to the ground pin on the regulator.

    HTH
    Brian

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Some theory

    Thanks BrianT,

    Yes, I use the CCP1 pin for HWPM.

    So, it would look like this:
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1803&stc=1&d=118292364 8">
    Brian, may I kindly ask to you to explain the time constant calculation and relation to the PWM frequency? This is not clear to me as I do this usually on the "thumb" (= au pifomètre).

    In fact, I made this circuit already (had a 47u cap) and could not vary the output voltage very well. But I thought this was because I adjusted the VR in "voltage" instead of "current" mode.

    The voltage would change only from around 120 to 240 dutycycle (CPP1RL) and I would read between 3V and 4V.

    I also corrected the output voltage on the schema...
    Attached Images Attached Images  
    Roger

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    1. Why not using a digital POT?

    2. Also, in the schema above, there should be a resistor parallel to C1 cap.



    --------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default any suggestion

    Hi Sayzer,

    To me, HPWM looks simple. But, as you say, why not another way?

    Never used a Digital pot before. What "resolution" (roughtly voltage step) will I get?

    Any suggestion of values I should use in this case and what the schema would then look like?

    If I stick to the HPWM, what value should I use for the resistor to be put parallel to the cap?

    Thank you in advance
    Roger

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    I think that the PIC is in danger by that connection. If your supply is 12V and the output around 2, the rest 10 volts should be between regulators ground pin and ground. So the output of the PIC is at high voltage point through the resistor.

    What exactly are the specs? What do you want to produce at the output?

    My suggestion could be something like this:

    1. PIC HPWM to a filter.

    2. Filter to an Opamp for DC voltage amplifying.

    3. Power output Transistor to give the appropriate current to the load.

    You can produce a 0-12 output that way.

    If you want controlled Current source then the Pass transistor could be at the feed back loop of the opamp. I'll try to scetch and scan if needed.

    Ioannis

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default This meant for a battery charger

    Hi Ioannis,

    I am making a lead-batteries charger.

    In my opinion, it is not necessary to control the full voltage range of the batteries that need to be charged.

    Important is to control the charging voltage (2,35V/element), the floating voltage (2,26V/element) and, of course, the timing (n hours for charging -depending on battery capacity- and then go to "float" or "trickle" mode).

    So, if you have i.e. a 12V lead-battery (= 6 elements), the charging voltage will be 6x2,35V=14,1V and the floating voltage will be 6x2,26V=13,56V.

    Roughtly, the voltage range to control is quite narrow: less than 1 volt. Thus. this should avoid the use of an OP-Amp. The current is limited by the transformer's capacity.

    So this is what I would like to achieve now. It could look like this:
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1806&stc=1&d=118293647 1">
    Attached Images Attached Images  
    Roger

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    On the schematic you have to power with more that 15Volts. 2950-5 needs at least 0.45 volts at the input above from 5V. If your battery is discharged and request more current, the transformer might drop the voltage bellow 15V.

    The circuit is quite economical but I am afraid that is quite a compromise too.

    I have attached my idea in a hand schetch (sorry, no CAD here!).

    Ioannis
    Attached Images Attached Images  

  9. #9
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    CAD is not necessary - your drawing is well done

    You're right, the Zener is going to be an 8,7V since I don't have another under my hand...

    Maybe I'll go for your solution.

    Have to make some trials.

    Thanks a lot.
    Roger

Similar Threads

  1. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  2. Voltage monitor and PWM control
    By StoneColdFuzzy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th May 2009, 16:11
  3. Negative voltage for LCD driving?
    By Fredrick in forum Schematics
    Replies: 11
    Last Post: - 15th January 2009, 11:51
  4. PIC driving Adjustable Voltage Regulator
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 6th June 2007, 20:05
  5. Help with final project
    By OvERKiLL in forum General
    Replies: 4
    Last Post: - 15th December 2006, 20:35

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts