Page 1 of 1

Bruce Armstrong's BMW E30

Posted: Thu, 24 Jun 2010, 16:30
by bga
Welcome to my project.

The plan is to convert a BMW E30 sedan from its current decrepit ICE power plant to an Induction Motor, using my home baked IM controller and 512V (160) of Sky Energy 40AH cells.

Parts inventory:

. 1985 BMW E30 Sedan, Champagne colour

. 18.5KW ABB IM, re-wound for 220V operation

. 2 x Elcon 312V 2KW charger

. 160 x SE 40AH LiFePo Cell

. Motor controller (600V/300A 3-phase)

Basic task list:

. Purchase big ticket items

.     (car, motor, battery, charger, accessories)

. - mostly complete

. Refurbish and re-license the host vehicle

. - in progress

. Design and build BMS

. - in progress

. Design and build Motor controller

. - in progress

Current works:

Building battery modules.

Bruce Armstrong's BMW E30

Posted: Thu, 24 Jun 2010, 16:40
by bga
Refurbishing the Host vehicle

I want to get the vevicle re-licensed before starting the electrification process so that its test-drivable when the conversion is underway, also less things to check when the conversion is finally inspected.

It's surprising (not really) how many things need to be fixed on an old car to bring it back to a roadworthy state. At present the project looks like any car restoration project - lots of spanners, spare parts and degreaser and a bit of black chassis paint.

So far:
Lower control arms, tie rod ends. (used control arms)
Front brake disc rotors. (new rotors)
Rear wheel bearings. (new bearings, but needed subframe being removed)
Rear brake disc rotors.
Drive axle CV boots. (new boots)
Driveshaft. (Its annoying that BMW didn't make the bearings replaceable in the Uni joints, so I'm just lubricating it and reinstalling it for the time being.)
Motor rear main seal and clutch release bearing.
Front seats (loose screws and seized track rollers)
Drivers seat belt. (slightly frayed)
I installed a LHS seat belt in the inertia reel.
Minor body rust around boot lid.

it continues...
Gearbox - this is a throw-away part, but necessary to get it relicensed.
The original had a dead input bearing - a composite ball/roller for the 5th gear loads. The cages disintegrated and the rollers got loose in the ball section of the bearing. The small amount of remaining oil came out looking like metallic paint - a lot of metal in it.
$300 later and another gearbox only needing a little modification to make it fit and that problem was solved.

Rear Axles -
These were a bit of a surprise, the bearing re really small, really just a double row ?ball? race, about 75mm diameter and 40mm deep. It looks far too small for an axle bearing.
The wheel was a bit wobbly, no worse than some front wheels I've seen, but while cleaning up the rear brake assembly, the bearing collapsed completely and nearly fell off the axle. I had the BMW wrecker/workshop install new bearings on both sides. It looks like any play in these bearings is a sure sign of a looming problem.

Regrease the CV joints, change their perished boots and reinstall everything with a home made driveshaft install tool made from a ground down spare BMW driveshaft nut.

March 2011 update:
De-rusted the boot and boot lip so it seals properly. Repainted to original colour.
There was a sizeable hole near the latch inthe middle of the boot. This probably started out as a small scratch, but evolved into a 32 x 50mm aperture which would definitely fail the relicensing test.

I have pulled the retractable roof panel out to inspect its surround for rust and check the drain plumbing. Also to make it the same colour as the rest of the vehicle.

As you can guess by this dates above, I have been in no great hurry to get the car relicensed. I would like to do this before startng the conversion so that threre are fewer issues post-conversion and it's possible to test drive it a bit during the conversion.

Bruce Armstrong's BMW E30

Posted: Thu, 02 Jun 2011, 17:59
by bga
Battery Manager -
This seems to be a right of passage with AC projects, possibly because the high voltage ones have complex batteries with a lot of cells, 160 x 40AH in this case.

The battery manager is in two parts:
a) cell top manager.
This is in the form of pairs of cells with a processor and slave PCB on the cells. I did it this way to reduce the number of processors and opto-couplers and also allow the processors to be powered by two cells in series, so a severe voltage sag on one cell won't compromise the processor and loop.
Each cell terminal also has a temperature sensor located near to it on the PCB.
The cell processors communicate using an opto-isolated serial loop.
The shunt (bypass) capacity is approximately 800mA

