Tuesday, June 30, 2015

It's been a while... Small Improvements

Bad Luck

The Motenergy ME0913 motor started making a strange sound one day.  Kind of a brushing sound at low speed.  Careful listening indicated it was coming from the center of the motor.  Upon removing the fan cowl, a small bolt fell out.  It appeared to come from inside the motor.  Then with a flashlight, I saw a second bolt sitting on the interior coils.  This raised the mystery factor even further.  Then looking into the motor, I could see two empty holes in the center rotor where it attached to the hub that secured it to the main shaft.  There were still two bolts in place.  These are M6x12 flat head Philips bolts.  Well with a tweezers and a screw driver and some thread lock, two new screws went back in, the other two were tightened and the motor re-assembled.  Good advise from John at Motentery to not pull apart the motor housing/casing without first marking the alignment between the two halves since this assures the coils are aligned.  Luckily, I didn't have to separate the casing.

This reduced the brushing sound but there is still something not right.   One of the bolts that was fairly bent up and I suspect it dislodged one of the magnets in the rotor which is now rubbing as it spins.  Not too terrible sounding but not quite right.

Good news

Well with the motor back together, the timing advance circuit is working very well.  Currently, the circuit is advancing the timing from the motor as follows

<300 rpm - 0 degrees
300-600 rpm - 10 degrees
600-1200 rpm - 20 degrees
>1200 rpm - 40 degrees

This is in addition to some mechanical advance achieved by rotating the fan cowl.  The mechanical advance is limited to keep reverse functional since electric reverse is a nice feature for EVs.

The motor is running smooth but the 20-40 degree shift is barely detectable as a slight motor miss.  The next goal is to add a few more steps to lessen the amount of incremental shift per rpm band.

Regen

After some additional testing with regen, it has become evident that variable regen is a must and the best way to control this is tying into the braking system.  Found this stainless steel 500 psi pressure switch:
 stainless steel 500 psi Pressure transducer or sender for oil/fuel/air/water

The goal will be to tee this into a brake line and use it to signal the magnitude of regen for the Kelly KHB 72701 controller.  Using a switch on the brake pedal was too jarring since the controller was all or nothing with its regen efforts.  With this transducer, a 0.5V - 4.5V signal will be provided to the controller indicating the level of break pressure being applied.  By tweaking the controller, it should be able to supplement the mechanical brakes quite well and transparently.

Saturday, February 7, 2015

12V System Enhancements

12 Volts

After the challenges with the traction battery pack, I also noticed that the 12V-120V inverter that powers the cooling fan for the main motor was shutting off when the 12 Battery would start to sag below 12V.  Jane had a larger starter battery (the original from the the gas days) powering the 12V system along with 220V-12V charger to top it off at every charge.

However, under full loads, the 12V battery would run down and thus cascade into other problems.

Upgrades

First was to replace the 12V Starter battery with a DC-DC Converter that would step down the 84V traction battery to around 13V.  After checking the current draw of all of the 12V subsystems (headlights, blowers, radio, wipers, horn, driving lights, BMS) the maximum draw if everything was on at once would be approximately 30A or about 360W.  To provide plenty of headroom, I selected the Meanwell SD-500H-12


This is a 500W 40A DC DC converter that costs around $130.  It is not sealed, but since it will be in the Jane's truck, there was no concerns about dirt or moisture.  

To provide power for the radio when the ignition is off, a small 12V AGM 4.5AH battery is used.  The radio pulls about 3mA when off to maintain the settings, so this will run for months with issue.  Also, it is important that the hazard lights be operational when the key is off along with the horn.
After connecting the system, there was about a 50mA draw on the battery when everything was off which was traced to the DC-DC converter.  Apparently, it has a small load on the 12V battery side even when off.  This necessitated adding a 40A 12V relay between the DC-DC Converter and the rest of the 12V system.   This relay engages when ever the DC DC converter is active.  50mA equates to about 1.2AH per day so the 12V battery would have been drained in 3-4 days.  My goal is to be able to leave the car idle for at least a month without having to disconnect systems.

Also, to control the DC-DC convert, another contactor was added on the high-voltage side.  This contactor is activated anytime the BMS is on (running, charging or manual switch).


Testing

So once everything was connected back, it was time to test.  First just one system at a time.  The core electronics pull about 10A on the 12V system (Cooling blower, controllers, dashboard).  Then adding one system at a time:  Low beams (5A), wipers (4A), heater blower (4A), horn, hazard flashers, BMS (1A).  The current draw peaked at about 28A, well within the comfort zone of the DC-DC converter.

