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

The Kali distro has I think most of the CAN stuff in it - more Alex's domain :)

That explains the GM naming convention - interesting to know! I'm not sure exactly what box the E39 had other than being a 5 speed and not particularly strong. I still have the controller and loom from it, but that's about it.

The problem with converting a P38 that is already a diesel (early or late EDC) or GEMS V8 is that the gearbox controller needs analogue inputs on dedicated wires for each function - engine speed, throttle angle etc. That certainly won't marry up with the M57 ECU without something in between to take the CAN data from it and converting to those analogue signals for the auto ECU.

At this point we know at least some of the CAN data on the Thor V8 P38 setup is going to be compatible with the M57's CAN data.

Best case scenario? It 'just works' connecting the CAN bus up, with no translation of messages required. I can't see it being that easy though or someone would have surely done it by now. And even if it does, that doesn't meant to say the shift mapping in the auto ECU is a good match for the power delivery of the M57 diesel, so it may require fudging even if the messages matched up.

Member
avatar
Joined:
Posts: 8080

Sloth wrote:

I can't see it being that easy though or someone would have surely done it by now.

Not necessarily, the sort of people that are into engine swaps are those with a mechanical bias who steer well clear of anything involving electric, particularly data, it's all a black art. There's been numerous different engines fitted into Classic Range Rovers, Defenders and Discovery 1's as they are pretty basic and don't involve any data bus. Even low volume manufacturers steer well clear, even the Morgan uses the 14CUX controlled version with a distributor when it would be so much better, and stronger, with a GEMS unit in there.

Member
avatar
Joined:
Posts: 1228

That's true - unfortunately as old as it is, unless you want a manual or just to bash things together and hope it works... you can't really escape the electricals on a P38.

Member
avatar
Joined:
Posts: 8080

If you wanted to stick an old 300TDi motor and manual box in it, do away with the ABS, EAS and probably the BeCM and run all the electrical parts directly from the switches, probably anyone could do it. But all you would be doing is recreating a mid-1980's Classic in a P38 body. There's a very good reason why modern cars use data buses. Back in the mid to late '80's, I did some work with BMW when they had just released a new version on the 7 series which had gone over to CAN bus. They reckoned that on the previous version the single heaviest item on the whole car, heavier than the bodyshell itself even, was the wiring loom. By going to CAN they had knocked something like 200 kgs off the weight.

Member
Joined:
Posts: 781

I have been watching this with very keen interest as well. I looked at it a few years ago but thought better of it.
I have had a checkered history with engine swaps over the years. Norton with a Vincent engine, Ford Pop with a GT Cortina engine, Ford Escort Mexico with a 2L engine, Mini Cooper with a full race engine, then Range Rover Classic with a 3.8L Perkins diesel. It has put me off a bit. Nothing fits with most swaps.

A few comments off the top of my head:

The M57 engine is based on the older M51 engine, that we know. I also know the M57 will bolt straight up to a 4HP24 gearbox using the p38 diesel bellhousing. Not sure then which starter motor and flywheel are used, M51 or M57? or are they the same?

The problem with this is that only the diesel torque converter will fit. The petrol TC's are too big.

An option is to fit an uprated p38 diesel torque converter. I had one fitted by Ashcrofts to my car. Not cheap though.

I have chipped my M51 diesel and fitted a larger intercooler. Power has gone up from 135bhp to about 190bhp. I have also got the 4HP24 box fitted. It copes OK but would the TC cope with 300 bhp? I suspect not.

Question .... will the M57 TC fit into the p38 M51 bellhousing? I don't know.

I also had a look at the Compushift gearbox controller when I was at Ashcrofts a few years ago. A member on the .net site had one fitted to his p38 which had a 2.8L South American made diesel engine. Gear changes were very harsh.
A diesel engine with its long stroke and high compression ratio puts out a lot more torque and the fuel mapping has a Torque Limiter map specifically to cut the power during a gear change. The engine ECU needs to speak to the gearbox ECU in order to do this. If it doesn't it will result in harsh changes and even see off the gearbox.

I have also seen a p38 TDV6 conversion locally. Mechanic used a manual box though. Said he would never do another one.
I much prefer the straight six M57 engine.

Member
Joined:
Posts: 2441

Straight Six perfect for the job, V6s are rattly horrible things!

Member
avatar
Joined:
Posts: 8080