b) Cell host processor.
There are several of these in the battery, each manages up to 20 or 30 cell top processors, so there will be about 6 in the battery. This polls a loop of cells using a low latency 9600 baud asynchronous protocol, allowing a poll of 50 cells in approximately 50 milliseconds.

The host processor has RS485 communications to higher level display and managers, as will as relay outputs to allow low level control over the battery charger and motor controller.
The relay outputs are:
- Undervolts
- At least one cell in shunt bypass =~ reduce charge current
- All cells in shunt (bypass) =~ charge complete
- Blower run = high cell temp or shunt resistors on

Below is a pic of the PCBs during first assembly testing.
The board on the left is the host processor and
The board on the right is the pair of cell processors, still joined by a 'v' groove cut.

Early stage testing - so far so good

Bruce Armstrong's BMW E30

Posted: Fri, 03 Jun 2011, 04:32
by coulomb
bga wrote: Battery Manager - This seems to be a right of passage with AC projects
Amen, brother!    Image
The shunt (bypass) capacity is approximately 800mA
As a point of interest, how many resistors share this load? What size/power?
The relay outputs are:
- Undervolts
- At least one cell in shunt bypass =~ reduce charge current
- All cells in shunt (bypass) =~ charge complete
- Blower run = high cell temp or shunt resistors on
Wow, that's comprehensive. There must be quite a few wires for each cell.
Below is a pic of the PCBs during first assembly testing.

BGA, I see a lot of components near some of the terminals. Have you left enough room for cable lugs? Or do you design your packs so that the lugs never end up at the more crowded terminals?

Finally, it looks like with your design each battery box has to have an even number of cells... is that right? Or could a slave be in a different battery box its processor containing buddy?

Bruce Armstrong's BMW E30

Posted: Tue, 07 Jun 2011, 01:56
by bga
Hi Coulomb,

I've loaded up some of the PCBS. All fits resonably well:

As they say: one picture is worth a thousand words, so here it is:

Only two for the three cell pairs have their resistors installed.

I am going to install M6 x 25mm studs in the cells and secure the straps and lugs before installing the BMS boards. The nuts and washers should provide enough clearance for all of the cell top components to sit under the PCB, where they are relatively safe. This also gets away from the hump in the straps. At worst, two nuts will be needed.

I used 5mm LEDs is because I have thousands of them left over from LED signage projects, therse are high intensity types.
The cell boards have two general purpose and two for the shunt resistors.
The GP leds will likely be
GP1) Sleep and IO data
GP2) Fault code (Morse??? ._ _... _._. etc )

The idea behind pairs of cells was that a voltage crash below vmin on one cell would not comporomise the monitoring system. For an odd number of cells, the processor half of the cell pair can be used with some jumpering to eliminate the regulator. The PIC I have used will operate between 1.8 and 5.5V, although the ADC sensing will be affected below 2.5V.

This arrangement reduces the number of processors, optos and cabling, but gains a 10-way ribbon and and sea-moss op-amp to sense the second cell voltage.

The ribbon cable, I am relatively happy with. It shouldn't get melted by the resistors, especially with a bit of forced air during charging.
I have used this type of cabling previously, with good durability and reliability. Perhaps the strain relief clip should be installed to lift the RC further above the resistors.
The straps can be used either left-handed or right handed, depending on arrangement of the battery, the arrangement shown makes the serial data cables tidier.

Unless the next cell is very close, I wouldn't split the pairs with a long ribbon cable, but they should be fine to 500mm or so.

The resistors are 10 ohm/5watt ceramic blocks from Altronics. There is some lattitude to move them away from the ribbon cable strap. I'll use a blob of silastic under them to reduce fatigue issues on the leads.
They can pulsed to reduce the current, but I hope not to have to do that.

So far, it all seems to work. I haven't checked the RS485 on the host yet, but it was copied form another project, so the risk is low. Most of the holes in the PCBs are the correct size, with only the host's polyfuse not fitting - Can use a smaller one here.

