diy solar

diy solar

Interfacing with Valence built in monitoring

In my last post I was not referencing to the Raspberry Pi BMS, only the Valence U-BMS. It's also tricky that there are no standard CANbus protocol, different chargers have different protocols. I know the U-BMS uses the BRUSA CAN-bus protocol.

Instead of using a SSR, you should probably use a DC contactor to turn of the DC voltage from the chargers instead of the AC voltage to the chargers, and then another to control the load, or if your solar inverter have some built in switch you can trigger.
I am hacking my car, that's why I'm not controlling charge by a DC contractor, which is probably better.

How many batteries do you have? Series or parallell?

You could of course not use a BMS at all, as long as the chargers cut of at safe voltage. I would set that below the maximum om 14,6v, to not harm any cells if they end up unbalanced, especially if you have a number of batteries in series.

I have 3 batteries wired in parallel. 12V @ 414AH.

All cutoffs are at 14.4V. I have monitored my batteries for 2 months and they never go above 14.4V.

I am familiar with relays, but not DC contactors. I'll have to look into it.
 
Also, the Raspberry Pi only outputs 3v, so either you need a SSR/Contactor that accepts 3v as input, or you'll have to be creative with a separate relay to trigger the contactor/SSR
 
Thanks for your help. I ordered the RS485 and the connectors. Nothing is estimated to arrive until Apr 22nd at this point so I have some time to plan this out. I'll get my RPi up and running and then wait for parts.
 
I also will be running 3 U27-12xp's in parallel. I am unfortunately new to all things solar as well as coding so I basically have no idea what is going on but I am slowly starting to pick some things up. Someone in another thread said that the internal balancing BMS in each battery only works when connected to the monitoring software but from your experience Skaggetse the cells do balance themselves by the internal BMS? I will set the charge voltage down to 14.4 to be safe. If the cells become unbalanced how do I go around balancing them to a specific voltage. Im assuming I will also need to make sure that all three batteries remain balanced at the same voltage.
 
I am running 4 U27-12xp's in parallel charging with a VE multiplus 12/2000/80-50, VE MPPT 150/60 Tr with 4 200 watt Hightec panels, and from the alternator to protect it I'm using a Renogy DCC50S 12V 50A DC On-Board Charger with MPPT I used this DC to DC charger because of the MPPT so I could connect portable panels if I need to. I am real interested in your project and would like to contribute in any way. I'm using a VE Battery Protect for under charge on DC load and for overcharging relying on the profiles set in the VE MPPT, Multiplus and DC to DC charger but would really like a back up. I was even thinking a second Battery Protect could be controlled by my VE BMV-712 for over charge protection.
 
Hey all, first post but I've been lurking about on here and watching lots of Will's videos for a bit. I was able to find a Valance U27-XP locally and decided to try it out. I made up an RS485 cable and downloaded the software and was able to communicate with the battery. I am working on making my own BMS and thought about just getting rid of the onboard communication and hooking up directly to the temp sensors and cell voltage leads. After I got the back off and saw how nice of a job they did with everything, I was hesitant to start chopping wires. So, I started snooping on the RS485 communication and I've figured out it is using the MODBUS protocol at 9600 baud, 1 stop bit, but I couldn't get it to respond to any commands to poll the registers(command 3?) without having the diagnostic software connected. I also get parity errors on what appears to be the commands coming from the diagnostic software. If I have that running and send commands at the same time, then I can get a response. I did some more snooping and found some commands where the diagnostic software is using mark parity, so I think that could be the hang up. Does anyone have any knowledge of MODBUS and any MODBUS programming libraries that would allow me to configure a connection for mark parity?
Hello, I want to share this program with you so that you can test it and share it.
 

Attachments

  • Software Valence.pdf
    273.4 KB · Views: 64
Hello, I want to share this program with you so that you can test it and share it.



Hello,

First of all excuse me for my approximate English (thank you Google Translate ;-))

