Solid-Energy-Systems / NewareNDA

Python module and command line tool for reading and converting Neware nda and ndax battery cycling data files.
BSD 3-Clause "New" or "Revised" License
17 stars 10 forks source link

Cycle number calculation vs decoded from data #24

Closed vividh-garg closed 1 year ago

vividh-garg commented 1 year ago

3 Related to this closed cycle no. issue.

Why do you calculate cycle no. when you can just decode it from the data itself as Neware stores the cycle no. natively (as seen in the xls/xlsx files). There are many recipes/tests which involve multiple instances of charge and discharge in the same cycle. So your calculation comes out wrong in those tests.

I am currently using the code below to get the cycle number. Essentially, the correct cycle number here will be 'Cycle +1'.

[Index, Cycle] = struct.unpack('<IH', byte_stream[2:8])
d-cogswell commented 1 year ago

This is interesting, the newest version of Neware BTSDA returns different cycle numbers than older versions for the same nda file. Looks like they switched to reporting the cycle number from the nda. Previously, the only way I could match BTSDA was with _generate_cycle_number(df).

I wonder if the cycle number in the nda is a 4-byte integer?

d-cogswell commented 1 year ago

I just created a pull request with a flag to switch between the two different cycle numbers. What do you think?

vividh-garg commented 1 year ago

Let me check if my current code works with old nda files and that too if I have any old nda file. I also found another multiplier value of -12000 which is used in SIM step. Couldn't get to test around with it much.