Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: detecting the missing CKPS pulses


Veteran Member

Status: Offline
Posts: 80
Date:
detecting the missing CKPS pulses


for future reference ...

there are 22 poles and 2 missing poles for the CKPS (crank sensor) input to the ECU, and since there's no camshaft sensor this is all the information the ECU has for figuring out where TDC is ... here's how the code detects where the missing pulses are (below), the missing pulses are a signal that the next real pulse is the reference point, which looks like it coincides with bottom dead centre on cylinder 2 ...


The contents of free-running counter TCNT10A are transferred to input capture register ICR10A and TCNT10A then starts over from zero every time a CKPS pulse arrives.

The value in ICR10A is divided by 64 and written into the downcounter TCNT10C and also into the reload register RLD10C. When TCNT10C gets to 00000001, it sends a pulse to increment counter TCNT10G, then TCNT10C starts counting down again, starting from the value stored in the reload register RLD10C.

Since the reload register holds a number that is 1/64th the value of what is in the input capture register, the downcounter counts down to zero 64 times before the next CKPS pulse arrives - unless the next pulse arrives late, which is what happens when the 2 'missing' poles occur.

Each time a CKPS pulse occurs, it also clears TCNT10G.

So, TCNT10G counts up to 64 before the next CKPS pulse clears it to zero, and the process repeats.

If TCNT10G is counts up to the same value as that stored in general register GR10G, then a compare/match flag is set which causes the ECU to be interrupted, signalling that the missing pulses have been detected.

GR10G is loaded with a value that results from a map lookup ... it's a simple 1-dimensional map with 17 values in it ... and they're all the same value (H'200)
so regardless of the lookup value, the map yields the same result, H'200 = 512 ...
this is divided by 4 and written into GR10G ... 512/4 = 128

So after the 22nd pulse, there's a gap of two missing pulses before pulse #1 happens again. TCNT10G counts up to 64 when the first missing pulse 'passes' by, and it is up to 128 when the second missing pulse passes, and at this instant TCNT10G = GR10G and triggers the interrupt.

The very same interrupt (interrupt #180) is also triggered every time a CKPS pulse arrives.

So the ISR that services the interrupt first of all has to decipher whether the interrupt was caused by the arrival of a CKPS pulse, or because the missing CKPS pulses were detected. This is done by examining which flags were set ...



__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard