Low cost BMS

How do you store and manage your electricity?
User avatar
weber
Site Admin
Posts: 2601
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

Low cost BMS

Post by weber » Thu, 23 Jan 2014, 21:19

Nevilleh wrote:
weber wrote: Hi Nevilleh.

Although it is clear now, thanks to 4Springs' measurements, that it is not a clock speed problem, you seem to have failed to understand both of the points I made in my previous message.

Is that an insult? Maybe I'm too sensitive. But I didn't fail to understand, I just didn't bother reading it.

It was certainly not intended as an insult. It might well have been my deficiency in explaining, or you might have been too busy to do more than skim it. It did cross my mind that perhaps you hadn't read it at all, but I gave you the benefit of the doubt on that. And I did say "you seem ...".

Your 10% spread (+-5%) does apply when you know that one of the parties to the async comms has essentially 0% error, e.g. a crystal controlled master unit. Perhaps that's what you were thinking of.

Anyway, I expect that other readers who might need to know this stuff, have got it by now. If not, draw yourselves some diagrams.
One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 30 Jan 2014, 01:52

Nevilleh wrote: I guess you put your own charger control circuitry in it. Can you show what that is please?

Here is mine:
Image
This is for a TC Charger charger, and is straight out of its manual. I used one of the leftover optocouplers from the BMS modules. Made it up on a piece of veroboard.
The 12V on the left hand side is the normal accessories 12V that feeds the BMS master. The "Charger Control" is from the BMS master.
On the right hand side, the 12V is from the charger. This 12V is not very well isolated from the traction battery, so I treat it as HAZV, using orange wires and conduit. The ENABLE and 0V are also from the charger. This charger expects a voltage on ENABLE from 2-5V. 2 = off, 5 = on full bore, and continuously variable in between. To get this, you pulse the optocoupler on and off.
Neville was prescient in using an output for the charger that could be configured for PWM. Once I worked out how to set it up, using PWM is simplicity itself. Write a higher number to a memory address and the mark/space ratio goes up. Write a lower number and it goes down. This gives very good control to the charger.

I don't have a current clamp, but I do have a Watt meter for 240VAC. So I can tell that my charger uses about 2kW at full bore. This roughly translates to 12A DC delivered to the battery. My BMS modules can bypass about 200mA. I have set up the master to dial back the charger once a cell gets to 3.60V, and the cells also start balancing at 3.60V. Dialed back, the charger uses about 200W, which should be about 1A (the numbers get a bit fuzzy down here, because I don't know how efficient the charger is).
It all seems to be working so far. Without dialing back the charger the voltage on the highest cell quickly went from 3.6 to 3.7 to 3.8 (my "turn off the charger" value). Now that I have it dialing back it takes a lot longer. 200mA is a good fraction of 1A, so all the bypassing cells are getting less charge than the others. Each time I charge I have more cells going into bypass mode. My lowest cell is still 3.1V though when the charger finally turns off.
I do have one concern, I don't have modules on three of the cells. I managed to blow them up, and the replacement microcontrollers are taking a long time to arrive. I probably should go out and measure them with a voltmeter to make sure they aren't too high...

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

Low cost BMS

Post by Johny » Thu, 30 Jan 2014, 14:03

IMO No probably about it - do it. If any of the 3 unmonitored cells are higher voltage than most cells then I would take the time to move some modules from cells measuring low SOC to a cell measuring high SOC (resting voltage).
It should be pretty safe to have unmonitored cells for discharge providing you don't do any "range tests" while you have missing BMSs.

It would be a real shame to stuff one of those new cells.

Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Thu, 30 Jan 2014, 14:13

Your circuit looks fine.
I did use a pwm output when I originally thought about the bms as I had no idea what the charger would be then and I thought I could always control any sort of charger with a mosfet-in-a-box controlled by a pwm signal - a bit like what you are doing. Then when I bought the ProTech charger I found it had a programmable, low current mode, so I just used that output as an/off.
Can't see any reason at all why the master would reset when you use that 3.8v value.
I no longer have one to try it out on, which is a pity.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Wed, 05 Mar 2014, 22:09

