Please Help with LTSPICE for My Battery Charger Circuit - Page 1
Forum section: electronics / projects

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 22, 2021, 04:46:51 pm
content: I am a fairly skilled, self-instructed circuit amateur design engineer of sorts, but I've not yet learned yet on how to use the powerful simulator LTSPICE and I know that knowing how to use this tool is very important if I am to take my engineering skills to a new level.Please, could some electronic design engineer or more experienced person show me how or even just point me to learn how to learn LTSPICE myself well enough how to analyze my circuit?Please see the attached .asc fileI am new to using LTSPICE and hope someone could help me set it up to analyze my battery charger circuit.My circuit idea is to charge a series string of any combination of up to four insertable AA and AAA NiMH cells at the same time.While 500mA CC is a good choice for charging current for AA, it is over twice the current (as seen on the battery label) recommended for charging AAA cells.To allow charging both AAA and AA cells at the same time, my circuit attempts to shunt the charging current around the AAA cell when the charging current exceeds .25-Amp or when the voltage across the battery exceeds the maximal charging voltage of 1.6V.When the MOSFET is off, the .5-amp CC charges C1 slowly, and this increase in voltage causes the charging current to reach a threshold high enough to charge the battery and then charging current increases very rapidly within a short time.|n a simulation I want to have the MOSFET turn on when the voltage across the NiMH battery reaches 1.6V from the .5 amp Constant Current Source. The MOSFET should turn off again when the voltage across the battery falls back to 1.5V.What I want to do is to try to find a value for C1 that would allow a slow slew up in charging current to reach the 1.6V level. At the this point the MOSFET shunts a 2.2-ohm resistor across the CC source to disconnect it from charging the battery and discharge C1.What I need to find out what optimum value of C1 would allow the charging/discharging of C1 to be slow enough/optimal for a MCU to control this oscillation driving the MOSFET in the simulation.If I can see if this idea is practical, I plan to code a MCU to generate a 39KHz 10-bit PWM MOSFET gate drive to control the 4 MOSFETs after making A/D measurements and thus manage the charging operation of all 4 cells.----Seems like a simple relaxation oscillator problem with LTSPICE, but I have yet found no idea how to get LTSPICE to do this.I previously posted the topic to get some help, but didn't get any help:https://www.eevblog.com/forum/projects/simple-mixmatch-aaaaa-4-cell-nimh-charger/Thanks for your help!

author: IanB
author_rank: Super Contributor
timestamp: December 22, 2021, 05:08:49 pm
content: Possibly the other thread didn't get much response because the characteristic behavior of NiMH cells when being charged, and the best way to charge them, has been thoroughly described and documented for the past many years. People will get a little weary when a post is made that does not reference any of the existing theory or documented best practice for charging such cells.Nearly always, battery charging is based around a constant current circuit. This is true of NiMH, lithium ion, and lead acid.With NiMH, one option is to use a very low constant current and simply wait for a given time, or wait until the terminal voltage stops increasing. This is suitable if you have hours to wait for charging to complete, and is also suitable for charging several cells in series.The second option is to use a rather higher constant current and monitor the battery conditions for an end of charge signal. Common signals used include looking for the voltage to start decreasing, or looking for a sharp temperature rise. See the attached chart where I monitored an AA cell while charging it at a constant current of 1600 mA. You can see the very clear voltage and temperature signals that occur when the charging is complete. These signals are best detected with some kind of microcontroller logic. If the charging current is too low, these end of charge signals will become less distinct, so higher charging currents are preferred.Therefore, the ideal battery charging topology for NiMH will be a constant current circuit in the analog domain, and a microcontroller program in the digital domain, with measurements of voltage and temperature as inputs to the microcontroller.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 22, 2021, 05:16:59 pm
content: Thanks IanB,I am well-aware of many(if not nearly all) common circuits for NiMH charging circuits and their charging strategies, even if I might have failed to make this obvious in my initial posting!I have done my homework.What I wanted was to try a new approach of my own that attempts to improve upon the speed and versatility of common consumer and industrial NiMH chargers.In my attached .jpg schematic, I have attempted to show that aa cell temperature monitoring thermistor is part of the charging schemeand my MCU is certain to monitor each cell's temperature continuously and would terminate charging when a 5 to 10 Deg C rise above ambient is noticed, and this means charging is optimally completed. At this point my code turns the MOSFET continuously on and this completely shunts any charging current away from the cell being charged.

author: IanB
author_rank: Super Contributor
timestamp: December 22, 2021, 05:41:16 pm
content: I'm really not an expert on LTSPICE, but I think the best way to begin is to start by simulating small circuit elements and gradually build things up, adding one extra piece at a time.One question to address is the initial condition for the simulation. For a circuit that cycles, you typically would have to do a "zero volt" start up and run enough cycles for it to stabilize. I don't know if there is a better way to set up the initial conditions. A spice expert might be able to say more.

