Author Topic: [Review request] Bidirectional Current Measurement  (Read 1457 times)

0 Members and 1 Guest are viewing this topic.

Offline BadeBhaiyaTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: in
[Review request] Bidirectional Current Measurement
« on: November 10, 2025, 01:11:56 pm »
Hello all, hope you're doing well

I'm trying to design an SBS1.1 battery pack for my ThinkPad (and any other laptops) but with a twist, I'm not allowing myself to use any BMS AFE chips. I've got cell balancing figured out, next is current measurement.

This is a very simple circuit that I can use to measure current in both directions. Is there anything wrong with it? Besides using 1% resistors of course. Maybe some bandwidth limiting on the output? I have no idea.
 

Offline BadeBhaiyaTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: in
Re: [Review request] Bidirectional Current Measurement
« Reply #1 on: November 15, 2025, 07:42:30 pm »
After spending some time I finally realised why the earlier circuit is stupid. There are several reasons, but the biggest is the biasing decreases the differential voltage and hence will make me use a better opamp with lower Vos.
I have updated the circuit to the one in this post, its a better one. I plan on using OP07 opamps for this (not my opamps of choice, I just don't want to order parts from digikey).

OP07 have a Vos of 30uV so it makes perfect sense to use in the input stage. With a shunt of 10mΩ, I can measure a minimum current of 3mA. Dividers will decrease the common mode voltage by half but also the differential voltage so 3mA becomes 6mA. Still perfectly acceptable. The amplifier has a gain of -20x with bias voltage at VBAT/2
I have a 12b ADC on my MCU (STM32G0), so at a reference of 3.3V I can measure in steps of ~800uV, which translates to ~4mA of current across the shunt.

Sorry if this is all scattered and confusing. Hopefully the image is easier to understand. Not really thinking in terms of decent quiescent current right now, that comes later.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 17326
  • Country: de
Re: [Review request] Bidirectional Current Measurement
« Reply #2 on: November 15, 2025, 07:58:51 pm »
The shown circuit is rather complicated. One could get away without the extra divider and buffers if the difference amplifier has less gain (e.g. x 3 or x 5). With low enough a gain the differential amplifier also works with a CM level at the supply or a bit higher. More gain could be added as a 2nd stage. Low gain is still well better than dividers and the extra buffers.
 
The following users thanked this post: BadeBhaiya

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 983
  • Country: us
Re: [Review request] Bidirectional Current Measurement
« Reply #3 on: November 15, 2025, 08:24:42 pm »
Use a high side current sense, like https://www.ti.com/lit/ds/symlink/ina181.pdf

It’s not a BMS, just a goal specific opamp. Cheaper than trying to make the same specs with an above the rail generic opamp.

If you still want generic opamp, follow how INAA181 is built and the inputs are spec’d for common mode and over the rail.

« Last Edit: November 16, 2025, 12:52:10 am by dobsonr741 »
 
The following users thanked this post: BadeBhaiya

Offline MariuszD

  • Frequent Contributor
  • **
  • Posts: 725
  • Country: pl
Re: [Review request] Bidirectional Current Measurement
« Reply #4 on: November 15, 2025, 09:03:15 pm »
Quote
OP07 have a Vos of 30uV so it makes perfect sense to use in the input stage. With a shunt of 10mΩ, I can measure a minimum current of 3mA. Dividers will decrease the common mode voltage by half but also the differential voltage so 3mA becomes 6mA. Still perfectly acceptable.
Too good to be true. Change resistor R5 to 101kOhms. Since you used 1% resistors, such a change is within the expected range. At Vbat=12.6V and zero current, you will see a voltage difference of 31mV at the buffer inputs, which corresponds to an error of 6A :)
 
The following users thanked this post: BadeBhaiya

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 983
  • Country: us
Re: [Review request] Bidirectional Current Measurement
« Reply #5 on: November 16, 2025, 12:59:15 am »
This is the guidance from the Analog portfolio: https://www.analog.com/media/en/analog-dialogue/volume-44/number-4/articles/high-side-current-sensing-wide-dynamic-range.pdf  It tells how to do it in 3 ways.

 
The following users thanked this post: BadeBhaiya

Offline BadeBhaiyaTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: in
Re: [Review request] Bidirectional Current Measurement
« Reply #6 on: November 16, 2025, 01:10:09 am »
The shown circuit is rather complicated. One could get away without the extra divider and buffers if the difference amplifier has less gain (e.g. x 3 or x 5). With low enough a gain the differential amplifier also works with a CM level at the supply or a bit higher. More gain could be added as a 2nd stage. Low gain is still well better than dividers and the extra buffers.
Unfortunately OP07 is not rail to rail, so i felt reducing the CM would help with the swing, plus since this is bidirectional sensing application the battery (which powers the amplifier V+) may even be at a lower voltage than across the shunt (when charging). It will probably work but I'm being careful.
I hope i understood your comment correctly.

Use a high side current sense, like https://www.ti.com/lit/ds/symlink/ina181.pdf
It’s not a BMS, just a goal specific opamp. Cheaper than trying to make the same specs with an above the rail generic opamp.
If you still want generic opamp, follow how INAA181 is built and the inputs are spec’d for common mode and over the rail.
I did come across these TI chips and they look perfect for my use case but another condition that i have imposed upon myself is that i shall not use anything but jellybean analog parts. Thankfully since this is merely a hobby project i don't risk anything but poor accuracy at worst.

Quote
OP07 have a Vos of 30uV so it makes perfect sense to use in the input stage. With a shunt of 10mΩ, I can measure a minimum current of 3mA. Dividers will decrease the common mode voltage by half but also the differential voltage so 3mA becomes 6mA. Still perfectly acceptable.
Too good to be true. Change resistor R5 to 101kOhms. Since you used 1% resistors, such a change is within the expected range. At Vbat=12.6V and zero current, you will see a voltage difference of 31mV at the buffer inputs, which corresponds to an error of 6A :)
I completely forgot about that |O
Yeah with 1% it's 6.3A, i just calculated. I can also get 0.1% resistors but even with them it'll be 240mA. I guess that's good enough? I can put a couple of pots to fix that manually after assembly
This is getting quite messy. Im getting tempted to use those INA180 chips...
 

Offline BadeBhaiyaTopic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: in
Re: [Review request] Bidirectional Current Measurement
« Reply #7 on: November 16, 2025, 01:11:51 am »
 

Offline MariuszD

  • Frequent Contributor
  • **
  • Posts: 725
  • Country: pl
Re: [Review request] Bidirectional Current Measurement
« Reply #8 on: November 16, 2025, 07:18:36 am »
I completely forgot about that |O
Yeah with 1% it's 6.3A, i just calculated. I can also get 0.1% resistors but even with them it'll be 240mA. I guess that's good enough? I can put a couple of pots to fix that manually after assembly
This is getting quite messy. Im getting tempted to use those INA180 chips...
Differential amplifiers require extremely precise resistors to achieve acceptable CMRR. In integrated amplifiers, they are laser-trimmed. If you wanted to buy resistors that precise, they would be the most expensive part of your circuit.

The circuit below doesn't have that drawback, unfortunately, it only works one way, so you would have to use two.
 
The following users thanked this post: dobsonr741


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->