How to read fly wheel for control ignition?

Hi all
I bulid own electronic injection and ignition for old bike.I want to use arduino read angle from 36-1 tooth wheel base on speeduino code but I don't understand speeduino program how to canculate angle for injection and ignition?

What is "speeduino code" ?

Have you a sensor that can detect each tooth as it passes?

How does it know which tooth represents TDC?

...R

You have to know where TDC (Top Dead Center) is first. Second, calculating the "angle" is not as simple as it sounds since it is a variable time depending on the engine speed. Typically, you need some sort of phase locked loop that you can pick the timing out of. You also need to determine the ignition timing from several variables such as engine speed, engine load (the old distributors used the vacuum advance to determine the engine load since it was connected to manifold vacuum). Many of the newer systems seem to use a knock sensor bolted to the engine to allow them to advance the timing up to the point where it starts to knock then back it off a little bit so that would be another sensor you would need to monitor. The pulse width to the injectors is also variable and depends on the engine load and typically sensors in the exhaust to determine correct mixture as well as a TPS (throttle position sensor). Ignition timing and injector timing are actually quite complicated - some years ago when I was working on some avionics boards for the big jets, we chose the 68332 processor for a number of reasons, but it had been designed for the automotive computers and had a whole bunch of stuff in it to help deal with the complex calculations in an engine control computer.

Robin

Robin2:
What is "speeduino code" ?

Have you a sensor that can detect each tooth as it passes?

How does it know which tooth represents TDC?

...R

It is free program for arduino ecu by josh.
See speeduino.com

@Oldsnake00, there are several products on that Speeduino page. What specifically are you using? if you are using one of their programs please post it.

And please use the code button </>so your code looks like thisand is easy to copy to a text editor

…R

Robin2:
@Oldsnake00, there are several products on that Speeduino page. What specifically are you using? if you are using one of their programs please post it.

And please use the code button </>

so your code looks like this

and is easy to copy to a text editor

…R

Robin2:
@Oldsnake00, there are several products on that Speeduino page. What specifically are you using? if you are using one of their programs please post it.

And please use the code button </>

so your code looks like this

and is easy to copy to a text editor

…R

I studied this program and develop for my program.I don’t understand some part of program.How program count angle between tooth for ignition?

oh dear...

Oldsnake00:
I studied this program

You say "this program" but you have not posted the program so that we can see it in order to help you.

...R

1/ you need some way to identify TDC on the compression stroke - some toothed wheel encoders use a missing tooth to do this.

/2 you need to identify the compression rather than the exhaust stroke on a 4-stroke engine - modern cars have a camshaft sensor for this reason.

3/ 36 teeth only give you a resolution of 10 degrees - nowhere near good enough unless you either use a phase locked oscillator running at a multiple of the tooth frequency or some clever software.

how far have you got?

regards

Allan.

Robin2:
You say "this program" but you have not posted the program so that we can see it in order to help you.

...R

i cannot post code because many pages of code.Please see link.

allanhurst:
1/ you need some way to identify TDC on the compression stroke - some toothed wheel encoders use a missing tooth to do this.

/2 you need to identify the compression rather than the exhaust stroke on a 4-stroke engine - modern cars have a camshaft sensor for this reason.

3/ 36 teeth only give you a resolution of 10 degrees - nowhere near good enough unless you either use a phase locked oscillator running at a multiple of the tooth frequency or some clever software.

how far have you got?

regards

Allan.

Hi Allan
I build own cdi broad for my old motocycle (honda ca95 4stroke 2 piston )control by arduino uno.The hardware finish and work.I want to add injection to my old bike but My program not support this function because I use pulser coil detect angle for ignition.I want to add 12-1 or 36-1 tooth wheel to the roter.I don't know how to write program for read angle between tooth for start ignition.

Oldsnake00:
i cannot post code because many pages of code.Please see link.
GitHub - noisymime/speeduino: Speeduino - Arduino based engine management

Sorry. I'm lazy, There is far too much to read there without some specific pointer from you about which lines of code to look at.

Maybe you should ask yourself whether your own time would be better spent figuring out Speeduino code or just writing your own program from scratch.

If your Arduino can detect pulses from the gear teeth it can work out the speed. If it can detect TDC it can work out when to trigger the ignition.

...R

If it's parallel twin you'll be using a waste spark ignition - only one coil firing both cylinders, so you gain nothing by having a multi - tooth sense wheel . And you don't need a stroke indicator.
A single sense point is adequate. Where is yours set - at maximum or minimum advance?

Allan.

Am I wrong in thinking you will also need a throttle position sensor so you can adjust both the injection and spark timing?

Paul