I would think the gear shift points won't be far wrong. I've only ever driven one diesel and that didn't shift up until it reached 3,000 rpm. Someone on the other side was complaining that there's had started doing that (and hadn't previously) and was asking what the cause might be, so maybe that isn't right. My 4HP22 changes up at under 1,500 rpm on a light throttle, 2,000 ish if I'm giving it at bit of welly, or anything up to 6,000 with the Sport button poked. So I would have thought that would suit the low down grunt of a diesel anyway. I believe the Thor gearbox ECU can be reprogrammed anyway.

Member
avatar
Joined:
Posts: 1228

Gilbertd wrote:

If you wanted to stick an old 300TDi motor and manual box in it, do away with the ABS, EAS and probably the BeCM and run all the electrical parts directly from the switches, probably anyone could do it. But all you would be doing is recreating a mid-1980's Classic in a P38 body.

It always makes me laugh when you see people posting up 'how can I bypass the BECM' or other related 'how can I get rid of it' posts... If you want a vehicle without the "complication" of the BECM, or something you intend to drown on a regular basis... leave the damned P38s alone and stick with the more simpleton-friendly old Discos or Defenders...

Did see on one of the Facebook groups a while back someone had run new wiring for all of the windows to control them with rocker switches... and then asked 'how do I clear the window not set messages'..........

dave3d wrote:

I have been watching this with very keen interest as well. I looked at it a few years ago but thought better of it.
I have had a checkered history with engine swaps over the years. Norton with a Vincent engine, Ford Pop with a GT Cortina engine, Ford Escort Mexico with a 2L engine, Mini Cooper with a full race engine, then Range Rover Classic with a 3.8L Perkins diesel. It has put me off a bit. Nothing fits with most swaps.

A few comments off the top of my head:

The M57 engine is based on the older M51 engine, that we know. I also know the M57 will bolt straight up to a 4HP24 gearbox using the p38 diesel bellhousing. Not sure then which starter motor and flywheel are used, M51 or M57? or are they the same?

The problem with this is that only the diesel torque converter will fit. The petrol TC's are too big.

An option is to fit an uprated p38 diesel torque converter. I had one fitted by Ashcrofts to my car. Not cheap though.

I have chipped my M51 diesel and fitted a larger intercooler. Power has gone up from 135bhp to about 190bhp. I have also got the 4HP24 box fitted. It copes OK but would the TC cope with 300 bhp? I suspect not.

Question .... will the M57 TC fit into the p38 M51 bellhousing? I don't know.

I also had a look at the Compushift gearbox controller when I was at Ashcrofts a few years ago. A member on the .net site had one fitted to his p38 which had a 2.8L South American made diesel engine. Gear changes were very harsh.
A diesel engine with its long stroke and high compression ratio puts out a lot more torque and the fuel mapping has a Torque Limiter map specifically to cut the power during a gear change. The engine ECU needs to speak to the gearbox ECU in order to do this. If it doesn't it will result in harsh changes and even see off the gearbox.

I have also seen a p38 TDV6 conversion locally. Mechanic used a manual box though. Said he would never do another one.
I much prefer the straight six M57 engine.

Honestly at this point in the morning I'd need to look it up again, but I believe I will need an adapter plate for the bell housing I already have, because I want to retain the large torque converter that will keep the stall speed a bit lower than using the small diesel one. I won't be pushing for silly power - though about the 250hp mark would be nice.

Torque as you say may be the lunching factor in the gearbox long term. Standard I think the engine is rated for 390. The HP24 I think is good for 450, though from posts I've seen Ashcroft's believe it is okay for more if it isn't hooned about constantly.

In terms of gearbox control, having the torque reduction request working is on the 'must have' list - if it doesn't drive properly its no good. I want to stay away from the Compushift though as I haven't seen any reports of it 'just working' smoothly. Until we've exhausted the possibilities for getting the Bosch/Thor auto ECU working over the CAN data (with or without fudging if required), I won't be looking at one.

Last night didn't result in much success. We were attempting to feed a simulated road speed signal into my bench BECM+instrument cluster (as if it were coming from the ABS ECU), which would then be fed to the M57 ECU to see if it matched up okay. At the same time, the engine speed output was connected to the BECM to see if it would drive the tacho etc properly.

Neither worked, beyond the tacho jumping occasionally.

As it transpires, my BECM is from my old 96 P38, which had the GEMS engine. The engine speed input is PWM, but 0-12v, whereas the Thor is 0-5v, and my Arduinos as standard only spit out 5v - so that likely answers why that didn't work.

I had also tried the output from the M57 ECU, as we know we can make it think the engine is spinning by simulating the crank and cam sensors (pictured previously). But it turns out, its engine speed output is on a totally different connector pin from the one I was latched on to... I've been looking at so many different diagrams and pin outs lately I must have confused two of them. I suspect its also a 5v signal, and it was late so I went to bed!

As for the road speed signal from the ABS ECU, that looks to be 0-12v too on all model year P38s. So tonight armed with some more tweaking, both signals will hopefully be fed in and we'll see the dials do their thing, and the engine ECU will hopefully spit out road speed over the CAN bus!

Or something like that.

Member
Joined:
Posts: 426

Spent many a night deciphering ECU pins... keeping my fongers crossed. If I can help in any way let me know, though you are way above my competence levels with this.

Member
Joined:
Posts: 1081

The 630r Overfinch was fiited with the HP24 the TCM mapping was changed but the internals were the same.

That 6.3 small block put out 403hp and over 550nm of torque so i think it would handle the M57.

Member
Joined:
Posts: 549

anything is possible , if Martin and the others on rr net that helped him put an LS in his p38 can make that work then this is possible , all you have to do is meet the requirements for the computers and that is possible as per say,
PS I would do motor and suitable gearbox as a complete unit.
work forward of the transfer case in the same way Martin did . yes it involves an expensive shaft to adapt to but the motor, gearbox can communicate properly and make it think it still the original set up

Member
avatar
Joined:
Posts: 1228

Making the BECM and other bits (EAS, HEVAC etc) think the engine is there and running is the easy bit. Driving the tacho is either going to need the instrument cluster changing to a diesel one, or some massaging of the pulses between the engine ECU output and the BECM/instrument cluster. This is because the V8s output 4 pulses per engine revolution, whereas the diesel (both M51 and M57) output 3 pulses. I ideally want to keep my V8 dash that goes up to 6k RPM, so will look at manipulating the pulses.

Currently on the bench, the engine ECU being fed a simulated speed of 5300rpm only shows about 4000ish on the V8 P38 instruments, because of the lower pulse rate.

Videooooooo:

https://www.youtube.com/watch?v=IWZ-mHIqYp4&feature=youtu.be

I know putting the original gearbox from the E39 would be "easier" in terms of knowing the control between them would work, but as said, it will not be up to the job. It will fail quickly.

I could go with the 6HP26 or 28 from an E60, which might be the same bell housing as the GM box, but a) I don't have one of those and b) that would be the M57TU2 engine, which I c) also don't have and by all accounts is a lot harder to get running standalone.

