NefMoto

Technical => Reverse Engineering => Topic started by: elRey on November 18, 2012, 08:03:08 PM



Title: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 18, 2012, 08:03:08 PM
thinking out loud..

variables to watch:
wkrma = 0
! B_kfzk
B krdws ?
fra_w/frau_w/frao_w > FRAUMX/FRAOMX after time delay (new constant)
rl_w and rlsol_w < x (to prevent switching up under highload)

Maps to switch:

KRKTE
KFZW/KFZW2
KFZWOP/KFZWOP2
LDRXN (if desire more boost on E85)

coldstart/warmup fueling maps ??



But, needs to be a flipflop. If not, once KRKTE is switched then fra_w will decrease and then function will switch back. Needs to be 'sticky' until non-E85 detected. And sticks after turning off engine. i,e, is turn off with switched to E85, then next start is still with E85 maps.

wkrma > x (new constant)
or
B_kfzk
or
B krdws ?
or
fra_w/frau_w/frao_w < FRAUMN/FRAOMN after time delay (new constant)



So map switching depends on B_e85 set or cleared based on detection.


Please add/correct. Would really like to get a simple E85 switching so I don't have to set channels via unisettings everytime I change fuels.

---------------------------------------------
I. Detection
  A. fuel trim
  B. knock
II. Required running conditions
  A. load (actual/requested)
  B. engine speed
III. Reset
  A. fuel trim
  B. knock
IV. Make sticky
V. Switching
  A. maps

