DIYBMS v4

Hi @stuart , How are you getting on with your LF280\k cells … Curious to hear about your settings. I have set my charger to a max 55.2V (pack 16s) at which point it starts absorbing for 1 hour at that voltage (3.45v) per cell . I set the DIYBMS to balance at 3.45V hoping it will do its job during the C.voltage absorption period when the current tapers down. … but unfortunately at this point …the temperature raise on the board due to balancing kind of results in a slight raise in measured voltage and all cells eventually start balancing … if I set the balance voltage to 3.46v - don’t get any balancing kicking in though a 30mv-40mv imbalance remains which looks like a lost opportunity to get them closer… would have liked to try out 3.455V but the software doesn’t allow it …does it make sense to allow that setting to work around this…

You mention the software doesn’t allow 3.455 balance - is that because you can’t enter it into the screen?

Hello

Building the project in branch V450 I get the following error. Looking into the .pio/build/esp32-devkitc/ folder I can find a diybms_controller_firmware_espressif32_esp32-devkitc.map file but no .elf.

Linking .pio/build/esp32-devkitc/diybms_controller_firmware_espressif32_esp32-devkitc.elf
/Users/Sebastian/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32-devkitc/diybms_controller_firmware_espressif32_esp32-devkitc.elf] Error 1

Does anybody has an idea what is the problem? I’m on OS X 10.15.7

Thanks in advance for your help
Sebastian

Can you share the full build log and PlatformIO versions used? There is likely a clue a bit further up in the build log.

Hi Atanisoft.

Sure I can. Unfortunately I don’t see something further above which could be related to this.

PlatformIO IDE v2.5.5

Task wird ausgeführt: platformio run 