I'm doing this because I have the engine (that I am slightly attached to, I'm gutted the car it belongs to is gone, more so considering its E60 replacement is a massive disappointment), and my V8 isn't in the best of health. I don't, at this stage, have any want or reason to go and find another gearbox when I have the facilities around me that give a good chance of getting it working properly.

If it doesn't, then at that stage I can look at options.

Other current niggles with the ECU include getting road speed fed back into it for the cruise control operation. The ABS ECU in the P38 spits 8000 pulses per mile to the BECM, which spits it out to the engine ECU. Unfortunately the M57 ECU expects 48 pulses per wheel revolution, and despite the diagrams suggesting that analogue pulse can be fed into a certain pin (and there is a wire there too), it doesn't respond. When I look at the faults logged, it suggests its expecting it over CAN bus between the M57 ECU and ABS ECU of the E39. I will have to wire the E39 ABS ECU up and simulate the pulse into that, record the CAN data between the two, and then work on a way to convert the 8000 pulses from the P38 ABS output into a CAN message. In the video above, the BECM is being fed with the simulated 8000 pulse/mile signal to drive the speedo.

Member
avatar
Joined:
Posts: 8080

There's pots on the back of the instrument cluster that allow you to alter what the rev counter says. One is for offset and the other for slope, so you set the offset so it reads correctly at idle, then the slope to get it right further up the rev range. The speedo is the same, how do you think IRS managed to calibrate mine for plod? If you are prepared to spend a bit of time tweaking, you can get them both spot on.

Member
avatar
Joined:
Posts: 1228

I was talking to Marty about those pots last night.

It might have enough adjustment, but the pulse count expected by the electronics is different - so the value is basically a quarter less coming in than its expecting. Adjusting where it is at idle doesn't change the fact at higher engine speeds, it still won't read right in my mind, as 2000rpm will have the pulse count interpreted to 1500. I have nothing to lose trying them, but that's a lot of adjustment. I shall of course report back :)

Member
avatar
Joined:
Posts: 1228

More minor progress.

I haven't faffed with the instrument cluster any further yet - its not a show stopper either way as it stands. Either I need a diesel cluster and correct the mileage, or put some pulse correction in line with the signal. Assuming the pots can't correct it that is.

What I have been looking at is the road speed signal going into the M57 ECU. As far as I can tell, this is used primarily for the cruise control, and is also output to the auto gearbox ECU, however RAVE states if the signal over CAN is invalid/missing, it will have no apparent impact on the gearbox operation.

There is an analogue input on a pin that is populated on the M57 ECU, which is how it works on the M51 ECU, and the V8 Thor ECU. However... this is where it gets confusing. Looking at the diagrams for the E39 with my engine and year, I see this wire, along with a CAN bus link between the engine ECU and ABS ECU. The pulse count is however different between the E39 and P38 - so some magic would be needed between the two.

