ms2extra 3.3.2 +luftvagon0.7 (AFR Table Switch + CLT + MAT)

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

Moderators: jsmcortina, muythaibxr

luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

ms2extra 3.3.2 +luftvagon0.7 (AFR Table Switch + CLT + MAT)

Post by luftvagon »

ms2extra 3.3.2 +luftvagon0.7
-------------------------------------------------------

This firmware, in addition to 3.3.2 featurs, enables Fuel VE and Ignition table switching based on CLT (Coolant Temperature) and MAT (Manifold Air Temperature).
Ideal for use on aircooled engines. In particular, I am using this code "retard" my idle, until 100F. Similar feature could be had using Cold Advance (and negative numbers), but that would apply across the board, and would not be as flexible to having independent ignition map.

In addition to, this code enables AFR table switch based on any of the mentioned conditions. Very useful if you are running "Include AFR Target". This way, if you have crazy AFR table like piledriver and myself, you run "stock/factory" AFR until the engine warms up.

Features:
  • » Standard 3.3.2 features
  • » Enabled AFR table switching, as part of Fuel VE Table Switch
  • » Added CLT and MAT based Fuel VE Table Switch.
  • » Added CLT and MAT based Ignition Table Switch.
Known issues:
  • » BROKEN! Don't use. The memory writing/reading is incorrect. I left the download link as a reference, in case someone wants to figure out where to store this thing in RAM, and go from there..
  • » Fuel VE Table switch CLT and MAT share the same two bytes. Not really an issue, since you can only use one at a time.
  • » Ignition Table switch CLT and MAT share the same two bytes. Not really an issue, since you can only use one at a time.
Screenshot:
Image

Image
Fuel Table Switch Enabled (Fuel Table 3, and AFR2)

Download link (compiled + source) : https://www.sendspace.com/file/6yc2mf | sha256: e48da0904f7d21f40022849165058c9f9eed440bae6b8867a56baf5fac35b7a7

Usual disclaimer and licensing applies; closed course or bench testing only. I personally release my portion of code, free of copyright.
Last edited by luftvagon on Mon Aug 24, 2015 4:18 pm, edited 20 times in total.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: Fuel VE Table switching based on CTS

Post by luftvagon »

RESERVED
Last edited by luftvagon on Wed Oct 15, 2014 5:36 pm, edited 4 times in total.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: Fuel VE Table switching based on CTS

Post by piledriver »

I was going to try AFR target table switching to aid temp control.

With stoich targets the engine heats up quickly.
Once at operating temp, my std target table cuts CHT and fuel consumpton significantly.
(Example: my CLT never gets to normal operating range at cruise with OAT ><70F, running 19:1 AFR)
This is a feature at 100F+ OAT, at 40F OAT, it never heats up, and the thermostat only helps to a point.

AFR target blend would probably be ~ideal, not sure if doable, have not tried.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

Sorry everyone, I kind got carried away and renamed this thread, and cleaned-it up, to make it more relevant. I didn't want to start a new thread, since no body posted, well, besides piledriver, which is relevant to what I was trying to accomplish.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

I'll give it a shot ASAP, the spare ms2 cpu in in the car filling in for a dead ms3 daughterboard at the moment.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
slyrye
Experienced MS/Extra'er
Posts: 255
Joined: Sun Aug 12, 2007 2:41 pm
Location: Philippines
Contact:

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by slyrye »

count me in... seems like there's been a substantial amount of dead sold ms3's :D
MSnS'n'4G15
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

Looks like it was a tiny loose solder splash under the 40 pin connector header, bottom of daughterboard...
I'm quite experienced with electronic rework etc, and am very careful about clean boards, but it's possible a bit of FOD that got away and worked itself in there... or it could have been thre from day one and I hit the wrong bump.

Everthings getting conformal coated when it comes back.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

Have you had a chance to test the code? I needed my van this weekend, otherwise, I'd try it.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