Please ignore the loop connectors on the rear of the host board, I ordered the wrong ones. Will put the (huge) blower relay in after these are fixed.
(The PCB will also take the same type relay as the three at the front for low current and low-profile)

The two connectors on the front of the host board form a loop-in loop-out arrangement to facilitate connecting the host pcbs in series. The front relay contacts can be selected as normally closed (NC) or normally open (NO) to make the serial wire logic work correctly. I haven't decided whether or not to run the relays normally energised so that a host board failure will cause a fault condition.

The idea here is that the battery charger can be controlled by the relay contacts on the host boards without need for another control system in between. I will need to make an isolated driver for the analog control input on the Elcon chargers (2), maybe inside the charger itself.

Same for the motor controller, the Undervolts and Bypass relays can be used as a panic limit signal for the controller.

The host board is fed from the vehicle's 12V supply and has an ambient temperature sensor so that the cell processors can be given an ambient reference for their overtemperature sensing.

The boards are a bit complex - there's about an hour in each cell pair at present. I expect less with some practice, I've only made a dozen pairs of the 80 needed.

Now that I have some hardware, it'll be on with the firmware. I have test applications that can do Serial I/O and read the analog inputs etc for both, so it's not the entire mountain still to climb.

Then on to the controller, at least there's only one of those to make!


Bruce Armstrong's BMW E30

Posted: Tue, 07 Jun 2011, 05:53
by Richo
bga wrote: The idea behind pairs of cells was that a voltage crash below vmin on one cell would not comporomise the monitoring system.

I came across the same issue and also thought about paired monitors.
The down side for this was if the traction cable was disconnected (in a fault condition) between the paired cells if the high currents tried to force through the BMS.
But your design may be different and may not see this problem.
bga wrote: The boards are a bit complex

wow - looks like they have all the bells and wistles though!
My poor headway cells have no room for most of that Image
38mm Diameter with a hole for an M8 pan head in the middle.
I have been watching Doctor Who for some design ideas from the Tardis Image

Looking good Image

Bruce Armstrong's BMW E30

Posted: Tue, 07 Jun 2011, 15:10
by weber
Thanks for sharing. Obviously a lot of work has gone into this.

Our MSP430 processors are only specced to operate down to 1.8 V too, but in practice we find that they work down to 1.53 V, including ADC, at the low clock frequency we're using (4 MHz). They have a 1.5 V ADC reference.

Of course no visible LED will light with 1.53 V, but the IR LEDs in the optos still work, and we use a voltage-doubling trick with differential outputs, a diode and a cap to drive the red LED for the optic fibre.

Clearly yours can keep working a lot lower than 1.5 V, but I expect the cost of the op-amp and ribbon cable components (even ignoring labour to assemble the cables) is greater than a second (smaller) micro.

We've written our firmware so it doesn't require the master to transmit anything for the basic alarm functions. Any module that doesn't hear from a preceding module for a certain length of time, takes over the job of the master, in periodically sending a byte that indicates its level of distress and prompts the following modules to replace it with theirs if theirs is higher. And if this temporary master has an ID number other than 1, then the fact that it has been forced to become the master, is itself a cause for distress, and it reports this along with its ID number.

Bruce Armstrong's BMW E30

Posted: Wed, 08 Jun 2011, 21:43
by bga
All the extra parts for temperature sensing etc definitely make this a bit more expensive than the micro per cell versions.

I went for a ribbon cable in the end because I was concerned that using a flexible PCB link may result in fatigue issues between cells and the soldered in SIL cable (as used in cheap 3-in-one stereos) I originally wanted to use was really hard to source. Nothing less than 10K pieces.

On the voltage crash front, I would expect that this would only be the result of ignoring the early warning signs that a smart battery monitor can detect.

The TS-type LiFePo cells should never get below about 2.5 volts unless faulty or being abused, so I would expect that cell voltage crashes will be a rare condition that will probably be accepted and then ignored in favour of getting home where the battery problem can be dealt with.

The idea here is that cells normally don't just fail, but there is a period of increasingly degraded operation leading up to the failure. The BMS should be able to detect this pre-failure behaviour and report it so that preventative maintenance can be undertaken.

