Battery-Emulator
Battery-Emulator copied to clipboard
Why not using relay for A/B/C/D switch control ?
I wonder why you're using a manual switch for A/B/C/D instead of a (cheap) 4 relay board to control them for the precharge/charge sequence?
You can't respect the tight timing with manual switch (hard to switch on and off in less than 0.3s).
Just what I wanted to suggest, let the LilyGo handle the startup too!
Battery agnostic precharge/contactor closing has been added to the software. https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/blob/main/Software/Software.ino#L206
Still needs to be tested and documented!
We did some testing and on the battery we used the bit for LB_MainRelayOn_flag is always 0.
I changed the code temporarily so batteryAllowsContactorClosing = 1; and the precharge worked fine.
This was on an 30kWh battery.
Here is an screenshot on the relevant byte (3) from a log file.
I am not very familiar with Leaf battery and will appreciate if anyone has any ideas on what to test.
Edit: The battery is reported as LEAF battery gen: 2 Here is some log of values: __ OK __ Nissan LEAF battery selected WAITING_FOR_BATTERY... WAITING_FOR_BATTERY... Precharge... Negative... Positive... Precharge OFF... BMS Status (3=OK): 3 Battery Idle Power: 0 Max discharge power: 30000 Max charge power: 19000 SOH%: 9100 SOC% to Fronius: 4530 Temperature Min: 50 Temperature Max: 60 GIDS: 189 LEAF battery gen: 2 Min cell voltage: 0 Max cell voltage: 0 Cell deviation: 0 BMS Status (3=OK): 3 Battery Idle Power: 0
Thanks for testing @bobbo3 , you beat me to it! LB_MainRelayOn_flag wont be set to 1 unless both HV connectors are seated. Do you have both the big and the small seated?
Thank you! I think we shorted both interlocks - the drive one and the heater one... but it is possible that we may have missed something. I will double check.
Closing this issue as completed, many are using automatic contactor control already! 🥳