Hello Everyone,
I've created a SourceForge page for the Low Cost BMS. Link is here: Low Cost BMS
I have uploaded all of my files so that anyone can download them. I'd encourage anyone else involved with this project to do the same - either join up and become a contributor or PM me and I can upload the files for you. I'm hoping that someone browsing the page will be able to select from several different versions, depending on their cell size, compiler etc.

Thanks again to Neville for developing this project and providing it for all to use!
Last edited by 4Springs on Wed, 05 Mar 2014, 11:11, edited 1 time in total.

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Sat, 24 May 2014, 07:20

I have finally got my hands on the PCB's for the BMS. They look great.

Many thanks to Arber333 for all the assistance in adapting the circuit to fit 40Ah and 60Ah Winston cells (same terminal separation on both). Getting a PCB manufacturer to produce the PCB's is all new territory for me. The last time i made PCB's there was much messy acid etching involved.

I am quite excited to have a go at reflow soldering. Never done it before.
The few youtube videos i have watched make it seem very easy and the results are outstanding.

I am hoping that once i get the hardware running i can contribute to the software development.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Sun, 25 May 2014, 00:43

Astroboy wrote: Getting a PCB manufacturer to produce the PCB's is all new territory for me. The last time i made PCB's there was much messy acid etching involved.

I am quite excited to have a go at reflow soldering. Never done it before.
The few youtube videos i have watched make it seem very easy and the results are outstanding.

Ha - that was my experience exactly! Last time I made PCBs I used the photo-sensitive copper board, etched it up with acid. I can't imagine doing that for 48 boards though! Having them appear in the mail was just magic.
I bought a Mini Bake & Grill like the one that Nevilleh suggested. It was only about $60 new and works a treat. Good for sandwiches too! Pretty tedious placing all the components but much easier than through-hole work.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Sun, 25 May 2014, 04:50

Good for you...

Last week ive been driving on gas!!! My clutch gave way and i had to get a replacement.
It seems taking off in 4th or 5th made a mess of springs inside. I will have to be carefull, taking off only in 2nd.
For the record; previous month i passed 20000km electric mark. I celebrated this by giving it a full charge and went speeding to 180km/h :). I kept it there for 5km - cca 2 minutes. Current was cca 550A and voltage at 115VDC this means 2,75V/cell!!! Also means about 60kW on the motor maintaining the speed. I have no illusion, efficiency at that load is in 70%s though!

I am really thinking of doing MB CLK conversion using this motor on differential: http://www.enstroj.si/Electric-products ... rsgen.html
I know this guy and recently he got a reliable controller for low voltage application. This motor has 90% efficiency even at full load!
Should be fun...

A

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Mon, 23 Jun 2014, 17:31

4Springs wrote: Hello Everyone,
I've created a SourceForge page for the Low Cost BMS. Link is here: <a href="http://sourceforge.net/projects/low-cost-bms/" rel="nofollow">Low Cost BMS</a>
I have uploaded all of my files so that anyone can download them.
...

I have downloaded the files and added the two mplab projects to my mplab setup. Thank you 4Springs for making the files easily available.
I can complile/build both the master and celltop hex files but when looking at the code in the IDE i get several red underlined identifiers. The __delay_ms_ and the __delay_us_ are all underlined. It still complies without error so i am assuming the compiler knows what they mean but the IDE doesn't.
My mplab is version 1.95 and i noticed on their web site they are up to 2.10 so i updated to that version but still see the __delay_ms_ and __delay_us_ identifiers underlined.
Maybe i am missing an include?

Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Mon, 23 Jun 2014, 18:06

For my original version, I used the CCS C compiler which has functions delay_us and delay_ms built in and accessed by #USE DELAY()
I note that 4springs converted it to use the XC8 compiler and the functions _delay_?? are part of that. There is probably an include file that is needed to access them and I'm sure you will find it by reading the documentation for XC8. Haven't used it myself as I have CCS.
It should show compiler errors if it can't find these functions.