I have a system built around 4 U27-12xp batteries connected in series (48v). I charge them with a BlueSolar charger
MPPT 150-60 and 6 PV of 250w. Then a charger converter Victron Multiplus 48/1200/13.
I monitor the 4 batteries with a PC under Windows 7 and the Valence diag module software.

I will be interested in the following Valence software:

- Configuration and Monitoring
-BMS CAN monitoring
-BMS firmware update and configuration


I will be grateful if you will share them.

Regards,

Philoup
 
This is great! I'm planning to make a bkynk application to monitor the batteries data via rs485->esp8266 over WiFi. I have 8 u27-12xp in 4s2p, 14.3 kWh, same as a powerwall 2. I'll share progress with you all here and on GitHub. Thanks t3chN0Mad!
 
Hello,

First of all excuse me for my approximate English (thank you Google Translate ;-))

I have a system built around 4 U27-12xp batteries connected in series (48v). I charge them with a BlueSolar charger
MPPT 150-60 and 6 PV of 250w. Then a charger converter Victron Multiplus 48/1200/13.
I monitor the 4 batteries with a PC under Windows 7 and the Valence diag module software.

I will be interested in the following Valence software:

- Configuration and Monitoring
-BMS CAN monitoring
-BMS firmware update and configuration


I will be grateful if you will share them.

Regards,

Philoup
Hello send a message to : mongrenier@msn.com
 
Do you reckon there is a way to build a slave computer to turn on while my RV Is running, connect to the batteries via comms to turn on the internal balancing and then turn off when the RV is no longer running?

I imagine doing this would basically ensure that my batteries are always balanced since I drive my RV a lot. Basically just a slave unit that connects to the batteries while the vehicle is on.

That in conjunction with a smart charger that provides over-voltage protection (Renogy DC-DC MPPT for me) and a Victron battery protect for 12v loads and a low voltage shutoff on the inverter for 120V loads would make these things pretty much fool proof -- at least for parallel connections. Obviously would love over current/temp/etc. protection if we end up getting that far -- but for my use -- I'm mostly doing parallel connections.

I should stock up on these batteries now -- I imagine the demand is going to skyrocket for these things if a open source and easy to build BMS becomes available!

Hope you find some time to keep working on it -- I'm good with computers but the code is hard for me to follow as I have absolutely zero experience with CANBUS. Happy to help where I can -- I'll peruse the code here shortly to see if I can understand what is going on logically.

Awesome work everyone -- this is what makes the internet so great.
 
Hello,
here is a gauge which displays the battery SoC from the information given by the U BMS on its pin 2 connector B.
Enjoy.
What kind of arduino r u using? Or fit doesn’t matter? Can u please explain the 2 pins u connected? Wud u kindly share the code for the arduino with a sketch?
 
I'm starting to mess around with the python utility script that just reports batt v and temp from battery 1. I have tried to change the ID on my battery with no luck. My battery ID is 12. I've been trying to change payloadW = [0x00,0x00,0x01,0x01,0xc0,0x74,0x0d,0x0a,0x00,0x00] and payloadV = [0x01,0x03,0x00,0x45,0x00,0x09,0x94,0x19,0x0d,0x0a] to see if I can get any results, but no luck so far. Is payloadW id sensitive or is it just a general "everybody up" sort of message? For payloadV, I was thinking change the first part from 0c01to 0x0c, but I just get back "b", not a string of values. Any ideas on how to crack this? Also investigating ways to verify the script is actually talking to the com port. I see the lights flutter for a second, when I run the script, but it seems to do that no matter what com port I select, so I'm not sure that's even working.
 
You could of course not use a BMS at all, as long as the chargers cut of at safe voltage. I would set that below the maximum om 14,6v, to not harm any cells if they end up unbalanced, especially if you have a number of batteries in series.

The following is excerpted from https://marinehowto.com/lifepo4-batteries-on-boats/

When reading info on the net that suggest such things such as “13.8V is only 80% SoC for 12V nominal LFP battery“, please do yourself a favor and take this hog wash with a grain of salt. Alternatively, do what we do here in the CMI lab and test these nonsensical claims. An LFP cell will attain 100% SoC at voltages well below 3.6V, if the voltage duration is held long enough, as many lead acid charger do!


