Tuesday, November 25, 2014

CellLogs 8M and Current Draw

Getting to the bottom of the imbalance

The CellLog 8M is a great little device for $15.  When configured properly and wired up, they can provide both HVC and LVC alarming.  However, their front-end design though clever, leads to some severe current imbalance (draw) from the cells.

Currently, the confirguation is 7 cells connected to a CellLog, set to alarm at 2.5V and 3.5V and if the pack goes above 25V (or below 21V though 20.5 may be a better set-point to detect Cell #7 is disconnected: 7 x 3.3 = 23.1, 6 x 3.3=19.8, and 7 x 2.5 = 17.5.  The trick here is to alarm under 6 cells with no load but not under nominal load with 7 cells.

After measuring the current draw from each cell with both the the ground (Pin 1) connected and disconnected, here is the data in mA.

Pin Cell #(+) Pin-1 On Pin-1 Off
1 Cell 1(-) 33.00 0.00
2 1 0.03 0.30
3 2 0.04 0.26
4 3 0.03 0.22
5 4 -13.00 4.40
6 5 -0.03 0.03
7 6 0.38 0.45
8 7 -20.00 -5.00

From this data is became obvious the CellLogs are shuttling current between the different packs.  This CellLog as the D4-D5 current mod connecting Cell 7/8 to Cell 5/6 internally. I ran the same test with an unmodified (hacked) CellLog and the Cell 5 and Cell 7 currents were unchanged.  The one strange thing is the modified CellLog Mod powers up even with Pin 1 unconnected.  There appears to be insufficient power to fully boot up the device and make measurements, but the back-light does illuminate and the text is visible on the screen, though all of the voltages show zero on the screen.

The off-state current is the most worrisome since the device spends 95% of the time off (23 hours out the day).  So a 7mA draw for 95% of the month equates to about 5AH per month of imbalance.  Way too much and this explains why after 6 months, I was seeing a dramatic difference across the 60AH cells.  The 5% of on-time imbalance will still result in 0.7AH of drift per month or 8AH per year.  This is close to 10% of the pack capacity so perhaps annual balancing is the best strategy for now.

Without a full schematic for the CellLog it is tough to understand if the current deltas are a result of relative voltage levels or if it is a function of the overall design.

Next Steps - Full isolation while off, not just turning off Pin-1.  
Using 2 of these will allow for full isolation for the battery when the not charging or running.

Sainsmart 16 channel 12V relay module

$20 per 16 channels - 2 boards will provide full cut off of the 27 signals, though it probably isn't necessary to switch the ground, but for the sake of completeness and since there are extra channels, I go ahead.  There is not need to rebalance the pack until the isolation system is up and running, so until then, it will be prudent to just limit driving range and frequently check the cells.


Sunday, November 23, 2014

BMS and the CellLog

It is tougher than it should be...

The other day I was driving back from work and the battery alarm started going off.  Now this was just after I had rewired the battery monitor cables to CellLogs so I thought there must have been a bad wire somewhere causing the alarm and that the batteries could not be alarm since I had just charged them this morning and it had only been about 3 miles.

New harness setup....


Turns out the alarm was working just fine and the pack had become so imbalanced that a few of the cells were barely charged.

Here is my best guess of what has happened.

1) The CellLog interface board from Electric Porsche opens up the (-)negative on the first cell in each subpack.  This shuts off the CellLogs but there is still some residual draw from the other cells (besides #1).  A quick measurement and measured 30mA on the Battery 1 negative.  Others have reported in this range with about about 0.5mA when off on most of the pins except battery 1.

2) From the factory, the CellLogs treat batteries 7&8 differently and don't pull current from them to power the CellLog itself, only for measurement purposes.

Proof of the problem.

1) The 26 cell pack is divided into 2 six cell and 2 seven cell subpacks
2) On all 4 subpacks, cell 5 is consistently the lowest OCV (open cell voltage) cell and #5 were all alarming during the earlier drive.
3) On the 7 cell subpacks, #7 is the highest OCV.  Using a CellLog 8S (which logs voltages over time), I monitored a recent charging cycle and here is what it looked like.  Clearly near the end of the charge cycle, Cell 7 is becoming full and triggering the charger to shut-off before the others have a chance to top off.  The data at the beginning of the graph is from driving around a bit.  Cell 5 is the lowest line.
4) After draining the 2 #7s a bit, all four #1 cells were reporting at the highest OCV.  Please note that the packs are fairly well balance and there is only a 20-30mV difference between the highest and lowers cells.


Some Math....

No Driving Scenario

1) Cell 1 current draw=0; rest of cells current draw = 0.5mA.
2) Over 6 months (180 days) = 2.2 AH of difference.  In a 60AH battery, this is about 4%.  Not a lot since I am trying to run the batteries between 10%-90% of the operating range.
3) I think this explains why the #1s are all reporting a little high, but not a lot.

