Changing lambdaSensors.ini for Zeitronix WB ?

Questions specific to Megatune. (Only about the tuning software, not about MS1/MS2 code or code features)
Note that Megatune is obsolete.
Post Reply
Zaphod
Master MS/Extra'er
Posts: 390
Joined: Thu Aug 14, 2008 11:38 pm
Location: Germany

Changing lambdaSensors.ini for Zeitronix WB ?

Post by Zaphod »

Hi guys,

As I will be using me already installed Zeitronix ZT-2 WB with the Megasquirt, I had a look at the Megatune 2.25 and there is just the option of the non-linear wideband output of the ZT-2 and that makes the AFR Target tables to read in Volt. (the newer ZT-2 have a non-linear, as well as a linear output)

As I don't wan't to hassle with the AFR/Volt calculation all the time (and I am used to deal with AFRs from the EMU) I had a look at the background of the lambda sensors in Megasquirt.

There is the lambdaSensors.ini file within the Megatune2.25/mtCfg/ folder. In this file there seem to be all the calculation algorithms for the AFR calculation from the voltages comming from the WBO2.

like for the Innovate 0-5v 10-20:1 AFR

#elif INNOVATE_0_5_LINEAR
afr = { 10 + egoADC * 0.039216 }
lambda = { afr / 14.7 }
TargetAFR = { 10 + afrtarget * 0.039216 }
TargetLambda = { TargetAFR / 14.7 }

Would it be possible to change this ini-file to match the ZT-2 linear output?
Zeitronix descibes the function for the AFR at the linear output as follows:

"The Linear Wideband Output transfer function is AFR=2xV+9.6"

This is were my knowledge at this point ends - I don't know what the string egoADC means, it is not the sensor voltage - because otherwise it wouldn't fit the AFRs.

Just a thought to make the life for the ZT-2 user a bit easier. Any ideas?

*****

O.K. found some more new background (at least for me, I suppose the pro's already know this...)

In a thread at your board:

Q:
I was looking at the formula in lambdasensors.ini and for the LM-1, the formula is: 10 + egoADC * 0.039216. I'm confused on what the 0.039216 value is for because it doesn't look like [O2] * 2 + 10 to me.

A:
The difference is one is working against O2 volts (0-5) the other is ADC (0-255)
ADC 0 = 0V
ADC 255 = 5V

so:
5/255 = 0.01960784313
so:
2*0.01960784313 = 0.03921568627

Therefore:
10 + egoADC * 0.039216
and
10 + O2volts * 2
are the same

So in the case of the ZT-2 it would be:
afr = { 9.6 + egoADC * 0.039216 }
lambda = { afr / 14.7 }
TargetAFR = { 9.6 + afrtarget * 0.039216 }
TargetLambda = { TargetAFR / 14.7

Right? Wrong?
I appreciate any help.
Thanks!
__________________
Greetings from Germany
--------------------------------
fun is not a straight line

Image

Sven
http://www.mx-5club-sachsen.de
http://miata.cardomain.com/id/svenmx5
NB-1998-1,6-Garrett T25 HGP Turbo Stage I
LT401Vette
Super MS/Extra'er
Posts: 12731
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Changing lambdaSensors.ini for Zeitronix WB ?

Post by LT401Vette »

Looks like you got it right.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
Zaphod
Master MS/Extra'er
Posts: 390
Joined: Thu Aug 14, 2008 11:38 pm
Location: Germany

Re: Changing lambdaSensors.ini for Zeitronix WB ?

Post by Zaphod »

Hi,

thanks for the reply -

I suppose, I do also have to change the msns-extra.ini in my cars project folder?

#elif INNOVATE_0_5_LINEAR
afrBins1 = array, U08, 0, [8x8], "AFR", 0.0392, 255.0, 10.0, 20.0, 1

to

#elif INNOVATE_0_5_LINEAR
afrBins1 = array, U08, 0, [8x8], "AFR", 0.0392, 255.0, 9.6, 19.6, 1

Is this also correct?

Thanks!
--------------------------------
fun is not a straight line

Image

Sven
http://www.mx-5club-sachsen.de
http://miata.cardomain.com/id/svenmx5
NB-1998-1,6-Garrett T25 HGP Turbo Stage I
LT401Vette
Super MS/Extra'er
Posts: 12731
Joined: Sat Jul 16, 2005 8:07 am
Location: Moorseville, NC
Contact:

Re: Changing lambdaSensors.ini for Zeitronix WB ?

Post by LT401Vette »

Good catch, that would fix your mins and max's, but then you also need to tweak your translate so it starts at 9.6:1 on display. so:

Code: Select all

#elif INNOVATE_0_5_LINEAR
afrBins1 = array, U08, 0, [8x8], "AFR", 0.0392, 244.8, 9.6, 19.6, 1
On the innovate the translate would add 255 to the byte value, then multiply by the scaler (0.0392), so a true byte value of 0 would be 10 in your display. Changing that to 244.8 will make a true byte of 0 = 9.6:1 in your display.
Phil Tobin
EFI Analytics, helping to simplify EFI
Next Generation tuning software.
Supporting all MegaSquirt versions and firmwares.
http://www.TunerStudio.com
http://www.efiAnalytics.com/MegaLogViewer/
Support the firmware running your engine:
http://www.msextra.com/doc/donations.html
Zaphod
Master MS/Extra'er
Posts: 390
Joined: Thu Aug 14, 2008 11:38 pm
Location: Germany

Re: Changing lambdaSensors.ini for Zeitronix WB ?

Post by Zaphod »

Thanks again for that!
--------------------------------
fun is not a straight line

Image

Sven
http://www.mx-5club-sachsen.de
http://miata.cardomain.com/id/svenmx5
NB-1998-1,6-Garrett T25 HGP Turbo Stage I
Post Reply