My MS2 cpu currently resides in my favorite DD, and I can't get a reply on the status of my MS3 repair.
The weather is too cool not to drive the Squareback. (the gas heater seems to like E85 just fine with minor fuel flow adjustment)

Bizzarely off topic, I am considering an MS1 install on the BN4.
No, really.
The biggest things the BN4 lacks are temperature and altitude compensation.
It has a tach output every 31 rotations...
The MS1 would solve both, and one could even use closed loop EGO with a NB sensor.
If it was a MS2, it could read the ethanol% over CAN and use that if needed.
(but that would be ludicrous overkill)
Perhaps an Arduino or such would be more appropriate?
Actually, a BASIC Stamp would probably do, assuming they still exist.

I'll give the code a shot in the car if you consider it safe,
(looks pretty straightfoward, but was hoping someone could try on the bench)
Have binaries? Been awhile since I tried building it, I might have to set it all up again.

I definately want to try the AFR table switch to aid warmup with winter coming, although i suspect basing it on MAT in our cases might be a better choice. I'm not sure the VE table switch is useful, it is already well compensated for MAT/density and WUE can already make it richer where desired over the whole range.
(Reasonaing:aircooled, CHT trends ~linear with outside air temp unless the thermostat is actually installed and works far better than usual)

At least in my case, MAT==OAT, or at least the temp in the engine compartment, which is very close unless stopped in traffic.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

The binary and pre-patched source code is included in the download link. I could make another patch where VE and AFR are two separate switch options.
My brand new thermostat (Type4 "heating" flap thermostat) "leaked" out on me... My flaps are stuck open. Going to purchase a set from "awesomepowdercoat" for $149 delivered. A bit steep, hence why I was thinking about a stepper motor that could talk CAN. The Type4 thermostat has opening temperature of 85-90C (185F-194F).

Anyway, still hoping someone can JIMSTIM this first.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

loaded after backup, gave some warnings on initial load (not unusual), but still ---ran... until i set kpa as tableswitch, now it doesn't run at all, even after trying all options and turning back off.... set up on new fw pre-3.4a6, runs fine again.

(edit) It was losing sync and backfiring like some unintended output or input got switched, but initially fired off and ran fine until I played with the tableswicth settings. (I had table1 pre-copied to table3 in both cases).

where are the menu items to set it up?
(requires .ini work?)
table switch control menu doesn't show clt as a tableswitch option, and no menu to set options/tempertaure to switch at.
(mat would likely be better for aircooled folk)

i din't realise ms2e completely lacks a second afr table, so that would be major surgery, no bueno.
ms3 can do table switch on afr (or refuel or several other things) using many inputs, could probably loop back an extra programmable output to control it off mat clt or almost anything...
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

did you load the provided ini? it also sounds to me that you enabled dual table. it should be fuel1, fuel2, afr1 and afr2 with the correct ini loaded.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

luftvagon wrote:did you load the provided ini? it also sounds to me that you enabled dual table. it should be fuel1, fuel2, afr1 and afr2 with the correct ini loaded.
yep, loaded the ini from the fw package just like a normal FW upgrade, new project, load ini from new FW directory etc..
(i cannot remember ever actually running "release" fw for more than just literally a few moments for troubleshooting purposes, so i have plenty of practice)

