Sequential code for 4-cylinder engines

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

Moderators: jsmcortina, muythaibxr

racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Sequential code for 4-cylinder engines

Post by racingmini_mtl »

As you may have seen in the new to-do list and I mentioned earlier in the "Odd injector output behavior.. (semi sequential)" thread, I'm working on sequential injection code for 4-cylinder engines (and will do semi-sequential for 8-cyl.)

It will be interesting to see if this completely eliminates this need to have as many squirts as possible for best throttle response with a single timed squirt per cycle (or 2 timed squirts per cycle for an 8 cyl.). I have already done some timed injection code in an earlier alpha version but this was a quick and dirty implementation for validation and it didn't have the 2 additional injector channels and was for the special needs of the siamese-port engine of the classic Mini.

Now, I want the code to be fully integrated into the MS2/extra code and have the full set of features as well as the possibility to have the 4 injector channels. So this means it's going to take me some time to go through the current code (because there are many more features in MS2/extra than when I did the first version) and do a clean implementation. I also want to make sure I don't break anything. So it will take me at least 1 to 2 weeks before I have a first version available. This will be the first MS2/extra V3 alpha.

By the way, the 4 injector channels will require a very small modification to the MS2 daughterboard and that will also disable the PWM capability. You will also need to have 4 injector drivers which could be similar to the current V3 drivers or could just be 4 VNP5N07FI (similar to uS drivers but in TO220 package) if you have high-Z injectors or peak&hold drivers if you have low-Z injectors. I would not recommend mixing different types of drivers so you will need to chose one type and have 4 of them (or 8 if going to p&h drivers on 8 cyl.)

I'll keep you informed of progress.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
md95
Master MS/Extra'er
Posts: 721
Joined: Tue Mar 15, 2005 6:44 pm
Location: Grand Rapids, MI
Contact:

Post by md95 »

Excellent! I currently have Jame's semi-seq code running beautifully on my 4g63, and would love to test your fully seq code. It should be fairly easy to get 2 more injector drivers for me at least to quickly test...I have a fully assembled 2.2 spare MS board, and i can just remove that processor, make another db37 harness, and use that boards injector drivers. I'll just run the 2 other injector trigger signals from the main MS board, into the spare board, then jumper the signals to the proper cpu pins on the spare board, which go to the chip that fires the FETS....presto, 2 fully asssembled injector drivers with outputs. Have you thought about/devised an injection scheme for high rpm/high fuel load? Injection will have to take place earilier in these conditions with only one squirt per cycle per cylinder. How do you plan on timing a injection event?- per user's specific trigger wheel? Ignition firing? Are you going to incorporate per cylinder fuel tuning? That would be very helpful, as this could eliminate tuning problems with uneven airflow through intake manifolds/runners, intake manifold resonance at certain rpm and airflow, and get much more precise A/F ratios per cylinder to each user's setup. My configuration should be an easy test, since i have all the outputs needed, and also a ground wire to each injector right at the stock ecu...not to mention 8 total edges to time injection from the stock CAS sensor, with all odd edges spaced exactly 180 crank degrees apart.
-Matt-
1998 Mitsubishi Eclipse RS 420A Turbo- MS2 Extra- 2.1.0 Release
1992 Plymouth Laser RS 4g63 AWD Turbo MS2 Extra- 3.0.3s
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Post by racingmini_mtl »

md95 wrote:Excellent! I currently have Jame's semi-seq code running beautifully on my 4g63, and would love to test your fully seq code. It should be fairly easy to get 2 more injector drivers for me at least to quickly test...I have a fully assembled 2.2 spare MS board, and i can just remove that processor, make another db37 harness, and use that boards injector drivers. I'll just run the 2 other injector trigger signals from the main MS board, into the spare board, then jumper the signals to the proper cpu pins on the spare board, which go to the chip that fires the FETS....presto, 2 fully asssembled injector drivers with outputs. Have you thought about/devised an injection scheme for high rpm/high fuel load? Injection will have to take place earilier in these conditions with only one squirt per cycle per cylinder. How do you plan on timing a injection event?- per user's specific trigger wheel? Ignition firing? Are you going to incorporate per cylinder fuel tuning? That would be very helpful, as this could eliminate tuning problems with uneven airflow through intake manifolds/runners, intake manifold resonance at certain rpm and airflow, and get much more precise A/F ratios per cylinder to each user's setup. My configuration should be an easy test, since i have all the outputs needed, and also a ground wire to each injector right at the stock ecu...not to mention 8 total edges to time injection from the stock CAS sensor, with all odd edges spaced exactly 180 crank degrees apart.
The timing will be done similarly to the ignition code. So if the wheel is supported for ignition in the code, it will be supported for injection. I'm not sure yet that all wheels will be supported in the first release, I'll have to make sure what that involves.

