2009-06-23

BMS Charging System Works!

I've been working intensively on my battery modules, BMS and charger to get them working together. So here's the story in sequence.

Fun with SMD microbs

My battery modules are made from small SMD components which I was never working with before. My previous electronics experience was with bigger sized and DIP components. So it was a new learning experience as I had with many other areas on this project - a lot of fun and satisfying moments.
On the first PCB I tried soldering these components with fine tip soldering iron which worked but I wanted to try a different way. Popular way which is also used in industry is placing components on the PCB with SMD soldering paste and treating it with heat at which solder melts. In serial manufacturing the boards are soldered by putting them in special owens.
Alternative for manual soldering is soldering with hot air. I used the hot air way although owen method should work too if had an owen. In the beginning I used some small Portasol gas soldering iron with air blower tip. It worked fine but I was not happy that I cannot control the temperature of the air and I can only have a rough estimate of this temperature. So I bought a hot air soldering station which I know I'll use in future too. Soldering the boards with it was an easy job. The tedious but not difficult part of the process was putting SMD paste and placing the components on the boards before blowing them with hot air. No problem with shaky hands and sight. Surprisingly to myself I found it easiest to do it without any magnifying goggles although I had them. My wife said I could be a surgeon. I guess I could :-)
Anyway I liked the process and I think it would have taken me notably longer with traditional components with all legs bending, sticking, soldering and crimping. It has taken me around 2-3 hours for soldering each board consisting of 10 battery modules. So manufacturing 45 modules was not bad at all.
Here is one batch of 10 manufactured boards

And here is a massive array of 36 as 9 others were already sitting on the cells as I was taking this photo :)


Battery module features

I'd like to list features that my designed battery modules have. It was quite long and iterative design and development process and I am happy I finished it. I like the final result.

Here is the list of battery module version 1 features:
- Balancing type: shunting current controlled by microcontroller
- Microcontroller: ATMEL ATtiny25V
- Operating voltage range: 2...5V
- Shunting resistance: 2.35Ohm 10 Watt
- Shunting current control: Pulse Width Modulation
- Communication protocol: custom serial protocol with LIN style sync frame
- Comm. bit rate: 2400bps (may work up to 9600bps or more)
- Comm. line: 1 wire going from module to module in chain - very easy and tidy installation
- Communication isolation: 1 Optocoupler on first module on the 2-wire input from BMS and 1 on the output to BMS over 2 wires back
- Measured parameters: Cell voltage, Cell temperature and shunting PWM value
- Voltage measurement accuracy: +/- 0.01V
- Temperature measurement accuracy: +/- 5C
- Parameter read commands: Read Voltages from all cells, Read Voltage from specific cell, Read Temperatures from all cells, Read Temperature from specific cell, Read PWM values from all cells, Read PWM value from specific cell
- Parameter write commands: Write balancing voltage to all cells, Write balancing voltage to specific cell, Write temperature calibration to all cells, Write temperature calibration to specific cell, Write max allowed temperature to all cells, Write max allowed temperature to specific cell, Write max allowed PWM to all cells, Write max allowed PWM to specific cell, Write cell IDs to all cells and read back the cell count.
- Automatic cell enumeration and counting via Write cell IDs command from BMS
- Automatic microcontroller sleep on idle (no comm from BMS for some time - like 60 seconds) to save power
- Automatic shunting current control via PWM to keep preset balancing voltage
- In-circuit microcontroller reprogamming capability via 1-wire debugWire interface
- LED indication of communication activity and PWM balancing mode
- Voltage spikes protection of the circuit supply, input and output signals
- Low cost due to carefully selected components and their count on each module

BCMS prototype board upgrade with CAN bus and Real-Time clock

I've added Microchip's MCP2515 CAN controller with Philips PCA82C260 CAN interface to be able to communicate with my new PFC 3kW charger from www.hztiecheng.com. My ATmega640 talks to MCP2515 over SPI interface. After few evenings of programming I made CAN bus work and my BCMS started talking to the charger. I can set charger voltage and current and enable charging. Charger returns me actual voltage and current plus the status with info such as overtemperature or battery fault flags. The charger model I have is named 144V/16A but as I learned it is capable of producing currents up to 20A.
Then I worked on programming the charging algorithm which would be suitable for my battery pack. It was done quite quickly to the point where I needed to have some reliable timekeeping. So I decided to finaly implement the real time clock (RTC) into my BCMS.
The RTC is made on Maxim DS1307 chip which is talking to my main processor over I2C interface. It has a Lithium backup button battery to keep the clock running when all the batteries are disconnected.
Here is the photo of the board with the processor off

And here is with the processor on


BMS charging demo

Finally here is a short movie demonstrating my BMS working with charger to charge and balance the battery pack


At this point I will be starting to put all electronics into control box, test it and then put into the car and connect to the motor. I'll put battery boxes with batteries in the back trunk first to have test drives and tune the system. Later I'll put them under car's belly as intended.