What is the logic behind CC Accumulator output of MC3377xB_Get_Values box?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is the logic behind CC Accumulator output of MC3377xB_Get_Values box?

3,203 Views
bcelikte
Contributor III

Hi,

We are using MBD toolboxes for our BMS studies. We calculate SOC with an observer but we also want to see Ah counting on BMS IC. When we look at the MC3377xB_Get_Values box outputs it said CC_Accumulator, what it the unit of this output? Is it summation of mAs of all CC Samples or any other math behind it? When we draw 2A, we are observing 977943115 for this output like image below.

bcelikte_1-1608637900688.png

 

bcelikte_0-1608637872283.png

 

Thanks.

0 Kudos
12 Replies

3,045 Views
bcelikte
Contributor III

Thanks @PhilippePerruchoud-NXP ,

How about the values that we are observing? Still not the same with real values. You can see the model at zip file.

Thanks.

0 Kudos

3,031 Views

Hi,

The only way to make sure that the IC is measuring the correct value is to compare the content of ISENSE1 and ISENSE2 registers with a measurement directly on the IC pins ISense+ and ISense- with a milivoltmeter.

Note that PCB layout around the shunt resistor can lead to unexpected results, especially depending on how the sense lines are connected to the shunt. It is also recommended to have the shunt mounted directly on the PCB to avoid having wires between the PCB and the shunt.

Best regards,

Philippe

0 Kudos

3,011 Views
bcelikte
Contributor III

Hi,

I want to clarify couple of things first. I am using S32K144 EVB not the MC3377xB itself. So PCB or shunt issues are not my real problem for now.

I am actually confident about ISENSE1 and ISENSE2 values because when I am looking current value it is same what it should be. And I already have a power supply which is telling me the current in A. Therefore problem is not about Current reading, it is about this CC Accumulator box.

For example, I am charging my battery pack with 2.0A constant current (I am seeing already current is 2A at power supply and NXP either, so current is corrected) after 1 hour accumulation, blue circled in the figure should be 2Ah or in 1s it should be 5.555e-4 Ah, but when I did numbers are not like this. That is my problem. I need to validate this accumulation to use Coulomb Counting.

Capture.PNG

By the way all math in the figure is same with documentation.

0 Kudos

2,992 Views

Hi,

I'm not sure I fully understand your issue, but as previously mentioned by Marius the accumulator register is increased with the current measurement value every time the ADC makes a measurement. Depending on the ADC setting, this can happen once every 40-70 µs. So the accumulator register information is meaningless without the number of samples.

Let's take an example where you have 2 A DC current in your 1 mOhm shunt.

You initialize the COULOMB_CNTx registers at t0. After 0.5 s, you read again the register content. You get:

COULOMB_CNTx = 14 000 000 (in µV) or 23 333 333 in raw

CC_NB_SAMPLES = 7000

The average Isense value is COULOMB_CNTx / CC_NB_SAMPLES = 2 000 µV

This corresponds to a current of 2 A = 2 000 µV divided by the shunt resistance value of 1mOhm.

To get the amount of charges, you will have to consider the time interval  between the 2 events  (note that this time value is not provided by the IC, but by the pack controller). In this case we measured 2 A over 0.5 s which leads to 1 A.s or 0.00028 A.h.

Typically the CC function is used to get an average value of the current periodically, let’s say once every 50ms. The pack controller will get this value by reading the COULOMB_CNTx and CC_NB_SAMPLES registers from the BCC and resetting them for the next cycle.

I hope this helps.

Philippe

0 Kudos

2,989 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @PhilippePerruchoud-NXP 

Thank you very much for helping us with this!

Is there a register write sequence or a command to reset or initialize the CC_Samples and CC_Registers to 0? The thing is that once the MC3377xB is reset and initialized the CC registers does not seems to start counting and integrating for 0.

Regards,

Marius

0 Kudos

2,981 Views

Hi,

Yes. By setting ADC2_OFFSET_COMP[CC_RST_CFG] to 1, reading any coulomb counter register (from $2D to $2F) also resets the coulomb counter. Alternatively you can reset the COULOMB_CNTx and CC_NB_SAMPLES registers by writing a 1 to ADC_CFG[CC_RST].

Best regards,

Philippe

3,193 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @bcelikte ,

There are two registers involved in the Coulomb Counting. 

