How to calculate current in R2 with an LM317

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • EasyGoing1
    replied
    Re: How to calculate current in R2 with an LM317

    Originally posted by R_J
    This is not what you were asking about in your original post but have you seen this, "Control an LM317T with a PWM signal": https://www.edn.com/control-an-lm317...-a-pwm-signal/
    No, I haven't seen that before. Very interesting... I'll have to play with it and see how it works.

    Leave a comment:


  • redwire
    replied
    Re: How to calculate current in R2 with an LM317

    In my LM317 calculator spreadsheet, I did extra math so there are three possible equations:
    Given Vout, R1, solve for R2
    Given Vout, R2, solve for R1
    Given R1, R2, solve for Vout
    Also included the resistor's power dissipation calc and load, and what if the REF is high 1.30V or low 1.20V I think over temperature that is the case.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How to calculate current in R2 with an LM317

    Those online calculators never give you the current through the R2!

    I've actually written an LM317 calculator in Java ... with everything graphically laid out, you fill in the values you know it figures out what you don't know ... what I really like about it is that I can tell it that I want it to give me a list of values for R2 when I pre-select R1 then tell it I want the LM317 to have a specific voltage range... it will tell me what values of R2 will satisfy the sweep so I can pick the POT accordingly.

    It does some other stuff too ... once I've got the program complete, I was gonna see if anyone in here wanted to check it out and maybe even offer some ideas for improving it.

    Leave a comment:


  • EasyGoing1
    replied
    Re: How to calculate current in R2 with an LM317

    Originally posted by sam_sam_sam
    Or use a Servo to control the rheostat type of POT.
    This is actually a great idea ... I had not thought of using a servo to control a pot ... I mean ... setting aside the obvious - COMPLETE impracticality of such a design ... but then again Im not wanting to do the project to mass produce ... they sell chips for less than 50 cents that will charge an 18650 ... this is just for the satisfaction of actually doing it.


    Originally posted by sam_sam_sam
    the LG 1.5 amp hour ( I have a use for these batteries for another project) that are in it right now these batteries are not bad but every three of four days I have to charge them which is not convenient for me
    LiIon batteries thrive when they are topped off ... meaning it's perfectly OK to recharge them once they are down to only 90% charged. Unlinke NiMh batteries, which thrive on the deep cycle charges ... LiIon batteries will actually not last as long if you let them drain too much between charges...

    So why not just throw the batteries on the charger every night after you're done working?

    Leave a comment:


  • stj
    replied
    Re: How to calculate current in R2 with an LM317

    you dont reset a watchdog from a damned interrupt - you do it from the main program loop!

    Leave a comment:


  • eccerr0r
    replied
    Re: How to calculate current in R2 with an LM317

    dammit write good software from the get go, not expect firmware updates to save you after something goes up in flames...

    Leave a comment:


  • redwire
    replied
    Re: How to calculate current in R2 with an LM317

    A watchdog doesn't work unless you know what you are doing.
    One engineer had a 100Hz real-time interrupt (RTI) for timing things in his firmware, seconds counters etc. and he put the watchdog reset code there. Of course, his main software hung and the RTI kept happening, the product did not reboot- despite being hung up

    My buddy doing automotive ECU drive-by-wire code, one of (many) techniques is for every important subroutine, increment a counter everytime it's executed.
    He has a supervisory routine that looks at all the counters, if a count gets stuck you know the routine is dead or hung. Then you can attempt to restart it (that task/routine). If the counts are OK, kick the watchdog. The ECU you don't really want a reboot, that is a separate H/W chip doing that.

    Leave a comment:


  • stj
    replied
    Re: How to calculate current in R2 with an LM317

    any mcu used in a risky way needs a watchdog circuit.

    Leave a comment:


  • redwire
    replied
    Re: How to calculate current in R2 with an LM317

    Careful almost all Digipots are only good to 5V max, so the LM317 max. output voltage would be 6.25V as R2 can see 5V max. There are HV ones.
    Some Arduino's MCU has a DAC output. Most PWM solutions are an extra op-amp, not too complex.

    MCU-controlled battery charging is a bit risky, if your code crashes or hangs you want it to be safe.
    You can setup the Vreg hardware to output the highest safe voltage possible and then use the MCU to only lower that with software control.

    Leave a comment:


  • eccerr0r
    replied
    Re: How to calculate current in R2 with an LM317

    Yeah voltage control is not too bad. Current control ... now that's another ball of yarn.

    Leave a comment:


  • R_J
    replied
    Re: How to calculate current in R2 with an LM317

    This is not what you were asking about in your original post but have you seen this, "Control an LM317T with a PWM signal": https://www.edn.com/control-an-lm317...-a-pwm-signal/
    Last edited by R_J; 05-23-2021, 06:45 PM.

    Leave a comment:


  • eccerr0r
    replied
    Re: How to calculate current in R2 with an LM317

    and neither the synchronous interface or the 128 bit (or do you really mean 128-step) attenuation are the problems encountered with implementing a microcontroller controlled constant current source with the LM317 or L200...

    Leave a comment:


  • stj
    replied
    Re: How to calculate current in R2 with an LM317

    you can get 128bit digital pot chips with syncronous interface.

    Leave a comment:


  • sam_sam_sam
    replied
    Re: How to calculate current in R2 with an LM317

    This is why I bought the computer controlled battery charger which can work off line and if you want the results you just connect it to the computer for the results

    Yes I know it only for charging batteries but it does work very well for I use it for

    Leave a comment:


  • eccerr0r
    replied
    Re: How to calculate current in R2 with an LM317

    what has the world come to when one needs a 32-bit microcontroller to build a power supply...

    and the L200 has the same problem as the LM317 when it comes to microcontroller-controlled current limiting it looks...
    Last edited by eccerr0r; 05-23-2021, 09:58 AM.

    Leave a comment:


  • stj
    replied
    Re: How to calculate current in R2 with an LM317

    i'm pretty sure the whole concept of LM317 current regulation is obsolete for about 30years because of the L200
    https://duckduckgo.com/?q=l200+regulator

    Leave a comment:


  • sam_sam_sam
    replied
    Re: How to calculate current in R2 with an LM317

    This is one of the topic of Nuts and Volts magazine this month
    HIGH VOLTAGE OP-AMPS, A CURRENT SENSOR, AND A 32-BIT MICROCONTROLLER: HOW ABOUT A LAB POWER SUPPLY?

    Leave a comment:


  • eccerr0r
    replied
    Re: How to calculate current in R2 with an LM317

    Now this is the challenge: design a LM317 circuit that allows digital control (128 steps or better) that implements adjustable current limiting to a circuit up to 1A...

    Leave a comment:


  • sam_sam_sam
    replied
    Re: How to calculate current in R2 with an LM317

    STJ
    I found this from your post earlier

    I have not seen this type of setup before using this LM317 regulator device


    Circuit Operation
    Referring to the shown circuit diagram, the configuration looks pretty straightforward, two LM317 IC s can be seen, one configured in its standard voltage regulator mode and the other in a current control mode.

    To be precise the upper LM317 forms the current regulator stage while the lower acts like a voltage controller stage.

    The input supply source is connected across the Vin and ground of the upper current regulator circuit, the output from this stage goes to the input of the lower LM317 variable voltage regulator stage. Basically both the stages are connected in series for implementing a complete foolproof voltage and current regulation for the connected load which is a laser diode in the present case.
    Attached Files
    Last edited by sam_sam_sam; 05-23-2021, 07:23 AM.

    Leave a comment:


  • stj
    replied
    Re: How to calculate current in R2 with an LM317

    https://duckduckgo.com/?q=lm317+calculator

    Leave a comment:

Related Topics

Collapse

Working...