Page 1 of 1

DLP AFR linearisation

Posted: Thu May 29, 2014 11:05 pm
by gtsaurus
hi Matt
I have the Arduino mega with a 2x16 display. uart1 is connected to 2 daisy chained lc1s (r32gtr) uart 0 is connected to nistune. I am scaling AFRs in arduino to match default AFR1 scaling in nistune the raw zero displays 8 in nistune raw 1024 displays 32 in nistune afr of 14.64 in arduino scales to 283 raw(int) but displays in nistune as 14.76
here is my scaling in arduino case DLP_CMD_ANALOG_IN_CH1:
sensorValue = int((fAFR_Front-8) * 1024 /24); fAFR_Front is data type float 283.3 , there appears to be some linearisation around stoich values in nistune. (283 * 24/1024)+ 8 = 14.63
Nistune version 1.2 jan 10 2014.

Re: DLP AFR linearisation

Posted: Thu May 29, 2014 11:14 pm
by Matt
My calculations for AFR are (LSB << 8 | MSB) / 2 * 10 for reading the values

Then I just use the look up table. Voltage 0 -5000 maps to 8-32 using something like current volt/5000 * (32-8) + 8

Re: DLP AFR linearisation

Posted: Fri May 30, 2014 1:20 pm
by gtsaurus
10 bit analog input max value 1024 /2 *10 =5120 how does this scale to 0-5000 for the volts

Re: DLP AFR linearisation

Posted: Fri May 30, 2014 1:21 pm
by Matt
You can change the scaling in the AFR.CSV file in the DLP subfolder to whatever you like (eg 0-5120 instead for example)

Re: DLP AFR linearisation

Posted: Fri May 30, 2014 2:03 pm
by gtsaurus
Ok I assumed the default of 0-5000 was for the DLP Io8 that is a 10 bit A-D thanks Matt