Page 1 of 1

Serial Output - Injector Duration

Posted: Sat Nov 27, 2010 4:19 pm
by dn-j

I have built a microcontroller interface between the serial output of my Hondata ECU and the serial input of my datalogger system. All works fine, except I can't make sense of the injector duration data format in the serial stream, and I need this for some fuel consumption calculations.

KManager.chm says:

Byte Contents
9-10 MAP (mbar, LSB = 1 mbar)
11-12 Injector duration
13 Ignition timing (degs + 0x80, LSB = 0.5 deg)

So, for injector duration, bytes 11 and 12, it doesn't document the data structure, although it does for all the other values. From the two examples:

11-12 0CAC Inj 12.964 ms
11-12 079D Inj 7.784 ms

It is still not obvious. Please let me know how to do the conversion from the two serial data bytes into injector duration in milliseconds!


Posted: Sat Nov 27, 2010 10:33 pm
by kb58
0x0CAC = 3244 counts, and 12.964ms / 3244 = 3.996, very close to 4.

0x079D = 1949 counts, and 7.784 ms / 1949 = 3.9938, very close to 4.

So it's pretty obvious that each count is 250 us [corrected: 4 microseconds], . Frankly I'm surprised that you have the sw and hw background to get as far as you did, but got stuck on this! This is the easy part! Read the counts in, right-shift by 2 and display, presto!

Posted: Sun Nov 28, 2010 5:55 am
by dn-j
Yeah, that is how we have it implemented at the moment, although it works out as 4us per bit not 250us?

We have implemented:

injectorDuration_us = (packet[11] * 256 + packet[12]) * 4;

but then this gives us:

OCAC = 3244, * 4 = 12.976ms (not 12.964 as documented)
O79D = 1949, * 4 = 7.796ms (not 7.784 as documented)

which is why I asked! Either:

a) The documented examples are wrong
b) It is not simply 4us per bit, eg. a non linear relationship
c) I have missed something

Since there is no 3rd example to verify a linear relationship, and since we want the highest accuracy fuel consumption calculations possible, for endurance racing, I didn't want to assume A above! So was hoping for a definitive answer from Hondata.


Posted: Mon Nov 29, 2010 8:42 am
by kb58
Corrected! I understand your questions better now, but at the end of the day, does the very slight error even matter? You're off by 12 counts out of 12976, or within 0.1% of perfect, is that good enough?

Posted: Wed Dec 01, 2010 1:16 pm
by dn-j
No, you are right, it probably doesn't matter. Especially as my fuel consumption calculations, based on back testing against old ECU data and known fuel figures, is only proving accurate to about 10%. But I just wanted to check I wasn't missing something important.

I have some further calibration to do and compensations to add in and am aiming to achieve 5% accuracy on both fuel flow rate and total fuel consumption calculations.