#!/usr/bin/perl

use strict;
use warnings;
use OOPP;
use OOPP::config;

my $o=new OOPP;
$o->pushcss('tables.css');
$o->set('bare',1);
$o->print(<<"E");

<div style="margin:15px 15px 15px 15px">

<h1>Mazda DiTD, overengineered by Denso</h1>
E

$o->include('descr.html');


$o->print(<<"E");
<p>
After appx. 10 years and only 185000km the above described symptoms appeared on
my Mazda. I was not able to find any workshop that would be able to diagnose
the problem and fix the engine for reasonable price. Typical "proposal" was to
replace the ECD-V5 diesel pump for several hundreds euro. However, when I found
out that the engine starts flawlessly with own engine control unit, I've
decided to develop a simple workaround solution with cost less than 10€, whilst
after next 15000km there's no difference in fuel consumption and the engine
produces still the same amount of emissions as it did 5 years ago.
<p>
The goal is to slightly increase the amount of fuel delivered when cranking,
	this is also why the engine without connected ECT starts normally, the
	timing and fuel amount are different. Unfortunately, the Denso firmware is
	quite half-baked and does not offer any smart solution for successfull
	cranking after reaching certain point of engine and pump wear. And the
	implementation were certainly fairly easy, but also there weren't wasted
	money spent by other owners trying to eliminate this problem.
<p>
The solution consists of one switcher-relay and couple of cables. It's connected and mounted directly next to the ECU. When the engine cranks, voltage from the 1U wire powers the relay which connect a 10kΩ instead of the ECT. After engine start, the crank-signal turns off which dispowers the relay and the ECT is reconnected to the ECU.<br/>
Used terminals:
<ul>
<li>1U - crank signal (B+ when cranking else 0V)
<li>2G - ECT sensor
<li>body ground (signal grounds 3Y, 3B, 2B should be also body-grounded)
</ul>

<img src="schema.jpg" alt="wiring" />

<h2>The ECU</h2>

<p>ECU can be found (together with fuel shut off relay) mounted on a metal plate under carpet at co-driver's side.

<p>
<small>View from the harness side.</small>
<p>

<!-- 3 -->

<div style="float:left">
<em>3</em>
<table>
<tr>
<th>Y <th>W <th class="nc">U <th class="nc">S <th>Q <th class="nc">O <th class="nc">M <th>K <th>I <th>G <th class="nc">E <th>C <th>A
<tr> <th class="nc">Z <th>X <th class="nc">V <th class="nc">T <th>R <th>P <th>N <th>L <th>J <th>H <th>F <th class="nc">D <th>B
</table>


<table>
<tr><td>A<td>IDM: C (inject)
<tr><td>B<td>signal ground
<tr><td>C<td>??? immo ?
<tr><td>F<td>???
<tr><td>G<td>pump speed B
<tr><td>H<td>pump speed A
<tr><td>I<td>TCD A
<tr><td>J<td>TDC B
<tr><td>K<td>eprom D
<tr><td>L<td>vehicle speed
<tr><td>N<td>eprom A
<tr><td>P<td>TEN terminal
<tr><td>Q<td>FAN3
<tr><td>R<td>KLN
<tr><td>W<td>glow plug relay
<tr><td>X<td>FSO relay ground
<tr><td>Y<td>signal ground
</table>

</div>



<!-- 2 -->
<div style="float:left;">
<em>2</em>
<table>
<tr> <th>O <th>M <th class="nc">K <th>I <th>G <th>E <th>C <th>A 
<tr> <th>P <th class="nc">N <th class="nc">L <th>J <th>H <th>F <th>D <th>B
</table>


<table>
<tr><td>A<td>boost sensor C, accelerator C
<tr><td>B<td>signal ground
<tr><td>C<td>boost sensor B
<tr><td>D<td>FSO relay (ground?)
<tr><td>E<td>IAT1
<tr><td>F<td>accelerator D
<tr><td>G<td>engine coolant temperature sensor B
<tr><td>H<td>???
<tr><td>I<td>fuel temperature
<tr><td>J<td>EGR position
<tr><td>K<td>IAT2
<tr><td>M<td>???
<tr><td>O<td>IDM: A (confirm)
<tr><td>P<td>???
</table>
</div>

<!-- 1 -->
<div style="float:left; margin=0px 20px 0 0;">
<em>1</em>
<table>
<tr> <th>U <th>S <th>Q <th>O <th>M <th>K <th class="nc">I <th class="nc">G <th>E <th>C <th>A 
<tr> <th class="nc">V <th>T <th>R <th class="nc">P <th>N <th class="nc">L <th class="nc">J <th class="nc">H <th>F <th>D <th>B
</table>

<table>
<tr><td>A<td>power supply
<tr><td>B<td>B+
<tr><td>C<td>TCV A
<tr><td>D<td>SPV relay
<tr><td>E<td>???
<tr><td>F<td>ignition switch
<tr><td>K<td>EGRVAC
<tr><td>M<td>glow/diag control light
<tr><td>N<td>FAN2
<tr><td>O<td>EGRVENT
<tr><td>Q<td>A/C relay
<tr><td>R<td>???
<tr><td>S<td>A/C switch
<tr><td>T<td>idle switch
<tr><td>U<td>starter signal
<tr><td>Y<td>clutch switch
</table>
</div>

<div style="clear:both;"></div>

<h4>Cranking with and without ECT</h4>
<p>
Following picture shows the pump speed and the injection signals compared once with ECT connected (in a car which does not start) and once disconnected. I did not measure the behaviour with 10kΩ resistor anymore, but I would expect yet longer injection pulse.

<p>Click on the image below to display the measurement:
<a href="mazda-pump.png"><img src="mazda-pump-thumb.png" alt="injection signal and pump speed" /></a>

<h4>Relay's Installation</h4>
<p>
pre-mounted state<br/>
<img src="IMG_5843.JPG" alt="pre-mount" />

<p>
mounted with ecu<br/>
<img src="IMG_5848.JPG" alt="mounted" />

<p>
<small>Suggestions and feedback welcome, ɯoɔ˙ןıɐɯb@ןǝʌɐɥ˙ɐɹpuo</small>

</div>
E