The injection timing will use it's own timers so timing will be independent from ignition timing. There will be 2 possibilities to set timing: a fixed value or a table similar to the ignition timing table. I don't think there will be a need for as much granularity for the injection timing table as for the ignition so I'm planning to have a 6x6 table.

For high rpm/high load, the injection will just start earlier to have the correct timing. The issue is when duty cycle becomes high. Since the timing for starting injection is done from one tooth, if duty cycle becomes such that the injector is still on when the starting tooth arrives and since the timer used for starting and duration is the same, there is a need to deal with the conflict. The plan is to just force the injection to start at the following tooth and use the computed duration from there. This means that timing goes out the window but duty cycle can go up to 100%. In any case, timing in such a situation becomes less critical. Also, this situation will only occur either with wheels with few teeth or big gaps or with very high duty cycle. With teeth 180 degrees apart, this situation will occur whenever duty cycle goes above 75% so this configuration will probably be a good test for validating this forced injection. (Better test it on the bench first though :) )

As for per cylinder fuel trim, I will look into it but I don't know when this will be done because there's a lot of interaction with other features mainly EAE. But with the extra 64K of flash that is there, there is space to have the tables.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Post by racingmini_mtl »

One thing I forgot to mention is that this feature will not be compatible with the rotary trailing spark option. So in Megatune, when one feature is chosen the other will have to be disabled.

The same timers are used for both options so there is a conflict there. Also, I have no idea if timed injection would be of benefit for a rotary engine.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
md95
Master MS/Extra'er
Posts: 721
Joined: Tue Mar 15, 2005 6:44 pm
Location: Grand Rapids, MI
Contact:

Post by md95 »

Just a thought here about injection timing and max PW at full load/rpm..What about using one's set req fuel value to calculate maximum injection timing? A larger injector will have less duty cycle at max load, and hence more available time to fuel the cylinder. The code would "figure out" what the injection timing would be, referencing the req fuel value, so the fuel would never get injected too late at max load/rpm? May not work or even be possible..just a random thought..
-Matt-
1998 Mitsubishi Eclipse RS 420A Turbo- MS2 Extra- 2.1.0 Release
1992 Plymouth Laser RS 4g63 AWD Turbo MS2 Extra- 3.0.3s
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

[/quote]
As for per cylinder fuel trim, I will look into it but I don't know when this will be done because there's a lot of interaction with other features mainly EAE. But with the extra 64K of flash that is there, there is space to have the tables.
[/quote]

The main thing to keep in mind here is that the EAE formulas would have to operate per-injector in this case... we'd have to keep 4 "wallfuel" variables, and 4 added-to-wall-amount variables, and 4 pulled-from-walls variables, and then do the math that stores results in those variables 4 times.

There could potentially be a lot of extra code due to this.

Ken
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

racingmini_mtl wrote: The same timers are used for both options so there is a conflict there. Also, I have no idea if timed injection would be of benefit for a rotary engine.

Jean
There *could* be a benefit to low-rev throttle response, just like any other engine. Timing it would be a bit different though.

Ken
rb26dett
Master MS/Extra'er
Posts: 497
Joined: Tue May 24, 2005 11:34 pm
Location: Auckland New Zealand

Sequential code for 4-cylinder engines

Post by rb26dett »

The main thing to keep in mind here is that the EAE formulas would have to
operate per-injector in this case... we'd have to keep 4 "wallfuel"
variables, and 4 added-to-wall-amount variables, and 4 pulled-from-walls
variables, and then do the math that stores results in those variables 4
times.

There could potentially be a lot of extra code due to this.
could it not be done as a scaling factor and applied to all as a last step?

excuse my ignorance if this doesnt fit with how its implemented. i
understand that there could be very good reasons with loss of
precision etc to not do it that way.

