Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
525 stars 164 forks source link

Daly BMS integration #3

Closed Louisvdw closed 3 years ago

Louisvdw commented 3 years ago

Add the Daly BMS basic communication to the driver.

Part 4_ Daly RS485+UART Protocol.pdf

neoneddy commented 3 years ago

Up Vote

gyrex commented 3 years ago

Great work on this project mate! I'd love to see this added please

svaeyens commented 3 years ago

Up Vote

pau1phi11ips commented 3 years ago

This would be awesome!

MichaelStadler91 commented 3 years ago

Would be very nice! How is the current status?

Louisvdw commented 3 years ago

Would be very nice! How is the current status?

I already have code that can read the SOC for the Daly. Now I need to move the code a bit so that it can easily be shared between the current battery driver and the Daly code (issue #11) and then I can give you Daly users something to test.

pau1phi11ips commented 3 years ago

Do you have a rough estimate to when the Daly code will be available @Louisvdw?

Louisvdw commented 3 years ago

I hope to have a first version for the the Daly's SOC at the end of May.

neoneddy commented 3 years ago

Awesome, do you have a paypal or something to donate to?

dreadnought commented 3 years ago

I've implemented the Daly BMS protocol for one of my own Python projects last weekend. I'll use this weekend to clean up the code and publish it afterwards. That might save you some work.

dreadnought commented 3 years ago

@Louisvdw you can have a look at it if you like: https://github.com/dreadnought/python-daly-bms

Louisvdw commented 3 years ago

Awesome, do you have a paypal or something to donate to?

Yes you can use Kofi. https://ko-fi.com/louisvdw

yannickudb commented 3 years ago

Up vote!

Conspir3D commented 3 years ago

+1

Louisvdw commented 3 years ago

There is a new beta build for the initial Daly BMS integration for those that want to test it and give feedback. This build should work for both the RS485 and UART connection, update the battery SOC, voltage and current in the GX device.

Download the venus-data.tar.gz from beta2 and FTP it to your GX/pi. Extract using tar -zxf venus-data.tar.gz -C /data Reboot and let me know if it works. Those small 4cell Daly BMS seems to be running a different protocol, so I don't expect them to work.

Edit: v0.5beta3

pau1phi11ips commented 3 years ago

Awesome, I'll give it a go tonight. Excited! 😀

pau1phi11ips commented 3 years ago

@Louisvdw I've installed Beta 2 on my Cerbo GX. It's reading the values but only for a split second.

I made a screen recording: https://photos.app.goo.gl/n8SuuhjrU6c5bxQAA

This was with Venus OS 2.70 ~11 I've tried 2.71 ~1 and it's the same.

Louisvdw commented 3 years ago

@pau1phi11ips do you have SSH access to the GX to copy the log file and attach it here? /data/log/dbus-serialbattery.ttyUSB0/current

pau1phi11ips commented 3 years ago

@Louisvdw Struggling to attach the log directly but could get a screenshot. Screenshot_20210622-071301

I think the error it due to my BMS only having 1 temperature sensor.

Louisvdw commented 3 years ago

I think you are corect. That temp sensor seems to be the issue.

pau1phi11ips commented 3 years ago

I'll try and get it working here and post the results. I don't really know Python (just PHP and JavaScript) but think I can handle removing the temp2 references to see if that sorts it. At least that will nail there culprit down.

Louisvdw commented 3 years ago

@pau1phi11ips can you check if this fix your temp sensor issue venus-data.tar.gz

pau1phi11ips commented 3 years ago

@Louisvdw Yep, working now thanks! 😎

pau1phi11ips commented 3 years ago

One word of caution. I have a 24V LiFePO4 battery and usually charge to 3.35V/cell = 26.8V.

The charge limit on the Multiplus II is set to 26.8V. The battery voltage was at 26.7V. As soon as I enabled DVCC the Multiplus started putting 50A into the battery. It was at 27.1V in no time with no sign of stopping.

It looks like because the driver isn't getting Vmax from the BMS it might be using the default 55V?

DVCC

Enabling the Limited charge voltage in the DVCC settings sorted it out but this isn't the default setting so beware!

Louisvdw commented 3 years ago

Thanks for highlighting @pau1phi11ips All the current features of the driver will still apply. What you are referring too is described under point 7, but perhaps I will expand that to mention the voltages. The driver works on an upper limit of 3.45V per cell. If you want to lower either the charge current of voltage you can set those under DVCC.

pau1phi11ips commented 3 years ago

OK, thanks, I was worried it was using the default voltage the Maximum Charge voltage is set to as soon as you enable Limit managed battery charge voltage.

Louisvdw commented 3 years ago

The battery publish the discharge current, charge current and charge voltage (for the driver that is 60A,50A, 3.45V x cell_count) You can limit the discharge current under ESS. The lowest value between that limit and the driver will be used. You can limit the charge current and/or voltage in DVCC. The lowest value between that and the driver will be used.

This is there for you to override (lower) the defaults. It is normally used more when you set up your battery and want to give it time to balance and settle, but it works well for our needs in this case as well.

pau1phi11ips commented 3 years ago

Thanks for the info. Much appreciated.

BTW, I've edited my daly.py to change the polarity of the current value so it's the same direction as the value from the Victron BMV 712. It's definitely wired the right way around around ;)

Changed self.current = (current- 30000) / 10 to self.current = -1 * (current- 30000) / 10

This is how it looks now Current direction 2

Current direction

Is what I've done correct?

Louisvdw commented 3 years ago

Inverting should show a negative draw on the battery. I'll recheck the Daly protocol, but just from looking at you screenshot with the Miltiplus II your change does look correct.

yannickudb commented 3 years ago

Got my small daly 4S BMS today, didn't get it working. Anyone who want to help?

Louisvdw commented 3 years ago

@yannickudb can you upload the log file for us. See the trouble shoot section in the readme on how to do that. I had previous feedback from other users of those 4sell Daly also showing that it use a different communications protocol from the one Daly published, so it could be that. Or something else - the log would give an indication

yannickudb commented 3 years ago

I Will do tonight. But i've been messing around with the bms, and found the 4s needs another pc program. I suspect i uses other communication. Any way i can help with that?

Louisvdw commented 3 years ago

I think you are correct. We need the communications protocol for that. If you can find the protocol documentation, open a new ticket and attach that doc.

Louisvdw commented 3 years ago

Implemented in release V0.5

yannickudb commented 3 years ago

I think you are correct. We need the communications protocol for that. If you can find the protocol documentation, open a new ticket and attach that doc.

I did, have attached a PDF!

janekx commented 2 years ago

0612b045a09d492f5593ebf9b24742b3.pdf Daly 1.2v protocol