|
Software Tuning Discuss all software tuning topics. |
|
Thread Tools | Search this Thread |
11-11-2015, 07:19 AM | #15 |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Coding for Ethanol based scalings
Coding for Ethanol based scalings (A01G ROM base)
The code below returns and stores a few values based on ethanol content; will describe how to modify ROM and do cranking comp to use these later on: The clutch switch has been added to use as a failsafe in case the code added after is no good for testing purposes so fewer ECUs get bricked - the code only executes if clutch is depressed. Change the "branch if true" instruction at B97E6 to "00 09" (nop) to turn this switch off. Initially the ethanol value in fr9 in passed to fr4 and this value is limited by the Check_Bounds routine at 011260 (max value in fr6 and min value in fr5) The value returned in fr0 (Ethanol content) is stored to RAM_Ethanol and a Fuelling Multiplier is looked up from that table (E0=1.00, E85=1.40 in linear scale) This value is used to multiply the PI Injector Flow Scaling BRZ value for Port injector operation and a GDI multiplier that works on GDI pressure multiplier tables A and B (I call this GDI multiplier C). An interpolating value is then looked up in a table to scale between 2 Primary OL fuelling tables (E0=0.00, E85=1.00). A further interpolating value is looked up for use between 2 base timing tables (E0=0.00, E85=1.00) which are then added to the Knock Correction advance table which remains un-modified. This interpolation value is multiplied by the AVCS active value (0.00 = AVCS not active (looks up Base Timing A), 1.00 = AVCS active (looks up Base Timing B) to use the E0 map as a AVCS inactive map also. Theoretical table values input in image below. Please feel free to contribute data to discussion as to how best to scale these multipliers or interpolants to hit optimal fuelling and MBT with the 12.5:1 compression ratios with or without boost. Code:
000B97DE 000B97DE Check_Clutch: 000B97DE 02 80 93 9B movi20 #RAM_Clutch_SW, r2 000B97E2 60 20 mov.b @R2, r0 000B97E4 88 00 cmp/eq #0, r0 ; Clutch out = 0 (A33-15=12V) 000B97E4 ; Clutch depressed = 1 (A33-15=GND) 000B97E6 89 2A bt loc_B983E 000B97E8 000B97E8 FlexFuel_Scalings: 000B97E8 F4 9C fmov fr9, fr4 000B97EA F5 8D fldi0 fr5 000B97EC D2 39 mov.l #Check_Bounds, r2 000B97EE D6 36 mov.l #Ethanol_Max, r6 000B97F0 42 0B jsr @R2 ; Check_Bounds 000B97F2 F6 68 fmov.s @r6, fr6 000B97F4 D8 2C mov.l #RAM_Ethanol, r8 000B97F6 F8 0A fmov.s fr0, @R8 000B97F8 02 10 13 88 movi20 #Pull_2D_A, r2 000B97FC F1 0C fmov fr0, fr1 000B97FE F4 1C fmov fr1, fr4 ; Pull_2D_A 000B9800 D4 38 mov.l #Ethanol_Fuelling_Comp_Table, r4 000B9802 42 4B jsr/n @R2 ; Pull_2D_A 000B9804 D4 29 mov.l #RAM_Fuelling_Multiplier, r4 000B9806 F4 0A fmov.s fr0, @r4 000B9808 D6 30 mov.l #Injector_Flow_Scaling_BRZ, r6 000B980A F6 68 fmov.s @r6, fr6 000B980C F6 02 fmul fr0, fr6 000B980E D4 28 mov.l #RAM_Flex_PI_Scaling, r4 000B9810 F4 6A fmov.s fr6, @r4 000B9812 D6 2F mov.l #GDI_Pressure_Multiplier_C, r6 000B9814 F6 68 fmov.s @r6, fr6 000B9816 F6 02 fmul fr0, fr6 000B9818 D4 26 mov.l #RAM_Flex_GDI_Mult_C, r4 000B981A F4 6A fmov.s fr6, @r4 000B981C 02 10 13 88 movi20 #Pull_2D_A, r2 000B9820 D4 31 mov.l #Ethanol_Fuelling_Interp_Table, r4 000B9822 42 0B jsr @R2 ; Pull_2D_A 000B9824 F4 88 fmov.s @R8, fr4 000B9826 D4 25 mov.l #RAM_Flex_Fuelling_Interpolant, r4 000B9828 F4 0A fmov.s fr0, @r4 000B982A D4 30 mov.l #Ethanol_Timing_Interp_Table, r4 000B982C 02 10 13 88 movi20 #Pull_2D_A, r2 000B9830 42 0B jsr @R2 ; Pull_2D_A 000B9832 F4 88 fmov.s @R8, fr4 000B9834 D4 22 mov.l #RAM_Flex_Timing_Interpolant, r4 000B9836 D2 23 mov.l #RAM_AVCS_Timing_Interp, r2 000B9838 F2 28 fmov.s @R2, fr2 000B983A F2 02 fmul fr0, fr2 000B983C F4 2A fmov.s fr2, @r4 000B983E 000B983E loc_B983E: ; CODE XREF: sub_B97C0 000B983E ; sub_B97C0 000B983E 4F 26 lds.l @r15+, pr 000B9840 00 6B rts/n 000B98A4 FF F8 93 9B off_B98A4: .data.l RAM_Clutch_SW ; DATA XREF: sub_B97C0:Check_Clutch 000B98A8 FF F8 D4 10 off_B98A8: .data.l RAM_Ethanol ; DATA XREF: sub_B97C0 000B98AC FF F8 D4 14 off_B98AC: .data.l RAM_Fuelling_Multiplier 000B98AC ; DATA XREF: sub_B97C0 000B98AC ; sub_B97C0 000B98B0 FF F8 D4 18 off_B98B0: .data.l RAM_Flex_PI_Scaling ; DATA XREF: sub_B97C0 000B98B4 FF F8 D4 1C off_B98B4: .data.l RAM_Flex_GDI_Mult_C ; DATA XREF: sub_B97C0 000B98B8 FF F8 D4 20 off_B98B8: .data.l RAM_Flex_Crank_Comp ; DATA XREF: sub_B97C0 000B98BC FF F8 D4 24 off_B98BC: .data.l RAM_Flex_Fuelling_Interpolant 000B98BC ; DATA XREF: sub_B97C0 000B98C0 FF F8 D4 28 off_B98C0: .data.l RAM_Flex_Timing_Interpolant 000B98C0 ; DATA XREF: sub_B97C0 000B98C0 ; sub_B97C0 000B98C4 FF F8 AD B8 off_B98C4: .data.l RAM_AVCS_Timing_Interp 000B98C4 ; DATA XREF: sub_B97C0 000B98C8 00 0B 98 DC off_B98C8: .data.l Ethanol_Max ; DATA XREF: sub_B97C0 000B98CC 00 10 C6 80 off_B98CC: .data.l Injector_Flow_Scaling_BRZ 000B98CC ; DATA XREF: sub_B97C0 000B98D0 00 10 C6 14 off_B98D0: .data.l GDI_Pressure_Multiplier_C 000B98D0 ; DATA XREF: sub_B97C0 000B98D4 00 01 12 60 off_B98D4: .data.l Check_Bounds ; DATA XREF: sub_B97C0 000B98D4 ; sub_B97C0 000B98D8 FF FF FF FF .data.l h'FFFFFFFF 000B98DC 42 AA 00 00 Ethanol_Max: .float 85.0 ; DATA XREF: sub_B97C0 000B98DC ; ROM:off_B98C8 000B98E0 00 0B 99 10 off_B98E0: .data.l Ethanol_Cranking_Comp_Table 000B98E0 ; DATA XREF: sub_B97C0 000B98E4 00 0B 99 24 off_B98E4: .data.l Ethanol_Fuelling_Comp_Table 000B98E4 ; DATA XREF: sub_B97C0 000B98E8 00 0B 99 38 off_B98E8: .data.l Ethanol_Fuelling_Interp_Table 000B98E8 ; DATA XREF: sub_B97C0 000B98E8 ; sub_B97C0 000B98EC 00 0B 99 4C off_B98EC: .data.l Ethanol_Timing_Interp_Table 000B98EC ; DATA XREF: sub_B97C0 |
11-11-2015, 09:21 AM | #16 |
Senior Member
Join Date: Aug 2015
Drives: Scion FRS
Location: MI
Posts: 229
Thanks: 140
Thanked 78 Times in 61 Posts
Mentioned: 15 Post(s)
Tagged: 0 Thread(s)
|
@ztan
Any reason you chose to use the DI fuel pressure signal instead of the injector PW to mass scaling like you plan to do for PFI? |
11-11-2015, 09:53 AM | #17 | |
Senior Member
Join Date: Oct 2012
Drives: UK GT86
Location: UK
Posts: 3,040
Thanks: 185
Thanked 1,629 Times in 1,112 Posts
Mentioned: 155 Post(s)
Tagged: 1 Thread(s)
|
Quote:
__________________
.: Stealth 86 :.
Abbey Motorsport/K47 Tuned Sprintex 210 Supercharger Kodename 47 DJ: Soundcloud / Instagram / Facebook |
|
The Following User Says Thank You to Kodename47 For This Useful Post: | thambu19 (11-11-2015) |
11-11-2015, 05:14 PM | #18 | |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Quote:
Previous open source E85 implementations have multiplied the result in the GDI pressure multiplier tables A and B (Axes are engine load and fuel pressure) to come up with a value that, I understand, approximates DI quantity. I did disassemble the ROM to find the derivation of the axes in another post: http://www.ft86club.com/forums/showthread.php?p=2387636 The value from the GDI pressure multipliers A and B then gets multiplied by a scaling factor (GDI pressure multiplier C which I am using to scale for E85). I believe that this is the scaling factor that changes the number from a fuel quantity to a pulsewidth value. This raw DI pulsewidth value is then passed to the GDI flow rate table which is what is used to finalize the DI pulsewidth (compensations for quantity on one axis and fuel pressure on the other). |
|
11-11-2015, 05:41 PM | #19 | |
Senior Member
Join Date: Aug 2015
Drives: Scion FRS
Location: MI
Posts: 229
Thanks: 140
Thanked 78 Times in 61 Posts
Mentioned: 15 Post(s)
Tagged: 0 Thread(s)
|
Quote:
From experience the MBT spark timing does not shift so much for E85 to command any attention. It is just the actual spark timing that shifts. Some OEMs have MBT spark timing as a table in the ECU which makes it easy for tuners to tune for E85 because you just have to make the Base spark = MBT spark. |
|
11-11-2015, 06:58 PM | #20 |
Banned
Join Date: Dec 2013
Drives: FT86
Location: Australia
Posts: 7,998
Thanks: 1,035
Thanked 4,987 Times in 2,981 Posts
Mentioned: 598 Post(s)
Tagged: 2 Thread(s)
|
@ztan
So theoreticly on an A01G rom i could test this without a flex kit by making up a simple circuit to feed in 0 to 5 volts onto the evap input pin. Or just a switchable voltage divider with say 0 ,2.5 and 5 v and effectivly map switch between E85 e40 and petrol. assume you have added an extra Base TimingB and OL fuel map somewhere ? |
11-11-2015, 11:28 PM | #21 |
Senior Member
Join Date: Sep 2013
Drives: 2013 FRS
Location: SF, CA
Posts: 2,629
Thanks: 1,055
Thanked 5,469 Times in 1,494 Posts
Mentioned: 605 Post(s)
Tagged: 9 Thread(s)
|
ztan is a freakin' rock star
|
The Following User Says Thank You to Shiv@Openflash For This Useful Post: | shayangh (12-19-2015) |
11-12-2015, 02:18 AM | #22 | |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Quote:
All to be revealed after more testing etc... but in short: Base Timing A only gets used when AVCS off. FFF8ADB8 reads 0 when inactive (after ECU reset for a couple of minutes) and 1.0 when AVCS active. The value at FFF8ADB8 is use to interpolate between Base Timing A and Base Timing B. My plan is to hijack Base Timing A as E0 and Base Timing B as E85. Primary OL Fueling map is added to by the OL Fueling additive map on the basis of IAM value (no additive applied when IAM = 1.0, full additive when IAM=0.0). I am going to assume, rightly or wrongly, that folks who are applying this have the nouse to be monitoring IAM and that IAM will not drop far enough below 1.0 to require extra fuel. Hence I would plan to use Primary OL Fueling map for E85 and OL Fueling additive map for E0 with above interpolant values. It would be quite easy to add in completely new tables for the above, but this is the way I am thinking. |
|
The Following User Says Thank You to ztan For This Useful Post: | steve99 (11-12-2015) |
11-12-2015, 02:27 AM | #23 | |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Quote:
Unfortunately MBT spark is not visible in the ROM that I can find. I assume Shiv's E85 NA ROM will be pretty close on the money and hopefully we get some more data on where MBT lies higher in the load range on boosted engines in the future. |
|
The Following User Says Thank You to ztan For This Useful Post: | thambu19 (11-12-2015) |
11-12-2015, 08:26 AM | #24 |
Banned
Join Date: Dec 2013
Drives: FT86
Location: Australia
Posts: 7,998
Thanks: 1,035
Thanked 4,987 Times in 2,981 Posts
Mentioned: 598 Post(s)
Tagged: 2 Thread(s)
|
@ztan
For E85 cranking @Wayno s tables are very reliable even on united E85 E85 Cranking changes 0C/32F stock values multiplied x 1.5 10C/50F stock values multiplied x 2.0 20C/68F stock values multiplied x 2.0 30C/86F stock values multiplied x 1.3 40C/104F stock values multiplied x 1.2 50C/122F stock values multiplied x 1.1 60C/140F stock values multiplied x 1.05 For Dash fuel display multiply be 33% ie same ratio as GDI pressure multiplier offset or PI injector scaling offset. |
The Following User Says Thank You to steve99 For This Useful Post: | thambu19 (11-12-2015) |
11-12-2015, 03:23 PM | #25 | |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Quote:
My idea is to hijack the IAT cranking compensation table (returns 1.0 across the board for all IAT values) part of the routine and use that as an ECT cranking compensation. This sits just below the accel cranking compensation in the code (the latter table returns 0.0 when the accelerator is fully down when cranking and no fuel is delivered). I am thinking: We want a cranking multiplier of 1.0 with E0 and ECT compensation to be applied with higher E%, based on the Flex scaling multiplier. One way to do the maths is to return a multiplier of 1.0+((Flex scaling multiplier - 1.0)*ECT cranking multiplier). At E85 with a Flex scaling multiplier of 1.4, this would give us a cranking multiplier of 1.4 at 20C with the table that I posted in post #15. A table value of 2.5 would return 2.0 as a cranking multiplier. |
|
11-12-2015, 03:27 PM | #26 |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
This one is easy - get the normal table return and multiply it by the Flex scaling multiplier. The code would involve hooking the table lookup, scaling with multiplier and returning with all the values in the expected registers.
|
11-12-2015, 08:24 PM | #27 | |
Banned
Join Date: Dec 2013
Drives: FT86
Location: Australia
Posts: 7,998
Thanks: 1,035
Thanked 4,987 Times in 2,981 Posts
Mentioned: 598 Post(s)
Tagged: 2 Thread(s)
|
Quote:
It might be easier to rescale and offset the IAT vs Cranking IPW table rarther than the cranking Vs Coolant tables. have you seen kodename47 defs he has intergrated the opensource stuff with Ecutek stuff http://www.ft86club.com/forums/showp...&postcount=411 |
|
11-12-2015, 10:55 PM | #28 | |
Senior Member
Join Date: Jul 2013
Drives: Toyota 86
Location: Gold Coast, Australia
Posts: 311
Thanks: 44
Thanked 358 Times in 142 Posts
Mentioned: 60 Post(s)
Tagged: 0 Thread(s)
|
Quote:
That IAT cranking compensation table that reads 0.0 in Kodename47's def means 0% compensation applied. When looking at the disassembly and running that bit of code through the HEW simulator, that table returns a value of 1.0 (scaling factor 1.0 = 0% compensation). I changed my def to suit as well as started thinking in terms of scaling factors rather than % compensation. |
|
|
|
Thread Tools | Search this Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Open source Over Boost Fuel Cut | ztan | Software Tuning | 18 | 07-05-2023 08:30 AM |
Open Source Electric Supercharger | neutron256 | Forced Induction | 913 | 08-22-2021 05:16 PM |
open source software question | GeeTee86 | AFRICA | 15 | 02-15-2015 06:52 PM |
The Retrofit Source summer open house! | soundman98 | Southeast | 0 | 06-23-2014 08:41 PM |
ECUtek Flex Fuel REVOLUTION: World's First Flex Fuel Factory ECU GTR - BRZ soon! | Visconti | Engine, Exhaust, Transmission | 356 | 05-20-2013 09:36 AM |