For early warnings, I would like to be able to poll for minimim cell voltage, say a histogram of minimim cell voltages, say in 0.1V buckets between 1.5 and 4.0V. With 160 cells in the battery, statistics like outlier analysis should work well.
A means of tagging the outlies is also needed, say a poll that collects outliers, given a range limit.

Initially, I will use a laptop to occasionally query the BMS and then develop an on-board system that can do this. I don't want the project to be held up by the need to get a complex top-end running before the vehicle can be used.

I think that the host processor is a rough equivalent of the self-alarm function you describe. Because the host board carries the means of propagating the alarm signals, there is no need to have the cell top processors do any panic if the host isn't present.
I was going to use the lack of polling signals to trigger a powerdown to sleep to reduce the current consumption. In this sleep mode, the PIC and (powered down) temperature sensors only draw about 1uA, so the dominant current is the 100Kohm cell voltage divider resistors at about 80 micro-amps.

100uA = 400,000 hours to flat, or about 0.18% discharge per month, or 1/15 the intrinsic self-discharge of the cells. Sleep mode may not be needed.

My experience with PICS is that they are very reliable and never fail to run if VCC is present. The host board power supply is well protected from the 12V battery by diodes, fuses, electro caps and a 7805 regulator. It's an EV so no cold cranking dips to 4 volts!

The other behavior that I think I need is a way of latching and clearing the end of charge signal because the cells will drop out of bypass once the charger shuts down, signalling a resumption of charging.

I think the way to handle this is to latch the 'charge complete' (all in bypass) signal in the host boards so that, once this is achieved, the charger stays stopped and a green 'GO' lamp can be lit. This can be cleared by power cycle on the host boards or a software command over the RS485 bus when there is more controller in the vehicle.

Bruce Armstrong's BMW E30

Posted: Tue, 14 Jun 2011, 06:48
by bga
Well, that was an exciting weeked...

Built a BMS tester, or a box with +/-12V input and a pair of emitter follower regulators to supply 0-5V on each cell lead to simulate the battery cells. 5V is more than the cell maximum and was used to check the operation of the difference amplifier on the second cell, to ensure that it didn't limit anywhere and produce dodgy output.

I was able to experiment on the low voltage tolerance of the PIC processor. The PIC is OK to about 2 Volts, where it looks like the oscillator (4MHz Xtal) dies and the brownout detector goes off. This corresponds to about 1.25 volts per cell, so well outside normal operation.

There are now 40 BMS modules (80 cells worth) partly built except for the power resistors, which will be installed after testing so that the boards remain accessible on both sides.

While assembling the boards, I was thinking that the sensing divider resistors may be a bit too low. The quiescent current is high enough that it produces a modest imbalance on the cells because the lower cell has additional voltage dividers across it. The effect isn't very big, but does amount to about 40 seconds of 800mA bypass time per week.

I did a trial assembly of the inter-cell straps and BMS to confirm the clearances against the PCBs. There looks to be plenty of clearance with a nut and washers between them. I'm using the copper multi-leafed straps with a shallow hump that are usually sold with Sky Energy Cells. Unfortulately, these are for 60AH cells so will need re-dilling to move the holes for the 40AH TS cells.

Now to get the software into a useful state.

Bruce Armstrong's BMW E30

Posted: Sun, 03 Jul 2011, 06:09
by bga
Testing times...

I've given up for the evening to briefly concentrate on preparing for an orienteeirng event tomorrow, by programming the event computer, hitching the potra-dunny up to the car and organising something for the cake stall. Usually this only involves getting motivated and out early in the morning. The joys of occasional administration.

Back to today's fun and games.

My binary BMS communications protocol is working well and is being used to test the operation of the BMS PCBs. The software for the BMSses is abouy 75% complete, but need some more exhaustive testing to prove its reliability.

I have built up 80 BMS board sets, enough for 160 cells and have been working through these, testing the basic operation of the units using a test version of the software. The production software will be loaded in a repeat exercise sometime before assembing the battery packs.

