DIYBMS v4

Hi, I’ve prepared a 14S100P battery controlled with your cells manager and a M5stack a controller filling an influx database.
Thanks for all the work done and for sharing it.

I’ve started some tests and actually have two questions :

  • how should I calibrate each modules to have consistant and accurate measurements ?
  • is the bank voltage measured and shared performed with bypass active when it is activated ? I clearly see tensions drops when in bypass mode, what’s making the overall tensions evaluation not consistent.
    bypass impact snapshot
    Thanks for your tips

Measure the cell the module is monitoring (directly at the cell terminals) using a quality multimeter. Enter that voltage reading into the “Modules” page on the controller web interface and click “calculate” to automatically set the calibration value. Then click Save.

You should find the default configuration value is fairly close.

The bank voltage simply adds up the voltage each module measures and shows it on screen. It will be bouncing around during balancing.

An external current shunt and voltage measurement board/device is currently being worked on which would sit outside of the modules and measure the whole pack.

Hi

It might be that this already has been answered and in that case as do apologise in advance.

Compiling cell module worked fine but not the controller. Have tried both on windows and on mac but getting a number of errors. I compared my version with posting from a couple of days ago and I’m running exactly the same version. Probably I’m missing something simple but can’t find what.

This is the error:

In file included from src/PacketRequestGenerator.cpp:1:0:
include/PacketRequestGenerator.h:26:34: error: expected ')' before '*' token
      PacketRequestGenerator(Queue* requestQ) {_requestq=requestQ;}
                                  ^
In file included from src/PacketRequestGenerator.cpp:1:0:
include/PacketRequestGenerator.h:44:5: error: 'Queue' does not name a type
     Queue* _requestq;
     ^
src/PacketRequestGenerator.cpp: In member function 'void PacketRequestGenerator::pushPacketToQueue()':
src/PacketRequestGenerator.cpp:168:3: error: '_requestq' was not declared in this scope
   _requestq->push(&_packetbuffer);
   ^
src/PacketRequestGenerator.cpp: In member function 'uint16_t PacketRequestGenerator::QueueLength()':
src/PacketRequestGenerator.cpp:173:10: error: '_requestq' was not declared in this scope
   return _requestq->getRemainingCount();
          ^