Most lead acid designed charge sources can hold the absorption voltage stage more than long enough to cause long term damage or eat into some cycle life capacity of your expensive LFP cells. Some LFP manufacturers are now starting to understand this point, when selling into a lead-acid charger environment, and have reduced recommended max charging voltages accordingly. Of course, some others have not. The quality of the cells used inside the battery also play a major role as to how well they deal with constant voltage being held longer than is necessary.


I recently had four prismatic cells in the shop, sent to me by a gentleman who assumed a GEL setting on his charger was safe. He decided this based on Winston’s voltage specifications. He assumed, seeing as it was only 14.2V or 3.55VPC, and well within the spec, that 14.2V was safe for a nominal 12V bank. However, as I mentioned earlier, voltage is not the only factor to consider. You have voltage, duration at target voltage, and charge rate to also consider.
 
I'm starting to mess around with the python utility script that just reports batt v and temp from battery 1. I have tried to change the ID on my battery with no luck. My battery ID is 12. I've been trying to change payloadW = [0x00,0x00,0x01,0x01,0xc0,0x74,0x0d,0x0a,0x00,0x00] and payloadV = [0x01,0x03,0x00,0x45,0x00,0x09,0x94,0x19,0x0d,0x0a] to see if I can get any results, but no luck so far. Is payloadW id sensitive or is it just a general "everybody up" sort of message? For payloadV, I was thinking change the first part from 0c01to 0x0c, but I just get back "b", not a string of values. Any ideas on how to crack this? Also investigating ways to verify the script is actually talking to the com port. I see the lights flutter for a second, when I run the script, but it seems to do that no matter what com port I select, so I'm not sure that's even working.

I found that the request packet appears to have a checksum so just changing the ID didn't work.
I sniffed the RS-485 bus while the Valence SW was talking and found the proper packet formats for my other 3 battery IDs.
Attached is my python script I hacked up for checking and displaying all 4 of my battery IDs.

For reference, here are the payload packets for IDs 2-4;
payloadV2 = [0x02,0x03,0x00,0x45,0x00,0x09,0x94,0x2a,0x0d,0x0a]
payloadT2 = [0x02,0x03,0x00,0x50,0x00,0x07,0x04,0x2a,0x0d,0x0a]
payloadV3 = [0x03,0x03,0x00,0x45,0x00,0x09,0x95,0xfb,0x0d,0x0a]
payloadT3 = [0x03,0x03,0x00,0x50,0x00,0x07,0x05,0xfb,0x0d,0x0a]
payloadV4 = [0x04,0x03,0x00,0x45,0x00,0x09,0x94,0x4c,0x0d,0x0a]
payloadT4 = [0x04,0x03,0x00,0x50,0x00,0x07,0x04,0x4c,0x0d,0x0a]

Richard
 

Attachments

  • Valence_2.py.txt
    7.2 KB · Views: 44
Last edited:
I found that the request packet appears to have a checksum so just changing the ID didn't work.
I sniffed the RS-485 bus while the Valence SW was talking and found the proper packet formats for my other 3 battery IDs.
Attached is my python script I hacked up for checking and displaying all 4 of my battery IDs.

For reference, here are the payload packets for IDs 2-4;
payloadV2 = [0x02,0x03,0x00,0x45,0x00,0x09,0x94,0x2a,0x0d,0x0a]
payloadT2 = [0x02,0x03,0x00,0x50,0x00,0x07,0x04,0x2a,0x0d,0x0a]
payloadV3 = [0x03,0x03,0x00,0x45,0x00,0x09,0x95,0xfb,0x0d,0x0a]
payloadT3 = [0x03,0x03,0x00,0x50,0x00,0x07,0x05,0xfb,0x0d,0x0a]
payloadV4 = [0x04,0x03,0x00,0x45,0x00,0x09,0x94,0x4c,0x0d,0x0a]
payloadT4 = [0x04,0x03,0x00,0x50,0x00,0x07,0x04,0x4c,0x0d,0x0a]