My forgetful and occasionally crappy hand SMD soldering has been the biggest issue with virtually all of the problems related to dry or forgotten joints. It's progressing and I have enough tested boards for about 1/2 the battery now.

Bruce Armstrong's BMW E30

Posted: Sun, 03 Jul 2011, 15:05
by coulomb
In an earlier post (I forgot to reply when I first read it):
bga wrote: I'm using the copper multi-leafed straps with a shallow hump that are usually sold with Sky Energy Cells. Unfortunately, these are for 60AH cells so will need re-drilling to move the holes for the 40AH TS cells.

We got about 20 of the longer straps in our delivery as well. I assumed that these were for connecting cells along the 116 mm axis, rather than the 46 mm axis, but it turns out that normal straps for the 60 Ah cells (50 or 51 mm spacing) would be the same length. So they are probably just 60 Ah straps that were inserted by mistake (they look much the same at first glance).

It's good to hear that your BMS is coming together.

Bruce Armstrong's BMW E30

Posted: Thu, 07 Jul 2011, 18:33
by bga
The crappy hand soldering had largely disappeared in the second batch of 40 sets, with almost no defects. A bit of practice and more 'system' in the assembly helped a lot. One set of LEDs in backwards and a few dry joints.

There have been a few funnies, though:
There is about 0.2V of noise on Cell2's voltage reading. I need to scope this some to see what's going on, possibly my sleazy tester's power supply.

Not all of the processors powered up consistently. Sometimes, the bypass resistors are jammed on (!! urrk), but respond to the port direction control and data being reset by a link command.
There seems to be someting odd going on around the bit set/clear instructions.

Occasionally, the ADC channels don't get set up properly and Cell Volts 1 doesn't get read. (???)

I think a code audit and some experiments to reporduce the pathology is in order. It is possibly uninitialised memeory partly to blame.

I have yet to put the power resistors in and complete the production firmware, so the next run through will be good for testing the solutions to the above. Some fault monitoring is also needed. (does this mean a fault counter and an 'exception report' poll?)

As TS doesn't usually come with straps, the straps I got were an assortment. The most common version is the triple leaf with shallow hump version, probably from a SE 60AH cell.
The copper area (11 mm^2 per leaf) in these is such that two are sufficient for 40AH cells. Drilling and re-arranging into pairs should yield sufficient for the battery.

I estimate the average current will be about 15 amps at 60kph and 40 Amps at 100kph, so not much copper is needed most of the time.

It may be time to set up the TIG I borrowed and try some Alum Welding in preparation for making battery enclosures. (Diagonally braced 3mm alum 'T' and 'L' sections mostly, I think -- some loading calcs to do)

Another item is to drag the motor into the garage and look at what can be done to reloacate the terminal box so that it won't hit the mouth of the transmission tunnel.

I will know if the stator is reversible on the motor shortly, otherwise it may be an ugly hack to chop the terminal box off and extend the stator windings to the rear (of front) of the motor. Whetever it is, the motor won't get butchered until it is essential.

Also to add is an Airconditioner pulley, rotation sensor and re-arange the end cover and external fan.

Bruce Armstrong's BMW E30

Posted: Tue, 12 Jul 2011, 02:34
by Johny
bga wrote:I will know if the stator is reversible on the motor shortly, otherwise it may be an ugly hack to chop the terminal box off and extend the stator windings to the rear (of front) of the motor. Whatever it is, the motor won't get butchered until it is essential.
God I've been there - mine wasn't reversable - it looked like it was but the inside diameter of the drive end was 6mm larger. I ended up with a custom butchered terminal box - see blog (on the right select 'terminal box').

Bruce Armstrong's BMW E30

Posted: Wed, 07 Mar 2012, 01:56
by bga
There is movement at the station.

It's been a while, but I have fiunally submitted the modification application. I dnd't want to do this until ready to commit.

Current task is to make up the battery frames, which I can do from the dimensions I took off the vehicle - a set of sections of the engine bay in cad.

All those little 40AH TS cells make for a complicated battery frame, the rear one - 54 cells (3 x 18) went together without much drama. It's currently tacked and doesn't have the diagonal braces on it yet.

