MS2extra 3.1.1 anti lag code

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

MS2extra 3.1.1 anti lag code

Post by baldur »

I have created a variant of MS2extra 3.1.1 with anti lag, I thought I'd share.
Limited support available but there is a help dialog available from the anti lag config dialog.
It can use all the same inputs as the launch control can use and it seems to work with every trigger configuration.

http://foo.is/~baldur/ms2extra_3.1.1.als.zip
Baldur Gislason
techsalvager
Master MS/Extra'er
Posts: 443
Joined: Sat Jun 28, 2008 3:47 am

Re: MS2extra 3.1.1 anti lag code

Post by techsalvager »

My thanks for bringing code like this to the MS
MS2extra
Mass Air Flow fuel and spark
Miata 1.6 turbo
TechSalvager is banned for ignoring admin warnings not to link to his childish videos.
BenGTT
Master MS/Extra'er
Posts: 387
Joined: Sun Nov 23, 2008 4:46 am
Location: France

Re: MS2extra 3.1.1 anti lag code

Post by BenGTT »

Thank you !
m3ltd0wn
Helpful MS/Extra'er
Posts: 149
Joined: Sun Oct 03, 2010 2:32 am

Re: MS2extra 3.1.1 anti lag code

Post by m3ltd0wn »

wow, been waiting for this for a long time :)


thank you!!
KaPower
Master MS/Extra'er
Posts: 501
Joined: Wed Dec 22, 2004 9:43 pm
Location: Bonney Lake, Wa

Re: MS2extra 3.1.1 anti lag code

Post by KaPower »

I want to implement a very mild anitlag system for an autocross application Is there any online resource(s) that anyone would recommend to learn about antilag? I only race the car for single 1 minute (max) runs on the track with lots of cool down time inbetween, so hopefully I won't have any major heat problems to deal with.
mrx79
Experienced MS/Extra'er
Posts: 299
Joined: Wed Oct 29, 2008 8:26 am
Location: Frankfurt / Germany

Re: MS2extra 3.1.1 anti lag code

Post by mrx79 »

Thanks very much... maybe we can use this thread as a kind of knowlegde base for settings.
So if you figure out some settings that work, would be nice to post it here.

I'am sure i will try it as soon as i figured out my little idle problem with the 3.1.0 code.
Honda CRX B16A1 Turbo | MS3 running | pre1.5.1 beta7 Firmware | 24/1 Dual Wheel | COP ignition | 725cc ID injectors
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

First of all you need to have enough air passing through the engine with the throttle closed. A rule of thumb I was taught to be a good starting point was an air bypass that could get the idle speed up to at least 4000 rpm.
On a race car this is often accomplished by just adjusting the idle screw on the throttle body, then using a fuel cut rev limit to keep the idle speed sane when the anti lag is off (basically, using the overrun fuel cut to keep the idle down).
In other applications a good bet would be a Bosch 2/3 wire idle valve that has 20mm hose barbs (found in some European cars) or a throttle kicker solenoid.
The best tool to tune with is a turbo tachometer to observe the turbine speed during anti lag operation, but that is roughly a $500 investment (induction sensor + controller + machining of the compressor housing).
In any case you'll want to have a thermocouple in your exhaust header.

The theory of tuning it is to adjust the amount of air to set how aggressive the anti lag is and adjust the timing so the combustion stops producing mechanical work in the engine. The amount of air has a bigger effect than a few degrees of timing more or less. Fuel is added to control the temperature. You should probably start with no spark cut but some degree of spark cut can be configured to get a more aggressive combustion in the exhaust manifold, this might in turn reduce exhaust valve temperature but the louder bangs will put more stress on the turbine wheel and shaft.
For extended use (several minute long rally stages), you really need to have good exhaust valves with good valve seat condition (for maximum thermal transfer), a good cooling system, good intercooling and a high temperature turbine with a strong turbo shaft. For short autocross runs you may be able to get away with less.
Baldur Gislason
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

I should add that RPM1 through RPM4 represent RPM breakpoints, at which fuel1 through fuel4 and timing1 through timing4 are used, and they're interpolated between.
RPM1 is the lowest RPM at which the system is active, this should be a bit above idle RPM to prevent stalling. A 100 in the fuel fields means no enrichment at all, a 110 means 10% more fuel.
0 in the timing fields means 0° ATDC timing. The latest possible timing is 50 degrees after top dead but that can be changed by editing one line in the code and recompiling.
Baldur Gislason
xox1de
MS/Extra Newbie
Posts: 24
Joined: Wed Dec 30, 2009 11:07 pm

Re: MS2extra 3.1.1 anti lag code

Post by xox1de »

Thanks for the code! I tried! I have trouble to understand the min max tps settings even the timeout tps value, can you make an exemple? Also the PWM idle valve seems stuck at disabled, I have no chance to make it works.
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

The max TPS setting is the throttle position where the fuel enrichment and spark cut become active. From there and down to the min TPS setting, the spark retard gradually sets in.
For example, you may have max TPS at 15% and min TPS at 10%.
At 15% throttle you will have fuel enrichment and spark cut (if configured) but normal spark timing.
At 12.5% throttle you have fuel enrichment and spark cut (if configured) and timing that is halfway between what is in the spark table and what is configured for ALS
At 10% throttle and below you have fuel enrichment and spark cut (if configured) and fully retarded spark timing (from the 4 point spark table in the ALS dialog).
The timeout is in seconds but it's only accurate to +- 1 second, set it to 5-10 seconds unless you have a reason to do otherwise, 0 means no timeout.
The timeout clear TPS is so that after a timeout (most likely to happen if you start to drive slowly) you need to give it full throttle (or at least, above the timeout clear value) to re-activeate the anti lag.