Excerpt from User's Guide:
3.5.10 How Can I Implement a Delay in My Code?
If an accurate delay is required, or if there are other tasks that can be performed during
the delay, then using a timer to generate an interrupt is the best way to proceed.
If these are not issues in your code, then you can use the compiler’s in-built delay
pseudo-functions:
_delay
,
__delay_ms
or
__delay_us
, see
Appendix A. “Library
Functions”
. These all expand into in-line assembly instructions or a (nested) loop of
instructions which will consume the specified number of cycles or time. The delay argu-
ment must be a constant and less than approximately 179,200 for PIC18 devices and
approximately 50,659,000 for other devices.
Note that these code sequences will only use the
NOP
instruction and/or instructions
which form a loop. The alternate PIC18-only versions of these pseudo-functions, e.g.,
_delaywdt
, may use the
CLRWDT
instruction as well. See also
Appendix A. “Librar
Last edited by Nevilleh on Mon, 23 Jun 2014, 08:15, edited 1 time in total.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Tue, 24 Jun 2014, 03:09

Astroboy wrote: I can complile/build both the master and celltop hex files but when looking at the code in the IDE i get several red underlined identifiers. The __delay_ms_ and the __delay_us_ are all underlined. It still complies without error so i am assuming the compiler knows what they mean but the IDE doesn't.
Maybe i am missing an include?

This is standard operation for the IDE. I've had the same thing in every version I've used so far, and it is a fairly common question on the forums. The standard answer seems to be "yes, it does that, just ignore it".

Great to see you are coming along so quickly! How many modules will you be building?

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Tue, 24 Jun 2014, 07:11

4Springs wrote:
Astroboy wrote: I can complile/build both the master and celltop hex files but when looking at the code in the IDE i get several red underlined identifiers. The __delay_ms_ and the __delay_us_ are all underlined. It still complies without error so i am assuming the compiler knows what they mean but the IDE doesn't.
Maybe i am missing an include?

This is standard operation for the IDE. I've had the same thing in every version I've used so far, and it is a fairly common question on the forums. The standard answer seems to be "yes, it does that, just ignore it".

Great to see you are coming along so quickly! How many modules will you be building?


Thanks for the confirmation of the __delay_ms issue. Seems weird that the IDE couldn't be made aware that the xc8 compiler had that directive built in.
But as you suggest i will ignore it for the moment, i have bigger fish to fry.
I built 2 cell modules and one master just to test and make sure they worked ok. They didn't.   Image I discovered that somehow i muddled up the master pcb files when i sent them off to get made. So i seem to have an older version of the master board. Lacking the pullup resistors on the switches. Easily corrected. So after fixing those i fired up the maser module in isolation and got the expected display when not connected to cell modules. So then i loaded the two cell modules on cells. No sparks. Image However once they were connected up to the master module still no comms. So i built another master module to compare and got the exact same results. So whatever i did wrong i did it consistently wrong. Image

Its getting late now so i will leave it for tonight and maybe get the oscilloscope on to them sometime in the next few days and see if it is the master modules or the celltops that are the culprits.

I bought some cheap LCD modules from eBay which work fine but have a different contrast voltage requirement. I dropped the resistance in the voltage divider from a 10k/2.2k split to a 10k/750 split. This gives a nice display. Oh and the no comms issue was there before i changed that resistor.

The plan is for 60 cells but not sure if i will go with two parallel packs of 30 cells or pair the cells up and have a single pack of 30 pairs of cells. The pairing would mean less celltop modules but less visibility of each cells performance.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Tue, 24 Jun 2014, 13:31

Astroboy wrote:Its getting late now so i will leave it for tonight and maybe get the oscilloscope on to them sometime in the next few days and see if it is the master modules or the celltops that are the culprits.

Oscilloscope? - Luxury!
Actually I was able to borrow one a couple of times and it made debugging much easier. When I didn't have the scope I had to rely on hooking things up to the computer. I seem to remember that I could monitor what was going on from master or module by hooking it into a COM port. Setting that up of course made me learn a whole lot about USB/COM ports in linux.
Astroboy wrote:The plan is for 60 cells but not sure if i will go with two parallel packs of 30 cells or pair the cells up and have a single pack of 30 pairs of cells. The pairing would mean less celltop modules but less visibility of each cells performance.

True - my feeling is that the voltage wouldn't matter all that much, but by pairing modules you'd only get the temperature of one cell. Although you could do what Nevilleh did early on and have each thermometer on a fly lead to tuck down between cells.

