February 2016

EnerDel's Remote Lithium Energy Controller (RLEC).

Probing

The first thing though is to learn in detail how RLECs work, how to access information about each cell and how to control RLECs. This is the only part of unknown design and there is no realistic way of changing RLEC functionality. But it may not need any fundamental changes, all I need is be able to read voltages and temperatures and use RLECs as remotely controlled switches shunting particular cells (passive balancing). These circuits are already implemented and match the battery, so I may as well take advantage of it.

There is some documentation openly published by EnerDel about RLECs including quite detail programmer's guide that focuses on CAN traffic and meaning of all the messages. But even this document probably put together by Think does not describe exact functionality of RLEC (e.g. is not created by EnerDel who designed the thing) - many passages state that "It is believed than such and such values cause no negative impact on the RLEC operation thus suggested to be used as default". Extensive testing then is in order.

What is known about RLECs is their interface pinout and comm parameters. All 16 RLEC boards in the pack are connected to a single CAN bus running at 500 kbps using standard 11 bits message identifiers. Each RLEC board is programmed at the factory to accept particular message IDs which effectively becomes its "address". This address use to be set by DIP switches mounted right on the RLEC PCB, but this function is no longer used by A306 battery and DOP switches are ignored by RLEC's software - this information is stored in EEPROM. It can be changed if desired with special software tool available at the service stations dealing with Think EVs.

So there are 16 unique identifiers each RLEC board will accept, there is no way to program more. This means for my battery I cannot put all 32 RLEC boards out of two original batteries on the single CAN bus and I will have duplicate RLECs. The only solution is to have two separate CAN buses for each string with the main controlled acting as a bridge - it will mix the data from all the RLECs to decide on the balancing strategy. Since there are other CAN devices (inverters, chargers) requiring access, there will be dedicated vehicle side CAN bus as well, e.g. my main controller is going to have three independent CAN interfaces. 

First I need to learn as much as I can about RLECs - how to access them, read voltages temperatures and status and at least send balance limits and individual cell shunting commands to them. Some documentation is available such as RLEC programmers' guide, some other had to be created. To make development job easier I bought spare RLEC board to work with and made a battery emulator - simple jig the RLEC is connected to thinking it is connected to a real Think battery module. Electrically this jig is no different than the real battery, it consists of 12 small 18650 LiPo cells in series and includes fixed and variable resistors representing temp sensors. So when the jig is plugged into the RLEC board, the RLEC does not sense any difference. The CAN interface side is connected directly to the PC via CAN-USB adapter. Before the main controller will be made, I will access RLEC using CAN explorer software that allows good visualization of what's going on. This setup works very well, so far I was able to access my RLEC board, read cells voltages and temperatures and display the result graphically.

