MS1 MPI for the saimese mini?

Discuss MegaSquirt, VEMS and other non-free hardware and software here.
Post Reply
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

MS1 MPI for the saimese mini?

Post by Fred »

This looks to be yet another MS clone :

http://www.canems.co.uk/index.htm

Looks like it has siamese support though :

http://www.canems.co.uk/siameseports.php

It must be MS1 based as the fuel accuracy is stated to be "64 micro seconds" which is much worse than MS2.

Jean, it looks like the fuel timing is consistent across load, would you say a 2d curve is enough for this? If so, that would mean a lot less flash used to allow this functionality (as discussed in great detail LONG before these guys showed up) on FreeEMS.

I know your MS2e port used a spare 3d ign timing table for that, but is it really necessary? If that graph is legitimate and well tuned, it would seem not.

Your thoughts?

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: MS1 MPI for the saimese mini?

Post by jbelanger »

As far as I know this is not based on MS but is their own design. If it is based on MS1 then it's even worse than I thought.

This has already been on a few Mini-specific forums which is where I became aware of it. What is amazing is that they have a patent pending for something that has been on the net (they even put the link there) for some years. Everything they do is what I had already implemented in my MS2e-based version. And what's also interesting is that their results look very similar to what was obtained with my code by a guy on the turbominis.co.uk forum. It shows some AFR differences between the paired cylinders but it seems the engine runs really well.

The Canems guy was on the forum at some point but he got real defensive and quiet when I started asking some questions about was was original about his code compared to what has been available on the net for quite a while. Heck I've been discussing this subject on MS and Mini forums for years and nothing shown on their site is new. From the title of their patent (which is the only thing I could find) they seem to just patent Marcel's original idea (guy who wrote what they link on their own page).

When I asked about this on the forum and if they could share what was original, the only response I got was that it wouldn't make much sense to publicly discuss their patent because it would defeat the purpose. When I mentioned that a patent is actually making public an idea and it protects your commercial rights on it, I didn't get a response and I don't think he has posted since. Let's just say I wasn't impressed.

As for the more relevant subject for FreeEMS, if you look at the 3D curve presented on their site, it is actually 3D and not completely flat. The fuel timing is related to air speed in the port so it does make sense that it would vary with both RPM and port pressure. Is it really necessary to have both? I don't know for sure because it would require some extensive investigation on both the theoretical and experimental sides. And it will definitely be dependent on the intake configuration: injector position and intake port geometry will definitely have a contribution. How much of an effect, I have no idea which is why the 3D solution was chosen since it is the most flexible.

Another aspect is the well tuned aspect you mention. It's one thing to have the 3D timing table but it's another thing to correctly and completely fill it. You need at least a couple of WBO2 sensors and a good tuning session. And there is some margin on the fuel timing so even if you're off with small pulse widths, it probably won't make much (if any) difference in the tune. The problem is that very few people have gone through the process so it's pretty much all theoretical for the moment.

So if the goal is to keep things as flexible as possible until more is known, then it would make sense to have a 3D table. Is the size issue because you want to fit the tables in RAM or because you want to avoid paging in flash or something else? With the amount of available flash I wouldn't have thought this would be an issue but of course if that is said for all planned features, it will become an issue before long.

Jean
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MS1 MPI for the saimese mini?

Post by Fred »

jbelanger wrote:As far as I know this is not based on MS but is their own design. If it is based on MS1 then it's even worse than I thought.
Interesting, I sent them an email about it and it will be even more interesting to see what they say in response to my blunt accusations of MS use :-)
What is amazing is that they have a patent pending for something that has been on the net (they even put the link there) for some years.
Dodgy patents seem to be commonplace in the EFI sector these days ;-) LOL
The Canems guy was on the forum at some point...<snip>...Let's just say I wasn't impressed.
Interesting :-) Feel free to link the thread if you know where it is. Could be worth a laugh. If you do I'll read it on Monday night.
So if the goal is to keep things as flexible as possible until more is known, then it would make sense to have a 3D table. Is the size issue because you want to fit the tables in RAM or because you want to avoid paging in flash or something else? With the amount of available flash I wouldn't have thought this would be an issue but of course if that is said for all planned features, it will become an issue before long.
I don't want to be a Bill Gates or IBM here ("we envisage a world market of 4 computers" LOL) but ms2e does a LOT and aren't at 128k yet. I can see us needing to page flash (automatically with GCC) before too long (6 months more or so) but I strongly doubt we'll reach the edge of flash. Similarly, RAM is looking plentiful. I intend to frivolously use the RAM with a manual paging mechanism to enable a LOT of live tunable data to be stored. For example :