While Driving

1) Celllog pulls about 30mA while operating, this is divided amount the first 6 cells, is 5mA/cell.
2) Assume driving for 1 hour/day for 100 days.
3) this equates to about 0.5AH of difference for Cell 7 which is not see a draw.

Plan going forward

1) It appears that simply opening up cell #1 in each subpack is not sufficient to limit the CellLogs slowly pulling the pack out of balance.  
2) Modify the two cell logs to add the D5-D4 jumper to help balance the draw from Cell 7.
3) Create a new CellLog board which completely isolates the CellLogs when power is off.  It will have 8 4PDT relays which will only energize during driving and charging.
4) This will also allow a optimization of the charger cut-off circuit by integrating with the rest of the CellLog interface. 

BLDC Timing Advance Update

The timing advance circuit is working well.  Lots of tuning lately and finally landed on a advance scheme that is smooth yet provides the additional boost above 1,000 RPM.  Noticeable current decline when the shifter is timing phase activated 

BLDC Motor Timing

BLDC Motors and Timing Adjustments


BLDC motors have a timing adjustments which governs how the controller relates the hall sensor signals to managing the commutation of the drive voltages.

The internal combustion engine (ICE) analogy is close but not exact.  Most distributors (or ignition systems) will vary the timing of the spark based on the speed of the engine and possibly the load (vacuum advance).  The theory being that as the engine speeds up the spark needs to occur earlier in the combustion cycle so that the fuel combustion has time to prior to the Top-Dead-Center (TDC) or the optimal combustion point.   This adjustment is done either electronically or by mechanically rotating the distributor so that the spark is advanced relative to the piston position in the cycle.

With BLDC motors, there is a similar situation, especially if the controller is not designed to advance the timing as load and RPMs increase.  The Kelly KHB72701 does not have such capability where controller costing 2x-3x more do.

After some mechanical testing by rotating the hall sensors mounted in the fan cowl of the Motenery ME0913 two observations were made
1. The motor ran quieter and smoother at lower RPMs
2. At higher RPMs (2K-3K), there was more power available as evident by better acceleration in the 20-35 MPH range in 3rd gear.  This an only be explained by increased efficiency of the motor.
3) In second gear, a top speed increase was observed, increasing from 31 MPH to close to 36 MPH.

The physics behind this is simple:  By energizing the phase coils when the rotating magnets are at the optimal point, will result in the maximum torque being generated by the motor for a given current. Energize too soon and the generated field is opposing the magnets,  Energize too late and the magnets are past their optimal position and thus some of the field is wasted.

The challenge comes in how to best control this timing across the operating range of RPMs.

As inspiration, I saw the board Burtie created called Timing Adjuster which does the necessary phase shifting of the hall signals with great success.  It is a excellent device but he has sold out of the units.  This lead to the need to create one from scratch.

Interface Circuit


This was built on the Uno Prototype shied and placed in a project box along with connectors to intercept the  timing signals coming from the motor to the controller.  A KiCad version will be coming soon.

ChipKit Uno32



Optimal Timing

The software running on the 80MHz Uno took a while to refine and optimize and ended up being fairly straightforward.  The code need to be fast enough so that the board could shift the edges of the timing signals a few microseconds.  Though the absolute shift is in 100s of  microsecond ramge. the board still need to be able to effect the transitions with reasonable accuracy.  In the end, the board is reporting about 1 microsecond accuracy based on loop time with the ability to change the shift time every 10,000 cycles (~10 ms).

Getting the timing right has been a interesting challenge.
1) There is about 2-3 mechanical degrees of shift in the motor's cowl which probably equates to about 10% electrical shift.  Kelly reports the motor has a 6 degree error tolerance, so absolute shift is not know.
2) The shifting scheme is the following
- No shift below 1,000 RPM
- Starting at 1,000 start shifting toward a 30 degrees electrical advance.  Using a smoothing algorithm, this ramps ups slowly and hits about 30 degrees around 2,000 RPM.
- A switch on the dash allows the driver to select different shifts ramps and turn of the shifter all together.
3) The only feedback is a rumbling that is audible with the timing to too advanced.
4) Testing will continue to seek the "best" curve for shifting across all RPMs.
5) Special Note.  When shifting is employed, it also improves the efficiency of the regenerative braking, so the braking had to be turned down since it was quite abrupt at the high phase shifts.  It may be worth trying to link the accelerator switch to the timing shift to turn off all shifting when the accelerator is released and braking starts.  The assumption is the timing will be able to adjust back quickly (currently adjustments are made every 100ms or so) so the driver does not perceive this change.