More cells in the rear are needed, maybe extend this to a 4 x 18 cell rack - 72 cells. It looks as though the spare tyre will have to go in either case. The 3x18 configuration will foul the tyre unless lifted high.
The spare is optional - a tyre patch kit (an canned inflator or that oily rope stuff and a pump is allowed as an alterantive.

The idea is to leave it tacked until the actual vehicle fit is complete, then weld it out once there are no more hacks or brackets needed.

edited spare tyre bit

Bruce Armstrong's BMW E30

Posted: Sun, 11 Mar 2012, 20:34
by bga
It's becoming a real EV project:
I've done for first remake of a component. The rear battery frame is now 4 x 18 for 72 cells and is 866mm wide, 224mm high, 483mm long.

I had an interseting conversation with my powdercoater. They have a zinc primer powder process which looks to be a good alternative to prime and paint.

Bruce Armstrong's BMW E30

Posted: Sun, 11 Mar 2012, 20:54
by weber
Good work. Photos?

Bruce Armstrong's BMW E30

Posted: Fri, 30 Mar 2012, 05:30
by bga

I'm being economical with posts...

Battery frames
These battery frames are complicated beasts (what did I expect with 160 cells??), I'm still welding bits of steel onto them, but those bits are getting successively smaller, so the end is near.

I expect to achieve practical completion this weekend, then take some pics of my crap tacking. Actually, sort of OK, but little blobs of weld all over the place don't look too neat, at least everything's flush and square. At least the MIG is behaving itself now. I'll leave the weld completion for later in the project when all the mount brackets are in place and I have no need to add or remove parts. Even Tacked, it's very strong.

While I like the idea of powdercoating the frame, it's not really practical for such a work in progress. I will only lightly paint them for the time being and then get to setting up the battery, charger and its manager. Being an EV project, there is a strong likelihood that, ultimately, the frames won't look much like they do now. Image

The front frame has only been fitted to a virtual car.

Also shortly, to cut up another RHS tube project and turn it into a trolley so the battery can be loaded up and then wheeled around the workshop (as in get it out of the way) until it goes in the car. A 250kg battery warrants some attention to the structure of the trolley.

While fooling around with the frame in the back of the beemer, I discovered that the 40Ah cells leave enough room above the battery box to mount the chargers and electrical gear, so the wiring should all be well contained.

Precharge Controller
Also in the last fortnight, I laid out a battery voltage monitor and precharge controller for the project. It's similar to the host controller shown above (left hand PCB on the post of 6 jun 2011) , but has an extension where the cell loop cables went.
The extension has two channels of optically isolated 500+V voltage sensor and a second microprocessor (same type of PIC as the BMS cell top units) to acquire the voltages and shunt them across the opto-isolator.

Originally, the idea was to use a linear opto-coupler, one with a second photodiode to monitor the actual LED illumination, allowing a linearity error in the order of 0.005%, but with two channels the microprocessor is simpler and gets rid of all the potentially tricky analog circuitry, leaving only a pair of high voltage resistor dividers (10 x 1M ohm 1206 resistors in series).

Also on the precharge controller are some analog/digital inputs for control and current sensing. The three front relays and RS422 have been retained. (I'm not up to CAN bus at present - can always make a CAN bus version later)

The idea is the the main controller will send the precharge controller a signal to engage when the start button is pressed. The precharge controller then controls the contactors and monitors the (hopefully) rising controller side voltage, closing the main contactor when the voltage across the main contactor gets within tolerance.
This puts the precharge process outside the main controller, so that software trips can't cause a main contactor catastrophe. This removes some I/O to a peripheral in the battery.

The control microprocessor will also monitor the precharge trajectory (v/t), abandoning the precharge immediately if it falls outside limits.

Bruce Armstrong's BMW E30

Posted: Sat, 31 Mar 2012, 01:31
by coulomb
bga wrote: It's similar to the host controller shown above, but ...

I hate to be a pest, but "shown above" seems to indicate that you meant to post a picture or two. No pictures show for me in Firefox or Internet Explorer. Could we see a picture, please?

[ Edit: oh, right. "shown above" actually meant "shown way above". Makes sense now. ]