rangerovers.pub
The only place for a coil spring is up Zebedee's arse
Member
avatar
Joined:
Posts: 1228

This may upset the purists... but I've had a bit of an itch to put a BMW M57 diesel engine into a P38 for a while, and after thinking about it more and more - I think its time to start work on it. This may be a lengthy first post. Doesn't really fit into oily bits or electrickery - it will certainly contain both.

My P38 has a Bosch/Thor 4.6 engine that has seen better days. It's biggest problem is a suspected crack behind the liner of cylinder #6. For over a year I struggled with coolant being pushed out random places. Each time I 'fixed' one leak, it would pop up somewhere else. After it started missing badly at startup, which turned out to be a single cylinder, I found #6 spark plug was rusting... Those that have seen the deck of the block should know there is no way coolant should be able to get into that cylinder unless its coming through somewhere very bad.

So a top hat block would be the way forward - perfectly reasonable solution. Except I had just bought my first house, and the thought of sinking circa £4k into it when all is said and done wasn't going to happen. That left me with the initial options of scrap it, put a used engine in it, or park it and leave it. Scrapping it was obviously out, and I've done the used engine thing before with less than great results. Parking it up also didn't really work as I needed a big vehicle for getting things done.

I can't remember how I got the idea, but I figured there was little to lose in trying a chemical solution... it was already buggered, even if it ended up needing a new radiator and heater matrix down the line... it would be a small price to pay against the £4k of new engine. Settled on pure water glass, which is the main part of products like 'Steel seal' etc, but purchased as the chemical it is instead of a branded product is significantly cheaper! I've lost track of how long ago that was, but its over a year and between 5-10k miles now. No coolant loss, no leaking, no rusting plug, no missing.

So while it is, for the moment, keeping its coolant in check, its most likely on borrowed time. It's still burning a fair bit of oil and chucking more of it out down the side of the engine despite having rocker and valley gaskets done when it was pulled for the shattered flex plate. Breathers aren't blocked, so I must have done something wrong with one of the gaskets.

On top of that, LPG is becoming scarcer in my area. I have only two stations that do it that are worth going to now. One is expensive, and the other is out of my way and I don't trust that either will carry on supplying it for long. When LPG goes, my usage of the RR will have to drop significantly if forced to run on petrol.

And one final nail - it is bloody slow. Marty's is certainly quicker with its new engine and high torque cam, so mine is likely now an example of a probably less than stellar engine in terms of lost ponies. I know they're not sporty vehicles, but for the size of engine, the fuel consumption, the amount of noise it makes, it just needs more power.

And as it happens, I now have a superb condition BMW M57 engine from my late E39 530D. This is a common engine swapped into various LR vehicles, including P38s. Mine is the 194hp/390nm version. Less than the "225" hp my V8 may have once had, but more torque, and this is before a mild remap. And it stands a better chance of still having near its original figure as it stands!

enter image description here

enter image description here

enter image description here

