News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Constant power battery discharge

Started by david, May 28, 2021, 07:09 AM

Previous topic - Next topic

david

Hi All,
I've been playing with PICs to monitor Lipo battery discharge and it's all working well for a fixed resistive battery load but it would be nice to do a constant power discharge.  Constant current is also widely used and is easy enough to do but constant power seems a little harder.
If you refer to the attached schematics you will see a classic constant power circuit - much the same as constant current but instead of taking only the current sense it takes the product of current and voltage.   Now I don't want to get in to analog multipliers and wonder if I could do the maths in the PIC and output proportional PWM to be filtered and fed to the error amplifier.  It would be a sampled system with updates occurring every second.  What concerns me is having a time constant in the error amplifier's feedback  - usually a recipe for instability.
Has anyone done something like this or know of a better approach to achieve constant power while the battery voltage sags?

Best regards,
David

RayEllam

#1
Hi,
I have simulated something similar but not actually built anything yet and was planning on going the digital route as you propose. The kit I'm designing can disipate around 250 watts. Some observations.

1. Use a PIC with a 12bit AD for better resolution an accuracy.

2. Your only interested in a voltage range from 10 to 14 volts for the battery V so scale this range for your V ADC.

3. You will need to use a low offset low drift op amp for the current feedback to the pic to get max ADC resolution.

4. Have a temp sensor on the heatsink.

5. Doing the power calcs and adjusting pwm
for constant power will not be an issue.

I'm away from my computer at the moment but I can pass you the sim files I have if your interested.

david

Hello Ray,
250W is impressive - I'd be happy with half that.
I have run some simulations myself which look fine but of course the multiplier is only a maths function with no lag whereas the PWM approach will have both the ADC sampling lag plus the RC integrator lag.  Even a few mV differential on the error amplifier will see the gate voltage swing madly and the lag means it may never settle.  I guess the fall back situation is a constant current load which doesn't have delays inside feedback loops and can be set by integrated PWM.
My set up presently is all done with a 16F88 and has a 1 button select/confirm menu for number of cells (1-4), low voltage cut-off (3.0-3.6) and load resistance.  I using mostly floating point rounded to 2 decimal places and also streaming all the data out to a terminal logger.
I will try a constant power set up but using low currents so I don't need a fire extinguisher if it becomes a YouTube moment.

Best regards,
David

RayEllam

#3
There are 2 ways to handle power dissipation.
1. Switch mosfet hard on, dissipate most of the energy in the resistor

2. Have the mosfet in it's resistive region and share the dissipation in both mosfet and resistor. I have seen this method used for higher power dissipation across a heat sink.

An ideal way I guess would be a purely analogue feedback method where the pic sets a set point for power ( Iref) the comparitor does the control based on constant current, the pic averages the power calcs over a few hundred iterations then
 throws out a new set point.

RayEllam

#4
One other thing to consider. Lithium batterys of all types have a max discharge C. If your pulse switching a bank of parallel mosfets  hard on ( low rds) through a low ohm resistor then what is the downside on the batteries if any? Are you still getting true capacity levels due to very high pulse discharge? Meaning a truly electronic variable resistance may be a better option for the load?

david

Hello Ray,
No I wasn't considering PWM of the FETs in to a low resistance.  I think it has to be active, linear mode all the way.  Either way the total heat is the same whether it's resistors or FETs doing the dissipating.    I will look at PWM to derive the reference voltage rather than add a DAC.
I think rather than the circuit I posted earlier I should be looking at it as a slowly varying constant current source with the PIC just increasing the current slightly every sample period as the voltage sags.  That should be quite feasible I think.

Cheers,
David

Giuseppe

A very prepared engineer has already carried out the project with an arduino you could remove the arduino and manage with a pic. I put the link below :
http://www.scullcom.uk/design-build-an-electronic-dc-load-part-1/

Giuseppe MPO


If you use mosfets working not in commutation, ABSOLUTELY refer to their datasheet making them work below, I recommend much below, their safe operating area. Don't look at the general characteristics, in DC the mosfet can die with fractions of the maximum voltage or current it can withstand.

trastikata

In the past I used 2N3055 instead of MOSFETs. Anyway the discharge is through heat conversion, it's much easier to regulate with linear BJT transistors.

Put the power resistor before the 2N3055 and place them on common heat sink, then control the discharge current by controlling the transistor base current and measure the voltage before the resistor and the drop across the resistor to calculate the total power passing through the resistor and thus dissipated as heat either in the resistor or in the BJT.

top204

#9
The skullcom circuit looks way O.T.T (Over The Top) with its complexity.

It can all be done with a single microcontroller using the PWM as the DAC (created with timers for higher resolution, but lower frequencies) and the 12-bit on-board ADC and the on-board Op-Amp or Comparator acting as an Op-Amp for low frequency amplification. Even the RTC can be done with a standard device and some devices have one built in.

All that is required externally is the MOSFET and the power resistor, and a few small discrete components. I did something similar many years ago for a constant current copper plating controller and it all fitted on a tiny PCB with very few components, except for the heatsinks for the MOSFET and high Wattage resistor and LCD (not counting the rotary encoder and buttons).

david

