DLP AFR linearisation

Discuss software bugs and related problems here.

Moderator: Matt

Post Reply
gtsaurus
 

Posts: 5
Joined: Tue Oct 28, 2008 11:36 pm
Location: Central Coast

DLP AFR linearisation

Post 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.
Last edited by gtsaurus on Thu May 29, 2014 11:14 pm, edited 1 time in total.
Matt
Site Admin
 

Posts: 8961
Joined: Sun Jan 29, 2006 1:45 am
Location: Adelaide, Australia
Contact:

Re: DLP AFR linearisation

Post 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
gtsaurus
 

Posts: 5
Joined: Tue Oct 28, 2008 11:36 pm
Location: Central Coast

Re: DLP AFR linearisation

Post by gtsaurus »

10 bit analog input max value 1024 /2 *10 =5120 how does this scale to 0-5000 for the volts
Matt
Site Admin
 

Posts: 8961
Joined: Sun Jan 29, 2006 1:45 am
Location: Adelaide, Australia
Contact:

Re: DLP AFR linearisation

Post 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)
gtsaurus
 

Posts: 5
Joined: Tue Oct 28, 2008 11:36 pm
Location: Central Coast

Re: DLP AFR linearisation

Post by gtsaurus »

Ok I assumed the default of 0-5000 was for the DLP Io8 that is a 10 bit A-D thanks Matt
Post Reply