Processing esp32-devkitc (framework: arduino; platform: espressif32; board: esp32dev)
------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
/Users/Sebastian/.platformio/penv/bin/python -m pip install -v htmlmin
Using pip 22.3.1 from /Users/Sebastian/.platformio/penv/lib/python3.10/site-packages/pip (python 3.10)
Requirement already satisfied: htmlmin in /Users/Sebastian/.platformio/penv/lib/python3.10/site-packages (0.1.12)
/Users/Sebastian/.platformio/penv/bin/python -m pip install --upgrade htmlmin
Requirement already satisfied: htmlmin in /Users/Sebastian/.platformio/penv/lib/python3.10/site-packages (0.1.12)
[COPY/GZIP DATA FILES]
  Deleting data dir /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp
  Re-creating empty data dir /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp
  files to gzip: ['/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/notify.min.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/pagecode.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_de.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_en.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_fr.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_nl.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_es.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_pt.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_hr.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_ru.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/echarts.min.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/jquery.js', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/style.css', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/favicon.ico']
  files to minify: ['/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/softap.htm', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/default.htm']
  files to copy: ['/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/warning.png', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/wait.png', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/logo.bmp', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/logo.png', '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/patron.png']
  Copying file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/warning.png to data dir
  Copying file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/wait.png to data dir
  Copying file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/logo.bmp to data dir
  Copying file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/logo.png to data dir
  Copying file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/patron.png to data dir
  Minify file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/softap.htm to data dir
htmlmin --keep-optional-attribute-quotes /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/softap.htm /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/softap.htm
  Minify file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/default.htm to data dir
htmlmin --keep-optional-attribute-quotes /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/default.htm /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/default.htm
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/notify.min.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/pagecode.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_de.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_en.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_fr.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_nl.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_es.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_pt.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_hr.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_ru.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/echarts.min.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/jquery.js to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/style.css to data dir
  GZipping file: /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/favicon.ico to data dir
[/COPY/GZIP DATA FILES]
prepare_integrity_hash.py
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/notify.min.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/pagecode.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_de.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_en.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_fr.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_nl.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_es.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_pt.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_hr.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/lang_ru.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/echarts.min.js
Integrity /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/jquery.js
prebuild_generate_embedded_files.py
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/warning.png
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/logo.bmp
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_de.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_en.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/jquery.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/echarts.min.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_es.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/notify.min.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/softap.htm
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_fr.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_nl.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_pt.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/default.htm
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/favicon.ico.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/logo.png
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/patron.png
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/pagecode.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_hr.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/style.css.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/lang_ru.js.gz
Embedding /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_temp/wait.png
{'input': '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/web_src/logo.bmp', 'output': '/Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/include/tft_splash_image.h'}
Completed; the output is in /Users/Sebastian/Documents/test/diyBMSv4ESP32/ESPController/include/tft_splash_image.h
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 2.0.3+sha.142fceb 
 - tool-esptoolpy @ 1.30100.210531 (3.1.0) 
 - toolchain-xtensa32 @ 2.80400.210211 (8.4.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoJson @ 6.19.4+sha.079ccad
|-- SerialEncoder @ 0.1.0+sha.f909d31
|-- TFT_eSPI @ 2.4.79+sha.ef7c020
|   |-- SPI @ 2.0.0
|   |-- SPIFFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- LittleFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|-- FS @ 2.0.0
|-- LittleFS @ 2.0.0
|   |-- FS @ 2.0.0
|-- SD @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- SPI @ 2.0.0
|-- crc16
|-- settings
|   |-- crc16
|   |-- Preferences @ 2.0.0
|-- ESPmDNS @ 2.0.0
|   |-- WiFi @ 2.0.0
|-- Preferences @ 2.0.0
|-- SPI @ 2.0.0
|-- SPIFFS @ 2.0.0
|   |-- FS @ 2.0.0
Building in release mode
Compiling .pio/build/esp32-devkitc/src/HAL_ESP32.cpp.o
Compiling .pio/build/esp32-devkitc/src/PacketReceiveProcessor.cpp.o
Compiling .pio/build/esp32-devkitc/src/PacketRequestGenerator.cpp.o
Compiling .pio/build/esp32-devkitc/src/Rules.cpp.o
Compiling .pio/build/esp32-devkitc/src/avrisp_programmer.cpp.o
Compiling .pio/build/esp32-devkitc/src/influxdb.cpp.o
Compiling .pio/build/esp32-devkitc/src/main.cpp.o
Compiling .pio/build/esp32-devkitc/src/mqtt.cpp.o
Compiling .pio/build/esp32-devkitc/src/tft.cpp.o
Compiling .pio/build/esp32-devkitc/src/victron_canbus.cpp.o
Compiling .pio/build/esp32-devkitc/src/webserver.cpp.o
Compiling .pio/build/esp32-devkitc/src/webserver_helper_funcs.cpp.o
Compiling .pio/build/esp32-devkitc/src/webserver_json_post.cpp.o
Compiling .pio/build/esp32-devkitc/src/webserver_json_requests.cpp.o
In file included from src/tft.cpp:33:
.pio/libdeps/esp32-devkitc/TFT_eSPI/TFT_eSPI.h:909:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
       #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
        ^~~~~~~
Generating partitions .pio/build/esp32-devkitc/partitions.bin
Compiling .pio/build/esp32-devkitc/lib982/SerialEncoder/SerialEncoder.cpp.o
Compiling .pio/build/esp32-devkitc/lib4d7/SPI/SPI.cpp.o
Compiling .pio/build/esp32-devkitc/lib089/FS/FS.cpp.o
Archiving .pio/build/esp32-devkitc/lib4d7/libSPI.a
Indexing .pio/build/esp32-devkitc/lib4d7/libSPI.a
Compiling .pio/build/esp32-devkitc/lib089/FS/vfs_api.cpp.o
Compiling .pio/build/esp32-devkitc/libe1f/SPIFFS/SPIFFS.cpp.o
Archiving .pio/build/esp32-devkitc/lib982/libSerialEncoder.a
Indexing .pio/build/esp32-devkitc/lib982/libSerialEncoder.a
Compiling .pio/build/esp32-devkitc/lib757/LittleFS/LittleFS.cpp.o
Compiling .pio/build/esp32-devkitc/lib9b2/TFT_eSPI/TFT_eSPI.cpp.o
Archiving .pio/build/esp32-devkitc/libe1f/libSPIFFS.a
Archiving .pio/build/esp32-devkitc/lib089/libFS.a
Indexing .pio/build/esp32-devkitc/libe1f/libSPIFFS.a
Indexing .pio/build/esp32-devkitc/lib089/libFS.a
Compiling .pio/build/esp32-devkitc/lib983/SD/SD.cpp.o
Archiving .pio/build/esp32-devkitc/lib757/libLittleFS.a
Indexing .pio/build/esp32-devkitc/lib757/libLittleFS.a
In file included from .pio/libdeps/esp32-devkitc/TFT_eSPI/TFT_eSPI.cpp:16:
.pio/libdeps/esp32-devkitc/TFT_eSPI/TFT_eSPI.h:909:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
       #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
        ^~~~~~~
Compiling .pio/build/esp32-devkitc/lib983/SD/sd_diskio.cpp.o
Compiling .pio/build/esp32-devkitc/lib983/SD/sd_diskio_crc.c.o
Compiling .pio/build/esp32-devkitc/lib2af/crc16/crc16.cpp.o
Compiling .pio/build/esp32-devkitc/libd3c/Preferences/Preferences.cpp.o
Compiling .pio/build/esp32-devkitc/lib93a/settings/settings.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFi.cpp.o
Archiving .pio/build/esp32-devkitc/lib2af/libcrc16.a
Archiving .pio/build/esp32-devkitc/lib983/libSD.a
Indexing .pio/build/esp32-devkitc/lib2af/libcrc16.a
Indexing .pio/build/esp32-devkitc/lib983/libSD.a
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiAP.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiClient.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiGeneric.cpp.o
Archiving .pio/build/esp32-devkitc/libd3c/libPreferences.a
Indexing .pio/build/esp32-devkitc/libd3c/libPreferences.a
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiMulti.cpp.o
Archiving .pio/build/esp32-devkitc/lib93a/libsettings.a
Indexing .pio/build/esp32-devkitc/lib93a/libsettings.a
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiSTA.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiScan.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiServer.cpp.o
Compiling .pio/build/esp32-devkitc/lib9dd/WiFi/WiFiUdp.cpp.o
Compiling .pio/build/esp32-devkitc/lib1a7/ESPmDNS/ESPmDNS.cpp.o
Archiving .pio/build/esp32-devkitc/libFrameworkArduinoVariant.a
Indexing .pio/build/esp32-devkitc/libFrameworkArduinoVariant.a
Compiling .pio/build/esp32-devkitc/FrameworkArduino/Esp.cpp.o
Archiving .pio/build/esp32-devkitc/lib9dd/libWiFi.a
Compiling .pio/build/esp32-devkitc/FrameworkArduino/FirmwareMSC.cpp.o
Indexing .pio/build/esp32-devkitc/lib9dd/libWiFi.a
Compiling .pio/build/esp32-devkitc/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/HWCDC.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/IPv6Address.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/MD5Builder.cpp.o
Archiving .pio/build/esp32-devkitc/lib9b2/libTFT_eSPI.a
Indexing .pio/build/esp32-devkitc/lib9b2/libTFT_eSPI.a
Compiling .pio/build/esp32-devkitc/FrameworkArduino/Print.cpp.o
Archiving .pio/build/esp32-devkitc/lib1a7/libESPmDNS.a
Indexing .pio/build/esp32-devkitc/lib1a7/libESPmDNS.a
Compiling .pio/build/esp32-devkitc/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/StreamString.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/USB.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/USBCDC.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/USBMSC.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/WString.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/base64.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/cbuf.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-time.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/libb64/cdecode.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/libb64/cencode.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/main.cpp.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/stdlib_noniso.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/esp32-devkitc/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/esp32-devkitc/libFrameworkArduino.a
Indexing .pio/build/esp32-devkitc/libFrameworkArduino.a
Linking .pio/build/esp32-devkitc/diybms_controller_firmware_espressif32_esp32-devkitc.elf
/Users/Sebastian/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32-devkitc/diybms_controller_firmware_espressif32_esp32-devkitc.elf] Error 1
================================= [FAILED] Took 20.60 seconds =================================

Environment    Status    Duration
-------------  --------  ------------
esp32-devkitc  FAILED    00:00:20.599
============================ 1 failed, 0 succeeded in 00:00:20.599 ============================

 *  Der Terminalprozess "platformio 'run'" wurde mit folgendem Exitcode beendet: 1. 
 *  Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste. 

I got help by platformio community:

The problem is the version of espressif32 in [env]platform.
For Arduino-ESP32 2.0.3 platform needs to be [email protected]

Edit start
was able to fix this problem in the codebase and added a merge request:

Edit end

Unfortunately, that opens another problem. The diybms halts after powering up

I (11) diybms:


               _          __
  _|  o       |_)  |\/|  (_
 (_|  |  \/   |_)  |  |  __)
         /

CONTROLLER - ver:602ce5a0584cb03703265cc88c7d57bb83c8cf4a compiled 2022-11-13T19:47:07.326Z
ESP32 Chip model = 1, Rev 1, Cores=2, Features=50
I (26) diybms-hal: Configure I2C
I (28) diybms-hal: Scanning i2c bus
I (34) diybms-hal: Found i2c device at address 0x21
I (44) diybms-hal: Found TCA6416A
D (45) diybms: Configure VSPI
I (46) diybms: ** Controller changed state from Unknown to PowerUp **
[    52][E][esp32-hal-gpio.c:95] __pinMode(): Invalid pin selected
E (53) gpio: gpio_set_level(226): GPIO output gpio_num error
[    63][E][esp32-hal-gpio.c:95] __pinMode(): Invalid pin selected
E (64) gpio: gpio_set_level(226): GPIO output gpio_num error
[    74][E][esp32-hal-gpio.c:95] __pinMode(): Invalid pin selected
I (430) diybms-hal: CAN driver installed.  Filter=1621098496 Mask=6291455
I (431) diybms-hal: CAN driver started
./components/esp_littlefs/src/littlefs/lfs.c:1071:error: Corrupted dir pair at {0x0, 0x1}
E (438) esp_littlefs: mount failed,  (-84)
E (441) esp_littlefs: Failed to initialize LittleFS
[   450][E][LittleFS.cpp:94] begin(): Mounting LittleFS failed! Error: -1
E (452) diybms: LittleFS mount failed, did you upload file system image?
E (459) diybms: SYSTEM HALTED

You need to upload the file system image from within PlatformIO.

There is no script for this in branch v450

Hi @stuart , that’s correct not possible to enter it and save. Gives an error.
But I think I have another problem . I have vertically stacked the cell models with standoffs and I think as soon as one module starts bypassing , radiant heat transfer to the other module is sufficient to nudge it to start bypassing at this mV level balancing window we are into with these large LifePo4.

Do you think it is a future development consideration to now start integrating the DIYBMS controller to active balancers instead of the cell module (as an option) . JK for instance sells just the active balancer standalone at a much reduced price and has RS485 / bluetooth which can be used to integrate to the DIY BMS controller. I think the value of programability of the DIY BMS controller and integration possibilities it has …combined with off the shelf active balancer as a front end will be nice !

Could use inverter communication to slow down charging but for those of us on the 4 hour low tariff with OCTOPUS GO it will be nice to load up faster. perhaps some of this work can make it easier to integrate to the DIYBMS controller GitHub - syssi/esphome-jk-bms: ESPHome component to monitor a Jikong Battery Management System (JK-BMS) via RS485 or BLE

That was NOT a good idea !

Shame, it looks pretty!

V450 is a work in progress - it has no changes to controller or module code that can be used with previous V440 and older versions of the hardware.

Once balancing beings you really need to reduce the charge current. Each module can only handle about 0.5A, and if you are trying to push more than that into each cell, the cell voltage will still go up - potentially to a dangerous level.

The controller already has integration via CANBUS with Victron and Pylontech battery “emulation” - I’m actively working on that now, as its needed for my setup.

So it’s impossible to use the 4.5 controller with V440 modules? I build a 4.5 hardware controller.

Umm, no. You can’t depend on limiting the current to <1A. The reason is simple, suppose your solar array outputs 90A and your inverter feeds 5kW (also 90A, at 56V) to the grid. Your typical current measurement is maybe 1% accurate, thus whether +2A or -2A go to the battery is anybody’s guess. Also, guess what happens when the inverter suddenly stops inverting for whatever reason. Bingo, you get 90A pumped into a cell that’s already at 3.58V, the cell voltage shoots up to 3.9+, the BMS trips the relay, and everything crashes to a halt and requires manual intervention.

Victron for one explicitly does not support this mode of operation; in fact they rejected my patch to drop the max amperage the controller sets the solar chargers to by 5%, to account for these inaccuracies.

The way to fix this problem is to set the maximum voltage. You report 56.0V as long as your battery is perfectly balanced (assuming you want to charge each cell to 3.5V). If on the other hand all cells are at 3.4 except for one that’s at 3.5 already, you tell the system to stop at 54.6V. That way, charging halts when this single high cell reaches 3.6V, you have all the time in the world to bleed off its charge, and if your inverter suddenly stops inverting you don’t trip the battery’s relay because the charger won’t go higher than 54.6 – as soon as the unbalanced cell is at 3.6 there is no voltage difference any more and thus the current is zero by physics.

Now the system’s voltages may also be inaccurate, but unlike amperage differences that’s easily corrected for when you set up your system. Also, a 1% error in voltage measurements are really bad – while a 1% delta in amperage is reasonably good actually.

Sorry crossed wires!

The “V450” branch (in diyBMSv4ESP32) relates to code for V4.50 of the modules (not publicly released)

For V4.5 controller PCB - just use the “master” branch software - there are pre-compiled binary files for that, just follow the instructions.

2 Likes

I should have written - need to reduce the power going into the cells.

How the voltage or current is controlled, really depends on the installed hardware - as you mention Victron only permits voltage control, as that fits their purpose/design.

@Smurfix I know you’ve explored this option in some detail in a previous post, but can we explore this again, as its logic I’d like to bake into diybms.

Following the logic of voltage controlled charging would you expect to be regularly recalculating the charge voltage, or just as a cell approaches the maximum permitted per-cell voltage (3.5V for example)?

In the example above, (assuming 16 cells) you have 15x3.4V + 1x3.5V cells = 54.5V (actual cell voltages), are you then recommending a charge voltage of 54.6V (0.1V higher) to allow the 3.4V cells to “increase 0.1V” ?

1 Like

Well, of course this calculating exercise matters more, the further your top cell is from the linear region of the charge curve. If all your cells are at less than 3.4V, the voltage you pass to the charger won’t matter because it won’t get there: the current limit will hit first.

The CPU time to do this isn’t much compared to all the chatting with the battery and the charger/inverter etc., so I’d just run the algorithm every time you get new cell voltages.

Well, in this example I’m using 54.6V to allow the one 3.5V cell to go up by 0.1V because, you know, that’s exactly what’s going to happen when you continue charging. If there were two cells at 3.5 I’d allow a charge voltage of 54.7V. I’d expect the 3.4 cells to essentially not change at all in this situation.

In my BMS code I’m using the following algorithm:

  • Let’s say the max voltage per cell we’d like to allow is M (3.6V or whatever), the highest cell voltage in our stack right now is H, and the voltage where the charge curve stops being linear is F (=3.4V or so, for LiFePo4). Set U=1 (but see below).
  • If H >= M, tell the system to stop charging. Return sum(min(M,C)) where C is the voltage of each cell.
  • Calculate a voltage range R as min((M-H)*U, (M-F)/3).
  • Calculate S as the sum of the current voltages of all cells.
  • For each cell whose voltage C is at least H-R, add ((M-H) * (C - (H-R)) / R) to S.
  • Return S as the maximum charge voltage.

Thus, if you have a max voltage of 3.6 and your top cell has 3.5V, this algorithm adds 0.1V (for the top cell). If you have another four cells with 3.45V while everything else is at 3.4, you get another 0.1V: the further away a cell is from the top, the smaller its contribution to the allowed max voltage is going to be.

The idea behind the min(…, (M-F)/3) limiter (which I have ignored in the preceding paragraph, to simplify the numbers) is that when the cell voltage is in the flat part of the charge curve every cell behaves differently. Charge three cells which are at 3.37, 3.38 and 3.39V, in series, and it’s anybody’s guess which of these will head off to 3.5+V space first while the other two voltages don’t change (at least not enough to matter). As an example, if M=3.6 and H=3.48 this ignores everything below 3.44V instead of 3.36V.

This keeps max voltage low enough so that even if the BMS stops responding and the Victron-or-whatever system doesn’t notice, we probably won’t overcharge any cell, while not lowering it so much that you can’t charge with 100+A any more: doing that raises the system voltage at the charger side, due to battery/cabling/etc. resistance.

Another element you might want to play with is the factor U. If you have non-uniform cells in a stack (e.g. you know that some have been over- or undercharged in the past) you might want to reduce it somewhat. On the other hand, I expect LiIon cells with their steeper, more-uniform charge curve to support U=1.5 or thereabouts, though I don’t have any and thus didn’t test that yet.

You also want to set the max charge current dynamically. e.g. I_CH = min((M-H)*I_CH_MAX * 5, I_CH_MAX). I_CH should not be allowed to rise too quickly because the cells’ internal resistance causes cell voltages to rise with the current and you don’t want the whole system to oscillate; I’m using N=(M-H)*I_CH_MAX * 5; if I_CH>N then I_CH=N else I_CH=min(I_CH_MAX, I_CH+(N-I_CH)*0.1).