Tightmopedman9

Tuners Rejoice! Free Tuning For M4.4!

Recommended Posts

Haha no, the fluid level is just at that crossover point where if you accelerate, the G's push the fluid against the back of the reservoir and it dips under the level sensor in the front. :biggrin:

Share this post


Link to post
Share on other sites

Ah yes, I have seen that..

Let's see another run after some clamp adjustments..

Share this post


Link to post
Share on other sites

I've been trying to figure out the map lookup and logic for the PID control of lambda regulation, but haven't been having much luck.

I've tried to find where the maps are referenced in code, but I can't find them addressed in any manner which I'm familiar. I thought about looking at other maps of similar 7x6 size for the way they're referenced, but the 3 P, I, TV maps are the only ones this size. I've cross referenced every .bin and can find no MOV DPTR to a location even close to the location of the maps, even in the 570 .bin. I've also tried looking at where the other lambda regulation parameters are referenced, but that didn't help.

Also, Piet and Venderbroeck, where did you find any reference to F1C2 and F1C3? If I cross reference them to the 449.bin I see the same parameters are located at F114/F115, and are referred to in the DAMOS as FTEADMN - 'Minimalwert der Beladung des AKF's' and FTEADMX - 'Maximalwert der Beladung des AKF's' and they are under the category 'Tankentlüftung beladungsabhängig'. I can't find any references to them in the actual code. 

The reason for the curiosity is that I think the wideband lambda regulation routine could greatly benefit from a dynamic I factor. AFRs could become much more stable if the I factor was a dynamic variable related to the absolute deviation between the target and current AFR, vs a static map based on RPM and load. 

Share this post


Link to post
Share on other sites

F1C2 and F1C3 are incorrect (my bad)

It's F12C and F12D having to do with F814 and F815 resp.,  but only as a part of a complicated lookup

 

-------------------------------------------------------------------------------------------------------------------------------------------

I seems to me that the logic for the PID control is (at least  partially) in the subroutine starting at BAF7 

@ BAF9 : mov     DPSEL, #1 

                mov     DPTR, #0xF12C:        F12C is put into DTPR #1

 

@ BAFF : mov     DPSEL, #2

                mov     DPTR, #0xF13B       F13B is put into DTPR #2

 

