My Pic based BMS and Ebike computer project

kfong

100 kW
Joined
Sep 2, 2008
Messages
1,957
Location
SE Michigan, USA
I started this last year but have been too lazy to work on the software. The design uses pics and serial communication between BMS boards. I planned to use a cell phone type display for the bike computer. I actually have the display portion working, but have been busy with other projects. Here are pictures of the boards. The left one is not really ebike related, just a GPS data logger I planned to use to log my biking. The top right board is the bike computer; it requires a 5 volt source to run. I didn’t bother to incorporate a high voltage converter, since there are plenty of good dc/dc converters out now. Castle Creations has one that is really small. Bottom left is the BMS board; it is 1”x1”. I was going to make it SMT, but decided to keep it easy to build. The middle is an allegro current sensor, this is dependant on which version you use. The right is an interface board to attach a Nokia cell phone display. Hopefully posting this will get my butt in gear, also once the weather starts to turn. I will have more time as well.
 

Attachments

  • bike computer and BMS.jpg
    bike computer and BMS.jpg
    88.4 KB · Views: 2,683
kfong,

Nice work = )

As you know we are trying to do this now but perhaps with atmels in place of the PICs but... still nice to see somone else working towards a similiar goal.

- Mike

PS: Get that butt in gear, msg me if I can assist somehow.
 
It doesn't matter to me if it's pic or atmel. I just went with pics since I had the display worked out. Do you have the algorithms that would get me going faster if there is already code developed that I can go through? I work in "C" but can take parts of other code if I see it useful. I haven’t really followed the original pic thread since it doesn’t seem much focused, so I’m not really up to date on what has been developed. Hopefully starting this thread will get more of a finished product going, since the hardware is done.

mwkeefer said:
kfong,

Nice work = )

As you know we are trying to do this now but perhaps with atmels in place of the PICs but... still nice to see somone else working towards a similiar goal.

- Mike

PS: Get that butt in gear, msg me if I can assist somehow.
 
I had suggested that we base our design around the following MCUs

Master MCU - Atmega1280 (not cheap but fast and tons of IO lines + plenty of open source C code from arduino project) - compliant with Arduino Mega for RAD
Slave MCU - Each 6 cells or so (unless MUXing) Atmega328 (will have voltage issues) - compliant with Arduino MINI for RAD

Basically there is a ton of open source code out there already for Arduino platform which is nothing more than an Atmega1280 and / or an Atmega328. Both fine MCUs with plenty of memory and better onboard i2c (so no bitbanging the communications, no need). I realize there is also a ton of PIC platform code... it really doesn't matter except in pure calculation speed, atmel is nearly 4x faster than the fastest PIC. So if we want to crunch brute numbers (that is more or less what were doing), want to leverage open source code implementations of LCD drivers, voltage and current monitor, etc, would like to have the chip handle communications with other MCUs and ICs via i2c... I don't know of any other chip that can do all this (outside the embedded x86 market, which would be FAR OVERKILL for this little application).

I have to admit my shock that you are the first person who has asked if I have any of this done, actual algorythims or code base... short answer is: yes.

Long answer: I am knee deep in a pre-controller module based also on Atmega1280 which will provide for true speed control based on speed, electronic limited slip, etc. Much of what I have already written will be useful in the BMS... in terms of communications code, yes I have master / slave i2c code running 3 Atmega328's right now (off the main MCU) and serial eeprom memory (which is where I come up with the idea I would prefer SDIO or even USB to eeprom). I will happily provide any source, insight, algorythims, references, etc for this project (or any other open source BMS for eBikes)...

I guess my real interest is getting something which will keep the rider SAFE at all times as a primary concern, the eBike and batteries are the second concern and niceities are the third concern. I want to see it open sourced or just plain old released to the world because it will help our community evolve from a technical perspective as each new chemistry we will not have to purchase more / different equipment... just recode the SW and that's fairly simple to do via a GUI so the user can specify the technical cutouts, etc.

What is your take on this?

-Mike
 
That would be great, I really don't think speed is an issue with what we are dealing with so the pics are fine for this application, besides, the hardware is done so only software development is needed. I have no problem with having the code posted. It will help me get my ass in gear if I have subroutines I can paste together as well as feedback on what should be done. If you have communications worked out with message priority protocols. I would be interested in focusing on that part of it so I can get the bms to talk together along with the bike computer. Once I can get that established, the rest should follow rather quickly.

Here are the schematics of the boards; hopefully I didn't make any mistakes. I didn't go through the usual prototype stage. I was in a rush at the time to get it done. If anyone sees any errors, please point it out.

My main intent is to create a bike computer similar to Cycle Analyst in functionality with battery monitoring of individual banks of cells. If there is a fault, the computer will know about it and provide a warning status and display voltages. If you notice there is no battery balancing feature, just keeping it simple so I know what's going on with the cells without overcomplicating things. The balancing stuff can be off loaded onto the charging boards. Some of my packs will be konions so active balancing isn't needed. I'm not even sure it's necessary for A123. In anycase, I will at least know if my cells go out of balance. Any real faults, the bike computer will just shut down the throttle controls, and you will have to just pedal back till you fix the problem. I see no case where I would chance running the packs down any further.
 

Attachments

  • Bike computer.pdf
    105.6 KB · Views: 341
  • BMS BOARD.pdf
    75 KB · Views: 338
mwkeefer said:
I want to see it open sourced or just plain old released to the world because it will help our community evolve from a technical perspective as each new chemistry we will not have to purchase more / different equipment... just recode the SW and that's fairly simple to do via a GUI so the user can specify the technical cutouts, etc.

That's what I was thinking too. I have a few Infineon Controllers, and I can not even get the parameters that
were originally flashed with the Parameter Designer software. Almost like this is info that controller
builders might not really want to share, as they have to do a lot of testing themselves to match up how
they component out the boards with what they flash to it. And if they get it right, that makes their controller
better than the next guys. So I understand.

That being said, I'd love to see some Open Source modules for some standard hardware that's not too hard
to put together. Who knows what cool ideas people might come up with that could be added.

Have you thought about doing something open source for the xie cheng Infineon xc846 boards that would replace
Parameter Designer? I mention this as they are probably dirt cheap from source, before they are built up with
transistors, capacitors, mosfets, shunts, etc, which people can put on themselves, if there was some open source
guidance for them to start with.

For myself, I have a real learning curve to go through to understand this stuff. I have a bit of SBC knowledge,
but this kind of stuff is a level closer to the hardware I've never played with.
 
Back
Top