I have made at least one bug fix since I posted that code on Sourceforge. There was a problem where the display would start rolling random characters across the screen after a couple of weeks. The program was still working but the display was messed up. A reset would fix it. I put this code in the main program just before the display is written to:

if (TXVal == 8) initLCD(); //Do this occasionally in case LCD gets confused.
lcdPrint("\f");//Clear display ready for writing.

So the LCD is initialised once each time the program runs through. I thought this might produce some flicker but that doesn't seem to be a problem.
Your interest will probably encourage me enough to make another version for the Sourceforge page...

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Wed, 25 Jun 2014, 09:02

Well i hooked up the scope and it allowed me to find one fault which was a lifted leg on one of the cell module's optos. But that only affected that one module the other was fine. so fixed the lifted leg and now have two good cell modules that produce the expected data out individually and when hooked together.
Next was the master modules. I think i may have found another fault with the board layout. The opto pin 3 should go to ground and pin 4 go to pin 7 of the micro with a pull up resistor. Well it looks like those connections are reversed on my master boards. Pin 3 of the opto goes to the micro and pin 4 goes to ground.
It is rather late and i have been at it for an embarrassing amount of time so i will double check this tomorrow night and then attempt a fix.

If this turns out to be the problem then i will have to track down where i got the master pcb files from so they can be corrected or removed. Don't want anyone else using them and having these problems. The missing switch pull ups is a definite mistake on the version of board i have.
Last edited by Astroboy on Tue, 24 Jun 2014, 23:08, edited 1 time in total.

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Thu, 26 Jun 2014, 07:54

Two steps forward one step back.
I double checked and the connections to the opto on my master board do seem to be reversed. So i lifted one end of the opto and put in a couple of short pieces of wire to crossover the pins.
Hook it back up and yay comms error gone. I am getting voltage levels other than the 3.99 default displayed.
But hang on the voltage levels reduce with each subsequent measurement so that within a few seconds the voltage measured drops to 2.22 and the master eventually shows E3 (voltage too low).
Frustrating. Image
I will modify the second master board to see if it gives the same result. But i am now back to not knowing if this a master or celltop issue.

Ok, i worked out the counting down part, it is just the rolling average calculation bringing the values down to the reported values. Now to work out why the modules are reporting such low voltages.

Don't you love it when things just work.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

Low cost BMS

Post by BigMouse » Thu, 26 Jun 2014, 15:34

If you have one cell reporting 0, that will skew the averages down significantly. I'm not sure how the code works as I haven't delved in to it. Do you maybe have a constant set in the master code expecting more that two cells? For example, if both cells are reading 3.33v, but the master is taking an average over 3 cells (with the third cell 0), you'll get 2.22 as the average.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 26 Jun 2014, 16:47

2.2V is the minimum voltage that the cell module can report. This corresponds with a value of 0xFE sent by the cell module. The master is not reporting any comms faults, so it looks the cell modules are actually sending that value. I presume that your highest and lowest values are both 2.2V, so both modules are doing the same?
This could be a board fault or (heaven forbid!) a code fault. I may be teaching Grandma to suck eggs here, but I'd suggest putting this line at the end of the Analogues function in one of the cell modules:
*Volts = 0xee;
Put it right at the end so that this value overwrites whatever analogue value is read. 0xee will be converted into a lower voltage than 0xfe, so this will give you a clue as to where the fault lies.

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Thu, 26 Jun 2014, 20:00

4Springs wrote: 2.2V is the minimum voltage that the cell module can report. This corresponds with a value of 0xFE sent by the cell module. The master is not reporting any comms faults, so it looks the cell modules are actually sending that value. I presume that your highest and lowest values are both 2.2V, so both modules are doing the same?

Yes, both high and low values are the same.
4Springs wrote: This could be a board fault or (heaven forbid!) a code fault. I may be teaching Grandma to suck eggs here, but I'd suggest putting this line at the end of the Analogues function in one of the cell modules:
*Volts = 0xee;
Put it right at the end so that this value overwrites whatever analogue value is read. 0xee will be converted into a lower voltage than 0xfe, so this will give you a clue as to where the fault lies.