author: tooki
author_rank: Super Contributor
timestamp: December 22, 2021, 09:15:05 pm
content: Quote from: SuzyC on December 22, 2021, 05:16:59 pmYou need to look into the theory of NiMH cells more. An absolute temperature rise doesn’t tell you much. There’s a reason proper chargers use delta-V/delta-T termination: it’s the increase inrateof temperature rise that tells you charging is done.(The internal resistance of a NiMH cell increases once it’s full, which causes the cell to heat faster, and the voltage to drop.)A NiMH cell, once full, converts any further current to heat, in turn causing its internal resistance -- and thus the voltage drop -- to fall. (Thanks to IanB for the correction!)The chemistry and charging of NiMH cells is well understood; the chances you could actually improve upon it are vanishingly small.Absolute temperature rise is useful as a safety cutoff, though.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 22, 2021, 10:18:02 pm
content: Thanks Tooki, for the encouragement!It is always enjoyable to know that encouraging experimenting with designs on this blog is always known to be a way to encourage people to learn about electronics. I am glad this blog often encourages people to experiment with their own designs to create their own electronic devices. Some blogs just tell posters to go out and buy a module to do what they want..no learning in that!I may not be able to make something that is better than the best industrial-grade chargers, but I know I can design my own charger circuit and assembly that could outperform most consumer-grade multi-cell chargers in charging and in regard to protecting the battery and the charger itself.I know that while a NiMH battery is being charged very little energy is turned into heat until charging is complete, especially with C/4 charging conditions. Therefore, any increase in cell temperature, assuming ambient temperature is stable, is charge current generating heat because the battery hasnearlyor already reached full charge.There can be no other explanation for the rise in temperature. My design also incorporates an ambient temperature measurement of the charging area to ensure accurate thermal rise comparisons.I also want to build a gentle charger that doesn't overcharge any cell because too much cell heat rise certainly damages the anode and weakens the cell.I am measuring the temperature of the cell on the back of the positive cell charger connector area, the back of the place where the positive tit on the cell contacts the charger connector. Perhaps I will measure a smaller detected temperature rise at the back of the positive charger terminal, but this event could certainly mean there is a much larger rise in temperature inside the core of the battery and charging is finished.I have examined some delta-V chargers that fail to protect the cells(or the charger itself) because they fail to measure cell temperature at all, and the charger connects all the cells in series, and if a fully charged cell inserted into such a charger, the chances are good that this cell would become overcharged and leak. This is exactly what I've noticed with a charger of this design.

author: IanB
author_rank: Super Contributor
timestamp: December 22, 2021, 10:27:26 pm
content: Quote from: tooki on December 22, 2021, 09:15:05 pmIt's true about the rate of temperature rise. When the cell is charging, most of the supplied power is accumulated inside the cell, but once the cell nears full charge it can no longer accumulate energy and the input power starts to be dissipated as heat, causing the sharp uptick in the temperature. Simultaneously, the increase in temperature causes an increase in ion mobility in the electrolyte, which decreases the internal resistance, which causes the minus delta-V that can be detected. Both of these effects can be seen in my chart on the previous post.You get stronger delta-V and delta-T signals with higher charging currents; if the charging current is too low there is a chance of missing the signals.

author: IanB
author_rank: Super Contributor
timestamp: December 22, 2021, 10:28:47 pm
content: Quote from: SuzyC on December 22, 2021, 10:18:02 pmThe "best" chargers charge and monitor each cell individually. Only the "lazy" chargers charge the cells in series.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 22, 2021, 10:30:51 pm
content: Thanks again IanB! I can see you are one of the rare esoteric fluid-flow experts that is able to understand the electrolytic events inside a NiMH cell.This is exactly why I am relying on temperature rise to detect when to stop charging, a Delta-V might be missed, especially if the charger charges all the cells inserted in series andeach cell is from a different useand therefor at a different state of discharge.And at the same time, with my design, other cells that have been inserted into the charger can continue to charge until their own temperature rise terminates charge.No lazy chargers for me!

author: IanB
author_rank: Super Contributor
timestamp: December 22, 2021, 10:34:18 pm
content: Some of the better chargers I own have a plastic cover that I believe is to minimize air circulation and keep the heat in--this helps with the temperature detection. Another charger that has no cover has the instruction to plug it vertically on a wall, and not to lay it flat on a desk, presumably for the same reason.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 22, 2021, 10:38:52 pm
content: One must be most careful with the care and feeding of their NiMH cells to ensure their health and long life!The legacy charger chassis that I am using to make my "Novel Improved Charger" has a plastic lid that prevents errant winds from upsetting those cells under treatment. This old charger is quite large in size and there is a cm or more between cells. This benefits my design because it prevents adjacent cells from heating each other and confusing their charge state.

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 27, 2021, 02:40:37 pm
content: Suzyc, how is the evolution of your project going?If I understood correctly, when reaching the 1.60 volts, the load should be interrupted and re-established when the battery voltage reaches 1.50v. This leads me to understand that the battery voltage will have the behavior represented in the image below (blue lines). You then want to determine the size of the capacitor, to have a more damped drop, as line in red. That's it ?

