Help with current limiting circuit - Page 1
Forum section: electronics / general

author: Frazatto
author_rank: Contributor
timestamp: June 19, 2020, 08:23:21 pm
content: I'm currently trying to convert my bicycle for electric and it has been a long and frustrating process so far......My currently road block is charging the battery packs (12s 3.8 liio).I bought I good enough power supply but when I tried out to recharge the pack, the power supply just keeps turning off and on.Yes yes I quickly diagnosed that the low voltage batteries have a very low resistance and acts as a short, so the power supply protection keeps engaging and now I need a current limiting circuit.Current limiting, not continuous current. I have seem this two terms being used interchangeably in lots of places but I need a solution that just let the batteries do its thing and a cc circuit would just blow the batteries after it reached the target voltage (50v if anyone was wandering).Anyway, I found this circuit here:https://freecircuitdiagram.com/215-variable-adjustable-current-limiter-circuit/It does almost exactly what I need, except for the maximum power it can handle.I would like to handle 3A+ (charging 3 packs at most at the same time 1A each) and 50V, but the 2N3055 power Transistor kind of limits this.I was going to build it as is just to keep going with the project and upgrade in the future, but talking to the guy in the store he recommended I just used an 2N5296 (https://pdf1.alldatasheet.com/datasheet-pdf/view/1200453/SPTECH/2N5296.html) that can handle 4A continuous.Now....I'm pretty sure I built everything correctly (picture attached) on the protoboard and I'm trying to test it at 4V on just one battery in my bench just to be sure buttttt nothing happensand I don't know why.(it's so frustrating when nothing happens.......)I'm a computer engineer, I'm used to work with simple circuits for microcontrolers and this one is just out of my knowledge graspAnyone have any clues where or how I could start debugging???

author: ahbushnell
author_rank: Frequent Contributor
timestamp: June 19, 2020, 09:08:45 pm
content: Charging LiPo's is a little tricky. It requires a controlled power supply that can operate in constant current and constant voltage. Initially the battery is charged with constant current. When it reaches a maximum voltage per cell it starts controlling voltage and the current starts dropping. When the current drops low the charging is then shut off. You do not float charge a LiPo. Note I said cell voltage. You need to monitor all the cells and go to constant voltage when one of the cells reaches the limit. There are chips (TI) that can be used for cell monitoring. I suggest you dig a little deeper into battery charging.Have fun and be careful.

author: ocset
author_rank: Super Contributor
timestamp: June 19, 2020, 09:37:39 pm
content: I'll knock you up a circuit to simply charge with 1A, and then stop charging when cell voltage reaches x volts.....as attachedSo the battery has 12 Lipo cells in series?Does it come with any battery management circuit......ie, does it have an internal balancing circuit?Or do you have to dismantle it and charge each Lipo cell separately?The simplest way to "do cell balancing", as already said, is just stop charging the whole battery when one cell gets to max voltage....but that means you wont be using the whole capacity of the battery...then again...you may not care about this?Are there not offtheshelf solutions for this?......ebikes are really popular everywhere now and i thought the mass producers would have already flooded the market with chargers?LT8584 is a well known highly efficient cell balancer, but you need to design a flyback smps for it.

author: ahbushnell
author_rank: Frequent Contributor
timestamp: June 19, 2020, 09:50:06 pm
content: That's not cell balancing. But it avoids destroying the battery.

author: ocset
author_rank: Super Contributor
timestamp: June 19, 2020, 10:40:55 pm
content: Can you post schem of your breadboard?Do you have at least a DMM so you can probe the nodes?Perhaps some crocodile clips on wires so its easier to hook up to the nodes?is this your circuit? from your post above at top?https://freecircuitdiagram.com/215-variable-adjustable-current-limiter-circuit/..you put the cell between q1 and r1?Did you put 1 cell there, or the whole 50V battery?What voltage is the incoming power source?

author: Frazatto
author_rank: Contributor
timestamp: June 20, 2020, 03:08:01 pm
content: Ok ok, this problem could have been avoided if I just have said "this is a protection circuit".Stay with me, ok?! Some of you won't like what I'm going to say next.I will not use a BMSIn principle because I"m trying to learn as much as I can, it's a personal project and I already have learned A LOT!!! Enough to understand the consequences of my decision and what I have to do to achieve it.Also, because my country money is as valuable as marbles right now and I just cant buy a decent BMS even if I had to. I tried the cheap ones before, not worth it.....WTF am I doing than?I'm bottom balancing the pack.And I succeeded!!All the batteries are within 0.05V from each other.And now is a matter of charging it properly.Which bring us to the second thing you wont like me saying.I'm not planning on using a dedicated brand li-po charger.For the same reasons as before.And for now, I also succeeded, the only thing missing is current regulation.(with I also don't need and am not planning on using active discreet stages detection)So, to the matter at hand.Quote from: treez on June 19, 2020, 10:40:55 pmI attached a picture of the circuit on the breadboard in my first post, I could draw the EXACT pins I'm connecting for each component if you like to.The only thing I don't have is a oscilloscope.Yes, that is the circuit I'm trying to build.No, the cell + goes where the Load is on the diagram.Considering I'm building the "Darwin Awards" solution here, I'm testing everything on very low loads first to be EXTRA sure everything works as I expect. So no, I'm not connecting this thing to a 50V 4A charging station, I'm trying to test the thing on a single cell (4V expecting the circuit to limit it to 1A) at the bench regulated power supply.As far as I can tell, everything is at 0V and that means one or more (possible all because they are cascading) of the transistors are closed!I just don't understand EXACTLY how this thing works to find what I did wrong assembling it.

author: ocset
author_rank: Super Contributor
timestamp: June 21, 2020, 12:31:13 am
content: Here is your circuit in the free LTspice simulator.You can check it to see what your voltages should be.ALT+right clicking(EDIT: ALT + LEFT CLICK) a component gives the power dissipation in it...if you set your bench psu too high, its a lot of dissipation in the main npn power transistor....set it too low, and you wont get enough charge current.I urge extreme caution !!!...you could blow that battery up...wear eye protection at the very least...do not leave it overcharging.

author: Frazatto
author_rank: Contributor
timestamp: June 21, 2020, 07:10:01 pm
content: Quote from: treez on June 21, 2020, 12:31:13 amLTspice runs great in Linux, nice! (it's so magical! never used a circuit simulator before)Ha! Don't know what I did wrong, but now I understand the purpose of each component.The big fat resistor is a buffer for the battery, taking the hit till it equalizes with the power supply.The cascading transistors are properly limiting the current once it gets to the target, should be free flowing if lower than that.Which is regulated by the POT and Q2.

author: ocset
author_rank: Super Contributor
timestamp: June 21, 2020, 08:57:49 pm
content: i'm glad you like the LTspice.Actually, i have a confession...i didnt spend much time choosing the transistors...so i probably need to go over them again, and find ones with the correct amount of hfe (gain).Also, the transistor that takes the most current should have enough gain so that it can have enough collector current...........considering its base current.The top three transistors are essentially a "darlington" stage.....three are used because no single transistors exist with enough gain and enough current capability.The bottom transistor is controlling the "darlington", so that it passes no more than the "clamp current" level.The clamp current level is set by the vbe of that bottom transistor, and the big power resistor and potThe big resistor may do some power dissipation.,.........but its not really meant to......it just does...the big power transistor should dissipate the most power...the resistor is really just a sense resistor.The divider and pot across the power resistor is just there so you dont have to keep swapping out the power resistor every time you want the clamp current level to change.It looks like you need a power supply voltage of at least 6.8V or so, in order that you can keep supplying at least an Amp as the battery voltage rises up to 4V. (as the attached shows)Remember after you have run the sim, and you have the waveform window there still...ALT+LEFT CLICK gives you the power in any component.This course has details on how to use good features of LTspicehttps://drive.google.com/file/d/0B7aRNbu3Fes4TU92Mkw3YlA3ams/view?usp=sharing

author: Frazatto
author_rank: Contributor
timestamp: June 22, 2020, 01:41:42 pm
content: @treez if you don't mind, let me bother you a little further.I found this while researching:https://www.homemade-circuits.com/universal-high-watt-led-current-limiter/The first circuit, it creates a constant current, It's not the same function as the one I'm building, right?If you take a look at the datasheethttps://www.ti.com/lit/ds/symlink/lm317.pdf(item 9.3.3 page 13) it really says it's a current limiting circuit, but the resistor in line, won't it just create a fixed current?

author: Frazatto
author_rank: Contributor
timestamp: June 22, 2020, 02:05:40 pm
content: Quote from: treez on June 21, 2020, 08:57:49 pmUHU!!!You are right and the simulation helped a lot.Once I passed the 6V threshold, the current started to go up.I will make further tests to be sure the current will mingle once the battery reach 4V, but I think the mystery is solved.

author: ocset
author_rank: Super Contributor
timestamp: June 22, 2020, 09:58:36 pm
content: QuoteIts essentially the same, just different components...the LM317 will be more precise than the transistor one you show in top post.The LM317, if set up with just a resistor R between ADJ and OUT, will clamp the current to 1.25V/R....If theres not enough input voltage, then less current than 1.25V/R will flow.A heatsink is likely to be needed on the power transistor or the LM317, whichever one you choose.Actually it looks like you can rig up the LM317 to do both voltage and current regulation........but it looks like there is a minimum current requirement of 3mA...otherwise it goes out of regulation.Basically the LM317 will regulate such that there is 1.25V across whatever you put across the OUT and the ADJ pins.QuoteYes i suppose you can call it a "fixed" current...i call it a "clamp current level"...........but if theres not enough input voltage, then less current than the clamp current will flow.I must admit i forgot about the LM317 in relation to what you are doing.......the LM317 is probably the most famous of all linear current regulator components...all electronics forums are full of posts on LM317 useage.The attached LT3083 is a bit like LM317.There may be an ltspice model of LM317 on the web....i found one but it was inaccurate.The jist of it is that LM317 and LT3083 are more accurate than the pure transistor ones, because they have an internal op-amp to do the current regulation

author: bin_liu
author_rank: Contributor
timestamp: June 23, 2020, 04:11:26 am
content: The normal output voltage range of the 12S battery pack is: 2.75V/CELL~4.2V/CELL, which is 33V~50.4V, and the linear step-down method is not efficient for CC and CV charging.You can consider using a switching power supply, such as LM5116.

author: Frazatto
author_rank: Contributor
timestamp: June 23, 2020, 01:23:01 pm
content: Quote from: bin_liu on June 23, 2020, 04:11:26 amThanks for the heads up, I'll definitely keep upgrading this solution in the future, but for now the way I'm doing is working great.Quote from: treez on June 22, 2020, 09:58:36 pmLevel clamp, sure I know what that is. Only saw with voltage, but it's now obvious that you can do it with current tooI read in some places that the op-amp solution is not good for changing batteries, "they don't like" the constant fluctuation. And I'm sure there are workarounds, probably all the commercial solutions use digital power control, but for now I will double down on the solution I have because there are still other things to do till I can use the bike.But anyway, I tested the circuit on the 50V pack and it worked great.The greater the difference between the power supply and the pack, the greater the current.It slowly approached the target tension and precisely turned off at 50Vjust beautiful!Thanks a lot for the help o/

author: ocset
author_rank: Super Contributor
timestamp: June 23, 2020, 03:38:31 pm
content: Sorry but i think the opamp solution is fine for charging batteries.Then again, if the transistor way works, then i suppose thats fine too.It sounds like you have set the input voltage to that exact level whereby the transistors stop charging the battery when at 50V....thats good...but what if you forget and set the vin higher?...you could overcharge the batteries and cause an explosion.Also, an individual cell could get overcharged as it sounds like you are not monitoring each cell voltage when you are charging the 12S stack?

author: ocset
author_rank: Super Contributor
timestamp: June 23, 2020, 10:36:09 pm
content: Here is a cheap switch mode charger that can be built on stripboard due to the low frequency and heavily damped fet.Very low current though.LTspice and pdf attached

author: Frazatto
author_rank: Contributor
timestamp: June 24, 2020, 01:33:35 pm
content: Quote from: treez on June 23, 2020, 03:38:31 pmI'm building a dedicated charging station for the bike, once set I will never touch it again.And I'll use a tension gauge and a current gauge on the final solution to be sure things are as it should along the way.There is no BMS, that is right.....let me explain my setup and procedures so you feel less worried (and it may help other adventurous and cheap dudes in the future)Once I get the batteries, I make a test on each one with a LitoKala test station and mark the capacity and internal resistance.I then proceed to bottom balance everything, gather the ones most close to each other and proceed to discharge than all to a very low power state. Discharge till 2.8V and let it rest for one or two days, if they stabilize ~3.0V I start soldering the pack, if not it's just another session at the discharge station.Pack ready, plug in the charging station, make sure to regulate the top current to the C rating of the batteries and wait for it to go up to the pack voltage and slowly get to 0A.I was able to get all the batteries within a error of 0.05V when discharging and to 0.01V after charging the pack.Bottom balancing requires more care and maintenance, I will have to check balance once a year (probably 6 months) and re balance the packs when needed.And if you are connecting packs in parallel, MUST BE SURE they are all at the same voltage level before doing it. (but I think this is also the case if using a BMS)Do you think people would be interested in my discharge solution?I ended up creating my won since I could not find any proper solution using an Arduino.

author: ocset
author_rank: Super Contributor
timestamp: June 24, 2020, 07:19:59 pm
content: Oh well yes, it sounds like you are making sure the batteries are all kind of matched so it sounds better.I am sure you know that in the pack some batteries may run hotter than others, and they will wear out quicker and go out of match...but yes you said you will re-check in time.A proper switch mode, 1A (or whatever) charger could so very easily be made of for this application, so im surprised so little exists off the shelf. Maybe they are scared of being sued if somebody trys to charge the wrong battery pack and it all blows up, or trys to charge a non balanced pack and there's no balance checking etc.I heard from a "Big insider" that in Formula E they dont check cell balance when they recharge the car batteries when they come in for pit stop....they super fast charge the heck out of them...and overcharge the entire stack aswell......specially if the racer is a bit behind...and the battery stack often starts smoking due to this, but he said he never saw a battery stack blow up during such mal-treatment.However, care is always needed, eye protection.