I had spark1/3, afr1/3 per usual so perhaps I inadvertantly loaded the std version via the new project dialog...?
I'll give it another shot and manually copy the ini into the projects directory to be certain.
(I'll have a peek to see what version it is first)

...Nope, sorry, I loaded the ini you provided, in the right place in the project.
Verified via file size and diff(trivial to do in midnight commander (mc))

Are you sure the #2 tables exist? All I have ever seen is table 1/3 switching.
TS perhaps does a lot more error checking when connected...
(TS 2.6.04)
warnings on project load: (not connected) looks like it barfs on a few things....

Code: Select all

6 Warnings:
Warning: More bit options defined than possible, max options:4. Not adding: "CLT", Problem at:
[mainController.ini]:[Line:849]:       f5_0_tsf_opt   = bits  ,  U08,      828,      [2:3], "Hardware", "rpm", "kPa", "TPS", "CLT"

Warning: More bit options defined than possible, max options:4. Not adding: "CLT", Problem at:
[mainController.ini]:[Line:850]:       f5_0_tss_opt   = bits  ,  U08,      828,      [5:6], "Hardware", "rpm", "kPa", "TPS", "CLT"

Warning: [UserDefined] field assigned to invalid Constant 'tsf_clt'., Problem at:
[mainController.ini]:[Line:2838]:       field = "CLT Greater Than",    tsf_clt,  { f5_0_tsf && f5_0_tsf_opt == 4 }

Warning: [UserDefined] field assigned to invalid Constant 'tss_clt'., Problem at:
[mainController.ini]:[Line:2846]:       field = "CLT Greater Than",    tss_clt,  { f5_0_tss && f5_0_tss_opt == 4 }

Warning: No Constant or Command Button found with name tsf_clt, Problem at:
[mainController.ini]:[Line:1883]:     tsf_clt = "CLT threshold."

Warning: No Constant or Command Button found with name tss_clt, Problem at:
[mainController.ini]:[Line:1890]:     tss_clt = "CLT threshold."
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

ok, i see the problem. i'll try to fix it tonight. :yeah!:
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

Sorry about that.. i think this will do it.. I am still puzzled over this offset and range. It literally does not compute in my head.. I think this should work now.. It loads without errors, and all menus are present, and working accordingly.
Last edited by luftvagon on Thu Oct 16, 2014 8:06 pm, edited 1 time in total.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

Fresh build download location the same?
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

Actually, let me build it again, and I'll get it reposted. I'll have to change it tomorrow -- again ;(
I figured - it will have to be a 16bit value unless we change entire code (and ini) to not have "on, off" + source feature; but instead bundle both into single menu option, "Off", "Hardware", "kpa", "rpm", "TPS", "CLT", all in one menu option. I like the second option better, and we could retain 8bit values then.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
piledriver
Super MS/Extra'er
Posts: 1681
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by piledriver »

luftvagon wrote:Actually, let me build it again, and I'll get it reposted. I'll have to change it tomorrow -- again ;(
I figured - it will have to be a 16bit value unless we change entire code (and ini) to not have "on, off" + source feature; but instead bundle both into single menu option, "Off", "Hardware", "kpa", "rpm", "TPS", "CLT", all in one menu option. I like the second option better, and we could retain 8bit values then.
No hurry, works is good. Simple and works is better.

This should be a significant win for aircooled folks.
Running ~stoich afr map when cold shold heat things up nicely.
Can ingition map be switched via CLT as well? (for the same reason, even a bit retarded=more heat, faster)

For anyone just tuning in, the goal is faster warmups and being able to maintain temps in cold weather.
(this may be only useful for aircooled folk)
My AFR1 map is extremely lean (19:1 over 2400 RPM and <83 KPA) so the heads overcool at highway cruise (65-75 MPH) under ~70F OAT
19:1 requires timing that would make old school VW people scream in terror... Very slow burn.
Probably need more compression. 96mm bore flattops would probably work.

I have run 22:1 targets but the curently installed WB won't go there. Planning to swap the old JAW back in...
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

Here is a teaser:

Image

I finally figured out the offset, and range, so now things should go smother for me.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
luftvagon
Helpful MS/Extra'er
Posts: 136
Joined: Sun Dec 16, 2012 9:55 pm

Re: ms2extra 3.3.2 +luftvagon0.1 (AFR Table Switch + CLT Con

Post by luftvagon »

After learning about bitmasking, and getting familiar ini offsets and typedef constructs, I think I got it working..... Original thread updated.
Last edited by luftvagon on Thu Oct 16, 2014 8:06 pm, edited 1 time in total.
1981 Volkswagen Vanagon Westfalia - air-cooled Type4 1970cc CV (hydraulic lifters, 42x36 valves, stock cam, microSquirt FI with wasted spark ignition)
Post Reply