author: Peabody
author_rank: Super Contributor
timestamp: December 27, 2021, 03:18:12 pm
content: Going back to your original question about LTspice, I went through that learning process a while back on a solar charger for 18650 batteries. I found the Youtube videos to be the most helpful source for how to do things, including Dave's video #516 and some tutorial videos posted by Linear Techology and others. One thing you have to watch out for is there are two versions - 4 and 17 - and there are some differences in how they work. Try to stick with v17 if you can.I did not find anything in LTspice in the way of a solar panel, but found a video that gave me that. But I still haven't found a way to simulate a TP4056 charger. You can simulate a NiMH battery as a voltage source, but I doubt you will find anything that simulates a battery's behaviour during charging, which it seems is what you really need.I'm an amateur, and maybe that's why I found LTspice to be non-intuitive and difficult to work with. I hope you will find it easier than I did. In any case, I think you'll do best if you watch a bunch of video tutorials on Youtube.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 27, 2021, 08:56:02 pm
content: Avelino, Sampaio & Peabody..Eggsactly! Thanks for bringing my topic back to life.Actually, with my many hours of searching, I found an LTSPICE model for a 1350mAH NiMH cell.I have watched most everything on YouTube re. LTSPICE, but models of antennas, noise-figure analysis, oscillators of several types, LT IC circuits and many other circuits with op-amps, etc. are all over the place, but battery charging circuits that come anywhere close to my idea.. I'm still looking.I don't know how to create the LTSPICE directives/code that shows operation linking/simulating voltage across the capacitor and the turning on/off of the MOSFET.Attached is my non-working LTSPICE .asc file.It's just a relaxation oscillator.It's this simple: When the MOSFET is on, the 2.2-ohm resistor discharges the capacitor a little and then the MOSFET turns off and the 500mA const cur source then ramps up the capacitor's charging voltage slowly to a point where the MOSFET is turned on again.I want to see how to get a MCU to manage to dither charging current in a Goldilocks zone of operation. where each cell's voltage and current is dithering minimally and yet kept in a range near optimal charging voltages and currents.I need to limit the charging current into AAA cells in the string of charging cells to ~250mA and also want to accurately measure the average charging current to determine the mAH of charge. If all this is achieved, It is easy enough then to terminating charging where a rapid rise in cell temperature indicates charging is done(I have thermistor monitoring for each cell in my design detecting that)..

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 27, 2021, 11:28:12 pm
content: SuzyCTomorrow I'll test the circuit on my protoboard and give you the results.

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 28, 2021, 03:19:58 pm
content: SuzyCI decided to start the tests controlling the current to 250mA, simulating the use of the AAA battery.image1: circuit I used for this test.Image2: without using the capacitor. Oscilloscope in DC. Note the huge spikes displayed on the battery. The DUTY was adjusted by 30% to reach 250mA (image 3).image 4: with the use of a capacitor (100uf). Oscilloscope in AC. The DUTY is adjusted by 56% to obtain 250mA (image 5).ADC reading will not be compromised? What is your assessment?

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 28, 2021, 06:00:25 pm
content: I thank you much for your effort so far.Firstly, I truly approve using a MacGyver approach to designing a quick and dirty circuit to very quickly create a circuit solution that would work "good enough". This seems what you are doing here. MacGyver gets his ideas to work perfectly every time!I am not sure I can gain much from these pictures to help my design effort, though. This is not what I was expecting to see in LTSPICE.It' s not quite the '393 circuit you said you would breadboard and I am not sure where the probes are in any picture.I am surprised by the size of the spikes and would certainly like to find out their cause.A LM317 could generate transients like this and would behave naughty like this if the load is rapidly changing(which it is), else perhaps is is also the recovery time of the 1N4007 diode in series with battery(or are all the spikes due to extra long wires or uncompensated probes?)Adding a 1-amp 30V schottky diode in series with the 1N4007 might solve part of the spike problem.Try using an output capacitor from the LM317 output to ground?, else a fast output compliant CC SMPS P/S for the const. cur source might also be needed if the LM317 is the fault. I would not expect to use a LM317 in my circuit because of it's slow transient response and the heatsink required.I am not sure what your are measuring these pictures, I guess, but Iam not sure if the scope probe in all the pictures is always across the top of the diode to the bottom of the battery.-----------I am trying to get away from a cut and try approach to circuit designand instead use LTSPICE and somemathto try to get this circuit to work. At the same time, I also understand there is always a need to prototype a circuitafterusing math anda circuit simulator. Butmost of all, I want to be using math to create a careful design that would be tested to verify correct operation.Most importantly, the behavior of the constant current supply under changing load is something that must be explored by actual testing.---------------------For instance,discharge of the capacitor:the capacitor is only being discharged by a 2.2-ohm resistor when the MOSFET is on.The time-constant formulaT=RCcan be used to show the capacitor discharge voltage waveform.With a little more math, it is also possible to determine then thetime it takes to partially discharge a capacitor(ok, pick and try I admit, by plugging in various capacitor uF values) to achieve an optimized discharge change in voltage (a 200mV decrease (perhaps) from the cell reaching 1.7V) , but find a suitable time charge/discharge time compatible with a MCU monitoring all four charging circuits in series.Charging the Capacitorand the cell when the MOSFET is turned off again:(DeltaV/DeltaTime)= (Current/Capacitor uF).A capacitor charges linearly with time when a constant current is applied.======What would be revealing would a scope image of both the current and the voltage across the cell at the same time.I see that you first adj. the duty cycle to get the a 250mA charging current, but only a dual-trace scope picture would show the actual charge current (across a sensing resistor, (perhaps a 1-ohm to ground would work) ) in one trace and the other simultaneous trace should show the voltage across the cell. This requires using at least a dual-channel scope.Why not use the Hantek to show what's going on?

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 28, 2021, 07:45:47 pm
content: Quote from: SuzyC on December 28, 2021, 06:00:25 pmThe oscilloscope is measuring the value on the battery.Quote from: SuzyC on December 28, 2021, 06:00:25 pmI'm using the MUR160.Quote from: SuzyC on December 28, 2021, 06:00:25 pmI had already done some preliminary tests but I will redo them. For example, look at the result of the voltage over the battery in image2 without using the capacitor. Also note the frequency. The LM393 is slow and I am using a relatively large resistor in the mosfet gate. I will also test with the LM311.I'm going to add the 100uf capacitors, as shown in theimage 1, and I'll run new tests.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 28, 2021, 10:31:09 pm
content: I am having difficulty identifying pictures attached. I am confused. I don't know which images are what image numbers, all your pictures are not named or numbered this way.If you are first referring to the image directly under the previous schematic, then seeing 2.55 volts at its peak, across the cell, is quite alarming.The latest picture you've sent shows around a 1-uS period, if the 315mV waveform is with a LM393 circuit driving the MOSFET, it makes sense, but shows that charging is occurring only about 25% of the cycle and the average current is unknown.This circuit is perhaps not charging the cell 3/4 of the charging time. Using AC coupling doesn't show the actual cell voltage or current, just the change of cell voltage. In any case, an exceedingly fast A/D on a MCU would be required to manage even one cell charging with this circuit, unless the MCU is only monitoring cell voltage while charge pauses or is just reduced in function to monitoring cell temperature.Why use a LM393 that does dumb charging when a MCU could replace this charging charge/discharge function intelligently?

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 29, 2021, 12:01:44 am
content: SuzyC,Quotei have the PIC12F765. If you send the programming (hex) I perform the test.Below is the image of the last test, with all the 100uf capacitors installed. What changed well was the amplitude, which was 400mv-pp.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 05:44:06 am
content: Don't mean to be picky, but there is no such thing as a PIC12F765, according to Microchip.Perhaps a typo, maybe you meant PIC16F765?The latest waveform shows <=50% charging time. A charger should not waste time charging a cell and this waveform guarantees that approx. half the time the design causes a cell to not being fed electrons.My idea here is too evaluate an unusual circuit for a charger. In design of a charger, there are always alternative ways to accomplish a task. If a circuit, after some experimentation, seems like a hare-brained idea then it is a poor choice to accomplish the goal, and one should then go back to the drawing board!There are more ways to skin a cat. A plan B might be better here.A circuit idea might be a good idea to be implemented if:1) It accomplishes a task better than an alternate circuit.2) It is cheaper to make, easier to find parts for, easy to make, yet gives as good performance as alternatives.3) It has fewer and inexpensive components than other circuit ideas, but doesn't compromise performance.4) It has a smaller PCB footprint, yet works as good as an alternate.5) It offers many advantages in performance, it is more versatile, easier to repair than alternatives.A circuit idea should be abandoned or rethought if:1) It is a dumb way to do something, unstable, hard to fabricate, uses hard to get, obsolete or imaginary components, performs erratically, costs too much in parts, wastes time accomplishing a design goal, doesn't perform as well as alternative circuits, isn't safe, likely to catch fire or burns, scares small children, police or pets, or likely to explode or maybe just trying to set it up to work causes incidences of mental illness, severe frustration and depression, or its operation cannot be understood by ordinary people, or is likely to require a visit by a Buddhist priest for a blessing, and even then requires summoning both a member of the clergy and then an exorcist to get it to work, or just brings bad luck to anyone who constructs it and tries to use it.2) Hasn't been optimized to work well so much that it causes unexpected results, causes damage to the environment, damages libido, else somehow causes pains in the neck or the posterior, else its implementation just causes you to be shamed and shunned by your friends, parents, peers and also insults your ancestors.3)Hideously ugly.So, maybe too early to throw code at an imaginary chip?