The stock connection between RLEC and lithium cells and thermistors.
Schematic of the EnerDel battery module.
Test jig overview - very simple setup. Three of the fixed resistors representing real thermistors are replaced with variable ones so I can mimic temp change of arbitrary cells 1, 7 and 12 from +15°C to +35°C and observe changes in the software. (this jig contains 16 cells from another project, but only 12 are wired and used for RLEC testing).
Side view - I've extended the ribbon cable by about 5 cm and soldered dual row header to the end of it so I can easily monitor actual cell's voltages and resistance of my surrogate thermistors. 
CAN-USB opto-isolated adapter fitted with 120 Ohm termination block - both made by Peak Systems (Germany) - the company which also created PCAN Explorer software. Because my test CAN bus is so short (about 40 cm), I used a single termination on the adapter side only.
RLEC programmer's guide published by Think
This is complete information of all RLECs CAN messages in Excel format.
Screen capture of the PCAN Explorer environment running RLEC test. All info in CAN messages is converted in readable form on the fly.
This is an example CAN log (trace) as captured by the PCAN explorer - what you should expect when a RLEC is accessed.
This is video screen capture as I ran first test to see how well temp controls work and how my test pack reacts to 0.6 A charge current from a power supply and about 0.6A discharge current into a 50 Ohm load resistor. (Note - this is large 115MB .mp4 file, may take a while to load. If it won't play in your browser, here is zipped version for download you can play off-line)
After testing RLEC board and digging into its CAN documentation I figured all the messages it requires to start self-balancing 12 cells. Here is my virtual instrument panel graphically interpreting incoming CAN data. While I can set the balancing thresholds and RLEC will keep balancing its 12 cells on its own without any further communication to it, I will not take advantage of this functionality - it is not taking into account condition of all other cells connected to different RLECs. Since RLEC reports the lowest voltage cell it finds, all my main controller has to do is to collect this lowest voltage data from all 32 RLECs, find lowest voltage value among these and broadcast common threshold 25mV higher than that value. At least this is how it suppose to work in Think, and it will be first iteration to try by BMVCU.


As far as the hardware, the RLEC is designed around Freescale 8 bit MCU MC908GZ32VFAE packaged in 48 pin LQFP. If you're curious, this chip belongs to the M68HC08 family, it packs 2k of RAM and 32kb of flash memory which holds default parameters and of course vital CAN communication parameters such as RLEC ID acceptance filters allowing it to respond to particular messages. The CPU has got 24 channels of 10 bit A/D converters, shift registers, CAN interface and other standard periphery. Other circuits on the RLEC PCB include analog MUX/DEMUX and level shifters, some glue logic chips, transformer based galvanic isolation, vehicle side CAN interface and power supply components. There is one more 8 pin IC bridging isolation gap, but I did not want to remove insulating compound from it to find out what type it

The balancing is accomplished using conventional passive balance scheme by connecting bleeding resistors across cells. For the software development I needed to visualize shunting activity on the board itself, the simplest way to do it was to connect LEDs across each resistor (actually two paralleled resistors), but I had to have a bit more details to determine which resistor connects to which cell for proper addressing, so I partially reverse engineered the circuit from the output side. RLEC uses bipolar PNP transistors as switches to connect and disconnect shunting resistors, six channels on one side and six on another, but they are not exactly alternating. Anyway, I connected a block of 12 LEDs (staggered a bit for easier count) to the shunting resistors such that they are in order following cells 1 through 12.

The A/D resolution of RLEC's circuit (~2.44mV/bit) is sufficient but the accuracy turned out to be quite mediocre. I was surprised to discover that the difference between test voltage measured by one channel of RLEC and reported over CAN and actual cell voltage measured by Agilent 34405A 5-1/2 digits multimeter can reach over 40mV! Now, that is 1% of the full scale (see the plot below - Y-error bars represent +/-1% of measured value) and it is hard to build a mass produced (read - relative inexpensive) circuit with better accuracy, so the only conclusion I can get is that somewhere in the software there has to be calibration correction applied to raw measurements, but I would expect it to be part of RLEC's firmware. I can tell for sure that raw 40mV absolute measurement error is not acceptable, especially at the end of charge. So I decided to apply calibration coefficient to each A/D channel of all 32 RLEC boards. Since this was mainly A/D gain error, applying a single multiplier I was able to accomplish measurement error within 1 LSB (red line). I will run a few comparison tests and see if the error is systematic so the common multiplier can be used to all reported value, or it is hardware dependent and has to be stored and applied individually. This remains to be seen. I'll provide more info when all the measurements will be done.

To access raw cells with multimeter I had to construct an adapter between ribbon cable and RLEC connector that brings out all cell's voltages but applies them to RLEC input at he same time. You can see it on the photo below. Now it is simple to compare and fill in a table. Excel will compute all the correction coefficients and provision has been made in the code to hold calibration array in memory.

Test LEDs connection to the RLEC board.
Fragment of the schematic of output stage of RLEC and connection of test LEDs.
Non-destructive probing active SMT components. Electrically bipolar transistor checks out as two diodes but because such combination will have current gain of one, identifier is able to distinguish between diodes and transistors.
With bright light source behind PCB the isolation path between CAN side and cells side is clearly visible. 
Another video clip - PCAN visualizes injecting 200 mA into my test pack.
One convenient feature of PCAN is decoding pop-up window when I hover cursor over raw CAN message - this helps debugging the software: if you see wrong value, you can pinpoint bad message. Would be impossible by just looking at raw hex numbers.
RLEC Ch1 A/D error plot. Input voltage was ramped up from a power supply in discrete 0.5 V increments and two values plotted against it on Y axis: decoded value RLEC reported over CAN and actual precisely measured voltage.
This is simple adapter to connect ribbon cable from cells and thermistors to RLEC interface and fan out individual cell connections so calibration values can be determined by figuring ratio between precision external measurements and respective A/D converted values reported over CAN.


When RLEC circuit is powered up, it continuously checks integrity of cells connection by applying short shunting pulses to each cell in round robin fashion and measuring voltage changes (there should not be any difference). This can be observed on test LEDs that blink in sequence regardless if a cell is shunted or not. Shunting is done by increasing duty cycle of these pulses, it is not continuous "on". Below is oscillogram of the voltage across shunting resistors. Below are few photos and video of accessing RLEC and turning shunting resistors on and off - essentially all I need RLECs for. As I mentioned before, after receiving proper command RLECs are capable of balancing 12 cells connected to them absolutely autonomously, without any further communication with master or any CAN traffic at all.

Left side - shunt off. 10 short ~6.25 ms pulses with 75 ms period generated by RLEC for each cell to verify integrity of connection. Right side - shunt on. Duty increases to ~58 ms. RLEC does not PWM shunting pulses, it rather times them.
This video captures RLEC shunting cell 1. You can see that continuous polling of all other cells (10 pulses/cell) is still there, this background process is always active as long as RLEC is powered up.
This video clip shows test code accessing arbitrary cells 4, 5, 7, 11, 12 - I can send this command from BMVCU by pressing a button on the LCD interface unit. Granted, in real life the balancing algorithm will take care of choosing cells to shunt, here was just a test to make sure I understand how to talk to a RLEC and turn on/off individual shunts.
This clip shows autonomous balancing executed by RLEC's firmware. Monitoring actual voltages allows to guess how RLEC chooses to shunt, but much depends on the limits sent to it over CAN (55 MB file, may take a while to load).

I've done quite exhaustive testing of RLEC, and by now figured everything I need to be able to take advantage of it, including re-assigning its ID - few bytes command to do it is far easier than swapping out individual RLEC boards in the pack. I need this since the RLECs are daisy chained in a very different way than it was done in Think's A306 battery. But hope this page gave you pretty good idea what EnerDel's Remote Lithium Energy Controller is and what it does.

Next - how to turn on relay.

Home of the project


1 Sorry, there won't be detailed schematics, code or plans to just duplicate the design - unfortunately due to attempts to copy my designs for commercial purposes this is no longer offered. Another reason is utter technical ignorance of some people out there who tried to use hardware I supplied (whether my own designs or OEM), ruined it, and promptly published review blaming everyone for their failures but themselves. Thanks to those, unfortunately I have to limit distribution of detailed technical info to only qualified OEM engineers who are welcomed to contact me if you want to engage in technical discussion or have a project on hand you need assistnace with. Let's leave it at that.