if you take VE tables, some people want 2 for V engines, others want 2 for table switching, why not just put 4 in and have V engines with table switching? It certainly simplifies the code, and there is plenty of ram for it. I intended to put a full fuel timing 3d curve in for you anyway my only concern being tuning complexity for other users. However, that shouldn't be an issue AT ALL as for the majority of people a dead flat timing table adjusted to be correct at idle will be just fine. how does (configurable) 20x20 ish strike you? :-)

A big table like that eats less than a coolant lookup (1k vs 2k) and each RAM page is 4k so its a non issue IMO. All the big tables will only need accessing in three places :
  • lookup math code
  • serial tuning code
  • flash burning code
Everything else will rely on the stored data IF they need it at all (most won't).

Right now we are at 23k from 48k of currently accessible unpaged flash and only half of it is code. Se are using very little ram, maybe around 2k, so splitting it into 6k of GP RAM, 2k of fixed configs stored in unpaged RAM and 4k blocks of tunable tables seems VERY easy to do :-) In fact, I just shrunk RAM to 6k in preparation for this as it's next on the list of stuff to do :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: MS1 MPI for the saimese mini?

Post by jbelanger »

Yeah,512K is a lot of 1K or 2K tables.

And 20x20 for fuel timing is huge! However, it might be easier like that so that you have the same axis as the VE table to tune the same points in the different tables.

As for the number of VE tables, it might be interesting to think of having a base VE table and one VE trim table per injector or cylinder. I know that the Mini engine has vastly different needs for the inner and outer cylinders (apparently up to about 15%). Of course that becomes an issue with filling those tables but you can leave them at 0 or copy information from one table to another (which means the tuning software would need those features).

The same thing could be available for ignition timing but it becomes even more difficult to fill that with meaningful values unless someone has some way of looking at the peak pressure position for each cylinder.

I assume that this discussion should be done somewhere else.

Jean
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MS1 MPI for the saimese mini?

Post by Fred »

jbelanger wrote:And 20x20 for fuel timing is huge! However, it might be easier like that so that you have the same axis as the VE table to tune the same points in the different tables.
You aren't the first to say that, and I think I agree with it too. The last lot were some beemer guys that thought AFR should match VE for the same reason despite 8x8 being heaps for AFR...
I assume that this discussion should be done somewhere else.
Perhaps, but I think it might be shorter than you are expecting (will split it later if need be) :
As for the number of VE tables, it might be interesting to think of having a base VE table and one VE trim table per injector or cylinder.<SNIP>Of course that becomes an issue with filling those tables but you can leave them at 0 or copy information from one table to another (which means the tuning software would need those features).

The same thing could be available for ignition timing but it becomes even more difficult to fill that with meaningful values unless someone has some way of looking at the peak pressure position for each cylinder.
There may be a lot of flash, but there isn't so much ram, and I would want the same behaviour for 12 cylinders as for any other number (uniform behaviour and config if possible remember). Also, it's only available 4k at a time, so it would require a bunch of annoying page changes to do that. Given that all good engines have basically perfectly even air flow by design (yes, I'm aware that rules out a lot of US V8's as not good engines ;-) ) I think a basic % trim per cylinder is enough for both fuel and timing use.
I know that the Mini engine has vastly different needs for the inner and outer cylinders (apparently up to about 15%).
Umm, I thought that was part of the point of the Injection timing, ie, offset that centre away from the place it should be and put it where it needs to be? I realise that would require a tuning loop where the timing affects the AFR, but if you get it suitablly rich/lean in the first place such that the average is where you want it, then it should be single step process more or less.

Or am I missing something here?

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: MS1 MPI for the saimese mini?

Post by jbelanger »

Fred wrote:
I know that the Mini engine has vastly different needs for the inner and outer cylinders (apparently up to about 15%).
Umm, I thought that was part of the point of the Injection timing, ie, offset that centre away from the place it should be and put it where it needs to be? I realise that would require a tuning loop where the timing affects the AFR, but if you get it suitablly rich/lean in the first place such that the average is where you want it, then it should be single step process more or less.