author: IanB
author_rank: Super Contributor
timestamp: December 29, 2021, 06:03:25 am
content: Quote from: SuzyC on December 29, 2021, 05:44:06 amMaybe PIC12F675?https://ww1.microchip.com/downloads/en/devicedoc/41190c.pdf

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 06:24:40 am
content: The 4-cell circuit requires legions of A/D input pins, the 12F675 only has four and even lacks a 16-bit timer and so little flash code memory or data to cause a coder to experience loss of sleep, ennui, possibly hallucinations of grandeur.

author: Ian.M
author_rank: Super Contributor
timestamp: December 29, 2021, 09:25:54 am
content: Additionally the PIC12F675 is notorious for loosing its OSCCAL internal oscillator frequency calibration and the bandgap voltage reference calibration during development, and its got Microchip's original 14 bit 'midrange' PIC core, which makes it a PITA to develop for. Its also overpriced when compared to more modern 8 pin PICs and indeed other brands of low pin count MCUs. Unless supply chain issues, or massive legacy stock in hand force your hand, you'd be crazy to use it for a new design.

author: Avelino Sampaio
author_rank: Frequent Contributor
timestamp: December 29, 2021, 09:49:40 am
content: SuzyC and Ian.M,this here is looking like a conversation between drunks. The PIC12F675 is sufficient for the circuit I'm testing, so an ADC input is sufficient. All I asked for was the programming to test the 1.6v cutoff voltage, in place of my test with the LM393. Who said here that I'm proposing this PIC12F for the original project?Well, I think you already have enough information for you to move forward or not.

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 11:00:34 am
content: Quote from: SuzyC on December 22, 2021, 10:30:51 pmChargers that do multiple cells properly must measure each cell’s voltage individually, and control each cell’s current and termination individually. It is technically possible to do this with complex series connections, but I don’t really see why you’d wanna take that approach.Regardless, -delta-V termination is actually the best thing to measure, and this is why:When you measure the temperature of a cell, you’re measuring the temperature of thesurfaceof the cell. The voltage drop upon full charge is itself a proxy for the cell temperature rise, except it occursinsidethe cell, and thus earlier than external temperature measurement. So by relying on external temperature measurement, you’re actually prolonging the time when the cell is being overcharged. Look at IanB’s first graph: the sharp external temperature rise has only just begun at the time where -delta-V detection has already terminated the charge.I dunno why you think you would miss the voltage drop. It’s just a few mV, but that’s easy to do with a modern MCU’s ADC. (You can easily take dozens or hundreds of measurements and average them to eliminate noise, since an effective sample rate on the order of, say, one every 10 seconds is more than fast enough.)

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 12:37:52 pm
content: Tooki, its really simple code to measure each cell's voltage and temperature.My design does this for each cell to protect the charger and the cells being charged.I must again repeat, my topic is about LTSPICE and I have already posted these words below:My design is a charger for insertable cells, so while a deltaV check can be missed, a small temperature rise is guaranteed to be detected with a thermistor. A small temperature rise doesn't damage a cell, according to some manufacturer's charging recommendations for charging, but certainly indicates near to or full charge.If just deltav is the only thing relied on to terminate charging, it can cause a fully charged cell to emit caustic fluids and damage both the battery and the charger's PCB and circuitry.DeltaV can also cause sometimes false indications of full chqrge, especially in chargers that charge two or more cells in series.This missed deltav problem is fixed when (as in my proposed design) each cell is not required to match any other cell in state of charge or size to be charged properly by my circuit and coding idea because of individual voltage, thermal, time and mAH monitoring for each cell.

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 01:21:56 pm
content: Quote from: SuzyC on December 29, 2021, 12:37:52 pmGood!Quote from: SuzyC on December 29, 2021, 12:37:52 pmNon sequitur: countless chargers for "insertable" cells use -delta-V sensing. Why do you think they're incompatible?Quote from: SuzyC on December 29, 2021, 12:37:52 pmSure, which is why good chargers use both -delta-V AND delta-T termination (plus a cutoff timer just in case). With either one, the charge current must be sufficiently high as to cause a measurable increase in temperature. Remember, the voltage drop is theresultof internal heating. As has already been explained, -delta-V/delta-T charging cannot be used with low charging currents. That's why commercial chargers use various ways of detecting a cell's physical size in order to set the charge current appropriately, to ensure it's always high enough to produce a measurable termination point.Quote from: SuzyC on December 29, 2021, 12:37:52 pmYes, we all know this, and the mechanism for this has been explained to you in detail by IanB.Quote from: SuzyC on December 29, 2021, 12:37:52 pmThat's not a result of -delta-V charging, but ofcompletely failedcharge termination. If you're pushing a current high enough to cause catastrophic battery failure, you're pushing a current high enough to produce a reliably measurable voltage drop.Quote from: SuzyC on December 29, 2021, 12:37:52 pmIf your design measures and controls each cell individually, as you say it does, then why do you keep bringing up the situation of series charging?And for non-series charging, what situation results in -delta-V triggering premature termination?Quote from: SuzyC on December 29, 2021, 12:37:52 pmSo... like any halfway decent NiMH charger?Regardless, you seem intent on proving -delta-V sensing is some kind of deficient thing, when in fact it's a) generally quite reliable and is the primary termination method in any decent charger because it triggers sooner, and b) almost always paired with delta-T sensing as well.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 01:23:22 pm
content: Thanks for your effort Sampaio,I can only say is that your short replies can be unfortunately so vague to me as to cause me to almost all the time not understand what you are doing, have done, or the what and why about what you will do next.I don't want to guess, and considerable and careful explanation is always necessary in the science of engineering to communicate well about complex ideas.Circuit design shouldn't always be a guessing game. Nor should communication.I know my ideas about communication require an investment in time and thought but I accept this is something I'd likely expect from most people who understand how to help others understand.Sadly to say, I have only maybe got you to turn sour and I feel bad about that, and I admit our conversation was off-topic from the start, and no, I haven't got enough(hardly any) information yet about my posted topic and question.

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 02:10:12 pm
content: Quote from: SuzyC on December 27, 2021, 08:56:02 pmCan you share this elusive model?

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 02:38:57 pm
content: Tooki, thanks so very much for replying to my topic question!https://www.slideshare.net/spicepark/ni-mhbatterysimplifiedopenltspice110815232344phpapp01http://ltwiki.org/?title=Modelling_a_Ni-MH_battery_with_hints_on_Li-Ion_battery_modelinghttps://www.edaboard.com/threads/how-to-make-a-battery-model-of-nimh-on-hspice.214394/

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 03:08:05 pm
content: Quote from: SuzyC on December 29, 2021, 02:38:57 pmYou can thank me by being cooperative and answering the questions I asked.Quote from: SuzyC on December 29, 2021, 02:38:57 pmThanks! The first one is a sales presentation for a $390 purchaseable spice model.The second one is interesting, but at least as far as I can tell from a few minutes of experimenting (with my mediocre spice skills) it only models discharging. :/The third one doesn't say much of anything at all.

