Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 23-10-2017, 00:28   #31
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by hzcruiser View Post
Excellent approach, Vasko!

Quite impressive how you manage to implement everything with just breakout boards and jump wires. And yes, current accuracy is quite a challenge, especially over a range of three magnitudes (say, from 10mA to 50A). We might try the Kalman filter in our vessel mgmt project as well, I'm just waiting for the latest board revision to arrive today.

All the best and keep us posted on your progress!
Thanks!

Simple Kalman filter does a very good job( actually mandatory) for amps/volts and GPS measurment :

/ make sure you use the Kalman to the raw data - e.g. on the pin readings and the raw GPS coordinates - not on the final calculations /

example for GPS - from one of my other projects ( you can see the volt/amps in the merix project):

#define GPS64_CALC_INIT_x f64(-1000L)
#define GPS64_CALC_INIT_p f64(0L)
#define GPS64_CALC_INIT_q (f64(125L) / f64(1000L))
#define GPS64_CALC_INIT_r f64(4L)

// Kalman filtering
// if x <= -1000f64 then assumed not intialized yet
// based on : Filtering Sensor Data with a Kalman Filter — Interactive Matter Lab
inline GPS_DATA kalman(f64 & x, f64 & p, f64 & q, f64 & r, GPS_DATA & in)
{
if (x <= f64(-1000L))
{
x = gtof64(in);
return in;
}

// pefrorm Kalman
p = p + q;
f64 k = p / (p + r);
f64 i = gtof64(in);
x = x + k * (i - x); // but we want correction only after 5th digit after the decimal point
f64 c = f64(100000L);
x = abs64o(x) * c; // everything before 6th digit in int part
x = x - f64((int32_t)x.ipart()); // clear int part
i = i * c; // move till 4th digit before the point
x = (f64((int32_t)i.ipart()) + x) / c; // take the part before the 6th digit from i and thd rest from x


p = (f64(1L) - k) * p;
return f64tog(x);
}

//
__________________

__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 02:09   #32
Registered User

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 3,806
Re: Free Open Source Advance Battery Monitor System

That wcs1800 current sensor looks interesting, couple questions - how accurate are the readings you are getting?
Is there a max current above the rating?


I'm after something to measure down to about 0.1A accuracy but with no real interest in the higher figures, I've played around with the acs712 but no way could the 5A version cope with starter/alternator loads.

Your project looks interesting, well done, personally I'm much more interested in knowing that the batteries are getting fully charged most days from solar, if that's happening then the actual state of charge at other times is interesting and useful but not massively important if it isn't calibrated perfectly.
Thus the desire to measure & log amps going in, if the volts are high and current is down below 2A going in then state of charge must be getting up to 100%

Also, MQTT might be worth taking a look at for offline monitoring if you have wifi - if data is getting sent over MQTT it's pretty easy to set up node-red online to graph it for viewing anywhere on a web browser.
__________________

__________________
conachair is offline   Reply With Quote
Old 23-10-2017, 02:13   #33
Registered User

Join Date: Feb 2017
Location: rainy Europe
Boat: Wauquiez Centurion 40
Posts: 8
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by vtomanov View Post
Thanks

FYI : to replay to your question : I'm a software engineer - London/UK based as a day job developing software and leading a team of developpers building and supporting extream performance messaging systems for investment banking industry but enjoying developing small extras for my sailing boat

Thanks for sharing Vasko. For a second I was afraid I needed a multi-year engineering degree if I want to create a battery monitoring system myself, but given you'e a HFT programmer I don't feel too bad anymore about missing a few bits and pieces... Great project, this one is definitely going into the project library of wisdom
__________________
blucassen is offline   Reply With Quote
Old 23-10-2017, 02:56   #34
Moderator
 
Dockhead's Avatar

Cruisers Forum Supporter

Join Date: Mar 2009
Location: The boat: Cowes (Winter), Above 60N (Summer); me: somewhere in the air!
Boat: Cutter-Rigged Moody 54
Posts: 21,046
Re: Free Open Source Advance Battery Monitor System

I love it! Big kudos to Vtomanov!

We have had several discussions recently about battery monitors. I am one of those who does not really crave deep knowledge about exact state of charge -- simple system voltage method, which can tell reliably "your state of charge if about 'x' and is not less than 'y'" works for my purposes.

But I think this is the wave of the future -- radically cheap computing power and cheap sensors mean we can collect and analyze a lot more data about all kinds of things, and in the end know more about what's going on around us and on our boats.