work in progress
(http://creativeion.com/rey/vw/help/me7/e85_switch_flow.gif)

(http://creativeion.com/rey/vw/help/me7/e85_switch_flow_outline.gif)


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 18, 2012, 08:27:50 PM
I decided to write a map switching routine because I found a local E85 station and would like to make the switch.

I'm not sure if surrendering control over to a custom routine is such a good idea though. It would have to be very robust to ensure that there isn't an erroneous switch.

Maybe even a incremental "flex fuel" type adjustment.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 18, 2012, 08:42:05 PM
It would have to be very robust to ensure that there isn't an erroneous switch.

This is what I'd like to discuss. I understand the concern. A boost leak and cause frao_w > FRAOMX and possible switch maps when you wouldn't want it to.

So, I'd like to discuss other checks. How can we distinguish between boost leak induced high fra_w and fuel type? Or bad o2 sensor.

-The switch TO E85 (or up) should never happen under load. Switching out of E85 (or down) can.
-....


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: rajivc666 on November 19, 2012, 03:54:45 AM
 ;D Exactly my thought, flex fuel. Have got some ideas like shifting the maps to ram so that it can be variable as required, but I dont understand tuning much. As of now busy with something else so will pick up on this later, can somebody make a logical flow chart as what is to be exactly done, and what controls have to be put in place.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: prj on November 19, 2012, 06:16:25 AM
For flex fuel tuning you will need to go off of O2's and knock sensors pretty much.
You will need to create an algorithm that will take these two in account and then progressively shift KRKTE and timing.
You will need to interpolate between two krkte's and two timing maps based on the detected alcohol content, plus the cold start maps.
It is possible to look at the fnwue code and how it interpolates stock between KFZW and KFZW2, and do something similar.
The knock sensors must be used as a sanity check, so that the algorithm does not go crazy if you have an air leak somewhere.

But as the first thing it is a good idea to define an algorithm where the input will be the O2 sensor data, probably short term trims and so on, plus the knock sensor data, and the output will be a "fnwue" type variable which will indicate alcohol content in the fuel.

After a good specification for the algorithm is made, the next step is to implement it. This algorithm is basically a software based alcohol sensor.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: rajivc666 on November 19, 2012, 07:04:46 AM
Thanks prj . Will have to digest the information do some reading. 


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 19, 2012, 07:16:33 AM
For flex fuel tuning you will need to go off of O2's and knock sensors pretty much.
You will need to create an algorithm that will take these two in account and then progressively shift KRKTE and timing.
You will need to interpolate between two krkte's and two timing maps based on the detected alcohol content, plus the cold start maps.
It is possible to look at the fnwue code and how it interpolates stock between KFZW and KFZW2, and do something similar.
The knock sensors must be used as a sanity check, so that the algorithm does not go crazy if you have an air leak somewhere.

But as the first thing it is a good idea to define an algorithm where the input will be the O2 sensor data, probably short term trims and so on, plus the knock sensor data, and the output will be a "fnwue" type variable which will indicate alcohol content in the fuel.

After a good specification for the algorithm is made, the next step is to implement it. This algorithm is basically a software based alcohol sensor.

Exactly what I was thinking, but the hard part will be the activation conditions and scaling of the interpolation factor.

What conditions can only exist as a result of running E85 on 93 oct maps?

The interpolation of KFZW and KFZW2 is fairly simple. IIRC, if fnwue is >= 99% then KFZW2 is used. For fnwue of 0, KFZW is used. Else, ((1 - fnwue) * KFZW) + (fnwue * KFZW2). The trick would be scaling the "fnwue" type factor based on conditions.

We would have to determine exactly how different concentrations of ethanol affect our control variables.

Edit: KFZWOP(2) is not necessary. Also, whatever conditions we determine would have to be fast acting enough that we adapt before any damage can be done.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 09:01:29 AM
I would request that a flex-fuel scaling functionality, as you are discussing now, have it's own thread. One that can go beyond what I intended for this thread.

I'd like to keep this thread just about switch back forth from gas to E85. Once we have working code, you can take it from there, or for those not interest in anything less that the scaling flex-fuel can ignore this thread and continue the great discussion in it's thread.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: rajivc666 on November 19, 2012, 09:15:55 AM
If you are only interested in e85 switch then imo you are better off using manual switch, and yes the mode is remembered even after the car is switched off as long as the ecu is has supply. Also can learn from this discussion.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: prj on November 19, 2012, 09:21:54 AM
I would request that a flex-fuel scaling functionality, as you are discussing now, have it's own thread. One that can go beyond what I intended for this thread.
Actually the first part - the alcohol detection algorithm is still very valid and exactly on topic here.

What conditions can only exist as a result of running E85 on 93 oct maps?
The car will start running really lean. So what you do, is start adding fuel and phasing in timing.
If it is indeed E85, then you will be able to phase in timing and little to no retard will take place under load.

The knock sensors are a safety boundary. If severe amounts of knock are encountered and high CF's result under load it means a fault is present.
In this case it should be stepped back until knock subsides.

You basically need short term fuel trim and wkrma, and then some logic.
Whether you do incremental phasing and adjustment or just a hard switch - the detection logic is the same.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 09:35:49 AM
Agreed. The detection is what I what to discuss. Just not the incrementing part (NWS like).

I believe I started the detection conditions in the OP.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: prj on November 19, 2012, 09:37:29 AM
Sticky functionality can be done by writing the state into the EEPROM.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 09:41:33 AM
Sticky functionality can be done by writing the state into the EEPROM.

Do you have example code, or existing b_ variable, or Doc function that does this?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 19, 2012, 09:51:07 AM
 I agree with rajivc that if you are only interested in a hard shift then a manual switch to another set of maps makes alot more sense, but I'll play along.

The RAM is persistent, so the state of the variables remains after shutdown. No writing to the EEPROM is necessary.



Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: prj on November 19, 2012, 09:54:26 AM
I agree with rajivc that if you are only interested in a hard shift then a manual switch to another set of maps makes alot more sense, but I'll play along.

The RAM is persistent, so the state of the variables remains after shutdown. No writing to the EEPROM is necessary.

Yes, that is true. But if you want to do it right, you would write it to the EEPROM IMO.
Because otherwise good luck starting the car on E85 on a cold day if for some reason you had to disconnect the battery or remove the ECU.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: rajivc666 on November 19, 2012, 10:02:35 AM
Automatic switch or not there should be an option to switch manually. This is what setzi62 wrote about writing to EEPROM
"The EEPROM is connected to the CPU via an SPI bus, it is the SSC in the C167.
Look for SSCCON in the code."


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 19, 2012, 10:16:26 AM
Yes, that is true. But if you want to do it right, you would write it to the EEPROM IMO.
Because otherwise good luck starting the car on E85 on a cold day if for some reason you had to disconnect the battery or remove the ECU.

Makes sense. I would also suggest having a way to manually override as a backup too.

Back to detection...

How can we differentiate between a faulty MAF and E85?

Fuel trims and absence of KR alone can't do that?

Will LTFT learn fast enough to make the switch before any damage is done?

%STADAP might be useful.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 11:07:11 AM
I'll maintain a flow diag and an outline in OP that we can refer to. Specifically the outline to know what aspect is currently being discussed.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: prj on November 19, 2012, 11:19:28 AM
Btw elRey, are you aware that in winter more gasoline is blended into the E85 mix and in summer less gasoline?
Binary solutions don't work very well for E85 fueling... It is not the end of the world of course, but doing it right would involve a progressive system.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 11:34:11 AM
I'm aware. But look at our current situation. All way have now is a binary solution via full flash, unisettings, or manual switch.

This it just one step further. Are there more steps to beyond this, yes. But I want to concentrate on this one step. Once it's done, we can (and will) build from there.

And rey is fine :)


What about already set condition that we might be able to leverage?

i.e.
I.A -> B_frmax


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 19, 2012, 03:34:23 PM
Makes sense. I would also suggest having a way to manually override as a backup too.

Back to detection...

How can we differentiate between a faulty MAF and E85?

Fuel trims and absence of KR alone can't do that?

Will LTFT learn fast enough to make the switch before any damage is done?

%STADAP might be useful.

Well I consider the conditions to SET the switch and conditions to RESET to be separate. Maybe use LTFT to SET but frm_w over a small amount of time to RESET?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 21, 2012, 06:21:49 PM
Will help if I provide you some ME7.5.10 files used in flex fuel cars in Brazil ? (C20/93oct to E100/110oct fuels)

I Guess I have some for EA827 2.0 8v and EA111 1.6 8v NA engines


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 21, 2012, 11:27:10 PM
Will help if I provide you some ME7.5.10 files used in flex fuel cars in Brazil ? (C20/93oct to E100/110oct fuels)

I Guess I have some for EA827 2.0 8v and EA111 1.6 8v NA engines

In a big way!


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 22, 2012, 06:31:55 AM
For now found just an EA827 1.6 8v ME7.5.30 (will try to find ME7.5.20 and ME7.5.10 wirh Flex system)

Don´t know if will help, but there is also Astra / vectra 2.0 Flex with ME7.9.6


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 22, 2012, 08:38:03 AM
For now found just an EA827 1.6 8v ME7.5.30 (will try to find ME7.5.20 and ME7.5.10 wirh Flex system)

Don´t know if will help, but there is also Astra / vectra 2.0 Flex with ME7.9.6

Thank you. The file you posted seems to be ME7.9.6. I'll dive into it tonight.

Were there any Turbocharged Total Flex vehicles offered in Brazil or just NA Total Flex?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 22, 2012, 09:46:21 AM
Sorry...forget to attach the ME7.5.30

Only NA engines, one friend in FIAT said that to make ME7.9.10 (Fiat Punto GT 1,4 turbo 155cv) bosch asked too much.








Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 22, 2012, 09:57:05 AM
By the way, if You find how to deactive the "flex" system in these files I´ll be very Happy !!!


Thanks in advance !


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 22, 2012, 01:27:54 PM
Are these cars equipped with a flex fuel sensor?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 22, 2012, 02:16:03 PM
From the little reading I've done, no. They use a SFS (Software Fuel Sensor) using existing sensors. IE what we are trying to do.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 23, 2012, 11:21:03 AM
just example of dual map I found (not from flex file). Probably nothing different from switching maps thread.

Code:
movbz   r2, byte_FA26
shl     r2, #2
mov     r12, [r2+word_815D50]
mov     r13, [r2+word_815D52]
mov     r14, #211h
mov     r15, #206h
calls   83h, LookupZ_83445c ; KFVAKL Lookup


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 26, 2012, 12:39:39 PM
As elrey said the use an Marelli patent solution called SFS, wich is no much more of leave the narrowband sensors find an multiplier called "K" wich is the ethanol/gasoline proportion.

The process to find K is started by some situations like when you start the ignition and the fuel was more than 20 liters (some cars is 10 or 15 liters) than it was before... an guy said that there is another triggers to begin the "K adaption" like if the misture is lean and have no detonation (means that Ethanol -wich is 110oct- is more present)



Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 26, 2012, 01:52:14 PM
By the way, if You find how to deactive the "flex" system in these files I´ll be very Happy !!!

What behavior are you trying to disable?
What does it do that you do not like, and what do you want it to do instead?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 26, 2012, 02:25:53 PM
The problens are:

1- CR, some engines are 10,5:1... in this case Etanol can´t reach the best consuption or power.

Some engines more moderns are about 12:1 but in this case the operation with pure gasoline is bad, the calibration make it run richer and with low advance... besides, the best CR for etanol are about 12,5 to 13,5:1

You can´t reach the best condition ever !!!


2- We convert several NA engines to turbo... 10,5:1 gasoline engines using etanol can handle more 12psi even without intercooler... but SFS don´t deal very well.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 26, 2012, 02:45:37 PM
Do you want the ECU to stay on ethanol mode or gasoline mode?

To me it looks like the stock ECU adds timing and fuel BUT decreases power for better consumption in ethanol. Is this true?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: phila_dot on November 26, 2012, 03:08:58 PM
To me it looks like the stock ECU adds timing and fuel BUT decreases power for better consumption in ethanol. Is this true?

Where are you getting this?

I disassembled the 05A9 file but haven't gotten to go through it at all. Just curious if you've identified any of the flex fuel code.

What's up with the "ME7.5" VW file size?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 26, 2012, 03:33:30 PM
The clear example of different maps being used is KFPED. I followed that condition to what looks like the use of fnwue. Since fnwue was used on the 1.8T to use different timing, etc it makes sense to use it for ethanol content.

I see where they set fnwue and one other similar variable by 2D maps, but I have yet to identify the input for those maps and how it's related to ethanol content.

edit: frau_w is the input to map that sets fnwue (like) var. So, it does seem to be apart of the flex functionality.

But from overspeed's comments, I don't think it will be much better than what we can come up with vs time spent trying to reverse these files.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 26, 2012, 08:46:55 PM
It looks like it doesn't adjust fueling. It stays at a high frm and uses that value (frau_w specifically) to scale a timing additive. It also looks at B_kfzk and some variable from KRDY as a condition to use frau/fnwe based timing additive or not.

So, overspeed, you never did specify what you want (clearly). Are these narrowband or wideband cars?


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 27, 2012, 09:41:39 AM
What we realize is the primary calibration is on ethanol (with prioritary target to minimize consuption, but power is lower than could be), is the ECU see that is too much rich it tend to guess it has some gasoline, so the natural path is to lean the misture and decrease advance, but there is some combinations of K that means too much advance for turbo converted engines and too lean that can give some detonation.... besides it mess with start and dont´work good at all.

So, there is two issues:

1- in NA engines You never can reach the best power on ethanol or best consuption in gasoline
2- in turbo converted engines you can´t stay at stable values because the system tend to lean in some condition (partial load) that in a turbo engine can be dangerous.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 27, 2012, 05:09:47 PM
Why is the car running rich on ethanol ? The ECU requests a specific lambda based on ethanol, it is running ethanol, why is it running richer than requested?

So, you are asking for a tune, not just a deactivation of flex functionality.


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: overspeed on November 27, 2012, 06:17:27 PM
No, You didn´t understand (my bad, english is not my first language lol !)...

Let´s say the car is now with an turbo convertion using E100, you put the gas on the floor and obviously the misture go rich as you want, in some cases the ECU start to recalculate the K factor and mess with both misture (go leanner that you want) and advance (start to take advance only when start detonation in some cases)

I´m talking about generall ME7 (Opel, FIAT and VW)

So, I just want to deactivate the flex system, so it will have "one" advance table (the corrections will be deactiveted) and one fuel without corretions



In other hand, as I said, the NA engines with receive race cams or other modifications ussually have problems...


Title: Re: detect E85 = switch maps (KRKTE, etc)
Post by: elRey on November 27, 2012, 06:41:05 PM
No, You didn´t understand (my bad, english is not my first language lol !)...

Let´s say the car is now with an turbo convertion using E100, you put the gas on the floor and obviously the misture go rich as you want, in some cases the ECU start to recalculate the K factor and mess with both misture (go leanner that you want) and advance (start to take advance only when start detonation in some cases)

I´m talking about generall ME7 (Opel, FIAT and VW)

This is what I do not understand. K factor is only recalculated when reqeusted AFR != actual AFR. At WOT ECU wants rich (request = rich) and if mixture is rich (actual = rich) then request = actual and K should stay same. I can not understand why ECU would recalculate K factor if the ECU is the one that wants to be rich at WOT.

If it is doing what you say, then something else is making mixture rich, richer than ECU is requesting. Do you know what is making mixture rich?

Is turbo before or after MAF sensor?

So, I just want to deactivate the flex system, so it will have "one" advance table (the corrections will be deactiveted) and one fuel without corretions

In other hand, as I said, the NA engines with receive race cams or other modifications ussually have problems...

Do you want ethanol advance table or gasoline advance table?