Unfortunately my E39 met its demise in December of last year. No one was hurt (I wasn't even in it!), but the car was beyond repair - which became more apparent on pulling the engine. My car hit the car in front, and another hit it from behind. The front impact was so severe, despite not looking that bad, it slammed the engine backwards smashing an engine mount, and the gearbox crossmember. Despite all that... when the front of the engine was cleared and power was applied directly, it started straight up and purred like it always did. 168k on the car. I've genuinely never had to top off the oil or coolant while owning that car - and there was virtually no oil sat in the intake either like most diesels. I sorted some of the common M57 issues out in my ownership as preventative maintenance too. It had its swirl flaps taken out a couple of years ago, as well as the EGR disabled to prevent nasty intake buildup, and the oil breather was changed from a filter type that can clog to a cyclonic type etc.

enter image description here

enter image description here

enter image description here

Removing the engine and everything else needed, plus anything of use/value from the rest of the car. The upside of starting with a donor vehicle like this is I have all of the necessary wiring, ECUs, keys etc - and owning the car I know the condition of things.

enter image description here

What I will say is the viscous fans on these things are bloody strong. Power steering pump (further back than the fan, obviously), completely smashed... fan? spins true.

enter image description here

enter image description here

As I said, the P38 has seen M57 swaps before, but what I have never seen is a proper write up of how it was done, what challenges needed to be overcome. What I have seen a number of examples of is bodge jobs and half-finished projects that seem to stop being updated. Probably because they came up against something that couldn't be overcome. Certainly, if starting with a manual vehicle, it is a lot more straight forward.

Alas... I have and want a working automatic. I want everything to work as it originally did inside the car. Dials, gauges, HEVAC, heated seats+windscreen, air conditioning, cruise control. I have already started work on planning how each of these needs interfacing - I will post up how I go about these. It's a Range Rover - if the toys don't work, you might as well start with a Disco.

Truthfully the only thing that currently concerns me is the auto box control. One way to go about it is a Compushift aftermarket controller. But they are expensive, and that is going to be the last resort at this stage.

Because I'm still working on my house and garden at the moment, the engine is currently sat in storage. I have the engine ECU, immobiliser (EWS), key transponder pickup and loom all inside to start work on when the weather stops play in the garden. You can have the engine ECUs reworked to programme out the immobiliser entirely, however as I have the matching ECU, EWS and key, for the time being I will packaging the three together to let the engine run. For one, its a cost I don't need to fork out for initially, and by getting it running with the original setup, if I have any problems from the first start, I know it will be something I've done, rather than someone else.

The complete loom from the front half of the E39:
enter image description here

Reduced to what is actually needed to just run the engine ECU. ECU, EWS, key transponder pickup, drive by wire throttle, OBD socket:
enter image description here

These will form the basis of the vehicle interface loom. The loom that powers the ECU isn't shown as I left it on top of the engine, but its self explanatory. The interface loom connects the engine ECU, the EWS and key pickup, and the drive by wire throttle/accelerator pedal. It will also have outputs for the oil light on the dash, the alternator light, CAN bus for the auto box ECU (via whatever means I come up with to interface it to the gearbox), temp gauge, engine speed, things like that.

In terms of physically getting the engine into the P38 bay, there are a couple of hurdles I believe I need to overcome.

Mating to the gearbox is going to need an adapter plate to use the 4HP24 gearbox and V8 torque converter. These are available from a place called rallyraid, though I need to email them to check if the specific gearbox I have is suitable or if I need to find a particular gearbox and torque converter to suit.

After that, one of the engine mounts can be used from an M51 I believe, but the turbo/left/drivers (RHD) side will need fabricating, and the turbo actuator modifying.

The sump will need customising. To clear the bump stops, I've seen people use half an M51 sump and half an (I think) e39 M57 sump welded together. That's no issue. I've heard of others putting extended bump stops in place... but that's janky.

Once the engine is actually sat in place and mated up to the gearbox, I'm actually not concerned by anything else mechanical. I'll need an intercooler and to move the autbox cooler. The engine oil cooler won't be needed as the engine has an oil to water heat exchanger. I'll probably change the main radiator for a GEMS style one, as the top hose outlet on the M57 is on the right/passenger (RHD) side of the engine near the top. My electric fan setup will be staying, so the viscous fan will be removed from the engine.

The air conditioning is going to need some custom pipework I suspect, but that will be a future problem.

As I said... a long first post. But that's a bit of a splurge on my current plans/thoughts/reasoning. Yes, I'll lose the V8 soundtrack, but a common rail straight 6 diesel isn't the worst sounding thing in the world. It will also sound like a diesel at idle and have a reason for doing so, unlike my current V8 :) What I'll in theory gain is power, fuel economy, and reliability. I drive my P38 daily currently, and while I'm not worried about it letting me down at random - I can't help but think I'd have more confidence in the BMW engine.

Member
avatar
Joined:
Posts: 8080

All I can say is it sounds like you'll get it to work, it's just a shame your E39 was a 530d and not a 545i. Then you'd have had the 4.4 litre V8 that went into the early L322. That is a conversion I'd like to try on a Thor. They both use the Bosch Motronic engine management so all the required outputs to interface with the rest of a P38 should be there, the L322 uses the 5 speed ZF 5HP24 rather than the, near identical, 4 speed ZF 4HP24 so, in theory, with a bellhousing swap it should be possible to mate the L322 lump to the P38 box. Now whether it would be able to handle the 300 bhp from the later engine or not is a different matter but it should be fairly simple to find out with a heavy right foot.......

Member
Joined:
Posts: 1327

Good luck nick, you always seem to like a challenge, lol, ive read about the stand alone wiring of the petrol engines when being used in kit cars ect, in theory it should be quite easy to fit, as you’ve got loom etc I’m thinking once you’ve got it started, a bit of fettling and away you go, I’m gonna follow this thread, as I’m toying with a different engine into mine, not giving away which quite yet,,

Member
Joined:
Posts: 1307

I get there feeling there's a real extended workshop weekend in the making... :)

I'll obviously help (especially electrically) anywhere I can... you have my views on a few of the things... I wouldn't be surprised if the M57 ECU and the P38 Auto-slush-box ECU's become best friends, as the other swaps I believe I've read about are all to do with either from a GEMS or M51 in the first place, that talks to the Gearbox ECU's over individual wires, whereas BMW changed that on the Motronic system - the Gearbox ECU is actually a different part number for them and all.

I forsee the issues coming in with things like the tacho and road speed. The tacho can probably be fudged pretty easily, it will be a case of working out the pulses per revolution between the M57 and what the P38 BECM expects, and either build or buy and adapter box to adjust the required pulses. I remember recommending one to LLT on the .net for his LS Swap, when he asked me about the tacho for that as he was trying to use a trigger wheel, but I found a tacho pulse adjuster which would take the output from the LS PCM and adjust it to what the P38 BECM wanted. So that's probably easy enough...

Road speed might be the fun one, depending on what the M57 ECU uses if for - if it needs the ACTUAL speed, then depending on what it's expecting/what the WABCO ECU spits out - there could be fun happening there, but it might also be a case that the engine ECU just wants it to know the vehicle is moving (rather than revving it whilst parked for example) and feeding it the pulse from the ABS ECU would appease it enough.

I think the mechanical side of it will be the testing bit, especially mating to the HP24 box/Thor bell housing, but then electrical bits don't scare me... trying to fabricate something to join together lumps of metal that spin fast is a bit more outside my remit...

Dibs on you're old V8 when it comes out though :P... it could be the start of a 5.8L project V8....

Member
Joined:
Posts: 331

Oh wow!! This could be an interesting thread. lol That was my first thought, Marty ....... bet Nick gets Marty involved lolol

Member
Joined:
Posts: 2441

That looks like a worthy and epic project! I've never driven an E39 oil burner but they had a good reputation. I did have the E39 540i (545i was a later model) with an M62B44TU. With 280ish HP and a six speed - that went OK but probably wouldn't excite you in a P38 unless you're really thrashing it. It needed quite a lot of revs to wake up (peak torque at 3600rpm). I'm no diesel fan but I think a relaxed torquey lump is ideal for the job.

I certainly wouldn't be offended by your P38 losing the Rover V8 and getting something more modern. I'm always a bit underwhelmed by the 4.6 anyway. It does the job and sounds nice but the fuel burn is ridiculous for the numbers.

Member
Joined:
Posts: 501

This might be of use. Lots of help available

https://m.facebook.com/groups/1106830676068639

Member
avatar
Joined:
Posts: 1228

Mmm - to be honest my other appeal of the diesel is that its easy to get power out of - and I might as well go with it as I've got one before diesel becomes made "the worst thing in the world" by the same people that promoted them not so long ago...

Marty has willingly or not already been roped into this little endeavour :) We've had various chats about the inputs and outputs of things. I'm already in the BMW engine conversion group on Facebook - and its interesting to see what others are up to. I don't think I will post much there as such, as I find Facebook groups are pretty much where posts go to die and get hidden/lost.. I'll probably link to this thread once I get going. At the moment I'm still in the research stage.

