RCU Forums - View Single Post - Complete new CDI - website open
View Single Post
Old 09-02-2010 | 01:22 PM
  #124  
Gompy's Avatar
Gompy
Senior Member
 
Joined: Jul 2010
Posts: 404
Likes: 0
Received 0 Likes on 0 Posts
From: Alkmaar, NETHERLANDS
Default RE: Complete new CDI - website open

Comment from the programmer

This image is a snapshot from some output of a logic analyzer hooked up to the CDI.
The topmost row (RB0/yellow) is attached to the Hall-sensor.
It shows the actual pulse coming in from the pick-up.
In this case the pulse itself has a length of 82.5 usec and there is a period of 4.823 msec between two consecutive pulses.
So the actual laptime is 4.906 msecs.
This is also reflected in the row one up from the bottom (RA3/orange).
For testing purposes I used this port to toggle whenever a pulse comes in and it is
therefore effectively giving me the laptime: 4.906 msecs which equals 12230 rpm if I am correct.
As soon a the incoming signal (on RB0) changes from high to low, i.e. on the falling edge, the actual calculation of the laptime and desired delay starts.
This is reflected in the output of pin RA2 (2nd row from the top/green).
Again, for testing purposes I set this pin up in such a way that it goes high when a pulse has come in and goes low as soon as the ignition needs to fire.
The calculation uses the time difference between this pulse and the previous pulse to determine the actual laptime.
This is why you need at least two pulses before an actual calculation can be made.
This laptime is then used to retrieve the angle from a table. Which in turn is then used to calculate the delay needed.
The program then basically waits until the time has come to fire and fires the ignition pulse.
This can be seen in the middle row (SCR/purple).
Some 277 usecs after the last pulse from the sensor the ignition is fired, i.e. SCR goes high.
It stays high for 77.7 usecs which is more or less exactly the ignition duration set through the PC program.
And finally, the last row (RB3/red) shows the output of the PWM that can be used to generate the intermediate voltage.

Note that the actual row names (RB0, etc.) in this picture are the pins used on the PIC.
Attached Thumbnails Click image for larger version

Name:	Vt57087.jpg
Views:	98
Size:	53.6 KB
ID:	1494100