Idle code

All Megasquirt 1 support questions. See also the Documentation

Moderators: jsmcortina, muythaibxr

rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

ok i've downloaded the new code and had a look.. i'll give it a go tomorrow..

yes i am running the idle valve with ms.. it is a ford 2 wire pwm one..

thanks
andrew
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

keithmac wrote:I did that, if coolant temp above threshold, map and rpm below threshold it goes into idleVE. It`s all linked into my custom code but if you just want that feature I`ll be able to tweak the firmware for you.
Keithmac,

The new update works flawlessly. The idle is so smooth i can hardly believe it. Having the idle richer (as opposed to very lean which was how i had it before to stop the hunting) makes pulling away from a stop so much smoother too, and it takes less revs to do it (feels like it has more power off idle).

Only thing now is the locked VE is active for all coolant values. This means for about 5 mins after starting i can't get an idle at all. You mentioned that the code looks for coolant above threshhold, how do i specify the threshold?

thanks again
andrew
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

I`m running a later code with the MAP and Coolant setpoints, along with a modified starting routine and dashpotting, all ported to 029Q.

You can give that a go or I can add the setpoints to your current code which maybe better as it`s working ok for you?.

Cheers, Keith.
Squirted VW GTI 16vG60 mk2
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

Idle code

Post by Keithg »

Keith,

You are adding all this idle code and have not had the 'out of space' problem?

KeithG

Posted by email.
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

Keith, all this is in the 029L code that RS2000 is using, I`m running two big wedges of code and 40-80 more bytes of flash_table9 with no I`ll effects on 029Q and also the hi-res code. Running Distributor mode so this may have something to do with it (me not having a problem).

Later codes have 2 more MAP sensor lookup tables, that may have something to do with the bootloader problems? I`ve checked all my codes against the limits in the .lst file after compiling and they all come up way short of the limit?, keeping a good eye on things as Ken sugested though.

I may be coding an ignition adder based on rpmDot, see how it pans out, may be the last straw for my code..

RS2000, I`ve added the coolant setpoint to the code if you fancy giving it another go.
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

keithmac wrote:RS2000, I`ve added the coolant setpoint to the code if you fancy giving it another go.
Keithmac

It doesn't appear to work.. I've tried on the stim and it sill locks the VE no matter what value i put in the coolant box or where the coolant is at.. any ideas?

thanks
andrew
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

Sorry Andrew, it was skipping the coolant check, I`ve loaded up a modified one for you to try. Glad to see you`re nearly there!.

Would be interested to see a datalog with IdleDC in it to see how the Valve is reacting.

Cheers, Keith.
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

Cool thanks, Looks good on the stim.

I'll have to get out an tune the VE to get a nice cold idle, have to wait for the car to cool down 1st. The thing i've found in the past is i can tune the VE table to get a good idle at a set temperature. This means if it idles well cold it will hunt and stall warm and vice versa. Now i can set the cold idle with the VE table, and at 50* the code takes over and locks the VE. Should work really well..

I think the ultimate idle code would have 3 temp bins, say 20*, 50*, 70* and let you specify a VE value for each, then interpolate between them depending on temp. Then you could have a locked VE from startup. I might have a crack at it, but i have to learn how the code works first!!

Thanks again keith, you really went out of your way to help me get this code running and its much appriciated (by both me and the car!)

andrew
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

No problem Andrew, glad to see you`ve got it sorted! Mine kicks in at 30c but I also use a wideband to correct the idle (14:1) so most of the differences are soaked up with the EGO correction.

3 point table is an idea, will have a look into that.

If you ever spark it I`d be interested to see how you find the idle ignition timing correction, that`s what made a big difference to mine, but the engine`s on the edge of tickover at 1000 rpm idle due to the cams..

Fitting my Chargecooler on Sunday, looking into driving the pump via MS based on it`s water temp.
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

I will be doing spark soon, probably in a few weeks when i've got some time.. I had it running with a VB921 but after a 15 min test drive i got home, parked in the driveway and it was dead when i went out next.. weird but i haven't had a chance to troubleshoot, i think it may have been the distributor playing up. I have a different one to try now.

I was suprised how gooder idle i can get. The engine is a ford pinto in a mk2 rs2000 with an FR32 cam, so a 'fast road' cam. I never got it idling this well on carbs (or ms). Its idling at about 900. The code has also solved a problem i had with it hunting after a warm restart.

I tuned the warmup yesterday. Not having to worry about the warm idle meant i could richen the bins it would use at cold idle and get it to idle well cold. I tried a cold start this morning. The first start it reved up to about 1400, but then dropped straight through the idle and stalled. Second start it dropped straight onto my fast idle! Thats the best cold start i've ever had!! So with a bit more tweaking i might be able to get it perfect..

andrew
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

rs2000 wrote:I think the ultimate idle code would have 3 temp bins, say 20*, 50*, 70* and let you specify a VE value for each, then interpolate between them depending on temp. Then you could have a locked VE from startup. I might have a crack at it, but i have to learn how the code works first!!
Ok i had a look at the code today, but got a bit lost. I made a new menu in megatune, and i need 2 more variables in the code. I have named them idleVE_f1 and idleVE_f2. The first thing is i don't know how to define and store them in the code. Do i just add them under this line at 147 and 148 or is that not how it works?
idleVE_f db 37t; (144) VE at idle
idlevetps_f db 36t; (145) tps thresh for idleVE
idleveclt_f db 40t; (146) coolant threshold for IdleVE
Then for now i decided not to bother with interpolation, but to have 3 VE values for the temperature ranges (which for now i have hard coded, i will likely change that later).
T<30_____then VE = idleVE_f1
30<T<60__then VE= idleVE_f2
60<T_____then VE = idleVE_f
Then my 'custom' code would be as follows. Are 30 and 60 correct as hex ($1E and $3C) or should the be decimals? i wasn't sure;
idleVErpm:

___lda RPM
___cmp #13T_____;1300 rpm limit (failsafe)
___bhi IdleVE_NO

___lda coolant
___cmp $1E_______;check if under 30 degrees
___blo idleVE_T1
___cmp $3C_______;check if under 60 degrees
___blo idleVE_T2

___lda idleVE_f
___sta vecurr
___rts

idleVE_T1:

___lda idleVE_f1
___sta vecurr
___rts

idleVE_T2:

___lda idleVE_f2
___sta vecurr
___rts

IdleVE_NO:

___mov tmp6,vecurr ; Normal Table..
___rts
Am i close to something that might work? I'm a total coding newb (i only started today), this seemed like a good mini project to start with.. I haven't tried compiling it or loading it onto ms, to be honest i have no idea if my code and logic is even right..

Any comments or suggestions would be appriciated,

andrew

ps. I have used a lot of _ underscores instead of whitespace as the forum deletes it, just to make it look neater.. it wouldn't actually be there
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

I normally use decimal numbers (cmp #100t) etc, the Coolant variable in the MS is deg f + 40, so you`ll have to convert your temps to deg f and add 40 to get celcius readings to compare in the code.

Code should work fine, the _f denotes the variable is in Flash Memory (makes it easier to understand), maybe use IdleVE1_f, IdleVE2_f etc?.

You could add them after 146 on Flash_table9, just make sure you define them in MegaTune as well.

Good look with it, nice and satisfying when it goes right :D.
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

I wondered what the f meant, i'll change the variable names as you suggest.. and fix the coolant temps

How do decimal values work? T = x 100, what does t mean?


andrew
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

well i'm still unsure if i have entered the temperatures correctly..

When i go to compile it is coming up with the error 'Access Violation at 00431514. Read of address 8043527F' which means nothing to me. On the other menu it says it is at line 7797/9078.

Any ideas whats wrong?

andrew
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

I looks fine and complied ok on my computer, are you using the compile.bat in the SRC directory to compile it?. If I use the Winide32.exe it always comes up with an access violation, even with stock asm`s. I use the Winide to hunt down any problems but I always have to do a final compile with the compile.bat icon on the SRC directory.

If you want a decimal value of say 123, just input #123t into the code, what you see is what you get, your code looks fine.
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

Yeah i was using Winide32, it does compile fine with compile.bat

Thanks

andrew
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

Woo hoo it works!!

Got to try it out on the car tomrrow then maybe look at interpolating..
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

Depending on the VE differences you may not need to interpolate, if you do LININTERP is easy to use, glad to see you got it working!
Squirted VW GTI 16vG60 mk2
rs2000
Master MS/Extra'er
Posts: 472
Joined: Mon Mar 07, 2005 9:32 pm
Location: Perth, Australia

Post by rs2000 »

I tried lininterp, very easy to use.

I now have 4 temperature and VE values, with the code interpolating between values 1 and 2, 2 and 3 and 3 and 4. I used temps 20, 40, 60, 75 deg C.

I tried the old version i had this morning, and it worked quite well (that was interpolating between 2 values) but it lacked any resolution. i'll have to wait for the car to cool down 1st before trying the new version..

Looks good on the stim though!

How much space is there for defining new variables? Ideally the temperatures should be user definable as well as the VE's..
keithmac
Master MS/Extra'er
Posts: 658
Joined: Sun Jun 19, 2005 12:52 pm
Location: UK, York

Post by keithmac »

Each Flash_Table can hold 189 bytes so there`s plenty left on 9.

Would be interesting to see what spread of VE numbers you have?.
Squirted VW GTI 16vG60 mk2
Post Reply