Anda di halaman 1dari 6

Bosch modified original TSZ-I ignition using a PIC

16F84
or 16F628 with multiple sparks

This project is the result of a surge in my periodic interest in modern


ignition systems and the fact that I had a few exceeding 16F84's PIC
microcontrollers left from a previous application.
Basically I wanted to improve on my old 1987 VW Passat (Dasher) which
has
a 1.6 liter ethanol engine which is a 4 cylinder with Bosch distributor
including mechanical vacuum spark advance and centrifugal speed spark
advance.
There is a reluctor (magnetic pick-up) inside the distributor that
signals the Bosch ignition
box ( all electronics fit inside that box ) when to switch the coil on
and off for delivering the spark.

The scope of the project was that if the modified ignition box
stopped working then I would switch to an extra unmodified ignition box
to avoid getting stranded in the road.

As the distributor already has vacuum and mechanical advance there was no
need to implement advances electronically so the microcontroller's only
objective is to manage current switching through the coil.

The fig.1 shows a reverse engineered schematics of the original Bosch


TSZ-I ignition box.
As you can see in the schematics in Fig. 1 transistors T01 and T02
act as a non-invert Schmitt-trigger. So the periodic sine-like signal of
varying amplitude coming from the reluctor in the distributor will get
transformed into a 12V p-p square wave at the collector of T02.
Transistor T03 will amplify current from a few milliamps to 0.25 amps.
Transistor T04 will switch coil current (several amps) on and off.
Resistors R15 and R16 and 75V zener will protect power transistor if
collector voltage raise above about 230 volts.

Errata: Diode 1N5232 should be 1N5262

Fig. 2 shows the original Bosch ignition box.


The scope of the project is to place the 16F84 microprocessor and the

extra components needed in a small printed circuit under the main


ignition
board and connect them through 5 thin cables. Everything should fit
inside
ignition box (Fig 2)

The Fig. 3 shows the schematics of the added hardware.


As you can see this hardware is enclosed by a dashed line.
The circuit inside the dashed rectangle in Fig. 3 replaces the dashed
rectangle in Fig. 1

Enlarged Fig. 1

Enlarged Fig. 3

At the input the 0 to 12V square wave is transformed to a 0 to 5V


square
wave by resistors R01, R02 and ZD01 and then input to RB0 pin 6 of PIC
16F84
microcontroller. I decided to use a 4Mhz cristal or resonator instead of
internal RC oscillator to avoid possible jitter problems. Output is at
RB3
pin 9 and uses BC548 transistor to switch base current at T03 BD139.
Supply to microcontroller PIC 16F84 is 5 volts through regulator 7805.

That is all there is about the hardware.


The software accomplishes the following:

1) No current through coil if engine is not running


2) Constant dwell time over most of speed range (well almost)

The software is assembled for a coil of 5 ms. dwell time so the included
igni1.hex is for a 5ms. coil only.

If your coil has a different dwell time then edit the file igni1.asm
placing the new value of dwell at file and then reassemble it with
mpasm.exe and you will get a new igni1.hex file with your values.

Note: *.hex files are what you input the 16F84 programmer.

The algorithm is as follows for 4 cyl. engine:


Note: spark duration is always 1 ms.

If engine speed is above 5000 rpm (6ms. between firings)


then increasing engine speed will decrease dwell time).

If engine speed is from 750 to 5000 rpm (6 to 40 ms. between firings)


then dwell time will be a constant 5 ms.

If engine speed is below 750 rpm ( more than 40 ms. between firings)
then dwell time will be one eighth of firing interval.
So if engine runs at 500 rpm (60 ms. ) then dwell time will be 7.5ms.

In addition to the main spark signaled by distributor, this ignition


will provide up to 5 additional sparks after main spark for each
cylinder, provided time constrains allow it.

Assuming t=0 at main spark


then at t=1ms. charge coil
then at t=6ms. extra spark 1
then at t=7ms. charge coil
then at t=12ms. extra spark 2
then at t=13ms. charge coil
then at t=18ms. extra spark 3
19ms.
24ms extra spark 4
25ms.
30ms. extra spark 5

Any of the extra sparks will fire only from 0 to 22.5 degrees of
crankshaft rotation.
So above about 935 rpm there will be no extra sparks.
So from 375 to 935 rpm there will be 1 extra spark
"" "" 234 to 375 "" "" 2
"" "" 170 to 234 "" "" 3

I don't know if those extra sparks are of any use but they are
for free so enjoy them and tell me.
The engine in my car seems to refuse to die at low idling speeds.

Note: if you don't like extra sparks you can edit the igni1.asm file by
uncommenting the indicated line (deleting a semi-colon) then reassemble
the igni1.asm file using mpasm.exe to obtain a new igni1.hex with no
extra sparks

Note: The software assumes negative-going input to indicate time to fire.


"" provides negative going output to fire spark
"" provides positive going output to start charging
coil.
This software uses the only byte counter TMR0 in the 16F84. The maximun
resolution is one whole byte count or 256 microseconds. Attempts were
made before to increase resolution to fractions of byte counting but I
encountered too much jitter. Also during development I attempted to use
parabolic extrapolation for calculating future dwell but at certain
speeds
too much jitter was again observed. So I settled for zero order
extrapolation (future interval between firings equal past one). With 2
byte
hardware counters as in 16F628 or higher clock speed (20 Mhz.) I guess
the better extrapolation is possible.

Despite of all this talk I have been using this ignition in my car for a
couple of months with very satisfying results.
If any of the readers builds this ignition let me know how it went.

Note: I have only assembled and tested the 5ms.dwell version so if you
try other values of dwell make sure the values as they show in igni1.lst
make sense

My guess is that software will run for dwells smaller or equal than 31
times 0.256 milliseconds (about 8ms.)

Note: use at your own risk, I assume no responsibility if your engine


blows up or so!

The links are provided to download the igni1.asm and the igni1.hex file.
Also the files mpasm.exe, p16f84.inc and ate.bat are provided for
download

Go to main page (software downloads)

If you want to assemble igni1.asm yourself then put files mpasm.exe ,


P16F84.inc , ate.bat and igni1.asm in the same directory and run at
command line prompt (MS-DOS mode):

ate igni1.asm

And you will get new igni1.hex file

Good luck.

Anda mungkin juga menyukai