Perhaps the OP can explain the algorithm for determining AH capacity remaining and % SOC?
__________________
"Parce que je suis heureux en mer, et peut-être pour sauver mon ame. . . "
Dockhead is offline   Reply With Quote
Old 23-10-2017, 02:59   #35
Registered User

Join Date: May 2011
Location: Toronto
Boat: Sandpiper 565
Posts: 3,099
Re: Free Open Source Advance Battery Monitor System

Great project! Thanks for sharing that. Lots to learn from even if I don't build one.

Good taste in DMMs too. I just bought a MASTECH MS2109A a few weeks ago.
__________________
Lake-Effect is offline   Reply With Quote
Old 23-10-2017, 04:15   #36
Zil
Registered User

Join Date: Mar 2013
Location: South Jersey
Posts: 259
Re: Free Open Source Advance Battery Monitor System

And the thread goes on forever. OP brought up cost of battery monitor. I only addressed the cost. We can't have too many references on all the battery uses. I also thought OP is generous.
__________________
Zil is offline   Reply With Quote
Old 23-10-2017, 10:25   #37
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by conachair View Post
That wcs1800 current sensor looks interesting, couple questions - how accurate are the readings you are getting?
Is there a max current above the rating?


I'm after something to measure down to about 0.1A accuracy but with no real interest in the higher figures, I've played around with the acs712 but no way could the 5A version cope with starter/alternator loads.

Your project looks interesting, well done, personally I'm much more interested in knowing that the batteries are getting fully charged most days from solar, if that's happening then the actual state of charge at other times is interesting and useful but not massively important if it isn't calibrated perfectly.
Thus the desire to measure & log amps going in, if the volts are high and current is down below 2A going in then state of charge must be getting up to 100%

Also, MQTT might be worth taking a look at for offline monitoring if you have wifi - if data is getting sent over MQTT it's pretty easy to set up node-red online to graph it for viewing anywhere on a web browser.
readings look good - but I'm switching for the next build to the allegro sensor as the current range is too low and I need about 200amps range
__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 10:32   #38
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by Dockhead View Post
I love it! Big kudos to Vtomanov!

We have had several discussions recently about battery monitors. I am one of those who does not really crave deep knowledge about exact state of charge -- simple system voltage method, which can tell reliably "your state of charge if about 'x' and is not less than 'y'" works for my purposes.

But I think this is the wave of the future -- radically cheap computing power and cheap sensors mean we can collect and analyze a lot more data about all kinds of things, and in the end know more about what's going on around us and on our boats.


Perhaps the OP can explain the algorithm for determining AH capacity remaining and % SOC?
the best and only 100% exact state of charge is based on volts - BUT a BIG BUT - the batteries shoudl be left to rest for about 24h !! e.g. in practice cannot work whne batteries in dalily use the current implementation is based on apms in and amps out + coeficient for the loss ( e.g. as starting coef to get 1ah out you need to charge 1.25ah) , the coef is adjusting every time the bateries are charged in full or the batteries has been in rest and the ciorrect state of charge can be determined based on the voltage - and the coef can be adjusted based on the actual amps in and out , the calculated state compared to the actual state.

battery capacity - the current version is not adjusting it as the only way to adjust it dinamicaly is again whne batteries has been resting for good amount of hours - and calculate the capacity based on the actual charge state compared to the exact charge state and the amps in and out ...

e.g. the current implementation is doing the best as it can to determin the actual state of charge dinamicaly and adjusting its calculations whne possible by actual state from voltage when fully charged or resting for enough time
__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 11:17   #39
Registered User
 
martinworswick's Avatar

Join Date: Sep 2008
Location: southern denmark
Boat: naver 29
Posts: 136
Re: Free Open Source Advance Battery Monitor System

Do you have any recommendations on where to source parts for this project?preferably from within him the EU if possible.
__________________
martinworswick is offline   Reply With Quote
Old 23-10-2017, 11:36   #40
Registered User

Join Date: Jan 2017
Posts: 3,700
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by vtomanov View Post
the best and only 100% exact state of charge is based on volts - BUT a BIG BUT - the batteries shoudl be left to rest for about 24h
Often more than 72h is required for real accuracy.

Quote:
Originally Posted by vtomanov View Post
battery capacity
only accurate measure is a 20-hour load test. Now if a FOSS based gadget could automate THAT, I reckon there'd be a strong commercial market

In a recent thread here a poster discussed a lo-tech approach using Merlin SmartGauge, a known-accurate SoC meter that **doesn't** count coulombs, in conjunction with an AH counter to derive declining AH capacity, with the goal of calibrating the latter's SoC accuracy.
__________________
john61ct is offline   Reply With Quote
Old 23-10-2017, 11:41   #41
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by martinworswick View Post
Do you have any recommendations on where to source parts for this project?preferably from within him the EU if possible.
I got all of them from ebay