author: IanB
author_rank: Super Contributor
timestamp: December 29, 2021, 06:15:11 pm
content: Quote from: SuzyC on December 29, 2021, 12:37:52 pmI know you are trying to make this thread about LTSPICE, but in my opinion, problems with missed termination on minus delta-V are due primarily to poor implementation, not that anything is wrong with the theory itself.This brings it back to circuit design. The optimum design for a multi-cell charger will have a constant current source applied individually to each cell, and a program in a microcontroller that carefully monitors cell voltages and temperatures and takes the appropriate actions. The complexity is going to be in the microcontroller program, not the circuit itself.Even chargers from reputable manufacturers can make mistakes in the implementation area. For instance, the well-regarded MH-C9000 charger from Maha. This charger cycles the constant current supply in time slices between the different cells on charge, and it measures the cell voltage in the intervals when the current is turned off (perhaps to eliminate interference from noise on the switch mode converter). Therefore, to achieve an average charging current of 250 mA, for example, it might supply 1000 mA for a quarter of a second every second.This has two problems. Firstly, supplying high current in pulses is not good for older cells with a higher internal resistance. Secondly, trying to detect the minus delta-V signal in the interval when current is turned off is not consistent with the mechanism by which the minus delta-V signal occurs (the drop in internal resistance of the cell). This particular charger was notorious in its early versions for missed terminations. Maha has "fixed" the algorithm in later versions by adding a high voltage test as a backstop, but it is still not ideal. I might perhaps obtain their latest V2 model of this charger to see if anything has improved since?(If you refer back to my chart at the top of the thread, you will see the Eneloop voltage tops out at about 1.63 V. I believe Maha put the high voltage limit at about 1.6 V, so when charging an Eneloop the MH-C9000 will never see the minus delta-V signal.)But one thing you can learn from this is to focus on having a smooth, continuous current source rather than a chopped current source. A potential design is to pass the current through all the cells in series (so you only need one current source, not four), and then do charge control on each cell individually by bypassing the current around cells that have reached full charge (similar to charge balancing on Li-ion packs). I think this might be what you have in mind?

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 06:49:03 pm
content: Wow! Thanks IanB for your input.However, almost consumer chargers require and charge two of the same AA or AAA type cells at once and charges pairs in series and rely on DeltaV charge termination. Also bothersome, require setting a switch to charge four cells at once.The DeltaV problem in this case is obvious, if the voltage across two cells is used to detect deltaV and it is most certain that the cells do not initially match in size or in state of charge, then DeltaV will certainly not occur simultaneously and then only one cell will have been fully charged while the other one would remain in an unknown state of charge due to mismatched charge termination.I also don't like the idea of having to insert two cells of the same type to begin charging and I have not seen any consumer-grade chargers that monitor each cell's temperature and have an affordable price.I initially decided to build my own charger because it is sometimes possible to mistakenly insert fully charged and near-zero charged cells in such chargers, not to mention the error of inserting alkaline cells.My close friend was using such a two/four fast-type charger and managed to insert a fully charged cell with a zero-charged cell and later I observed that the charger had become inoperable and a clear fluid had come forth from the charged cell. I took the charger apart and saw the fluid ate away the copper and resist of the top fifth of the charger PCB and it needed to be discarded.With this all in mind and considering the high price of a really good charger, I decided that all my studying of circuit design should be put to purpose and I decided to make my own Novel NiMH charger while re-using the chassis of the nfg old charger.My design would not cut corners to lower BOM, allow one to four cells to be charged in any mix/match and carefully monitor the state of charge and temperature of each cell..