The road speed signal is one that the engine is going to need for the cruise control - as it is entirely the job of the diesel engine ECU to maintain vehicle speed. The old vacuum chamber and bowden cable setup that the V8 uses will be going away. In theory I could make that work - keep the bowden cable pedal in the P38 and make a bracket up to connect them to the pot inside the fly by wire pedal. But, that's janky, and the electronic cruise control system is FAR superior to any bowden cable setup.

But that will be on the post-engine-in-and-mostly-running list of things to work out.

Speaking of research - this evening I've connected up a CAN bus interface to the P38 and recorded two little runs driving about. Just sitting there stationary with ignition on and engine off, you can see things like the throttle angle and gear selector position pop up, but decoding it is going to take some time. And having this is all well and good, but what I could really do with is borrowing an E39 530D to record the same kind of data to see what is different.

CAN tap to a handy plug accessible with the seat in place. I figured I'm sure more data logging is going to be needed pre and post engine swap, so a proper plug and socket saves faffing later.

enter image description here

Lots of data to start going over now.

Member
Joined:
Posts: 501

Facebook is totally shite if you want to find anything. I can guarantee if you want to find a post, you never will again. Bloody hate it.

Member
avatar
Joined:
Posts: 1228

It really is. Unfortunately Facebook groups are becoming the death of proper forums these days :( That said... I think proper forums on the whole now probably have a better calibre of post quality...

CAN data being analysed. Some interesting things going on for sure.

Member
Joined:
Posts: 662

You are a brave man. A very brave man to risk melding two incompatible control systems. Heck even BMW couldn't manage a sensible job of it when they rushed the L322 up to production status about 2 or 3 years early leaving total and utter dogs dinner mishmash of the control buses. There is a reason why the NanoCom doesn't support the early L322!

Might be interesting to look a what Simtek did to shove a TDV6 into a P38. Heck of a lot of translation gubbins and, even then, I believe the gear change bit was never properly sorted with tendency to harsh changes.

Hafta say that if I were doing it I'd keep the BMW gearbox, it is an auto isn't it, and sort out the mechanics of hanging the transfer box on the side. At least that is pure engineering. If its done right it will just work.

These days you can get accurate work done relatively cheaply by CNC workshops and the "free to small users" Fusion 360 CAD program is more than up to doing the design. A whole different world from 10 or so years ago when you'd be talking proper engineering designer and toolroom skills to make the bits. At least a magician with a Bridgeport or Beaver. Electronics / computer side becomes basically stopping the immobilisers fighting and persuading the BECM that there is still an engine in the car. OK its more complex than that but at least you don't have to go down the rabbit hole of persuading the various ECU's to talk to each other all the time.

Best of luck.

Clive

PS I hope it doesn't end up like my Bristol 603 project, bought 25 years ago by a supremely logical evaluation process, that turned out to have a been very well bodged leaving few issues a bit too far for me to cope with then. It's still under a cover out front!

Member
avatar
Joined:
Posts: 1228

The autobox in the E39 530D is the same GM one they put into the BMW L322 - and it fails on a regular basis because it wasn't up to the job of the massive weight of the vehicle. In the E39 with a standard engine map, its just fine.

Either way I no longer have it, and that would have needed marrying up with the transfer case, and depending on its length, new prop shafts etc. And if the weight didn't kill it in short order (bearing in mind it had 168k on it already), an engine remap likely would.

In terms of electronics, having the BECM think the engine is running, along with the EAS, HEVAC, instrument cluster and gauges etc all thinking the same and thus be operational is not something I'm considering a problem. We could do that with no engine physically fitted to the car. The sophistication of the electronics in the P38 are vastly exaggerated frankly. They're quirky perhaps, but by modern car standards (even the E39), they're nothing special.

The most complicated bit of electronics on a Bosch/Thor P38 is the CAN bus between the engine ECU and autobox ECU - and that's going to be the biggest hurdle in getting the gearbox working smoothly. During normal operation it spits out a LOT of data - and I mean data, not analogue values or high/low signals like the EDC diesel and GEMS V8 setup used to do it. It may or may not be possible - even if I can get the commands between the two translated one for one, the power curve of the engine may differ to the V8 enough that it doesn't change gear nicely using the standard 4.0 or 4.6 maps the gearbox ECU has inside it. If that is the case, then some fudging might be possible between the two, or it might (as a last resort) be a case of going for a Compushift and doing away with the original gearbox ECU altogether.

Between Marty, Alex (not on here) and myself, we'll see how far we get with it. As for machining - conveniently we have a good friend who is a machinist and onboard at the whiff of anything diesel :) The adapter plate I will likely still get from rallyraid, as it appears to be good value for what it is and its something already taken care of. But there will be other areas that need some fettling to make it a 'drop in' conversion. My long term plan with this is to get it done and tidy in this P38, but then depending on how the rusty sill progresses, move it over to a new P38 down the line. If of course it pans out and runs properly. To that end - it isn't a case of 'if' - but how. I don't expect this to be a quick engine swap without issues - I want it to run and drive properly.

Member
Joined:
Posts: 1356

I'm looking forward to reading more about this!

Member
Joined:
Posts: 1081

Looks like the makings of a great project.

I'd rather use the HP24 as both the 5hp24 and GM5l40E wouldn't be up to the job!

The 5hp24 lacks a torsional dampener in the Torque converter so it slips the lockup clutch to give good changes but with more power it slips and tbf even stock it doesn't really last.

Can't wait to see progress!

Member
avatar
Joined:
Posts: 1228

Interesting info there on the torsional dampener - makes me feel better about sticking with the HP24!

More probings have been had, on both the P38 and the M57 ECU on the bench. No pictures at the moment sadly but I'll get some soon... cos without pics it didn't happen etc :)

