stuartpittaway / diyBMSv4ESP32

diyBMS v4 code for the ESP32 and new controller hardware
Other
181 stars 80 forks source link

Coding help for Freedom Lite #192

Closed deekoowee closed 1 year ago

deekoowee commented 1 year ago

Hi, My inverter supports Freedom Lite storage. It seems to use similar protocol as PylonTech have. Dynamic charging is supported and I can see the charging current changes at inverter's hidden webpage. I have tried PylonTech 3000 setting at inverter configuration, but it have some mystery charging issues. That's why, I go to Freedom Lite. Now I can charge much more quicker (120A).

I don't have enough programming skills to make modifications to pylon_canbus.cpp file.

Following important changes saves Li-Ion battery life; 1) charging voltage; Maybe it could be same as 'Battery charge voltage' in Charge/Discharge configuration page. I'm not sure, if it is line 37 in code and is defaulted to 1. (Inverter defaults to 55,8V) 2) discharge voltage; Might be same as 'Battery discharge voltage minimum' in Charge/Discharge configuration page (line 40 ?), but changes doesn't do any difference at inverter's hidden page. (Inverter defaults to 46V)

What kind of changes I should do ?

stuartpittaway commented 1 year ago

Hi @deekoowee, do you have documentation on the protocols Freedom battery requires?

If not, we can't make any code changes as we don't know what "language" the inverter expects to communicate under.

Its possible that your inverter is limiting the current on the PylonTech battery due to the other issue you mention #189

deekoowee commented 1 year ago

Hi, I don't have the protocol documentation for Freedom Lite.

To get more info about the protocol, I tested the 'Prevent charging' and 'Prevent discharging' settings with controller firmware version de9f98ac85c55d09b9de3956597e27ded41be4c9 . They both worked with inverter's Freedom Lite battery setting.

I forced charge from inverter to 'full charge' of 55,8V. At that voltage, inverter stopped charging and SoC at DiyBMS was around 85%. Inverter regulates the output voltage depending of inverter's battery selection, because changing the battery at inverter config changes the 'full charge' voltage. Browsing the internet and found Victron documentation, which give a hint at page 16 to set the full charge voltage. 'The charge voltage values are overridden by the LiTE but should be set correctly regardless for redundancy.' Maybe Victron's software is setting their inverter's Absorption and Float voltages via Canbus message from Freedom Lite ?

Late last night, I set the 'Individual cell min. voltage' to 3650 and start discharging. Some time at last night, discharging has stopped to level 3650 and SoC is 61%. I think DiyBMS has sent 'Prevent discharging' or similar command to inverter.

Trying to underestand SoC. I think SoC should be near 0% (not 61%). Propably the Ah in/out counting is not correct yet. Could the 'Nominal Battery Capacity' make the Ah calculation error ? It is now 830Ah, but inverter do not reach the 'Battery charge voltage'. Maybe I should set lower capacity Ah at DiyBMS and change it back, when top charge voltage issue has solved.

Ideas for protol digging; I found 'General BMS protocol' for MG MAster LV. I don't know, is it correct and real general bms protocol. I found, that 'General BMS protocol' have;

My best guess, that Freedom Lite might use 'general BMS protocol' Is it possible to make 'Generic battery' emulation like 'PylonTech' and having above ID's ?

I will continue to use Freedom Lite setting, because of higher top voltage.

Yes, with new firmware, the charging is working as expected and commented to #189

stuartpittaway commented 1 year ago

I would recommend using the pylontech more on the inverter, as we know that's fully supported, I can't verify if the lite protocol does anything strange, and we don't want to risk the cells.

The state of charge needs to reset on fully charged battery voltage, take a look at the shunt settings on the controller

deekoowee commented 1 year ago

Hi @stuartpittaway, Some mystery things has happened again. After yesterday's success testing, I made following; 1) I calculated the Ah for lower top voltage and saved it to 'Current & Voltage Monitoring' and 'Charge/Discharge configuration'. 2) Set new values for 'Battery charge voltage' and 'Fully charged voltage' 3) I programmed the inverter to make forced charging, but it do not start charging cycle. 4) Refressing Charge/Discharge configuration page give always two notes a) Discharging is prevented b) Charging is prevented 5) Those checkboxes are not checked 6) Made a connection to DiyBMS from another computer (if it is browser problem), but same notes will occur. 7) Tried check and uncheck above settings >> 'Settings saved'

Now, the battery voltage is a bit lower than 'Battery discharge voltage minimum' setting.

What could cause the notes at Charge/Discharge configuration page ?

stuartpittaway commented 1 year ago

The rules page will also trigger error messages to the inverter, like low cell voltage or low/high bank voltage.

Check there are no rules active (highlight in green)

deekoowee commented 1 year ago

Thanks a lot ! Rules was causing the charging problem. But why undervoltage triggering causes 'Charging Prevented' Following rules were triggered; 1) Cell under voltage 2) Current monitor under voltage 3) Bank under voltage I think, that in case of low voltage, it shoul not prevent charging.

After testing, 'Cell under voltage' at Rules settings, do not trigger the 'Discharge Prevented'

Still informs 'Discharging is prevented' No triggering at Rules and no checkbox at 'Charge/Discharge configuration'