fred.
ms2,v3,cop,innovate,mazda fe3/fe-dohc 2l 4cyl with stock 10:1 pistons,4 stock coils,4 stock ignitors,rx7 550cc injectors maxed@6600rpm&17psi,custom everything,holset he351cw turbo,44mm ext gate,nis gtr bovs,nis gtr intercooler,70mm lexus throttle,chinese fpr,10may v2 ms2e alpha code
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

yeah, any time you convert to a %, you're losing precision... the best way to do it would be to track all those variables in their native units, then convert at the end.

Ken
rb26dett
Master MS/Extra'er
Posts: 497
Joined: Tue May 24, 2005 11:34 pm
Location: Auckland New Zealand

Sequential code for 4-cylinder engines

Post by rb26dett »

understood, but is there really any need for 4 seperate ae values in
those calcs? surely one set of those, and most things, and 4 ve
values, and the calc done 4 times at the last second would work? once
again excuse my ignorance :-)

fred.
ms2,v3,cop,innovate,mazda fe3/fe-dohc 2l 4cyl with stock 10:1 pistons,4 stock coils,4 stock ignitors,rx7 550cc injectors maxed@6600rpm&17psi,custom everything,holset he351cw turbo,44mm ext gate,nis gtr bovs,nis gtr intercooler,70mm lexus throttle,chinese fpr,10may v2 ms2e alpha code
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Post by racingmini_mtl »

Actually, thinking about it, the main show stopper is the fact that there is only 2 O2 inputs. Without feedback this isn't going to work.

So the best that could be done is to use the dual tables and associate all the injector outputs to one table or the other. I think that Ken was planning to support dual table with EAE so that could be the solution.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Even without O2 feedback, people *might* want the trim tables... say if they know for sure that a certain cylinder runs x% leaner than another, they could "trim" the main table.

I'll be able to work with whatever is implemented though.
User avatar
Maglin
Experienced MS/Extra'er
Posts: 243
Joined: Wed Jun 29, 2005 1:48 am
Location: Wichtia, KS

Post by Maglin »

Well I would think that for the 4 cylinders at least it wouldn't be needed. As the wall wetting and sucked from walls will be the same on every cylinder as long as the injection evens all happen at the same time in relation to intake valve events.

I can see having to add more fuel to certain cylinders on 6+ cylinder installs as it will be using a batch fire strategy. But then again it will be adding fuel to the entire batch of injectors and not a single injector which will still give you that one leaner cylinder.

So really it would come down to hardware for out of balance cylinder AFR's. IE.. clogged injectors or faulty wiring. The more I think of this the more I see per driver % correction totally not being needed. The OEM's use bank fuel trims to account for uneven engine wear and in those cases I can see doing something like this. You would have to do a through compression check and see if you can make a bank fire strategy around it so the lower compression cylinders can get a tad more fuel to even out the power distribution. I've yet to ever see a OEM use per cylinder fuel trims.
Jeremiah
93 5.8 LX Mustang - MSIIextra
92 Eagle Talon TSI AWD Turbo - MSIIextra
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

If the amount of fuel commanded is different per cylinder, the amount sticking to or coming off of the walls will be different, even if the percentages tuned are the same.

Ken
md95
Master MS/Extra'er
Posts: 721
Joined: Tue Mar 15, 2005 6:44 pm
Location: Grand Rapids, MI
Contact:

Post by md95 »

So you couldnt have a simple correction factor per injector output, just referencing one VE table? If you know one cylinder runs lean, you could just use a simple correction factor to compenstate. I dont really mean a true, "per cylinder trim" code, just a code that lets you add/subtract fuel on each injector output. For example, you could have 4 correction bins per injector output, and you could enter an actual PW correction factor in the same PW resolution, eg you need .550ms more fuel for injector 2. You could have the number reference "add" or "subtract" options. Basically just a simple way to alter each injector's final PW, on a per injector basis. You could even do a simple 6x6 table, per injector output, with rpm vs map, to do this..I know the 420a motor using a stock intake mani and boost, has a nice dip in airflow due to manifold resonance where one cylinder can go way off in A/F, so a correction table map/rpm would work well in this case. I have no idea how the code will work, just thinking what would work or be semi-usefull. As for EAE, wont the need for that deminish with true sequencial injection?
-Matt-
1998 Mitsubishi Eclipse RS 420A Turbo- MS2 Extra- 2.1.0 Release
1992 Plymouth Laser RS 4g63 AWD Turbo MS2 Extra- 3.0.3s
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

