DIYBMS v4

Can try, but I have never done it before and do not know how it works…

hi, @stuart

Thinking out aloud about this section of code - i’m probably wrong but i will try.

At the beginning of main.cpp you instantiate a request queue of 30.

And the section of code that you highlighted to Leo appears to slow down the insertion of requests to minimize the likelihood that the queue is always full - possibly to prevent interactive/lazy_tasks requests from being starved by the full queue.

The problem maybe whenever you are running at the higher speeds the request queue is emptied very quickly and periodically the 8 seconds module timeout is breached. This is more likely to happen when there is no user interaction and no balancing is happening as balancing would result in more additional background requests.

Maybe a better approach to the delay section at the top of “enqueue_task” is for the initial call to vTaskDelay be adaptive based on current queue fullness as opposed to number of modules.
e.g.
prg.queueLength <= 5 … delay very small
prg.queueLength >5 <=20 … delay medium
else delay large (to allow queue to naturally shrink)

Unfortunately the above doesn’t really go anyway to explaining why the issue seems to be worse when Leo goes beyond 16 modules.

In short the issue maybe the queue is empty long enough that 8 second module timer breaches. And if this is so a different approach maybe to adjust the delays at the top on enqueue_task and to a lesser extent the repeating 6500 delay within lazy_tasks to be adaptive based on runtime queue length.

Thoughts ?

I used something like this: https://smile.amazon.com/XHF2018-Adhesive-Holders-x19-5mm-HS-101S/dp/B07M69LK65/

I found them at our local Lowes in a 25 or 50 count package.

1 Like

Sounds reasonable for me.
Since my test setup is not yet “disasemble” and put back in normal operation, I can test it if necessary.

That’s certainly a possibility. To be fair you want the queue to be as empty as it can be, which means the system is operating in near real-time.

When first powered up, the controller sends out a lot of requests and the queue will definitely be full at that point. However the requests block until the queue has a slot free (that was the basis of the last release).

I decided to do it in a minimalist style =) one line only

    // Ensure we service the cell modules every 4 seconds. 
    //To prevent the queue overflowing for every request in the queue additional 200ms delay is added (max 10s)
    vTaskDelay(pdMS_TO_TICKS(4000 + prg.queueLength()*200));

Works fine: no errors, send Q lenght stays at 0 or near 0 values, if more requests generated (module balancing) send q length rises for short time but fast returns to 0.

1 Like

fwiw (OK, not much…) I used @Yar_Leo code and for the last 24h system has not crashed/rebooted. Used to reboot when charging and balancing for over a couple of hours. And that’s a test setup with 4S2P 18650.
Don’t know if you can make anything out of it, just stating it.
will try the one liner now :slight_smile:

V.

1 Like

I like your solution - ‘simple is better’.

1 Like

Of the stupid thing i could do…in equalizing cells…i accidentily had to high voltage on a module…now leds light up, all three, but i am not seeing the module the controller…
Have i killed the cell module, or merely popped a fuse on it?
Have not been in a position to remove the module from the cabinet yet…

Difficult to know without removing the module. Try reflashing the code to it, it might still be alive.

1 Like

I disassembled all the modules from the 16 board and I’m testing them one by one.
They are V4.4 modules with 16 resistor board
I’m trying to configure with a single module
I have observed a curious thing, in the standard communication they go well, but when I program at 9k6 the modules only start to communicate with the controller from a voltage of 3.8V below that voltage the communication is lost.

Questions.
What can be causing this, defective or broken Attiny?
Anything else?

While I receive some answer from you, I’m going to take one of these modules that works badly and I’m going to change the ATTiny for a new one of guaranteed origin

Very strange. Can you check the voltage at the pins on the attiny using a multimeter?

Did you install the same crystal as in the BOM?


I think yes .

At attiny 1 and 14 pins the voltaje as the same as the batery (source Power in this case)

a video link test module v4.4 - YouTube
Other video more detailed MoreTest V 4.4 - YouTube

result of any of the tests performed.
As I mentioned, the modules do not manage to synchronize when the voltage is less than 3.8V. I have replaced the resonator of one of these boards with another resonator of an abandoned board (the ones that have been sent to me due to burnt Attiny or polarity cable accidents) well with the change the problem has not been solved, but I have appreciated that with this other resonator the minimum voltage that the board needs to establish communication at 9k6 is only 3.6 instead of the previous 3.8, I suspect that the problem may be in that set of resonators or in the set of 16 modules that something has been degrading the resonator, perhaps making it lose precision at lower voltages, does what I say make any sense to you?

@stuart or anyone who can help…

just started using the esp32 controller that i build over 6months ago.
no matter what ive tried i can not get the controller to communicate with the cell modules…

the cell modules just flashes a green led .***, **, **, ****, **, , , , (NO BLUE)
the esp32 controller blink green every 5 sec and twice randomly

the lcd just shows “stabilizing” and the dashboard show nothing… if i connect the rx and tx together the “ignored requests” counts up steadly

i have flashed both the esp32 and cell modules with the latest firmware…

im going crazy… ANY IDEA’S?

Which modules do you have? If it’s the 4.4, what Comms speed did you program?

Did you pick the right Comms speed in the web interface?


Although i see no damage on the module, i think i killed it…

Verify that you have it connected correctly. I’ve seen this if I connected the wires backwards.

hello all,

potentially silly question (I also asked in victron forum…)
testing my proper lifepo4 bank of 304Ah, however my victron kit still thinks it’s a 8Ah bank as I had it configured when I was testing with 4S2P 18650 cells.
Now for the life of me, I cannot find where I’ve put this 8 in the diyBMS interface, could someone please help?
Thought it was in Settings, but there isn’t something there!

and:

cheers

V.

If its the value in diybms, its in the current monitor settings…

image

hey @stuart ,

i using 4.21 modules.

i left the comm’s speed set to the default, since its says something about not using the faster speed unless using certain modules.

Also, can I use my ESP32 controller to program my cell modules if I don’t have a SD-card slot installed on my controller? I used Platform IO to program my cell modules since I assumed i needed the SD-card slot in order to use the controller. (maybe I flashed them with incompatible/older firmware?)

*EDITED
seems that not having a SD-card slot shouldn’t matter. I’m going to try to flash them again now using the ESP32 controller and see if that fixes the issue.