author: IanB
author_rank: Super Contributor
timestamp: December 29, 2021, 07:00:45 pm
content: Quote from: SuzyC on December 29, 2021, 06:49:03 pmI do not own any chargers like that. If you are selective about what you purchase, it is easy to buy a charger that charges four cells individually. Panasonic, in particular makes such chargers. I own, for instance, the Panasonic BQ-CC17 and never had a problem with it. It has four status lights for four cells, and each cell is controlled independently. I also own the very nice BQ-321 that charges two cells independently.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 29, 2021, 07:17:32 pm
content: IanB, it is sometimes a bit more difficult these days to find a good charger in stock(because of the plague causing distribution problems), but most of all, I enjoy designing and fabricating my own circuits that give the best performance.I get a thrill out of getting to use the knowledge and skills I've learned.I have a plan B circuit that uses four independent PWM CC supplies(one each for each battery), and all fed from a fifth single PWM buck convertor that supplies ~2-4V, and every power supply is my own discrete component buck design, all P/S are PWM based and all this is managed by a single 40-pin PIC MCU and all power from one 12V 3.5Amp repurposed laptop brick.I know I can finish this project in a few days (at least two, including making my own PCBs, fabrication, testing and coding). It will use a separate (data to be displayed sent by serial UART to a slave) MCU that is just for driving a (salvaged repurposed) mtplx'd .5-in 7-segment by 7-digit bright yellow LED display that allows a ticker-tape type display technique to show charging status(voltage, mAH, cur) for each cell.It will also dumb gentle slow (many hours) charge two 9V NiMH batteries at the same time and offer battery testing, but that is very easy.A single rot-enc with m.c. press sw. will manage the GUI, but on turn on the task is set to autocharge and it is only necessary to insert a cell for charging to begin automatically and detect cell type.Each cell/9V bat also has a single LED whose blinking pattern betrays the current charge status of all cells/9V at a distance with one glance.I have already have laid out PCBs and developed code that will adapt fairly easily for all these tasks(I did this over some years time in the past). I have documented them well enough and now it is just a problem of integrating my code saved and making one new PCB from the saved layouts and populating it. A new PCB is required to fit into the repurposed chassis.If I make them, I can always repair them. I also like the green idea of reusing the old chassis which has the rather hard to construct battery holders/connectors in good condition (I am w/o a 3D printer to make my own). This saves me many hours of construction/assembly work and not seeing it ending up in some landfill.The only problem I have right now is to get this project finished as there is a growing small mountain of discharged NiMH cells lying about that need charging. The three yr old design was only breadboarded and has worked well, but I have been robbing parts out of it to build this project and also needed(really wanted to try out a new idea) one night to reuse the breadboards. It is really hard(impossible) to find the P-Chan power MOSFETs and MCU I used in stock anywhere, Mouser/Digi-Key/Farnell promising stock in July 2023.I am facing the grim reality that I need to finish assembly of this project fast else buy a few alkaline cells to keep some of my gadgets working or buy a ready-made charger(nix to that!).

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 10:34:00 pm
content: There’s absolutely nothing wrong with “I want to do this for fun, not because it’s cheaper or better”. Just don’t lie to yourself (and others) that good solutions which meet all your requirements are hard to find, or even don’t exist. They absolutely do, and they’re not hard to find. I’ve got a 15 year old Sony charger that has 4 completely independent slots, each for AA or AAA, with a display showing the charge level for each cell. It also detects non-NiMH cells as well as bad NiMH cells, and won’t charge them. It also has a discharge mode. And that charger didn’t cost a fortune, maaaaaybe $50 including a set of cells.What baffles me about your main design is that it doesn’t actually take the best approach towards your own stated goals. You’ve mentioned repeatedly how you want to be gentle on the cells, but by relying on delta-T alone, you are guaranteeing that in most cases, you will be overcharging the cells more than if you used -delta-V and delta-T termination. You talk about the downsides of series charging, yet have opted for… series charging.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 30, 2021, 03:17:38 am
content: Tooki, Read my posts before being so judgemental! You must con-TROLL yourself.No, no series charging for me, (But again, this topic is about learning about evaluating with LTSPICE an alternative, novel circuit idea)I've just prev. posted a description of my (completed three-yr old design)charger that charges/tests/monitors each cell individually using DeltaT and mAH monitoring.

