Boron 1.4.2 battery charging issue

boron
Tags: #<Tag:0x00007fe21f054f98>

#3

Nothing in my code related to PMIC whatsoever.


#4

one more nuance:

seems like I’m only able to reach 97% charged (at least that’s what the particle is reporting). I’ve tried both a 5V adapter wired to the VUSB pins, as well as a USB power supply, and the behavior is the same.


#5

This is common with Lithium batteries. The device actually only charges to about 85% to prevent overcharging, and adjusts the value in the console. If the battery is old and/or has been fully discharged, over time it will hold less charge than when it was new.


#6

Particle ruined the Boron charging code in recent update; please see at least two recent threads about this.
E.g.:


#7

Thanks for all the replies. @Paul_M I’ve looked through a couple of those threads. Might need to do it manually to achieve the reliability we need, but unfortunately the documentation is lacking for the PMIC side of things. I’ve got a ticket in, we’ll see what that yields. I’m rapidly headed towards an enterprise deployment, so I’ll be looking for fixes in the next couple of weeks.


#8

Hi @aklein24, thanks for posting this (and for opening up a support ticket referencing this post).

First, @picsil’s answer is correct re: max charge reporting.

Regarding the inconsistencies above, I will return here and in our ticket for an update.


#9

Sorry for late responses, I hadn’t thought about this much for awhile because I hadn’t seen any issues with my devices lately. Well, deployed another 1.4.2 Boron and it’s on VIN power (5V) and a LiPo battery and it drained the battery down and is now offline.

image

I’m reading through this thread:

and there’s a couple of fixes suggested, but they are specific to the solar charging use case. For this specific case (5V VIN) what settings do I need to adjust to prevent this problem?


#10

Is our response here (below) not relevant? I don’t believe it’s confined entirely to solar cell use cases:


#11

potentially? I’m having a hard time deciphering what exactly I need to do to fix the issue, I’ve read all those posts and I can’t figure out exactly what to do. My devices are on 5V power all the time, and I haven’t touched any PMIC settings, so I’m not sure why it decides to drain the battery down and die…


#12

alright, I’ve troubleshot a little more, and I’ll give a little more thorough background:

  1. I am power using a 5V 1.5A power supply through the VIN pin.
  2. I use the EN pin to shut the device off using a switch
  3. I’m using one of your LiPo batteries
  4. if I shut the device off using EN, while the device is on battery power, it will not begin charging again unless I unhook the battery while the device is unhooked from power, power it back on, then reattach the battery
  5. this code suggested in the other thread didn’t fix the problem:
void setup() {
    detachInterrupt(LOW_BAT_UC);
    // Delay for up to two system power manager loop invocations
    delay(2000);
    // Change PMIC settings
    PMIC pmic;
    pmic.setInputVoltageLimit(4640);
    pmic.setInputCurrentLimit();
}

#13

and I found a kinda sorta workaround though I don’t know what the fix is…

void setup() {
  detachInterrupt(LOW_BAT_UC);
  // Delay for up to two system power manager loop invocations
  delay(2000);
  // Change PMIC settings
  PMIC pmic;
  pmic.begin();
  pmic.setInputVoltageLimit(4360);  //  for 5V input
  pmic.setChargeVoltage(3850);      //  Set Li-Po charge termination voltage to 3.850V
  pmic.enableDPDM();  
  pmic.enableBuck();                //  enableBuck required when using EN Pin Shutdown ??.
  pmic.enableCharging();

}

something in there seems to have fixed it but I really don’t care at this point, battery is charging.


#14

I was about to tell you that’s not the normal case, until I tried it myself.
Confirmed with my Borons on 1.4.2.

I would have expected the PMIC to restart it’s routine (source qualification, etc, etc) but apparently not.

Just curious why/how you landed on 3.85V as the setting for max charge for the Li-Po pmic.setChargeVoltage(3850). We should take another look at the PMIC datasheet, as it may explain your findings.

[Edit] : I just noticed your Post #13 didn’t contain pmic.begin(); before you made your PMIC changes .


#15

@aklein24 , I decided to reproduce your findings for documentation.
I can reproduce using a USB port from a Computer.
I can not reproduce using a 5V power supply with micro USB connector.

To Break (with USB cable/port):
Li-Po @ 3.81 V
USB cable/computer port (4.95V no load) to Boron USB connector, Boron begins charging Li-Po @ 440 mA, 4.05 V measured on Li-Po Pin.
Remove USB Port power source, Li-Po now powers Boron.
Ground EN pin causing a Shutdown.
Re-attach 4.95V USB port power source = nothing happens, no recharging.
Un-Ground the EN Pin, Boron Boots normally but will not resume Li-Po charging, no matter what.