Or am I missing something here?

Fred.
There are basically 3 different ways to do injection timing to deal with the siamese port: 2 which require a cam sensor and a third which doesn't (the one used by Canems and my current code). This last method fires both injectors (one in each siamese port) at the same time once per rev. The timing is done so that it corresponds to when the intake valve is open on the outer cylinder of one port. So in the other port it injects on closed intake valves but the fuel will be ingested by the inner cylinder when it's intake valve opens. This has the advantage of being simple but has the disadvantage of not having a perfect AFR distribution due to the fuel from wall wetting going mostly to the inner cylinders. With a cam sensor and some fuel trim (table, percent, ...) it would be possible to correct this AFR mis-distribution.

Another method that can be used is the one you're thinking of and the one used by the Rover MPi Mini: have a single fuel pulse with the injection starting when the inner cylinder intake valve is open and ending when the outer intake valve is open. However, this method has a few disadvantages. First, it requires a cam sensor (not a big issue) so that means that there is a need to use another method of injecting until cam sync is reached (more annoying). Second, it doesn't like big cams: with a big cam, you will have an overlap of both intake valves open AND the exhaust valve opening on the inner cylinder which means you're sending fuel directly out the exhaust. Also, for the same reason, with big power you have very short pulses which will be injected during this overlap period because that's pretty much the middle of the injection time window. It might work for powerful turbo engines because you don't want much overlap anyway.

The third method is to have one injection pulse per cylinder timed on the open intake valve such that the 2 injectors will go squirt-squirt-pause-pause for one injector and pause-pause-squirt-squirt for the other one over the complete engine cycle (2 revs). Again this requires a cam sensor and some fuel trim because wall wetting will not affect both cylinders equally. Also, you can't have the same timing for both inner and outer cylinder because of the overlap so the injection for the inner cylinder needs to start earlier to finish before the overlap and the injection for the outer cylinder needs to start later to start after the overlap.

Actually, this last method becomes a more generic variant of the first method which is how I want to implement it in the next version of my code: ignore the inner cylinder timing and fire both injectors on the outer cylinder timing until cam sync is reached then use cylinder-specific timing and fueling. I'll also make the inner cylinder timing optional because I'm not sure anyone will want to tune that even though there is probably some gain in doing it because there may be some air displacement due to fuel evaporation when injecting too early.

I'm sure it's more than you wanted to know but unfortunately it's difficult to keep things simple when talking about siamese port injection.

Jean

edit: corrected a few typos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MS1 MPI for the saimese mini?

Post by Fred »

jbelanger wrote:I'm sure it's more than you wanted to know
No such thing! Thanks for the detailed explanation.

Perhaps the best thing to do then is not really attempt to provide for it at all. Rather, just provide the raw materials to do the job right.

So, what do you need in the way of raw materials? If I've read correctly, 2 3d fuel timing tables (inner and outer), 2 fuel VE tables (inner and outer), ability to schedule centre of the fuel flow to the timed angle? So far, the ve tables are more than covered, you can use the dual V bank arrangement and still have table switching if you wanted, I'm planning the centred/start/end timing anyway, and if we are having 1 fuel timing table, we may as well have 2 and they could share the same page with a pair of lambda tables (as required for proper dual fuel operation anyway). How does that sound for raw materials. If you have enough data to lookup, and enough control of the output, its just a matter of doing some config/math to work out what to do with it all in the middle right! :-)

http://www.diyefi.org/forum/viewtopic.php?f=8&t=318

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: MS1 MPI for the saimese mini?

Post by jbelanger »

That sounds perfect. With the tables and the ability to do centered/start/end timing, everything is there to do the work. As you say it's just a bit of config (and not a lot of additional math, if any) to assign the injection pulse to the correct injector.

While I'm thinking about it, since you're going to do wasted spark until there is cam sync, I assume you'll do something similar with timed (sequential) injection?

Jean
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MS1 MPI for the saimese mini?

Post by Fred »

Yeah, that's the plan, I still don't know just how I'll implement it yet, but I do know how to keep it all out of the ISRs and nice and generic, then its normal "boilerplate" code to stitch config to output ready for action. I'm sure we'll figure something nice and generic out :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply