Originally Posted by
kur4o
The fluctuation you get might be normal play. The PCM also have built in error margin. It is +-2 degrees from mid point for high resolutions counter. I`ve monitor the counter it is called CYLID in the stream. The midpoints are 46,56,66,76 and 86 for different cylinders.
I wanted to reply to this the other day but was busy getting my hands dirty. The numbers your'e seeing there directly correlate to this function in the sequence detection.
Code:
int8_t detectSequence(uint8_t seqDegrees) {
// note: returns the index of sequencer array, not cylNo
if ((seqDegrees > 82) && (seqDegrees < 90)) {
return -1;
} else {
// 90 - 14 = 76 #4
if ((seqDegrees > 72) && (seqDegrees < 80)) {
// next cyl #4
return 2;
// 90 - 24 = 66 #6
} else if ((seqDegrees > 62) && (seqDegrees < 70)) {
// next cyl #6
return 4;
// 90 - 34 = 56 #7
} else if ((seqDegrees > 52) && (seqDegrees < 60)) {
// next cyl #7
return 6;
// 90 - 44 = 46 #1
} else if ((seqDegrees > 42) && (seqDegrees < 50)) {
// next cyl #1
return 0;
}
}
return 0;
}
Where 86 are the four non-indexed low-res slots, four degrees wide (2, 3, 5 & 8).
Originally Posted by
kur4o
i checked some logs and compare result. On steady throtle till 3-4000 rpm you get most of the time *6s, At higher rpm and rapid accelerations you go at *5s and very rare 4*. I checked your last log and there is excessive *5 at low rpm.
Can you give me timestamps of this? The number here directly correlates to the error statistic "E" that the controller is streaming. Essentially $EE is giving the degree count when the low res slot ends (falling edge) as "CYLID". Mine is giving the remainder of 90 minus however many high res degrees were counted since the last low res rising edge (TDC). If it isn't counting 90 between each TDC signal then an interrupt was missed or there was some oscillation of the cam or distributor shaft that caused the phototransistor to be switced on and off twice on one trigger edge. It's been a week or better since I looked over these logs, but I don't recall seeing consistent error counts at low RPMs in the plaintext logs. This makes me think the PCM might be missing interrupts more than the controller is. It's also possible on vented optis that a few thousands of clearance between the cam dowel pin and the index slot in the opti drive could be to blame.
Whatever the case, I wanted to thank you for describing how the PCM keeps time on the low res pulses for RPM. It got me thinking in the right context to optimize the RPM tracking. I was hung up on needing absolute / literal time intervals (i.e. microseconds) to work with, but I was able to find a timer prescaler that let me have 16us resolution (very adequate) while keeping the low res timer value / RPM lookup in a 16 bit space as well as eliminating a bunch of uneccessary code. I was also able to change the lookup table so it uses these same time intervals, which eliminated the need to perform any math beyond comparisons for RPM tracking. Ultimately I'll have the uart logging spit out this raw number as well, and then will use a script or something on the computer that's doing the logging to convert it to human readable RPMs.
The next thing I'd like to tackle is doing something similar with voltage detection. The way it currently works the controller is taking the raw ADC values and converting that to millivolts, then translating that to an index to the voltage table (1v / row). The millivolt conversion and subsequent dissection into human readable voltage is highly intensive floating point math. If I can figure out how to handle the table creation using the precompiler I hope to be able to do the same with voltage detection so it uses the raw ADC values for table lookups. This will speed things up immensely.
Edit: after dropping 8 bennys on a new clutch and flywheel yesterday I needed to do something a little lighter and less depressing, so I installed my freshly painted coil brackets. Notice, no wood grain!
Pic1
Pic2
Pic3
Bookmarks