The same test with a 5V power supply on the Boron’s USB connector works properly and will resume charging under the same test.

A year ago, Boron’s had no trouble recharging Li-Po’s during and after an EN Pin Shutdown (my Trial #1), but that was older hardware and firmware.

Since any PMIC calls in setup() are performed after an EN pin shutdown, something fishy is going on.

My first guess involves the D+/D- data lines, since that’s the major difference between my (2) quick tests. But that would point to the PMIC retaining some phantom power source (board capacitance ?) when the only voltage source is the Li-Po during a EN pin shutdown. That might explain why the PMIC never attempts to re-qualify the source after EN pin shutdown when Vusb wasn’t available. But if so, that should have also been the case a year ago when my Borons had no trouble.

This may also be related to how Boron’s on Utility Power could have a quick interruption of power and never again maintain the Li-Po.

@marekparticle, care to take a swing?


#16

Could USB power negotiation during bootup/enumeration be a contributing factor.
Per USB specs devices should start off in low power mode (<100mA) and may only get more after asking for that.
Dedicated USB charging ports will typically supply more current even without negotiation.


#17

@oddwires1 - would you be willing to engage with the above potential workarounds and requests for information regarding the PMIC issue you addressed elsewhere?


#18

@avtolstoy Can you take a look at this note stream. Not sure it relates to previous PMIC issue. Thanks, Ian.


#19

If this feels like amatuer hour please bear with me, my expertise isn’t programming MCUs like many of you…

  1. I picked 3.85V cause I googled charge voltage for Lipo batteries and that seemed to be a recommended voltage setting.
  2. yeah I forgot to put pmic.begin() 'cause the code snippets didn’t mention it in the other threads and the PMIC documentation is terrible / doesn’t exist
  3. I should probably look at the datasheet but I’m in the midst of deploying monitors to farms right now so I’m pretty crunched for time…
  4. PMIC doesn’t seem to restart unless I put the lines of code I referenced up there in it. I’m gonna trial and error it to see what works.

#20

posted in the wrong thread, reposting here… but TL;DR gotta re-enable buck if you disconnect from VIN while EN is low/device is off because of EN pin.

  1. as far as I can tell, if you remove power from the boron (when it’s powered via VIN) while EN is pulled low (device “off”) and then plug it back in, it won’t resume charging while EN is still low. .
  2. this behavior seems intermittently different if you use the actual usb port, though I’m not sure if it’s a voltage thing or what yet, haven’t gotten out the multi-meter yet.
  3. I went one by one through the lines of code, and to get VIN power to recover it seems like all you need is pmic.enableBuck();:
void setup() {
  //detachInterrupt(LOW_BAT_UC); //(2) / doesn't matter, don't seem to need.
  // Delay for up to two system power manager loop invocations
  //delay(2000);
  // Change PMIC settings
  PMIC pmic; // yes need
  //pmic.begin(); //don't need...
  //pmic.setInputVoltageLimit(4360);  //  for 5V vin... also doesn't seem to matter? though the charge soure/status seemed weird...
  //pmic.setChargeVoltage(3850);      //  Set Li-Po charge termination voltage to 3.85V also doesn't seem to matter...
  //pmic.enableDPDM();  //doesn't seem to matter?
  pmic.enableBuck();                //  enableBuck required when using EN Pin Shutdown -> need this line!
  //pmic.enableCharging(); //not this setting alone, but not sure if I'm charging the battery, but at least VIN recovers
}

So seems like the buck gets disabled if EN pin is pulled down / device is off, so then it’s on Lipo only until you re-enable the buck? I’m guessing tho since the docs don’t speak to this. Looks like I’m gonna have to dig into the .cpp files but it’s late so that will have to wait.


Boron battery issue
#21

So any resolution on this? I think I’ve found the fix for my devices for now, but are you planning on rolling anything into some of the upcoming firmware releases?


#22

Yeah, I am waiting for this disaster to be fixed as well. Currently dying to be able to use Boron in the 6w Solar + 3.7v LiPo use case but I need to be able to enable and disable charging based on temperature 32f+/- readings. Currently seems like such a confusing nightmare with all these changes, problems, experiments, half-fixes, etc that I am just waiting for Particle to communicate about this.