RCU Forums - View Single Post - New CDI - opensource project JMJ and Bigboat
Old 02-21-2010 | 04:37 AM
  #918  
Rallyfinnen
Senior Member
 
Joined: Dec 2009
Posts: 106
Likes: 0
Received 0 Likes on 0 Posts
From: , SWEDEN
Default RE: New CDI - opensource project JMJ and Bigboat


ORIGINAL: kermet

Sam is that the 56us delay you where trying to reduce ???

rob why does SCR triger after the gap and not on the first pulse ?


brett
The 56us delay is actually a lot longer the way I use it. A coil spark needs more time to burn the spark then a CDI (as far as I know), so I use values over 1ms in the off-delay. This should not affect the dealy in the timing calculation though.
Just to explain it briefly. The delay value there is to keep the output low for a specific time, to give the spark time to burn before the output is going high again.

The delay I'm worried about is the 'processing delay' due to the number of cycles the processor needs until if actuates the output. The way I test this is by setting all values in tspark to 0, and then measure the delay between input and output.
This delay will always be there even if tspark value is 0. So, even if the delay is set to 0 (full spark advance) the spark will be delayed.
The debugger also tells you the processing time of each step, but when I compared the theoretical value with the measured value, I found the measured value to be slightly higher (5-10us).

There are definitely more delays in the circuit than just the processor. The hall sensor gives a delay too, and that depends on what sensor you use. The sensor I'm using gives a typical delay of 0,2us and maximum of 2us according to the data sheet. Then there will also be some delay in the ignition circuit, if it's a CDI or a coil. I don't know what the delay for the CDI is, but for a coil it is at least 10us as far as I know.

To conclude this, the trigger needs to be set XX degrees in advance of the maximum ignition angle you want. The amont of 'pre-trigger angle' needed is based on the maximum rpm and the total delay in the system (trigger+control board+ignition system). This way the actual timing advance should be the same as your advance curve.

The way it has been, the ignition angle is progressively retarding with RPM even if you had is set to a constant angle.
This is not a code problem really, you just need to move the trigger, and make a compensation calculation for triggaernangle and delay in the excel sheet.
However, the code should be kept as efficient as possible to minimize the delay. If delay goes over 100us, the trigger needs to be set very far ahead fo handle high rpm!