It's funny i was working away swapping around the modules, trying each master, even tried different versions of the microcontroller code. Tracing out the tracks to make sure there were no more errors and checking component values etc. Totally had a blind spot to being able to modify the code to help the diagnostics. I had it in my head that as the code has worked for others that it wouldn't be the issue so then didn't think any further on modifying the code. Its amazing what things we overlook in the early hours of the morning. Image

I will make some changes to the code tonight to see if i can pin down the problem. Thanks for the reminder.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 26 Jun 2014, 20:38

I've posted a new version of the BMS Master software on the Sourceforge site here.
Two fairly minor bug fixes:
- Fixed problem where fault LED did not light for comms faults (1 or 2).
- Added an extra refresh line for the LCD. This fixed a problem where the LCD would occasionally enter a mode where it would display random characters.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Thu, 26 Jun 2014, 20:50

Astroboy wrote: But hang on the voltage levels reduce with each subsequent measurement so that within a few seconds the voltage measured drops to 2.22 and the master eventually shows E3 (voltage too low).

I just had another thought.
The voltage reading depends on the voltage of the reference zener connected to pin 6. Is this one of the pins used by the PICKit interface? I seem to remember that something didn't read correctly while connected.
But hang on, you have two boards, so you wouldn't have them both connected...
Anyway you can check that voltage, and also pin 1 while you are at it.
The temperature reading uses the same reference zener - is that bit working?
Astroboy wrote:If this turns out to be the problem then i will have to track down where i got the master pcb files from so they can be corrected or removed. Don't want anyone else using them and having these problems. The missing switch pull ups is a definite mistake on the version of board i have.

I seem to remember that Nevilleh's very first version of the Master board had a pullup missing? From the Ecomodder site perhaps?

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Fri, 27 Jun 2014, 09:03

4Springs wrote:
Astroboy wrote: But hang on the voltage levels reduce with each subsequent measurement so that within a few seconds the voltage measured drops to 2.22 and the master eventually shows E3 (voltage too low).

I just had another thought.
The voltage reading depends on the voltage of the reference zener connected to pin 6. Is this one of the pins used by the PICKit interface? I seem to remember that something didn't read correctly while connected.
But hang on, you have two boards, so you wouldn't have them both connected...
Anyway you can check that voltage, and also pin 1 while you are at it.
The temperature reading uses the same reference zener - is that bit working?
As suggested I added in fixed values to the celltop modules code, slightly different values for each of them.
The master module displayed the values correctly and no more comms errors.
The temperatures were also correct and varied correctly as i heated each module slightly and returned to the correct ambient temperature once they cooled again.
So the temperature ADC on the PIC and the zenner must be ok so maybe tomorrow i will look for incorrect component values or track layout on the cell modules around the supply voltage ADC circuit.
Arber333 and i shuffled some of the component placements on the board a little to suit the small size 40AH/60Ah Winston cells. Maybe something was layed out incorrectly there. Hope not, its a lot of PCB's to correct.
4Springs wrote:
Astroboy wrote:If this turns out to be the problem then i will have to track down where i got the master pcb files from so they can be corrected or removed. Don't want anyone else using them and having these problems. The missing switch pull ups is a definite mistake on the version of board i have.

I seem to remember that Nevilleh's very first version of the Master board had a pullup missing? From the Ecomodder site perhaps?

That is probably where i grabbed it from.
If it is incorrect then i don't have an updated PCB file to post there as a replacement.

One other thing i noticed. The total voltage is a bit off. With 2 cells connected reporting their fixed in code voltages of 3.47V and 3.31V it displays a total voltage of 6.4V I would have expected 6.78V or a rounding to 6.7V or 6.8V but not 6.4V?

But first i need to fix the cell voltage measurement. Image
Last edited by Astroboy on Thu, 26 Jun 2014, 23:11, edited 1 time in total.

arber333
Groupie
Posts: 56
Joined: Mon, 11 Mar 2013, 02:29
Real Name: Arber
Location: Slovenia
Contact:

Low cost BMS

Post by arber333 » Fri, 27 Jun 2014, 13:01

Hi

