Rick Hurst Web Developer in Bristol, UK

Menu

Month: May 2014

VW T25 1Z Tdi conversion

VW 1z tdi engine from a golf mk3 installed in a T25

Those of you who have been following along will know that last year, Rocky’s original 1.6 CS diesel was replaced with a 1.9 1Y engine from a mk3 golf. This was a good upgrade and I would likely have happily plodded around with the 1Y engine for years, had the engine not turned out to be drinking an unsustainable amount of oil.

So while deciding what to do about the situation, I phoned Phil at Millers Motor Services and he very generously offered to trade the engine in against a 90bhp 1.9 1z Tdi engine he had waiting, from a mk3 golf. Millers specialise in engine conversions and have been refining their set-up for the T25 1z Tdi conversion. Whereas the 1Y conversion was almost a straight swap, fitting a Tdi is a more complex install because of the additional wiring and fabrication work. The trade-off is increased complexity versus increased efficiency and performance.

Although the 1Y was an acceptable improvement over the CS, the Tdi is much more of an upgrade and brings the performance of the T25 in line with more modern vans. The VW 1z Tdi is renowned for is reliability, and (if looked after properly) should last for multiple hundreds of thousands of miles. As it has an OBD port for diagnostics, most garages can perform diagnostics on it, and spares should be more readily available than the older vw diesel engines.

After a small amount of deliberation, I decided to go for it, and dropped Rocky down to his unit in Launceston in North Cornwall.

Gearbox and Clutch

jx clutch kit
The clutch was replaced with a new JX clutch kit. The engine mounts to a standard diesel bell-housing and is using my original 1.6 diesel starter motor. So far the starter has had no problem at all with starting the engine, in fact it seems to turn over easier than the CS and 1Y did. It also uses a standard input shaft, but like the 1Y conversion, requires a spigot bearing.

1z engine and t3 gearbox

The gear ratios in my original 4 speed diesel gearbox are too low for a Tdi engine, the revs would be at something like 3,500 rpm at 60mph. The long-term solution will be to have this gearbox rebuilt with bespoke gearing to suit a Tdi, but in the meantime this has been swapped for a gearbox from a petrol T25, which has slightly higher gearing. This is enough to allow comfortable crusing at 60 – 65mph, but the revs are very high above this speed. Although the “new” gearbox (unsure of the code – it’s not visible) is technically a 5-speed, the extra gear is actually an extra-low crawler gear rather than a cruising gear – this is the case for all T25 5-speed boxes, so there is nothing to be gained from swapping from a T25 4-speed gearbox to a 5-speed unless you want to tow heavy trailers up steep hills.

The alternative gearbox solution would be to use a “flipped” gearbox from a different front-wheel drive vehicle such as a passat. This would require the engine to be mounted in a different position and more custom fabrication work (and hence higher installation cost).

Engine Mount

custom nearside engine mount for 1z in a t25
The 1z is installed at an angle, like the original diesel engines in a T25, but the nearside engine mount is not a straight swap, so a custom mount was fabricated fo the job.

Air filter

cone air filter behind light cluster
The air box was removed and a cone filter was installed behind the rear light cluster, directly below a duct leading up to the nearside air vent.

ECU and wiring loom

ECU and OBD socket behind battery
The ECU is installed behind the battery, providing easy access to the OBD port. This is an early ECU, and does not have an integrated immobiliser, which makes the wiring installation simpler.

Fly by wire throttle

fly-by-wire throttle potentiometer mounted in footwell
The 1z is a “fly-by-wire” engine, so the throttle potentiometer was installed in the footwell. The alternative is to install it in the engine bay and use the existing cable to operate it, but this method means a much lighter throttle pedal. The downside is that it took a bit of getting used to at first while wearing big boots!

Oil return

fabricated oil return line form 1z turbo to jx sump
The turbo oil return line was fabricated to feed in to a JX sump. It would also have been possible to use the original CS sump with an adapter kit.

Intercooler

intercooler mounted beside transmission
The intercooler is from a Citroen Xsara Picasso, and is mounted alongside the transmission, angled to receive sufficient airflow.

Rev Counter

aftermarket rev counter on dash
As my original diesel instrument cluster doesn’t have a rev counter, I asked Phil to install this after-market tacho on the dash. This is driven by a feed from the ECU.

Dipstick

modified dipstick
Having always had trouble with the curved dipstick set-up on my previous engine (accessed in the standard T25 way via the number plate flap), after a bit of research, I decided that I wanted a straight dipstick. I ordered a specifically modified dipstick for a T25 1z conversion mounted at 50 degrees from Greaseworks in the states. I have to admit I ended up paying way over the odds for this after paying for express shipping and import tax, but it does the trick. I’ve retained a T25 oil filler for now, but may blank this off and install an angled filler cap on the rocker cover, as i’ll have to open the engine bay to check the oil level anyway.

Exhaust


It would have been possible to use my original exhaust with a bit of fabrication work to adapt it, but it wasn’t in brilliant shape and Phil had a custom exhaust available from a previous 1z conversion, so this was fitted.

So how does it go?

So far, which at time of writing is about four hours of driving, split between hilly Devon and Cornwall A-Roads and crusing back to Bristol on the M5, it has performed brilliantly. The difference in torque is massive, especially on hills. It feels safer to drive because it’s easier to get up to speed pulling on to roundabouts and out of junctions. On the motorway it is quieter, and happily zips up to the legal speed limit to overtake lorries in the slow lane, but with this gearbox it is definitely happiest cruisng at 60 – 65mph. It is safe to say that I am a very happy customer, and looking forward to seeing how this engine performs long-term.

If you are interested in knowing more about getting a Tdi engine installed in your VW T25 by a specialist, speak to Phil and Kev at Millers Motor Services on 01566 248554 millersmotorservices@gmail.com.