Benefits of the new setup:
1) Weight reduction - The old starter battery weighed about 30 lbs, which in a 1,000 car is 3%.  The new battery and DC-DC converter weigh less than 5 lbs so this should result in a small improvement to the running of the car.
2) Reliability - Since 12V system is now powered by the traction pack, it's run-time is directly linked to the overall run-time of the car.  
3) Proper Voltage on the 12V system.  A standard lead-acid starter battery has a resting voltage of around 12.6V but under load and given the losses in a car, at the fuse panel, the voltage was never much above 11.5V as shown on the dash volt-meter.  The DC-DC Converter is adjustable, so it is set at about 13.5V which is ideal for charging the AGM battery and yields about 12.9V at the fuse panel. This results in brighter headlights and the Blower Inverter having plenty of power.  

With this and the replaced LiFePO4 cells, I went for a test drive last night and everything looks to be operational.  Next steps - Finish up the timing advance system and rebalance the traction pack since it seems to be a bit off but with the relay boards providing full isolation, at least it should not drift out of balance any further.

Side Note: The DigiKey Scheme-It schematic design tool is really easy to use.  It is intuitive and flexible.  I am in the process of capturing an overall schematic for Jane and will post it here once done.

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.

Tuesday, July 29, 2014

Regenerative Braking Refinement

After a little experimenting, the regenerative braking settings seem to be dialed-in.  Currently, the Kelley KHB 72701 controller is set at 10% braking upon throttle release and 25% braking upon brake switch activation.  The brake switch is wired to the standard brake lights so a slight touch of the brake pedal will raise the braking power limit to 25% from 10% when the gas is released.  This % is the percent of the controllers maximum current (700A).  So far I only observed a maximum of 1500 watts of regen power and that only lasts for a few seconds before the car has slowed.

These settings provide reasonable engine braking and normal braking levels for coming to a stop.  It seems the braking power is proportional to the speed which makes for a smooth braking experience.  Since the voltage generated by the motor is proportional to the RPMs of the motor, as the car slows, the voltage drops reducing the amount of current that can be generated by the motor-controller.

The 10% throttle setting also allows the braking to come on slower than jumping right to 25%, which was jarring.

The Arduino on the dash is now reporting both power consumed (watts x time) and regen power.  It looks like with my normal city commute, regen is providing about 5% back to the batteries. Not a lot but with a 25 mile range this is maybe a mile extra for a full charge.  I guess regen is really more psychological and mechanical brake-saving than real range extension.  It is a fun thing to talk about...

Thursday, July 17, 2014

500

A milestone or is it a kilometer-stone...

With the odometer working, it is much easier to see total electric distance.  Well today, Jane hit 500 electric-KM.
This is significant since it has been 500KM without a mechanical issue.  Next goal.... 1,000KM

Electric-Regenerative Braking

One of the interesting characteristics of electric cars is their ability to recapture some of the energy that would normally be lost to braking and use it to recharge the batteries.  A key reason to use an AC (PMDC) motor is they are ideal for regenerative braking.  Previously, the regen function was set in the Kelly Controller (KHB 72701) to start when the gas pedal was released.  However, with the desire to be able to shift gears while rolling (and the lack of clutch), I realized that if the motor was braking, it put back-pressure on the drive train which made shifting impossible.  Also, the brake lights would not illuminate while regen was active which may have been confusing for other drivers, since Jane was slowing but no brake lights were on.

The Kelly controller supports having Regen start upon the grounding of the brake-sw signal.  So a simple 12V relay and a few wires later, the brake-sw signal is now grounded when the brake-lights are activated by the brake pedal.   This give the driver complete control.  To coast or shift, simple take your foot off the gas and the motor free-spins.  Shifting from 2nd to 3rd or 4th is easy since the motor has little momentum.  When the brake pedal is pressed the controller turns on regen braking and starts to put charge back in the batteries.  The braking is currently set at a 15% current limit or about 105 amps.  This results in soft braking right as the brake pedal is pressed and before the mechanical brakes start to engage.

The Arduino Mega digital dash reports that initially ~1200 watts are being generated through regen and this decrease as the car slows.  @ 15% the onset is not too jarring yet the rate of deceleration is reasonable for city driving.  This will save the mechanical brakes and provide a little charge back to the batteries.
A small code addition to the dash added a counter to display total watts from regen along with total watts from normal driving.  This will provide some information about of the range benefit from regen.