Comments (3)
The pack looks really nice! And the firmware should also be almost ready.
-
EEPROM: Do you actually have one on your board? This looks like it's reading garbage from the bus, as the header and CRC information is always different in each attempt. Also looks like this doesn't work with the older firmware either.
-
BMS communication failure: Which exact part number do you have? Did you double-check that the I2C address is correct (see below table from the datasheet). The previous firmware auto-detected the I2C address and whether or not to use CRC, whereas the new version only detects the CRC and the address specified in devicetree must be correct.
If that's all correct, this may be a bug in the driver. I have tested it on my board after the refactoring, but maybe I missed something. Do you have a logic analyzer to check the bus traffic?
I can't really explain right now why it seems to be able to read some temperature values, but it's not able to read anything else.
Also the state machine shouldn't go into discharging state if it can't read proper voltages. I'll need to have a closer look why this is happening.
- Error flags:
They can be found in the bms_common.h
:
bms-firmware/include/bms/bms_common.h
Line 28 in fb078cc
The error flags are defined as individual bits. In your example 0x280
the bits 7 and 9 are set, which means discharge and charge overtemp.
I just realized that these defines are not rendered in the docs. Will have a look into that and fix it.
- BMS state
This is defined in bms.h
:
bms-firmware/include/bms/bms.h
Line 32 in fb078cc
Enums always start at 0, so a BMS state of 3 means BMS_STATE_NORMAL
.
- Balancing status:
Same as error flags, but the individual bits indicate the balancing status of each cell. As an example, 0x0004
(in binary 0b0000_0000_0000_0100
) means that cell 2 (starting to count from cell 0) is currently being balanced.
from bms-firmware.
Many many thanks for reply.
1-EEPROM: Yes i do have one on my hardware. It is not same brand and chip as your hardware design i believe. Here is it's datasheet. I modified devicetree according this datasheet but i might be wrong about "size", "pagesize", "address-width" and "timeout". I double checked my hardware design it seems OK. Which i believe i have a software issue rather than hardware issue. I don't know if it is related to EEPROM issue but State of Charge value starts from 0 if i turn off and turn again this bms? In a nutshell i am not sure if my EEPROM works properly with old firmware and new firmware.
2-BMS communication failure: I have BQ7693003DBTR, which i believe have 0x08
i2c address and also have CRC.
I have cheap Cypress EZ-USB FX2LP-based Logic Analyzer with sigrok and 4 channel Rigol DS1054Z scope which have i2c decoding capabilities. (I am not sure about scope can decode i2c traffic between MCU and bq chip since it is not exact i2c protocol) So i can check bus acticity and post here.
Here is my devicetree and schematic summary:
3-Error flags: I am so sorry but i couldn't understand how did you convert 0x280
to the bits 7 and 9? Could you please explain in detail?
4-BMS state: Understood very well.
5-Balancing status: I think i understand this. For example in my previous tests balancing value was 258
. I converted decimal to binary and get 0000000100000010
which indicates CELL 1 and CELL 8 (starting to count from cell 0) are balancing right?
EDIT:
Now i tested with 0x18
address to see how it behaves now it gives:
E: Error reading current measurement
E: Failed to read data from BMS IC: -5
Which i assume 0x08
address is correct and it can communucate with bq chip but not in right way.
Side note: Also it behaves like this when i disconnect cell balance and main terminals and supply MCU from ST-LINK to program MCU which is understandable because bq chip is not powered with battery so it cannot respond to MCU.
from bms-firmware.
1. and 2. Ok, EEPROM and BMS devicetree all looks good then. So it must be a software issue, indeed. The communication is "normal" I2C and you should be able to analyze it with a Logic Analyzer.
3. It's the same as for the balancing status. Here is a screenshot from the Linux calculator I usually use:
5. Yes, the balancing status is correct.
from bms-firmware.
Related Issues (20)
- Home Automation Open Hardware Catalog
- BMS C1: LEDs Turn Off, 'No Serial Data Received' Error, and Flashing Problems HOT 11
- Tested the BMS C1 v0.3 using a load tester and tested for cell level protection. HOT 4
- LiPo Float Charge & SOC settings HOT 3
- How to use serial port used by thingset for data download HOT 12
- Function `bms_soc_update` no longer called post-zephyr bms driver update HOT 3
- QEMU Build Target HOT 2
- Control flow of code using thingset. HOT 3
- bq769x0: repeat read due to crc fail might read different bytes an might led to wrong data read HOT 2
- OV/UV_TRIP config kind of return probaly off by 1000 * (set im V return in mV)
- I2C error HOT 5
- API source code HOT 2
- Questions Regarding using Multifunctional Pin controls as thermistors HOT 2
- Regarding Potential RS485 Support HOT 1
- Thingset Synchronization with bq76952 Initialization HOT 1
- Warning when sending CAN data HOT 4
- Error flag 1 on connecting the board to a battery pack HOT 3
- How to enable Wi-Fi on BMS C1 HOT 2
- BMS current limit values configuration via thingset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bms-firmware.