The Camputer Part 3 – API hacking

In part 2 I got RasbBMC installed, and worked out how to get vnc server running. The next goal was to get to know how the music player works, how to create playlists and most importantly hack around with the API so that I can work out how to control it from a python script.

raspbmc displaying on small lcd monitor

My original intention was to run the pi entirely headless, but then I remembered I had already bought a small LCD monitor for a reversing camera, that I never got round to fitting. Hooked up to a 12 volt power supply and to the PI using the RCA socket, I now have a tiny monitor, which is handy for keeping an eye on what is going on with the player.

Most of the text is illegible at that size/ resolution, so I upped all the font sizes for the default skin:-


cd .xbmc-current/xbmc-bin/share/xbmc/addons/skin.confluence/720p
sudo nano Font.xml


Now all the line-spacing is wrong, so is more legible in some places, but less so in others. I don’t want to get side-tracked right now into learning how to skin XBMC. Maybe at a later date, it might be a nice project to create (or find) something specifically for very small screens.

IInitially I couldn’t hear any Audio, so I had to change the audio settings in XBMC to use analog audio out rather than HDMI.

I spent ages reading up on the api, the documentation is pretty confusing and lacking in examples, but eventually I found some simple examples on a forum showing how to interact with the JSON-RPC API.

I was expecting to find some examples of using the python API “directly”, but couldn’t really find anything (or at least anything complete enough to understand real-world use). I eventually found this python xbmc json client.

With that library downloaded to the pi, I was able to speak to xbmc from the python prompt:-


>>> from xbmcjson import XBMC
>>> xbmc = XBMC("http://localhost:8080/jsonrpc")
>>> print xbmc.JSONRPC.Ping()
{u'jsonrpc': u'2.0', u'id': 0, u'result': u'pong'}


To open a saved playlist:-


xbmc.Player.Open([{'file':'/home/pi/.xbmc/userdata/playlists/music/test.m3u'}])


I was then able to play/pause XBMC and move to the next track from the python prompt with:-


xbmc.Player.PlayPause([0])
xbmc.Player.GoTo([0,'next'])


Before I worked out how to open a saved playlist via the API, I noticed that the above play/pause command doesn’t work if the player hasn’t been opened yet i.e. when the Pi has been rebooted. I found a way of opening a playlist and pausing at XBMC startup, by creating a file called autoexec.py in /home/pi/.xbmc/userdata with the following in it:-


import xbmc
xbmc.executebuiltin("PlayMedia(/home/pi/.xbmc/userdata/playlists/music/all.m3u)")
xbmc.executebuiltin( "XBMC.Action(Pause)" )


This is run by XBMC at startup, and doing so ensures that the player has a playlist loaded and ready to play at startup. Currently not sure where this script imports xbmc from or how I could have this available to my own application scripts and managed by XBMC, but there must be a way. Either way I seem to be able to do most of what I need with the JSON-RPC API currently, with the exception of shuffle. The following command toggles shuffle on and off:-


xbmc.Player.SetShuffle({"playerid":0, "shuffle":"toggle"})


The JSON response sais “OK”, but annoyingly it has no effect on the XBMC player. When operating XBMC manually you can open a saved playlist, and at any point click the shuffle button, to toggle shuffle on and off, and the next track will either be in order, or “random” from a shuffled list. I was hoping that this toggle on the API would have the same effect, but apparently not. I think I may have to consult the XBMC forum, once i’ve put togther a precise list of commands that i’ve tried, and checked exactly which version of XBMC and API I am using (you know how forums can be if you go asking questions without providing enough background info!).

If it turns out that this is a bug and there is no solution for shuffling the current playlist with the API, I can envisage a workaround involving dynamically creating a shuffled version of each of the saved playlists. As I intend to create some kind of playlist management app for this (outside of XBMC), it would be a simple step on from that.

So, besides working out a solution for shuffle, the next step is to connect the Piface digital I/O expansion board, and work out how to trigger API stuff in response to button presses.

The Camputer Part 2 – raspBMC installation

(See Part 1 for details on what the project is about and the kit bought for it so far).

I decided to go with RaspBMC as the operating system, on the basis that I wanted something Raspian/debian based, and this distro is exactly that, but with the benefit of being preconfigured as an XBMC media player.

I ordered a 16gb SD card (I intend to keep my media on an external USB drive) and used the instructions to create a bootable raspBMC installation, using my macbook air, which has an SD card slot.



Then I put the SD card in the Raspberry Pi board that I got from UK Farnell, hooked up to a keyboard, mouse, ethernet cable (connected to our home router), power supply, audio cable to my hifi amp and our TV via HDMI cable.

The bootable SD then takes you through the rest of the installation – it took about 25 minutes.



The Pi then booted into XBMC, which i’ve never actually seen before, and it looks great. I enabled AirPlay in the settings and found that I could stream audio and (non-apple DRMed) movies from itunes and from my wife’s iPhone. I’ll probably set one up specifically as a home media system in the future, and probably others just for audio streaming to amps/speakers around the house.

I then went of at a tangent, trying and failing to get a vnc server installed and working, so that I can control it from another device, as it will likely be run headless in the camper van. After a bit of digging though, I realised it already has a VNC server installed which can be enabled in the system settings – the raspBMC settings rather than XBMC settings. You can also start it from the command line with:-


service vnc start


I couldn’t get it to connect using OSX screen sharing, so I installed Real VNC viewer. It seems very sluggish, but works.



So the next stage is to hook it up to a USB drive with some music on it, create some playlists and investigate how I can interact with the player programatically via the API.

Follow-up posts:

Part 3: The Camputer Part 3 – API hacking