Should you set R42 back to what was in [700], after you change it to aaaa?
This way your guaranteed to not mess with R42 setting it to a different value.
Flex Fuel Control
-
- Posts: 399
- Joined: 2021 Feb 15, 22:12
- Location: Sacramento CA
- Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1
Re: Flex Fuel Control
It’s is earlier written as byte AA for KAMQA so I didn’t bother
Re: Flex Fuel Control
A 0x42 already holds 0xAA just load 0xAA into 0x43 instead of the 0xAAAA into 0x42 and save a state time :D
-
- Posts: 399
- Joined: 2021 Feb 15, 22:12
- Location: Sacramento CA
- Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1
Re: Flex Fuel Control
Making some progress on updating KAMAFR using the built in (U)ROLAV function. I borrowed the time constant tcegr which is 2 seconds. Not sure if I should increase that or not.
Code: Select all
Sub_a30d:
a30d: ef,2e,b1 call 543e Sub_543e (); 'previously called from background fuel sub
a310: 32,9f,01 jnb B2,R9f,a314 if (B2_R9f = 1) { 'Return if in open loop
a313: f0 ret return; }
a314: a3,ee,96,32 ldw R32,[Ree+96] R32 = [716]; 'KAMAFR
a318: a0,96,34 ldw R34,R96 R34 = R96; 'LAMBSE1
a31b: a3,f8,18,36 ldw R36,[Rf8+18] R36 = [adf0]; 'TCEGR 0800h = 2 seconds according to docs
a31f: ef,50,a4 call 4772 Sub_4772 (); 'UROLAV function, not sure how that differs from ROLAV
a322: c3,ee,96,3e stw R3e,[Ree+96] [716] = R3e; 'New value for KAMAFR. More code is needed here to make sure valid
a326: f0 ret return;
-
- Posts: 6297
- Joined: 2021 Feb 15, 12:23
- Location: Metairie, LA
- Vehicle Information: Work Truck
'25 F-150 5L
Re: Flex Fuel Control
prob best to use the adaptive delay timer and conditions before trying to assimilate the lambse
-
- Posts: 399
- Joined: 2021 Feb 15, 22:12
- Location: Sacramento CA
- Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1
Re: Flex Fuel Control
Thinking r34 needs to be kamafr * lambse1 yeah? Looks like I need to do some math/conversion here. Lambse is x/32768 and AFR is 524288/x
-
- Posts: 6297
- Joined: 2021 Feb 15, 12:23
- Location: Metairie, LA
- Vehicle Information: Work Truck
'25 F-150 5L
Re: Flex Fuel Control
no
you want to be able to define a range
i.e. part throttle, 1500-2500 rpm, 50-70 mapope, etc...
temp alone wont cut it
you want to be able to define a range
i.e. part throttle, 1500-2500 rpm, 50-70 mapope, etc...
temp alone wont cut it
Re: Flex Fuel Control
Out of curiosity have you datalogged LAMBSE to see how stable the value is when using a fuel with a different stoichiometric A/F ratio to petrol. Or seen how long it takes to stabilise when a different fuel is added to what is already in the tank? I think these behaviours are important for how you need to determine the nominal stoichiometric A/F ratio.
LAMAVE might be a better value to use instead of LAMBSE.
Regarding code thrift, whilst my prior comment was a bit tongue in cheek, it is worth considering keeping any additional code as short and concise as possible. For example, at 0xA310 if you change it to a jump to quit if in open loop you can omit the return instruction at 0xA313 and fall through if in closed loop.
LAMAVE might be a better value to use instead of LAMBSE.
Regarding code thrift, whilst my prior comment was a bit tongue in cheek, it is worth considering keeping any additional code as short and concise as possible. For example, at 0xA310 if you change it to a jump to quit if in open loop you can omit the return instruction at 0xA313 and fall through if in closed loop.