Richard
Is this with arduino uno? Was any 4 module relays attached? Any voltage divider? Thanks
 
I found that the request packet appears to have a checksum so just changing the ID didn't work.
I sniffed the RS-485 bus while the Valence SW was talking and found the proper packet formats for my other 3 battery IDs.
Attached is my python script I hacked up for checking and displaying all 4 of my battery IDs.

For reference, here are the payload packets for IDs 2-4;
payloadV2 = [0x02,0x03,0x00,0x45,0x00,0x09,0x94,0x2a,0x0d,0x0a]
payloadT2 = [0x02,0x03,0x00,0x50,0x00,0x07,0x04,0x2a,0x0d,0x0a]
payloadV3 = [0x03,0x03,0x00,0x45,0x00,0x09,0x95,0xfb,0x0d,0x0a]
payloadT3 = [0x03,0x03,0x00,0x50,0x00,0x07,0x05,0xfb,0x0d,0x0a]
payloadV4 = [0x04,0x03,0x00,0x45,0x00,0x09,0x94,0x4c,0x0d,0x0a]
payloadT4 = [0x04,0x03,0x00,0x50,0x00,0x07,0x04,0x4c,0x0d,0x0a]

Richard
Sorry, didn't see the reply sooner. So it looks like it's time to get sniffing on my battery then. Or figure out the checksum... So to set up the sniffer, just need another USB/RS-485 adapter (without the power line connected) and connector for the other plug on the battery side. Fire up the Valance software and capture what happens. For the capture side, is there a popular program for that? I know of wireshark. It's been years since I've messed with that. Any pointers would be appreciated.
Thanks,
Mike
 
Hey All,

I'm just getting back to working on this project again; All of the work you've all been doing looks fantastic!

If any of you are working on more complex projects for other platforms such as RPi and want specifics on how to obtain certain data from the Valence system, please reach out to me via PM. I don't include it in the repository because I don't want any issues to arise by publicly disclosing the information.
 
Hi All,

I have a pretty big update: CRC has been implemented and has been pushed to the master branch. OpenXPBMS now supports reading from multiple batteries without having to specify modbus messages for each battery! All you need to do is add the HEX value of each battery ID in your battery network to the batteries array before uploading the sketch to your board. Please test it out and provide feedback!
 
Hi @t3chN0Mad
Looks great what you've done so far. I'm excited to try it out, and hope you can give me a couple of pointers to get started. I have a bit of experience with electronics and programming PICs, but haven't used these tech-skills in a while so kind of rusty :)

My setup is 2 parallel U27-12XP in a campervan, charged by a Votronic Solar/DC-DC/Mains charge controller, with a Victron BatteryProtect for low voltage protection and as a manual disconnect relay.

What I would like to achieve is to
(a) Keep the Valence internal BMS awake so the intra-module balancing is active.
(b) Provide a signal to the charge controller to disable charging in case of individual cell over-voltage or over-temperature.
(c) Provide a signal to the BatteryProtect to disconnect load in case of individual cell under-voltage.

I saw in your repository that you are using an Adafruit Grand Central M4 Express and have designed an auxiliary PCB for the application. But I'm hoping that for my simple requirements I can use a cheaper/smaller/lower power board without an extra PCB.

I wonder if you can help me choose a suitable Arduino board which will be:
- Compact
- Low power
- Runs from 12V
- Capable of direct RS485 communication and providing 5V for the Valence internal BMS
- Capable of outputting (low current) signals to the charge controller and BatteryProtect *
- Native USB to program it

* I'm aware I might need to add a MOSFET and couple of resistors to get a 12V signal.

I don't have much experience with Arduino, but from a quick browse of the Arduino website, it seems like even a Nano should be able to do this?
I guess I will have to rewrite some of your board-specific code, but before I dive in to learning how to do this, do you think something like a Nano will be suitable?

Thank you,
Seb
 

diy solar

diy solar
Back
Top