As far as I get from the Reference Manual, the ccSamples number represents the total samples accumulated in the ccAccumulator. Each ADC conversion the ccSamples is incremented.

I strongly suggest you to read the MC33771C Full Data Sheet from this location https://www.nxp.com/products/power-management/battery-management/battery-cell-controllers/14-channel...

mariuslucianand_0-1608728788252.png

The MBDT toolbox only accesses the COULOMB_CNT and CC_NB_SAMPLES registers.

Hope this helps,

Marius

0 Kudos

3,182 Views
bcelikte
Contributor III

Hi @mariuslucianand ,

I am using MC33771B not MC33771C, but I download the both full data sheet. MC33771B's data sheet is dated Feb.2019 and MC3771C's is Dec.2020 and it is more detailed. You pointed out GetRawValues box outputs ( it has 2 coloumb counting yes) but I meant GetValues box which you released lastly for BMS.

On MC33771C's data sheet there is a passage is showing actually ccAccumulator ( not in MC33771B data sheet by the way) , but it didn't explain what is the logic in there also. Am I getting summation of all samples in 1 time step or not, if so , when we tried, it gives way much higher results.(We checked with constant current)

For ex : ~2000mA constant current and nSamples are ~1300, accumulator should give ~2.6M but it gives ~46M.

Thanks.

bcelikte_0-1608789412104.png

 

0 Kudos

3,176 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @bcelikte ,

Sorry, my mistake, I have shared the MC33771C instead of B family. But I think both of them work the same.

What I understand on how CC accumulator works is that every time you start a conversion the nbSamples are incremented and to the ccAcumulator is added the converted value for the ADC2 which is the current measurement. Now, both of the blocks (either if we talk about raw or measurements are reporting this in raw values). So the value that you see on the accumulator is raw data value and not converted in mA. This is why the output for the ccAccumulator is int32. You are expecting this to be in mA but it is in raw.

There are two things that I need to explain:

1. The ccAccumulator is stored in two uint16 registers and the block puts them together MSB and LSB.  But I've seen that the SDK for the MC3377xB is defining a method on how to merge them. The actual formula from the toolbox is wrong, So I ask you to update the mc3377xb_s32k_get_values.tlc file under {Toolbox install path}\external_devices\blocks\mc3377xb. Here there are also a file that has to be replaced, at the same location, the mc3377xb_s32k_reg_write.mexw64 . So please update the files from the attached archive.

To convert from RAW to Amps you will have to use the formula presented in the Coulomb counting chapter under functional description. The rSHUNT is the value typed in the MC3377xB config block.

2. The initial configuration of the MC3377xB can be found as a C Structure under {Toolbox install path}\mbdtbx_s32k\src\BCC_SDK_SW\SDK_SW_Driver\bcc_s32k in the bcc_initial_configuration.h. At line 65 is defined if the counter uses the FREE_CNT method or not. 

Also, pay attention to the FAULT register value which notifies the CC_OVF. You will find all the info required in the Reference Manual of the MC33771B and you can use the MC3377xB_Register_Write Block to clear the faults.

Hope this helps,

Marius

 

0 Kudos

3,141 Views
bcelikte
Contributor III

Hi @mariuslucianand ,
Thanks for the zip file. We changed it but still we are observing wrong values. Here you can see our model ( we just add calculations which calculates uA from raw data like in the datasheet).

bcelikte_1-1608902357843.png

 

By the way, when we look at the datasheet, units seem to us strange at this passage. Shouldn't it be A rather than uA according to ohms law.

bcelikte_0-1608901938955.png

 

Tags (1)
0 Kudos

3,082 Views
mariuslucianand
NXP Employee
NXP Employee

@PhilippePerruchoud-NXP , can you please help us with this question?

Regards,

Marius

Tags (1)
0 Kudos

3,058 Views

Hello,

This is a typo that will be corrected in the next release of the datasheet (planned for 1Q21). You should read A instead of µA.

@bcelikte, I noted that you said in your previous post that "I download the both full data sheet. MC33771B's data sheet is dated Feb.2019 and MC3771C's is Dec.2020 and it is more detailed".

Note that the latest revision of the datasheet for MC33771B is rev6.0 dated 15 July 2020 and not Feb 2019. The latest revision of MC33771C datasheet is rev5.0 from 21 Nov 2019. You should be able to get them from DocStore.

Best regards,

Philippe