muythaibxr wrote:The main thing to keep in mind here is that the EAE formulas would have to operate per-injector in this case... we'd have to keep 4 "wallfuel" variables, and 4 added-to-wall-amount variables, and 4 pulled-from-walls variables, and then do the math that stores results in those variables 4 times.

There could potentially be a lot of extra code due to this.

Ken
Good thing you recently allowed the code to break the 64k barrier!

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

As for EAE, wont the need for that deminish with true sequencial injection?
The effect is less pronounced, but still there, so it's still necessary to account for it.

Ken
vlopsahl
Helpful MS/Extra'er
Posts: 136
Joined: Tue Jul 05, 2005 3:04 pm

Post by vlopsahl »

Any updates on this? Right now I am batch firing my injectors, but I plane to go semi or full sequential. I have a 2,0 l with 4 630 cc injectors. My idle PW is 1,4xx ms right now. If the sequential code is not that fare of I will wait for it and not go semi. I will have to do some more wiring before that as well to get my second trigger working and do some more injector wiring.

Thanks
Vegard
Audi 80Q 2,0 20V Turbo 630cc AEB/ABA/ABF
MS-II V3 MT2.25 MS2 Extra 2.0.1 VAG/Bosch VR 60-2 Waste spark PWM-idle
md95
Master MS/Extra'er
Posts: 721
Joined: Tue Mar 15, 2005 6:44 pm
Location: Grand Rapids, MI
Contact:

Post by md95 »

vlopsahl wrote:Any updates on this? Right now I am batch firing my injectors, but I plane to go semi or full sequential. I have a 2,0 l with 4 630 cc injectors. My idle PW is 1,4xx ms right now. If the sequential code is not that fare of I will wait for it and not go semi. I will have to do some more wiring before that as well to get my second trigger working and do some more injector wiring.

Thanks
Vegard
If you can, give the semi-seq code a try. I have that running my 2.0 4g63 BEAUTIFULLY; i cant tell a difference from the OEM computer running the engine to the MS2. It just runs that good. The OEM does full sequencial in lower load/rpm regions. I think to make the best use of semi-seq, you will want to know your trigger wheel teeth spacing, and exactly what part of the engine cycle a certain tooth is at. From my testing, you will want to choose a tooth that fires each bank anywhere from 70-280 degrees before the intake valve opens. This gives plenty of time to give fuel even at high rpm. Depending on your trigger wheel design, you may have 2 cylinders a bit more delayed in fuel injection, over the other 2. Like the 4/2 CAS for my engine, since each tooth is roughly 90 degrees apart, i have 2 injections around 77 degrees BTDC, and the ohter 2 at 280 degrees BTDC. I found that injection later than the 280 degrees BTDC, it made the engine run a bit rough, esp at idle. It was also more prone to detonation. This is why to really utilize the semi code, you will want to know your trigger wheel teeth, spacing, and where in the engine cycle each tooth is at, the enigne's firing order, then wire your injector's cylinders accordingly.
-Matt-
1998 Mitsubishi Eclipse RS 420A Turbo- MS2 Extra- 2.1.0 Release
1992 Plymouth Laser RS 4g63 AWD Turbo MS2 Extra- 3.0.3s
vlopsahl
Helpful MS/Extra'er
Posts: 136
Joined: Tue Jul 05, 2005 3:04 pm

Post by vlopsahl »

md95:

Maybe I will give it a try then. I have a 60-2 trigger-wheel. Cyl 1 is at TDC 78 degres after the first tooth. I have read all the semi-sequential treads and as I understand it MS divides 720 crank degrees into 8, and this is what you can select in the injector sequence. Am I right? I am a little bit confused how this really works with my trigger wheel. Since it is only semi sequential I do not need a second trigger (Cam-trigger) right?

Now I use 1 squirt simultaneous and I saw Ken write that then I must wire injector 1+3 together on injector 1 (Db pin 32/33) and injector 2+4 on injector 2 (Db pin 34/35).

As I said I was considering trying this but the lack of documentation frighten me a bit. The big question was whether it would work with my triggerwheel and without a second trigger (I know I need second trigger for full sequential).

Thanks
vegard
Audi 80Q 2,0 20V Turbo 630cc AEB/ABA/ABF
MS-II V3 MT2.25 MS2 Extra 2.0.1 VAG/Bosch VR 60-2 Waste spark PWM-idle
Post Reply