Regarding the idle valve thing, it looks like a tuner studio bug when handling hidden settings. I've changed the ini file to fix this, new ini file in the archive now or download it attached to this post. I had made a last minute change to the ini before I posted the firmware here.
Baldur Gislason
xox1de
MS/Extra Newbie
Posts: 24
Joined: Wed Dec 30, 2009 11:07 pm

Re: MS2extra 3.1.1 anti lag code

Post by xox1de »

Thanks for the detailed information, I will test it ASAP
m3ltd0wn
Helpful MS/Extra'er
Posts: 149
Joined: Sun Oct 03, 2010 2:32 am

Re: MS2extra 3.1.1 anti lag code

Post by m3ltd0wn »

what is with "use over-run" option in previous ini at ALS settings?
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

It means the idle valve gets closed when you go above maximum TPS (Only opens the valve when the throttle is closed)
You'd normally only use this option if your valve dumps air into the exhaust header.
Baldur Gislason
BNZ
Helpful MS/Extra'er
Posts: 59
Joined: Sun Dec 07, 2008 4:18 am
Location: Timisoara/Romania
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by BNZ »

Great job Baldur,many many thanks. I've downgraded from MS2 to MS1 just to use the old ALS option...but now i can come back to the nicer MS2 :)
Can we control other output than the fidle ? I want to try the "dump air in the exhaust" setup and leave the engine idle valve alone,witch is small anyway.
MS2 Extra V3 Rel 3.1.1A + Zeal Engineering Board
Celica ST165
3S-GTE 1st gen engine all stock
Using both Zeal conditioners for NE & G1 pickup

MS1 Extra V3 HR11d
Renault 5 GTE Turbo
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

BNZ wrote:Great job Baldur,many many thanks. I've downgraded from MS2 to MS1 just to use the old ALS option...but now i can come back to the nicer MS2 :)
Can we control other output than the fidle ? I want to try the "dump air in the exhaust" setup and leave the engine idle valve alone,witch is small anyway.
I have updated the archive linked in the first post. It is now possible to control the general purpose outputs using the bit masks with an AND operator.
So to achieve this, you pick any output from the Extended -> Output port settings dialog and set the condition to status3 And 4 this will give you a logic high on that output when the anti lag bit in status3 is active.
Baldur Gislason
BNZ
Helpful MS/Extra'er
Posts: 59
Joined: Sun Dec 07, 2008 4:18 am
Location: Timisoara/Romania
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by BNZ »

Thanks for that ! Will try it in my Celica soon ! Man I'm so happy about this ALS mod for MS2

Just to make it clear the setup in the outputs is like this :
Als_outputs.bmp
MS2 Extra V3 Rel 3.1.1A + Zeal Engineering Board
Celica ST165
3S-GTE 1st gen engine all stock
Using both Zeal conditioners for NE & G1 pickup

MS1 Extra V3 HR11d
Renault 5 GTE Turbo
m3ltd0wn
Helpful MS/Extra'er
Posts: 149
Joined: Sun Oct 03, 2010 2:32 am

Re: MS2extra 3.1.1 anti lag code

Post by m3ltd0wn »

baldur, thanks for explanation.

with the new ini that you've modified the option with the "over-run" doesn't appear anymore, so now all the air that needs to be bypassed is controlled by the idle valve, or other outputs?
also over-run fuel cut needs to be off for ALS to work as it should.
is it possible to control it with an ON/OFF valve? i have plenty of those and i can make a bypass system for the throttle body to let in more air.
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

Yes BNZ, this is how it should be to turn the output on when the anti lag is active. Although I had the trigger value set to 0 in my testing. (I don't know what trigger value does.)
You should probably not use the injection LED output for this purpose unless you're not using that for a spark output.

The overrun option in the idle valve setting was replaced by a second option below it called "Valve closes when throttle applied". It does the same thing. If enabled, valve is only open when throttle is below maxTPS, otherwise valve stays open when the anti lag switch is on and the system hasn't timed out.
You can use overrun fuel cut, the way I coded it, the overrun fuel cut becomes inactive when the anti lag becomes active but of course, anti lag has to become active at a greater throttle position than the overrun fuel cut.
Yes you can use an on-off valve. Does not have to be PWM or stepper.
Baldur Gislason
m3ltd0wn
Helpful MS/Extra'er
Posts: 149
Joined: Sun Oct 03, 2010 2:32 am

Re: MS2extra 3.1.1 anti lag code

Post by m3ltd0wn »

thanks baldur!

i should control the on/off valve using spare output ports and the way you had explained above.

Code: Select all

Trigger Value 
The output state when your conditions are met. On (1) or Off (0) 
Typical settings would have the power on value as 0 and the trigger value as 1.
baldur
Experienced MS/Extra'er
Posts: 256
Joined: Sun May 02, 2004 6:39 pm
Location: Reykjavik, Iceland
Contact:

Re: MS2extra 3.1.1 anti lag code

Post by baldur »

Ok. I have made another change and updated the archive linked in the first post.

Now, to use an output other than the designated idle valve for your air bypass, use trigger value of 1 and condition of status3 And 16
This way the valve will stay on when the throttle is open (required for some throttle kicker solenoids that don't push with much force but rather lock in place when the throttle is pushed) as long as the "closes when throttle applied" option is set to disabled.
You can still use status3 And 4 if you want to control a valve that must close when the engine is at full throttle.
Baldur Gislason
Post Reply