It is looking good so far. Throttle angle is spat out by both in the same way, and it appears other info is too like coolant temp, road speed etc. Kickdown is an interesting one. It isn't listed as being sent over the CAN link between the ECUs, only throttle angle. But the M57 pedal has a kickdown switch, which changes another bit of data being sent. The P38 has no such switch, just the potentiometer on the throttle body. So I'm hoping at this stage, that the gearbox is responsible in 4HP24 guise for deciding what is a kickdown event. Both P38 and M57 pedals send the angle as percentage - 0 to 100%. Well - ish, the M57 gets up to 100%, the P38 gets to 94ish%. So - long story short, the kickdown switch will likely just be redundant and ignored by the gearbox ECU.

Which raises another interesting tidbit of info. If you look at throttle angle under Motronic on a nanocom, it goes from 0 to about 75% - and this I believe is 'normal'. If you look at the same info under the gearbox ECU, you see the same 94% that I'm seeing in the CAN data. Another quirk of the nanocom I think...

Next up is to feed the M57 ECU with a simulated crank signal, so it thinks the engine is running at a specific RPM. Once it has that going in (along with registering I'm sure a crap tonne of 'WTF IS GOING ON WHERES THE ENGINE' faults) it should spit out over CAN that speed, which will be the next thing to compare with the P38. I have a feeling there might be an issue here. On the P38 for example, the BECM expects the engine speed over a dedicated line in terms of a number of pulses per engine revolution, which differs between engines. On CAN, the speed is in some value that is probably a number of pulses too, and that might differ. If it does, it will just mean some conversion will need doing on the fly between the two. On the other hand it might be standardised between various Bosch ECUs.

After that its road speed, which comes from the ABS ECU into the engine ECU, forwarded on to the gearbox ECU over CAN. This will need probing on the P38 between the ABS and engine ECUs I think in whatever format its sent over.

Member
Joined:
Posts: 1307

The ABS ECU on the P38 spits out road speed at 8000 pulses per mile - so the frequency of this signal will change in relation to road speed (IE how quickly the miles are being eaten up!)

A bit of maths would tell us (I might be wrong and have miscalculated....)

Say you're doing 60mph (as it works nicely with minutes/seconds)... so 60mph is 1 mile per minute or 60s... so there would be 8000 pulses every 60 seconds, or 133.333333 pulses per second, or 133hz would be the frequency of the square wave signal to signify 60mph.

That in theory is scalable... 30mph, would be about 66hz, 15mph 33hz etc etc etc.

I am pretty sure you could make something to fudge that data as an output, depending on what the ECU requires - OR take that input, read it, and translate it to whatever CAN format is required.

Member
avatar
Joined:
Posts: 1228

Pictures.. as promised. And a bit more positive news. The engine speed of the M57 ECU is spat out over CAN in the same way as it is for the Thor ECU:

enter image description here

enter image description here

The coolant temp is an intialisation value - when a resistance is connected to mimic the NTC sensor, it reads correctly too, as it does in the P38.

Next up is road speed. I wonder if we should start with feeding the 8000 pulses per mile in and see what it comes out with. I have a feeling road speed is reported by the M57 ECU at least in KM/h, so we'll see.

Member
Joined:
Posts: 2441

Kali, eh? A bit of Black Hat action on the side? :)

Member
Joined:
Posts: 549

not shore this is relevant but the numbers on gm gear boxes tell it all
example 4L60e stands for
4L , 4 speed
60, is the amount of weight the gearbox will move (6000lb)
e, electronic
5L40e with only 4000lb forward thust its obvious its not big enough for a heavy 4wd, it is possible to upgrade them up to 75 or even 80 in some autos.
just some useless information.

Member
Joined:
Posts: 426

Watching with keen interest. i did start looking at this myself but then remembered the list of projects in my sig let alone sorting out the house!

If I were to do it I would want to convert my curent DSE (even though it doesn't have traction control) but like you would want to retain the auto gearbox rather than fit a manual. I would of course have to change for a 4.6 transmission though to get the bigger torque converter.