Can you send me .pdf or .jpg of your master PCB. In my package i have totaly compatible master PCB and schematic. It is some 5th iteration that Neville and I tried. Only addition i made is the .01uF cap i added across the R1 to stabilise opto comms. You can try this also if you havent already. Later i also added one .01uF cap across 12V input pins. It seemed to helps with relay triggering.

I have also made another masterPCB which has PIC16 A0 pin free (used to be connected to LCD but not needed anymore) to connect as output. I havent built this board yet, since i am trying to learn about android programming now. I intended this pin to output voltage array or to use it as input for charger interrupt or something usefull...

Also i see you use the new code... First try your modules with my code to see if the problem is there. There is no need to change all modules. Just program one master and couple slaves...

Let me know if there is something wrong with the boards...

A
CellTopBMS.rar
Last edited by arber333 on Fri, 27 Jun 2014, 03:16, edited 1 time in total.

Nevilleh
Senior Member
Posts: 773
Joined: Thu, 15 Jan 2009, 18:09
Real Name: Neville Harlick
Location: Tauranga NZ

Low cost BMS

Post by Nevilleh » Fri, 27 Jun 2014, 17:36

Yes, the 1st master had a missing pull-up because I read the chip specs and they said that port a (or whatever) had internal pull-ups, but when I figured out why my s/w didn't work I discovered that that pin was the only one that didn't! I was more used to AVR at the time.
Note that the voltage is measured by using Vcc as Vref and measuring the zener input while the temp is measured by using the zener as Vref and measuring the thermistor voltage divider. Seems to me that there is more likely a mistake in the s/wif the temp measurements come through OK (rather than a pcb error). Since the s/w for both the cell module and the master has been modified a lot by 4springs, I think it would be wise to look there first.
When I was developing this, I used a single cell module and got that working with the master first. I hung a RS232 sniffer on the comms line so I could see the data packets on a notepad - using a terminal program - to confirm that was coming from the cell module was what I expected.
Neville
Last edited by Nevilleh on Fri, 27 Jun 2014, 07:40, edited 1 time in total.

User avatar
4Springs
Senior Member
Posts: 563
Joined: Thu, 23 Dec 2010, 01:14
Real Name: Christopher Walkden
Location: Selbourne, TAS

Low cost BMS

Post by 4Springs » Sat, 28 Jun 2014, 03:37

Astroboy wrote: One other thing i noticed. The total voltage is a bit off. With 2 cells connected reporting their fixed in code voltages of 3.47V and 3.31V it displays a total voltage of 6.4V I would have expected 6.78V or a rounding to 6.7V or 6.8V but not 6.4V?

Hmm, good find. Image
I had noticed a discrepancy between total pack voltage and when I measure with my multimeter, but not by much. It waxes and wanes a bit and looked hard to trace. It looks like you have found something that might be a bit more concrete. The values go through a few conversions on their way to being added up and I'm guessing that this is a rounding/conversion error. I might have a go at this one and I'll leave you to your more pressing fault.

Astroboy
Groupie
Posts: 53
Joined: Mon, 13 Jan 2014, 06:33
Real Name: Jase
Location: Melbourne, Au

Low cost BMS

Post by Astroboy » Sat, 28 Jun 2014, 08:04

arber333 wrote:...
Also i see you use the new code... First try your modules with my code to see if the problem is there. There is no need to change all modules. Just program one master and couple slaves...
...

I loaded your code and unfortunately i got the same result. High and low voltages of 2.21
The temperatures work correctly.
So totally different code, exactly the same result.
It is looking like a hardware issue on the cell top modules.
But as the temperature works fine the LM385 and the thermistor/10k voltage divider seem to be correct.
Also the two microcontroller pins (6 & 7) that are used for the ADC are also used for the programming connector so i am assuming the connections to the micro are fine as the modules are able to be programmed up.

I have been tracing out the cell top PCB and checking values using a schematic from arber333's package. Which looks just like Nevilleh's schematic on page one of this thread.

So far everything seems correct.

Here is an image of a completed celltop module and both sides of a blank PCB.
Maybe something will jump out at somebody who hasn't been staring at it for ages. Image

Image

Post Reply