example :

- 50A 3.3-5V ACS758LCB-050B-PFF-T Current Sensor Hall Current Module - £4.24
- ACS758ECB-200B-PFF-T - $3
- 40pcs Dupont Cables MALE TO FEMALE Jumper GPIO Breadboard Wire Ribbon Pi Arduino £2
- NRF24L01+PA+LNA SMA Antenna Wireless Transceiver Communication Module 2.4G -£2
- 10X 12V DC Power Pigtail Male 5.5 * 2.1mm Cable Wire Plug - £2.78
- MEGA 2560 R3 ATmega2560-16AU CH340G Driver With USB Cable
Compatiable to Arduino - £5.73
- ATmega328P UNO R3 - £3.22
- IIC/I2C 2004 20X4 Character LCD Module Display - £5.75
- Cable Lugs: Ring-, Crimp-, Tube-, Fork-, Straight Pin Terminals ; 0,5-150mm² x 25 x M8 - £2.50
- 25v Voltage Sensor Module - £1.79
- 5PCS DC-DC LM2596HV Adjustable Step Down Buck Module Voltage Regulator MO - £4.80

Let me know if I missed something
__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 11:42   #42
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by john61ct View Post
Often more than 72h is required for real accuracy.

only accurate measure is a 20-hour load test. Now if a FOSS based gadget could automate THAT, I reckon there'd be a strong commercial market

In a recent thread here a poster discussed a lo-tech approach using Merlin SmartGauge, a known-accurate SoC meter that **doesn't** count coulombs, in conjunction with an AH counter to derive declining AH capacity, with the goal of calibrating the latter's SoC accuracy.
yes agree, but we do not live in perfect world it is all about the thinsg to be as good as they do the job that we want from them
__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 13:04   #43
Registered User

Join Date: Jan 2017
Posts: 3,700
Re: Free Open Source Advance Battery Monitor System

It is true that in the AH-counting world, trying to accurately measure SoC of a bank whose capacity is seriously depleted is a big challenge.

However there are two ways forward there, one proven solid but inconvenient, the other very easy but a bit speculative.

If nothing else, for future R&D
__________________
john61ct is offline   Reply With Quote
Old 23-10-2017, 13:35   #44
Registered User
 
vtomanov's Avatar

Join Date: Jan 2016
Location: UK , London
Boat: Jeanneau Sun Liberty 34
Posts: 197
Re: Free Open Source Advance Battery Monitor System

Quote:
Originally Posted by john61ct View Post
It is true that in the AH-counting world, trying to accurately measure SoC of a bank whose capacity is seriously depleted is a big challenge.

However there are two ways forward there, one proven solid but inconvenient, the other very easy but a bit speculative.

If nothing else, for future R&D

my personal feeling is that most of the of-the-shelf battery monitors that we can buy are designed somehow for the old sailing world where electricity was really at premium and the boats did not have much electrivity usage e.g. mostly a anchor light - my goal is just to have somehow a better and more detailed batery monitor that can answer the questions: what is my consumption for the last 24h, how much battery I have left before start damaging the bank, how long it will take to change the batteries to decent state, how much electricity consume my watermaker etc. simple things that I want to have kind of a resonable answers to and in teh mean time to not show 90% of charging state whne the bank cannot consume current and the volts are 14.8 - and of course I like the xtra to experiment and add more furutes .. oohh an almost forgot - get rid of the bloody millions of cables that I need to find space to pass from everywhere to everywhere in my little crab pod
__________________
vtomanov is offline   Reply With Quote
Old 23-10-2017, 13:40   #45
Registered User

Join Date: Jan 2017
Posts: 3,700
Re: Free Open Source Advance Battery Monitor System

I don't think their simplicity is based more on the market not caring for that level of detail.

All the shunt-based ones I'd use work with up to 1000A currents, far more than most even recent model large sailboats use.
__________________

__________________
john61ct is offline   Reply With Quote
Reply

Tags
battery, monitor

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Battery-to-battery charger (independant of source charge voltage) ayates Electrical: Batteries, Generators & Solar 38 18-03-2018 05:48
Crew Available: Panama Canal Transit - Anytime in April with Advance Notice wildlawnc Crew Archives 4 26-03-2012 17:00
Dux or Advance Cats breakaway Auxiliary Equipment & Dinghy 3 24-06-2011 23:21
Cyclades Bareboat - Advance Scouting Request . . . Martigre Europe & Mediterranean 4 24-08-2010 07:54



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 19:59.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.