Feed that pin with a suitable signal to get a reasonable road speed reading from the M57 ECU and... nothing.

Looking at the registered faults in the ECU, and its giving me one for road speed... as a CAN fault.

On to some more digging, and looking at the diagrams for the ABS/DSC ECU for my engine and year... that wire is not present. At all. Only the CAN link. So somewhere between the diagrams it appears zee Germans have let a discrepancy fall through. Though that wouldn't explain why I actually had the wiring on my car between the ECUs, despite it being apparently redundant.

This lead to the ABS/DSC pump/ECU (it's a combined unit) being wired up on the bench itself. That was fed with simulated wheel speed sensor readings, but unfortunately proved quite an arse to get any usable results out of. Only once did the M57 ECU show the vehicle speed, but sniffing the CAN link between the two didn't reveal where it was hiding, and things appeared to get stuck.

enter image description here

I really need to pick up the pace on building my shed/workshop...

Some digging around on interweb revealed what might be the required CAN messages from the ABS ECU, so we spat those into the CAN lines, and up popped road speed... although some more tweaking is needed to send the value we expect.

enter image description here

So - TL;DR: an interface is going to be needed to take the 8000 pulses/mile signal from the P38 ABS ECU and convert it into constant CAN messages spat into the M57 ECU. That's the first confirmed translation that will be needed to make the cruise control work.

What I still need to check is the road speed spat back OUT by the M57 ECU is in the same format as the V8 Thor ECU does for the auto ECU. Even though RAVE suggests it won't harm it if its missing, I'd rather know ahead of time if its likely to cause an issue.

Member
avatar
Joined:
Posts: 1228

And we have the first bit of CAN data that is going to be an issue.

Road speed isn't spat back out by the engine ECU in the right place for the auto ECU. Which kind of makes sense - if the ABS ECU spits it onto the CAN bus, there is no need for the engine ECU to repeat it in a different place... the auto box ECU in the E39 just looked for it from somewhere else.

So the P38 is going to be looking at it from the engine ECU and what it is actually going to find is, oddly, cruise control data. If I were to hypothesise, Bosch took their standard (for the time) CAN layout and tweaked it to output the road speed from the analogue ABS input in place of the cruise data, as that is handled by an entirely separate system in a P38.

Which means we'll have to intercept all the CAN data between the ECUs and chop and change things on the fly.

The problem now is without a CAN data capture from an M57 automatic E39 or E46 (which I think both use GS20 gearbox ECUs), I don't have much more I can look into...

About the only thing I can try is plugging the M57 ECU into the P38's gearbox ECU over CAN and just seeing what errors or faults come up when turned on. Hopefully just road speed... which we know about.

Member
Joined:
Posts: 426

Just posting to let you know that I'm still following. Had similar scenes in my house over the years with engine harnesses spread all over the floor. But only been as clever as a multimeter, not a laptop and CAN BUS wizardry. You're way above my current level.

Member
avatar
Joined:
Posts: 1228

Ha - that's okay :) I'm mostly posting to have recorded somewhere what stage I'm up to, and if anyone else is interested along the way then that's great too.

Last night we did connect the M57 ECU up to the GS8.87.1 autobox ECU in my P38 with the fuses etc from the Thor engine ECU pulled out.

Mixed bag of results - immediately get a CAN bus fault of P1843 'CAN Level monitoring'. This is due to a software version check which is obviously wrong. So that will need to be convinced that all is hunky dory.

Throttle position and coolant however appeared on the nanocom, although the coolant value needs double checking. I had a resistance box connected to the ECU to emulate the actual sensor, and had a reading of about 21c on the nanocom. When I took the ECU back inside, the BMW diagnostics reckoned it was 44... I may have adjusted the resistance selection but I'm relatively sure I didn't.

enter image description here

Video of the throttle pedal doing its thing:

https://youtu.be/tC4paNBuKJw

Bit blurry as it was dark but you get the idea. Promising.

Emailed Ashcroft about the adapter plate and that shouldn't take long to get once I order.

A bit more CAN investigation first though, and checking clearances of other bits and pieces.

Member
avatar
Joined:
Posts: 1228

At this point, we're out of data to look at really.

Ideally I need an E39 or E46 diesel auto to capture some data from. Trying to power up the GS20 ECU on the bench didn't produce much useful information, and without an engine or gearbox connected up, both don't want to say much more.

So now its a case of working out when the engine can go in, and going from there.

Got some CAN bus hardware on the way though to look at building the interface, so when that turns up there should be some further updates.

Member
Joined:
Posts: 87

Great work, just picked up your thread today, I am hoping to do similar with my DHSE, it is a bit daunting though seeing the work involved just to get the cruise working! 10/10 for perseverance so far