@2B01 In routine_2AEF (wich is lcalled several times in the subroutine starting at BAF7):  F12C,  F12D,  F12E or F12F are read dependant of the value of R2   (since DTPR#1 is selected at 2ACF which points to F12C)

In routine_BAF7     R2 is set to 0,1,2 or 3  before calling 2AEF.     (mov     R2, #0  @BB52;                mov    R2, #1  @BB5B;                           mov     R2, #3 @BB9B)

 

Rather complicated lookups and calculations are made in routine_2AEF which contains  several lcalls to rouitine_2B5B

 

The result of these calculation are put into:

F814  (Reglersteigung)             in case of R2 is #0        (F12C is read in routine_2AEF)

F815  ( Reglersprunghoehe)   in case of R2 is #1        (F12D is read in routine_2AEF)

F81C  (         ??                 )              in case of R2 is #3        (F12F is read in routine_2AE)

 

 

 

 

Edited by Piet

Share this post


Link to post
Share on other sites

I'm running a Garrett turbo with external wastegate and have my maf in the intercooler pipe before the throttle body. That is throwing off the boost control of the car. It should be at stock boost levels right now but I'm seeing 20-22psi. I got the wideband mod and have the afrs dialed in. My question is, what would the best way to reduce boost? I'd like to see 15psi so I need to reduce 5-7psi of boost. Will the tcv be able to keep the wastegate open long enough to let the turbo slow down or would a boost controller be the best option. It doesn't build any real boost until over 3k RPM. Wastegate has a 8psi spring in it so it will open easy. And if I do go with a boost controller what is the best way to not let the ECU reduce timing or is there a specific way to hook it up to allow the ECU to still behave as if the tcv was there and working. 

Can't currently try anything since my ECU isn't working. Was in mid flash and my laptop decided to restart for an update now it won't let the car start. And was getting an internal rom error code before that so I'm waiting on another ECU to be delivered. 

 

Edited by Glt850

Share this post


Link to post
Share on other sites
40 minutes ago, Glt850 said:

I'm running a Garrett turbo with external wastegate and have my maf in the intercooler pipe before the throttle body. That is throwing off the boost control of the car. It should be at stock boost levels right now but I'm seeing 20-22psi. I got the wideband mod and have the afrs dialed in. My question is, what would the best way to reduce boost? I'd like to see 15psi so I need to reduce 5-7psi of boost. Will the tcv be able to keep the wastegate open long enough to let the turbo slow down or would a boost controller be the best option. It doesn't build any real boost until over 3k RPM. Wastegate has a 8psi spring in it so it will open easy. And if I do go with a boost controller what is the best way to not let the ECU reduce timing or is there a specific way to hook it up to allow the ECU to still behave as if the tcv was there and working. 

Can't currently try anything since my ECU isn't working. Was in mid flash and my laptop decided to restart for an update now it won't let the car start. And was getting an internal rom error code before that so I'm waiting on another ECU to be delivered. 

 

You should start a new thread in the Perf section; this is not specific to M4.4 tuning..

Share this post


Link to post
Share on other sites
On 11/20/2017 at 12:41 PM, Piet said:

The result of these calculation are put into:

F814  (Reglersteigung)             in case of R2 is #0        (F12C is read in routine_2AEF)

F815  ( Reglersprunghoehe)   in case of R2 is #1        (F12D is read in routine_2AEF)

F81C  (         ??                 )              in case of R2 is #3        (F12F is read in routine_2AEF)

I investigated those XRAMs a while ago, but found no references to them outside of that function. I added F814 and F815 to the logging stream, but never found the values to change. Thinking about these values made me investigate them some more and I looked at some old XRAM logs I have. Looking at the values I found for F814 and F815 in those logs, F814 corresponds to the values from the I factor map and F815 the P factor map; not much of a surprise there I guess.

I traced the logic (and probably failed, lol) and I think the easiest thing to do is to change the MOV DPTR @ 0xBB57 to an LCALL of a new function which takes the difference between the current AFR and target AFR, uses it as the variable for a single axis map lookup, then places the value in F814 instead of the 2AEF routine.

PUSH	ACC	
MOV		DPTR, 	#07FEFh		; Adaptive I-part setbit
MOVX	A,     	@DPTR
JNZ		RUN_ROUTINE			; If setbit = 0 jump to end of routine
POP		ACC
SJMP		REPLACE_DPTR
RUN_ROUTINE:
MOV     DPTR, 	#0FDAEh		; Target AFR XRAM
MOVX	A,     	@DPTR
MOV		B,		A
MOV     DPTR, 	#0F962h		; Rear O2 Voltage
MOVX	A,     	@DPTR
CLR		C			
SUBB	A, 		B				
JNC		NEXT				; If result is negative complement and +1
CPL		A
INC		A
NEXT:
MOV		B,		#0Ah
DIV 	AB					; Divide result by 10 for use in single axis map lookup
MOV		B, 		#0Fh
CJNE	A, 		B,	NEXT2	; A = AFR Deviation/10, B = 16
NEXT2:						
JC		SKIP				; If A >= 16 no carry is set, skip setting A to 16.
MOV		A,		#0Fh
SKIP:
MOV     DPTR, 	#07FC0h		; Dynamic I factor map location
MOVC	A,		@A+DPTR
REPLACE_DPTR:
MOV		DPTR, 	#0F814h		; The DPTR we replaced
RET

 

This is the routine I came up with real quick. The divisor by 10 is to scale the deviation so that we can have a 16 byte length map lookup. You would probably need to change the divisor based on the absolute output range of your AFR gauge. I based 10 on the AEM UEGO which ranges from 7-20.

I'll give this a log and see how it goes. 

Share this post


Link to post
Share on other sites

I'm interested to see how your wideband adaption works out. I think it's a very solid idea, actually making it more PI-control-like.

Something different; do we have variables somewhere that control fuel cut when lifting off the throttle completely? Like RPM thresholds etc. It consistently re-engages at 2000 RPM but I'm not finding a variable for this anywhere, and if possible I'd like it to kick in sooner when I lift off the throttle. Seems to take about a second currently.

 

Share this post


Link to post
Share on other sites
1 hour ago, Boxman said:

I'm interested to see how your wideband adaption works out. I think it's a very solid idea, actually making it more PI-control-like.

Something different; do we have variables somewhere that control fuel cut when lifting off the throttle completely? Like RPM thresholds etc. It consistently re-engages at 2000 RPM but I'm not finding a variable for this anywhere, and if possible I'd like it to kick in sooner when I lift off the throttle. Seems to take about a second currently.

 

Have you looked in the DAMOS? A quick search and I found TVSA0G,{Verzögerungszeit für Schubabschalten 0. Gang (LL)}. 6x1 map located @ 0xCAD9 in 608. Conversion = 11.9040 * X, 1=12ms. X axis is 0,1,2,3,4,5. 

There appear to be other fuel/time related tables in the SA_WE map group as well. 

Share this post


Link to post
Share on other sites

It worked. I just need to figure out how best to tune the map. 

 

Bb1T

 

The AFR swings look over exaggerated in that shot, but I have the axis set to a pretty narrow range, from 10-16. 

Right now the lowest I value is 8, but I bet I could set that even lower, perhaps even to 0. 

  • Upvote 1

Share this post


Link to post
Share on other sites

I'm going to redo the map lookup with a better map lookup. I'll use an interpolation factor and the axis will be the AFR deviation in .15 increments. I'll include a ROM variable that is equal to the slope of the wideband curve so it will be easy to port to different tunes.

I'm starting to wonder about the effects of exhaust gas velocity though; maybe I should create a 8x8 RPM vs AFR deviation map?

Share this post


Link to post
Share on other sites

I must say I expected better results, though I think you're purposely perturbing the system extremely to diagnose the effect of the I-value, if it tapers when close to target?
 

Little confused as to what you did exactly. Are you using the default RPM I-table and applying a factor on whatever it reads from there? Or are you straight up replacing the I-value it would have gotten from the table with a single variable that depends only on the distance of your target and measured AFR?

Afaik, the RPM dependant table is pretty important. I think it's design purpose was exactly that, to compensate for exhaust gas velocity. A while back I made a (very lengthy..) post on Wideband response times, and also addressed the travel time in the exhaust - which at low RPM is significant. Depending on where your wideband is in your exhaust (mine was directly behind the turbo), you'll have 700ms delay or more if you're further down before the a change in fueling is detected by your sensor element. At high load and RPM this goes down to 100-200ms, basically the response time of your package. So it is a very significant effect and the default RPM dependant I-table is very important. At low RPM you want a pretty low I value or you'll be overshooting the mark horribly. At cruise/wot it really depends on your package, how fast it handles the sensor signal when it comes in. Some are noticeably faster than others - the famous ALM package sports about 100-120ms delay, AEM X-Uego gets that down to about 30ms for instance. I'm not sure if better ones have been produced in the meantime.

I've tuned this map for my engine and am seeing an AFR deviation of no more than 0.3 total on idle, and likewise during cruising and mild/medium acceleration. WOT stays tricky and needs further tuning.

So if your current implementation discards that map, I'd say yeah definitely try to incorporate it somehow :)

Edited by Boxman

Share this post


Link to post
Share on other sites

That was just a quick idle and throttle blip from my car. Clutch still isn't working so I can't get running drive logs from it. I shouldn't have posted that, because it really makes the control look much more ineffectual than it is. 

The new routine directly replaces the stock I factor RPM vs load lookup. I quickly ditched the single axis, non RPM dependent lookup and replaced it with a AFR deviation vs RPM lookup map. The AFR deviation axis is in units of AFR and the scale of the axis is determined by your AFR gauge.

4-RH

I still need to play around with the AFR deviation axis and tuning of the factor, but the above map seems to give pretty good control of the AFR, even if the tuning of the 'VE' map isn't so spot on. At idle I find that with an I factor of 1, and the P,D variables set appropriately, the AFR will stay within .1 of the target. 

I think the next step in wideband control would be feeding the AFR into the ECU via serial input instead of analog 0-5 voltage.

I'll send the code to Piet and Venderbroeck if they want to incorporate it into their wideband regulation mod. I'd appreciate any feedback for tuning of the map. 

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi All.

I have been using Tunerpro to flash my ecu for some time now, I have finally upgraded to an ostrich 2.0
I have searched through the majority of these 454 pages and cannot find what I am looking for.

I can connect to the ostrich and can upload and download bins no problem but cannot get the car to run.

What I have noticed is if I upload a bin (I can verify it at this stage and get a pass), then download the bin immediately (I can again verify it at this stage and get a pass) the values have changed?  A good example is Injection Basic Adjustment Factor, I enter it in as .8125, upload, then download and the value is now 0.0469...

What am I doing wrong?

Any help would be greatly appreciated. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now