Flex Fuel Control
-
- Posts: 6297
- Joined: 2021 Feb 15, 12:23
- Location: Metairie, LA
- Vehicle Information: Work Truck
'25 F-150 5L
Re: Flex Fuel Control
would help if you comment out each line and values and have the directive resolve the addresses
-
- 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
Code: Select all
Sub_a30d:
a30d: ef,2e,b1 call 543e Sub_543e ();
a310: 99,55,b6 cmpb Rb6,55
a313: de,46 jlt a35b if (ECT >= 55) { 'criteria 1 'ECT >= 170f
a315: 89,00,20,b2 cmpw Rb2,2000
a319: de,40 jlt a35b if (TP >= 2000) { 'criteria 2 TP >=128 (not accounting for ratch)
a31b: 89,70,17,b4 cmpw Rb4,1770
a31f: de,3a jlt a35b if (N >= 1770) { 'criteria 3 RPM >= 1500
a321: 89,10,27,b4 cmpw Rb4,2710
a325: d6,34 jge a35b if (N < 2710) { 'criteria 4 RPM < 2500
a327: 3a,9f,31 jb B2,R9f,a35b if (B2_OL_FLG = 0) { 'criteria 5 Closed loop. if all criteria met, proceed to calculate rolling average of LAMBSE1. If not jump down to a35b to reset counter and KAMLAMAVE. Should move this to criteria 1.
a32a: a0,96,32 ldw R32,R96 R32 = LAMBSE1; 'Input Parameter 1 for UROLAVE
a32d: a3,ee,9a,34 ldw R34,[Ree+9a] R34 = KAMLAMAVE; Parameter 2
a331: a3,f8,18,36 ldw R36,[Rf8+18] R36 = TCEGR; 'Borrowed EGR Time Constant Parameter 3
a335: ef,3a,a4 call 4772 Sub_4772 (); 'UROLAV Routine
a338: c3,ee,9a,3e stw R3e,[Ree+9a] KAMLAMAVE = ROLLINGAVE; 'Saving result of Function
a33c: a3,ee,9c,32 ldw R32,[Ree+9c] R32 = PASSCOUNTER;
a340: 07,32 incw R32 R32++; 'Increment pass counter
a342: c3,ee,9c,32 stw R32,[Ree+9c] PASSCOUNTER = R32; 'save PASSCOUNTER
a346: 89,40,00,32 cmpw R32,40
a34a: d1,1d jleu a369 if (R32 <= 40) return; 'Only proceed to update KAMAFR after 64 passes.
a34c: 89,00,7d,3e cmpw R3e,7d00
a350: d1,18 jleu a36a if (ROLLINGAVE <= 7d00) goto a36a; 'Jump to enrich if rolling average of lambse is more that approx 4% lean
a352: a1,00,81,34 ldw R34,8100 R34 = 8100;
a356: 88,3e,34 cmpw R34,R3e
a359: d1,19 jleu a374 if (R34 <= ROLLINGAVE) goto a374; } } } } } ' Jump to lean out if more than approx 1% rich
a35b: 01,32 clrw R32 R32 = 0;
a35d: c3,ee,9c,32 stw R32,[Ree+9c] PASSCOUNTER = R32; 'reset PASCOUNTER to 0
a361: a1,00,80,34 ldw R34,8000 R34 = 8000;
a365: c3,ee,9a,34 stw R34,[Ree+9a] KAMLAMAVE = R34; } 'reset KAMLAMAVE to 1.00 Lambda
a369: f0 ret return; }
a36a: a3,ee,96,32 ldw R32,[Ree+96] R32 = KAMAFR;
a36e: 65,ff,00,32 ad2w R32,ff R32 += ff; 'enrich KAMAFR approx 1%
a372: 20,08 sjmp a37c goto a37c; }
a374: a3,ee,96,32 ldw R32,[Ree+96] R32 = KAMAFR;
a378: 69,ff,00,32 sb2w R32,ff R32 -= ff; 'lean out KAMAFR approx 1%
a37c: c3,ee,96,32 stw R32,[Ree+96] KAMAFR = R32; 'Save KAMAFR
a380: 01,32 clrw R32 R32 = 0;
a382: c3,ee,9c,32 stw R32,[Ree+9c] PASSCOUNTER = R32; 'reset passcounter to 0
a386: f0 ret return;
-
- 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
Working on updating crank pw and spark based on KAMAFR. Is it necessary to adjust Startup and WOT Lambse as well?
-
- Posts: 6297
- Joined: 2021 Feb 15, 12:23
- Location: Metairie, LA
- Vehicle Information: Work Truck
'25 F-150 5L
Re: Flex Fuel Control
ideally yeah
typically for e85 youd command .04 lambda richer for wot as compared to gasoline
and startup could be anywhere, an alternate table would be most ideal since its not uncommon for e85 to want less enrichment in some cases
typically for e85 youd command .04 lambda richer for wot as compared to gasoline
and startup could be anywhere, an alternate table would be most ideal since its not uncommon for e85 to want less enrichment in some cases
-
- 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
I am going to need some help with the maths here. The result of this code is a 0ms crank pw so something is obviously wrong with my logic. I am open to better ways than what is here.
Code: Select all
Sub_a260:
a260: a3,ee,96,38 ldw R38,[Ree+96] R38 = [716]; ' R38 = KAMAFR
a264: 89,40,91,38 cmpw R38,9140
a268: de,0a jlt a274 if (R38 >= 9140) { do nothing if IF KAMAFR is greater than or eq to 9140 (14.1:1)
a26a: 69,e5,8b,38 sb2w R38,8be5 R38 -= 8be5; subtract 8be5 (14.7:1) from kamafr
a26e: 0e,0b,38 asrdw R38,b slR38 >>= b; shift result (10:1 AFR should result in 0x0008)
a271: 64,38,3e ad2w R3e,R38 R3e += R38; } 'add result to r3e that is used at 4901:
a274: ac,3b,38 ldzbw R38,R3b wR38 = yR3b; 'continue with code from calling location (used to be at 48fe: below)
a277: f0 ret return;
Code: Select all
48e9: ef,12,fe call 46fe SUWFuncLU_46fe (
48ec: 00,04 #arg 1 Func_a800,
48ee: 38,00 #arg 2 38 );
48f0: a0,38,32 ldw R32,R38 R32 = R38;
48f3: 45,b8,03,f4,38 ad3w R38,Rf4,3b8 R38 = Table_abd2; 'crankpw
48f8: ad,05,34 ldzbw R34,5 wR34 = 5;
48fb: ef,de,fe call 47dc UYTabLU_47dc ();
48fe: ef,5f,59 call a260 Sub_a260 ();
4901: 6c,3e,38 ml2w R38,R3e lR38 *= R3e;
4904: 0c,06,38 shrdw R38,6 lR38 >>= 6;
4907: 89,00,00,3a cmpw R3a,0
490b: df,03 je 4910 if (R3a != 0) {
490d: bd,ff,38 ldsbw R38,ff swR38 = ff; }
4910: ac,ba,36 ldzbw R36,Rba wR36 = yRba;
4913: 6c,36,38 ml2w R38,R36 lR38 *= R36;
4916: 8d,ef,00,38 divw R38,ef wR38 /= ef;
491a: d5,03 jnv 491f if (OVF = 1) {
491c: bd,ff,38 ldsbw R38,ff swR38 = ff; } }
491f: 71,fb,a0 an2b Ra0,fb B2_Ra0 = 0;
4922: 71,ef,a3 an2b Ra3,ef B4_Ra3 = 0;
4925: 6d,73,cb,38 ml2w R38,cb73 lR38 *= cb73;
4929: c3,e4,ea,3a stw R3a,[Re4+ea] [16a] = R3a;
492d: f0 ret return; }
-
- 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
Reading through this again. I think the issue is I re-wrote r38. I am working on a fix