Originally Posted by
kur4o
The math is correct, but being waste spark, coil is fired each 360* or 10ms for 6000rpm.
I'm not a professional mechanic, and I've personally seen a half dozen of those waste spark coil packs melt around the towers on pre-2002 3.8L v6s - most with less than 200k miles on them. They were perfectly adequate on low-revving stuff, but I don't think GM used them on many "performance" setups with redlines > 5000rpm.
The waste spark coils they're using on the current 3.9L v6s seem to be much more robust.
Originally Posted by
kur4o
Lt1 pcm also converts dwell to degrees but only on startup situation. There is also some sophisticated system timer. Based on the timer each routine is executed on the timer basis with fixed intervals. Adding that kind of stuff may give you better control of code flow.
Maybe a project for next winter. Time based control would be nice, but there's only one 16 bit timer available on the AVR so if it's possible to handle sequencing overlapping dwells with just that, I haven't wrapped my head around how to approach it.
Coolant detection based on the 12057 cranking spark advance table looks like it will work.
First column is engine runtime in seconds, C is internal ecu engineering units - convert to celcius with (X*0.75)-40, V is obvious and M is raw adc count of the MAP input.
Code:
diy-ltcc-0.9.20
startDegrees=8 startLRCount=1 startSeqDeg=0 invertSeq=0 firstCyl=1
tbl0Val=93 ectMaxTmp=112 ectMinTmp=80
ectTable=0 tdcEvents=0 ectValue=93 initSaDegrees=9 firstFire=1 adcEctRaw=93
1 : F 9074 : C 91 : V 11.03 : M 897
2 : F 8242 : C 91 : V 11.25 : M 565
3 : F 8194 : C 92 : V 12.91 : M 518
4 : F 8200 : C 91 : V 14.14 : M 537
5 : F 8185 : C 91 : V 14.25 : M 479
6 : F 8184 : C 91 : V 14.04 : M 453
Transition to table1 worked as expected.
Code:
173 : F 8183 : C 118 : V 14.04 : M 348
174 : F 8191 : C 118 : V 14.00 : M 348
175 : F 8186 : C 118 : V 14.04 : M 342
176 : F 8192 : C 118 : V 14.07 : M 333
177 : F 8188 : C 120 : V 13.45 : M 336 < I forgot to have it spit a message out, but transition would have happened here
178 : F 8188 : C 121 : V 13.03 : M 334
179 : F 8184 : C 119 : V 14.04 : M 345
180 : F 8187 : C 119 : V 14.12 : M 335
181 : F 8193 : C 119 : V 14.00 : M 346
182 : F 8187 : C 119 : V 14.12 : M 344
183 : F 8189 : C 119 : V 14.07 : M 338
184 : F 8189 : C 120 : V 14.04 : M 335
185 : F 8184 : C 123 : V 12.82 : M 356
186 : F 8193 : C 120 : V 14.00 : M 334
187 : F 8189 : C 120 : V 14.04 : M 349
188 : F 8188 : C 120 : V 14.00 : M 330
189 : F 8189 : C 120 : V 14.02 : M 338
190 : F 8188 : C 121 : V 14.11 : M 344
191 : F 8189 : C 121 : V 14.00 : M 345
192 : F 8189 : C 121 : V 14.04 : M 330
193 : F 8188 : C 121 : V 13.99 : M 350
194 : F 8189 : C 122 : V 14.04 : M 333
195 : F 8193 : C 122 : V 13.97 : M 318
196 : F 8186 : C 122 : V 14.00 : M 340
197 : F 8181 : C 122 : V 13.97 : M 338
I'll have to test a bunch of different scenarios but the code is pretty simple.
Code:
uint8_t discEctTbl(uint8_t rawEct) {
// read the lookup value from table0 based on current raw ect value
uint8_t tbl0Val = pgm_read_byte(&ectTable[0][rawEct]);
uint8_t ectMinTmp = 128;
uint8_t ectMaxTmp = 128;
// iterate the cranking spark table from both directions
for (uint8_t i = 16; i < 255; i--) {
if (pgm_read_byte(&crankSpkTable[i][1]) > initSaDegrees) {
if ( i < 16 ) {
//ectMinTmp = pgm_read_byte(&crankSpkTable[i + 1][0]);
ectMinTmp = pgm_read_byte(&crankSpkTable[i][0]);
} else {
ectMinTmp = pgm_read_byte(&crankSpkTable[16][0]);
}
break;
}
}
for (uint8_t i = 0; i < 17; i++) {
if (pgm_read_byte(&crankSpkTable[i][1]) < initSaDegrees) {
if ( i > 0 ) {
//ectMaxTmp = pgm_read_byte(&crankSpkTable[i - 1][0]);
ectMaxTmp = pgm_read_byte(&crankSpkTable[i][0]);
} else {
ectMaxTmp = pgm_read_byte(&crankSpkTable[0][0]);
}
break;
}
}
if (ectMinTmp == ectMaxTmp) {
if (ectMinTmp == 0 || ectMinTmp == 255) {
if (ectMinTmp == 0) {
ectMaxTmp = 16;
} else {
ectMinTmp = 240;
}
} else {
// this should never happen, but if it does increase the spread
ectMinTmp -= 8;
ectMaxTmp += 8;
}
}
#ifdef TEMP_DEBUG
Serial.print(F("tbl0Val="));
Serial.print(tbl0Val);
Serial.print(F(" ectMaxTmp="));
Serial.print(ectMaxTmp);
Serial.print(F(" ectMinTmp="));
Serial.println(ectMinTmp);
#endif
// at this point there should be a range in ectMinTmp and ectMaxTmp that the current actual temp should reside in
if (tbl0Val > ectMinTmp && tbl0Val < ectMaxTmp) {
return 0;
} else {
return 1;
}
}
Bookmarks