author: tooki
author_rank: Super Contributor
timestamp: December 30, 2021, 02:04:44 pm
content: Quote from: SuzyC on December 30, 2021, 03:17:38 amIdidread your posts, and I'm neither judging nor trolling. Giving you pushback and feedback isn't judgment, it's discussion to help YOU reach a good design that meets your requirements. (Especially since you don't seem to have a solid grasp of the technology, based on your repeated statements.)Your refusal to respond to questions doesn't exactly makeyoulook good, though, nor does your insistence that good chargers aren't readily available, even after being shown that they are. (Not saying you should buy one -- it's absolutely fine to say "i wanna do it myself anyway!" --, just that you can't keep claiming they're hard to get.)Quote from: SuzyC on December 30, 2021, 03:17:38 amUmm, your words, right in the original post:Quote from: SuzyC on December 22, 2021, 04:46:51 pm(emphasis mine)Quote from: SuzyC on December 30, 2021, 03:17:38 amRight, but you haven't asked much in the way of LTspice questions. Unfortunately, without a proper bidirectional (charge and discharge) model of a battery, I don't know how one would begin to model the charger circuit.Quote from: SuzyC on December 30, 2021, 03:17:38 amYeah, I saw that. And...?

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 30, 2021, 03:03:03 pm
content: Tooki,For the last time, my topic is about getting LTSPICE toevaluatea novel circuit design,I am not married to the ideaof actually using this circuit it in anything, esp. if evaluation shows its a hare-brained idea. You seem to think to have an idea like mine is in itself somehow taboo and heresy, must be punished and pounded down because just mentioningevaluatingthe idea itself threatens the security of the sacred gods of DeltaV battery charging.--------------You're correct, latest check with "BuyBots" show chargers availability now. I could hop down to a big local electronic warehouse and buy a DeltaV one for 30 bucks, but considering the Covid threat is avalanching right now faster than a DeltaV rise, and even although I've had two jabs, I must do my best to avoid shopping as much as possible. My shopping motto is get the milk, grab the bread, then get the hell out!--------------For the purpose of charging a NiMH cell, an ideal voltage source that gradually rises with time being fed a const cur, until a limit is reached and DeltaV behavior is expressed and dominates, and most importantly with a realistic internal resistance, should make a good-enough model for LTSPICE(if you don't worship the gods of DeltaT, like I do).

author: tooki
author_rank: Super Contributor
timestamp: December 30, 2021, 03:18:52 pm
content: Quote from: SuzyC on December 30, 2021, 03:03:03 pmThen ask questions about LTspice.Quote from: SuzyC on December 30, 2021, 03:03:03 pmNobody has said or done anything of the sort. Telling you why that particular design decision is not the best idea a) doesn't mean it won't work at all, and b) has nothing to do with deities. We've told you this because there are sound, scientifically valid reasons why typically not the best, and it's frankly insulting that you think we'd be basing these explanations on dogma (and to be clear, we have explained to you the reasons for the recommendation, not just said "don't do it cuz we said so").Quote from: SuzyC on December 30, 2021, 03:03:03 pmOne can now order things online and they show up right at your door. But again, nobody is saying that you should buy one. Just don't pretend they aren't available, and don't come in guns a-blazin' about how you're going to do a better job than the many engineers and scientists who've worked on that very problem for years.Quote from: SuzyC on December 30, 2021, 03:03:03 pmTo a point, yes, but it certainly can't model things specific to NiMH cells, like the temperature rise and corresponding internal resistance drop, so you wouldn't be able to test your termination logic, regardless of whether by voltage or temperature.

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 30, 2021, 03:42:00 pm
content: Attempting to give one more beating to a should-be dead horse, I could online order one, if I at all wanted one,and I don't, it likely wouldn't be seen at my door for maybe 5-6 days considering the New Year. Look at today's date. And for some reason, this local warehouse doesn't ship, must order instead from its main distrib.location thats not just around the block. In that time I could build two of my own.----------My LTSPICE Conspiracy Theory:I donno LTSPICE from road apples, but I am sure, looking at the wildly different ideas/things that LTSPICE has successfully modeled, that it has certainly been spiced by charger mfg's "Scientists and Engineers", and they likely might consider this research a trade secret.For sure, with LTSPICE, NiMH battery charging simulation is piece of cake for those who know how to LTSPICE it up.-----------------I know for sure I can design and build a charger that is every bit as good and even better than the "scientist and engineers" who have been struggling with this problem since Abe Lincoln, because I am not restrained in design to minimize cost or size or looks and most of all, this design problem is not to me rocket science. I've already done it.

author: tooki
author_rank: Super Contributor
timestamp: December 30, 2021, 04:27:53 pm
content: Quote from: SuzyC on December 30, 2021, 03:42:00 pmNobody is saying it can't be modeled. It absolutely can, and it has been done. But given that such models aren't widely available, and one company charges $400 to license their model, it's likely something that isn't trivial to modelwell. Building spice models is something beyond the abilities of most spice end-users, as far as I can tell.Quote from: SuzyC on December 30, 2021, 03:42:00 pmSorry, but based on your statements and questions so far, I think it's exceedingly unlikely that you've made somethingbetterthan what's available. Not all battery chargers on the market are el-cheapo crap built down to a price. Is yours probably better than the worst chargers on the market? Absolutely. Better than midrange models? Could be. Better than the best? Not a snowball's chance in hell.