Giuseppe - many thanks for the interesting link but while it may be very sophisticated it lacks the monitoring of individual cells during the discharge process.  Both Lithium polymer and Lithium Ion cells need to be maintained above the recommended low voltage (about 3.0V for Lipo and 2.5V for Li-Ion) so must be sampled during the discharge process and stopped when reaching it.
Also  - I didn't spot a serial output for logging the data.  This to me is essential and yet is lacking on many of the cheap Chinese made CR,CC,CP dischargers which are often rated to 150W and are relatively cheap.
I have no problems using FETs with an op-amp to make them a linear current sink and use integrated PWM to set the value, either linear as a CC discharge or as the product of battery current and battery voltage as CP discharge.  I'm still tossing up which is better because CP is closer to the actual use case but most cell manufacturers publish CC discharge curves.
I have also looked at a combo of fixed resistor and active device but of course total heat is the same and active control is more flexible.
Why the need for an RTC chip in that charger design? For data like W.H or mA.H you need precise sampling but a background timer can cope with that and you don't need the actual time.
Finally - I would rather have my fingernails removed than resort to Arduino but I accept that it has introduced many people to the wonderful world of micros and often bad code.
I should mention I know a few people doing 2-4KW linear mode discharge of large Lipo packs.  This is done by some electric ducted fan modelers for assessing flight packs.  Typically 6S 6000mAH packs (136WH) are discharged in less than 4 minutes.  I'm right at the other end of the scale and typically use 2S or 3S packs up to 2200mAH

Cheers,
David

RayEllam

#11
This is what I'm thinking.
1.op2 scales 10 to 14 volts to 0 to 5v.

2. Op1 scales the current to 0 to 5v.

The comparitor is doing all the work based on the feedback from RS. The pic is constantly doing V And I ADC measurements and averaging them. Every second the pic does a new power offset calculation and sets the pwm (or DAC) accordingly.

david

Hello Ray,
Thanks for your extra input.  I had arrived at very much the same thing.  A DC gain of say 10 in the current sense op-amp and a simple PWM filter and the rest is logic.
It may be better to use a 2nd order RC filter to remove most of the residual triangle waveform from the integrated PWM.
My version didn't have the luxury of the 2nd op-amp - just 2 resistors to scale the battery voltage down.  I can live with the unmonitored current they would bleed off the battery.

I'm sure you have seen these units before-
https://www.aliexpress.com/item/4001153199791.html?spm=a2g0o.productlist.0.0.4913611chiX0Z2&algo_pvid=16dd0be5-7b89-4e69-a64e-6134c81c3ab9&algo_expid=16dd0be5-7b89-4e69-a64e-6134c81c3ab9-6&btsid=0bb0624216223509290563332e4870&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

They appear to offer excellent value but don't monitor individual cells and don't appear to stream raw data but I may be wrong on this.  Here in NZ I couldn't buy a bare fan and heat sink for that price.

Another unit hints at having serial output but still no individual cell monitoring-
https://www.aliexpress.com/item/32999141610.html?spm=a2g0o.productlist.0.0.4913611chiX0Z2&algo_pvid=16dd0be5-7b89-4e69-a64e-6134c81c3ab9&algo_expid=16dd0be5-7b89-4e69-a64e-6134c81c3ab9-41&btsid=0bb0624216223509290563332e4870&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Feature M (reserved) indicates some type of serial data, yet or never to be added.

Cheers,
David

RayEllam

#13
The second link you sent I have used one. It slowly failed over 3 months, the failure ranging from an increasingly incorrect current reading, then the voltage reading started to become increasingly incorrect then the mosfet went bang.

As for individual cell monitoring I just realy on an off the shelf BMS for balancing, lvd, ovp. The batteries I assemble and test are based around LIFEPO4, nominal V 12, 24,36, 48v. Nominal AH from 100 to 310.

Keep me updated on how you get on. I will eventually build my version but probably not for another month or so.

I also do a Manual full bottom balance (all cells parallel and left to self balance for a couple of days) before the first charge on all battery banks I construct.

david

Most interesting.
I certainly would try to avoid buying anything electronic at the moment as there are so many component shortages out there.  FETs and other semiconductors are rapidly increasing in price and the temptation will be to use available but ring-in parts that may not be fully qualified for the application.

That's hefty stuff you're playing with there and I would take a more professional approach with the discharger circuit than I would with RC hobby packs.  That said, I was pretty happy with the first test of the discharge jig and managed to get excellent plots off the streamed data.
I have come across a few individual cells that have rapidly collapsed upon reaching around 3.5V when discharging so hence the need to shut down the PWM if any cell measures low.

Cheers,
David

RayEllam

For any testing of real high power stuff like 48v, 310ah with high discharge I use a 48v to 220vac inverter driving a 1 to 2kW electric heater. I have a watt hour meter on the DC side, seems to do the job ok.

david

Sounds like a good, safe way of getting rid of that sort of power but as I mentioned earlier I do know of people using 200A discharging with purely active loads but at a maximum of 22V.    Shutting down that sort of current also has its problems with active loads - the energy stored in just a short length of wiring (0.5*I^2.L) can take out the FETs at turn off.

Cheers,
David

RayEllam

[quote the energy stored in just a short length of wiring (0.5*I^2.L) can take out the FETs at turn off.
[/quote]

Understand. So a beefy fast recovery diode across the mosfet should fix that. Also sturdy wiring to the batteries and a star ground system on the PCB. I'm also getting a 4 layer pcb made with 1oz copper that should help keep stray inductance to a minimum.

david

Hi Ray,
Indeed fast more than beefy.  It doesn't have much to do but what it does is important.  I have a little PIC based jig for measuring DC internal resistance of batteries which delivers a gated 10A current sink for 10mS.  Worked well on my 2S and 3S packs but died when testing a friend's 4S packs and I believe this should also have had a Schottky diode fitted.
Your other precautions are all good when dealing with higher currents.

Cheers,
David