src/PacketRequestGenerator.cpp:174:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
*** [.pio/build/esp8266_d1minipro/src/PacketRequestGenerator.cpp.o] Error 1
src/SoftAP.cpp: In static member function 'static void DIYBMSSoftAP::SetupAccessPoint(AsyncWebServer*)':
src/SoftAP.cpp:91:41: warning: 'SPIFFS' is deprecated (declared at /Users/matced/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
   _myserver->serveStatic("/softap.htm", SPIFFS, "/softap/softap.htm").setTemplateProcessor(DIYBMSSoftAP::TemplateProcessor);
                                         ^
In file included from include/DIYBMSServer.h:21:0,
                 from src/DIYBMSServer.cpp:26:
include/PacketRequestGenerator.h:26:34: error: expected ')' before '*' token
      PacketRequestGenerator(Queue* requestQ) {_requestq=requestQ;}
                                  ^
In file included from include/DIYBMSServer.h:21:0,
                 from src/DIYBMSServer.cpp:26:
include/PacketRequestGenerator.h:44:5: error: 'Queue' does not name a type
     Queue* _requestq;
     ^
src/DIYBMSServer.cpp: In static member function 'static void DIYBMSServer::StartServer(AsyncWebServer*)':
src/DIYBMSServer.cpp:863:42: warning: 'SPIFFS' is deprecated (declared at /Users/matced/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
   _myserver->serveStatic("/default.htm", SPIFFS, "/default.htm").setTemplateProcessor(DIYBMSServer::TemplateProcessor);
                                          ^
src/DIYBMSServer.cpp:864:37: warning: 'SPIFFS' is deprecated (declared at /Users/matced/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
   _myserver->serveStatic("/files/", SPIFFS, "/files/").setCacheControl("max-age=600");
                                     ^
In file included from include/DIYBMSServer.h:21:0,
                 from src/main.cpp:106:
include/PacketRequestGenerator.h:26:34: error: expected ')' before '*' token
      PacketRequestGenerator(Queue* requestQ) {_requestq=requestQ;}
                                  ^
In file included from include/DIYBMSServer.h:21:0,
                 from src/main.cpp:106:
include/PacketRequestGenerator.h:44:5: error: 'Queue' does not name a type
     Queue* _requestq;
     ^
src/main.cpp:111:1: error: 'Queue' does not name a type
 Queue requestQueue(sizeof(packet), 16, FIFO);
 ^
src/main.cpp:113:54: error: 'requestQueue' was not declared in this scope
 PacketRequestGenerator prg = PacketRequestGenerator(&requestQueue);
                                                      ^
src/main.cpp: In function 'void timerTransmitCallback()':
src/main.cpp:250:8: error: 'requestQueue' was not declared in this scope
   if (!requestQueue.isEmpty())
        ^
src/main.cpp: In function 'void setup()':
src/main.cpp:1162:8: warning: 'SPIFFS' is deprecated (declared at /Users/matced/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
   if (!SPIFFS.begin())
        ^
*** [.pio/build/esp8266_d1minipro/src/DIYBMSServer.cpp.o] Error 1
*** [.pio/build/esp8266_d1minipro/src/main.cpp.o] Error 1

This error has not been reported before - its generally referring to “queue” errors which is a 3rd party library from GitHub - SMFSW/Queue: Queue handling library (designed on Arduino)

Perhaps try a “clean” and “build” again and see what happens?

The automated check/build Travis system reports a good build/compile, so the code must be okay.
https://travis-ci.org/github/stuartpittaway/diyBMSv4Code/builds/740927771

Any mention of problems with SPIFFS can be ignored.

7 posts were split to a new topic: Switched to firmware version 1b393e4_2020-11-02

Thanks for quick reply. It seems that SMFSW library just about 24 hours ago released a new version and renamed their class from “Queue” to “cppQueue”…

Will try to rename and see of it works and maybe create a pull request on that change since I think there will be more people affected by this

Renaming Queue to cppQueue worked and it is now compiling as it should.

If you are interested I have a patch file for the change (just s couple of lines to update) :slight_smile:

Yes please

A patch can downloaded from here: Dropbox - Rename_class_Queue_to_cppQueue.diff - Simplify your life

1 Like

Hi, it turns out that the problem I was putting down to a bad install of VS, are exactly the same as you are having.

Not being very aware of VS, how do I apply the Patch? I’ve downloaded it, but where does it go?

Or wait for Stuart to update his code?

Hi Simon

You need to apply the patch using git commands, I’ll guess that Stuart will fix it rather soon.
If you feeling adventurous you can always replace the references to “Queue” with “cppQueue” manually, only three places or so to update.

I’m not 100% sure that everything is working in my setup yet, have controller installed but not able to see any of my cell modules, that is my next “battle” to take on.

I’m soon of to bed (late here) so might be a while before any more reply.

would it be possible to add voltage sensing wires that are independent from the wires used for balancing?

Possibly but you would need a different circuit board to do that.

Cool. I’m not adventurous enough for that. I’ll wait I guess. You wouldn’t think it eh, but 30 years in IT for international companies. But I have some mental block when it comes to programming and anything more then the basics of Platform.io.

While it may only be 3 places I don’t know what files they are in. So I’ll put it on hold. I’m running an older version of the code, and it’s doing the job at the moment so no rush. It’s been working for a good year at this rate

The issue with the master branch not compiling due to the external Queue library being renamed has been fixed. The code is in the master branch on GitHub.

@lanzecki you can update now!

1 Like

Cheers Stuart"

That was quick

1 Like

Thanks for those infos.
Can it be a simple option to interrupt bypass during voltage acquisition ?

Hi again,
Another question, if I remove the resistors for an external load the power dissipation limit is fixed by Q1 spec ? I think about grouping 10W loads in a dedicated box to reuse the heat.
Regards,

The problem with this is that it takes several seconds for the voltage to “bounce back” when the load is removed from the cell. This makes it almost impossible to balance and take “unloaded” measurements at the same time.

It may be possible to calculate this if the internal resistance of the cell is known, as this is what causes the voltage drop in the first place.