Possible uses of our timer resources : ideas soon please!

Official FreeEMS vanilla firmware development, the heart and soul of the system!
User avatar
ababkin
LQFP112 - Up with the play
Posts: 215
Joined: Tue Jan 15, 2008 5:14 pm

Re: Possible uses of our timer resources : ideas soon please!

Post by ababkin »

Again, please don't think i am trying to discourage supporting the secondaries (i love the idea of having it working personally and see advantages), i am just encouraging everyone to brainstorm about the potential troubles/pitfalls associated with getting it to work and tuning it conveniently.

Just another idea: (positive one for a difference ;) )
I understand that it is bad (or not optimal) to spray while the intake valve is open. If we use up the duty cycle of primaries before turning on the secondaries, we'd end up spraying quite a bit into the open valve. So it'd be perhaps better to start spraying from secondaries as early as possible (which is dictated by the opening time and idle/low rpm quality i understand) and this way keeping the overall PW of both stages as short as possible.

Speaking of the inj timing: I heard it's best to finish spraying right before the valve opens. But wouldn't we get the best evaporation if we start spraying as soon as the valve closes? (the disadvantage of this would be fuel possibly being redirected to a different cyl, which is not so nice)

Another question for the local injection gurus: wouldn't it make sense that the pressure in the rail should be increased with increasing the injector size, to ensure the same quality of atomization? (disregarding the actual fuel amount requirements here, atomization only). I am just considering the fact that the velocity of the fuel shooting from a smaller injector will be higher than it shooting from a bigger injector given same rail pressure. Is it standard that one endows the secondaries with a higher psi FPR?
Legal disclaimer for all my posts: I'm not responsible for anything, you are responsible for everything. This is an open and free world with no strings attached.
User avatar
AbeFM
Post Whore!
Posts: 629
Joined: Sat Feb 16, 2008 12:11 am
Location: Sunny San Diego
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by AbeFM »

My guess would be injectors should come with a requirement for what pressure differential they want to be run at.

My atomization claims earlier were saying you'd have un-mixed drops of gasoline and taluline, however you spell it, and each would burn weird (how does pure tolulene burn, anyway?), as opposed to mixing them in the fluid state where the chemistry matters more.

I'm not so sure about spraying on closed valves. I think some factory applications run "two squirts", one for evaporating, and one for going right in. Otherwise, yes, you'll get pooling, lots of wall absorbtion problems, etc.

My guess is yes, you'd want to start the one further up the stream earlier, I guess I'd always start with the secondaries. When the secondary pulse is short, it would end before the primary, and when it's long, it would end after.

No offense taken on any of this, mostly I'm trying to understand if my preconception are misconceptions, or just a different fresh point of view.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

I understand that it is bad (or not optimal) to spray while the intake valve is open.
Only for emissions, and only for short pulse widths. Past that you cause it to be puddled and worse. Of course, trying to optimise to that is just going to get ridiculous. You are going to end up with a timed start or end point and you get the rest of your gas after or before that. Trying to be more precise is beyond the scope of our project. What we need is consistent mixtures to each cylinder (even if they aren't quite right) and a single shot per cycle. That way your cylinders all behave the same, and you can get a smooth idle and save power conditions. We aren't here to f#$% around increasing economy... We are here to make POWER :-) economy is what you get when you buy a prius (great car btw(from a non performance point of view)).
I heard it's best to finish spraying right before the valve opens.
Most likely best is "longest pulse before full on ends just as or a little before valve shuts" and shorter ones end with less and less going in directly. That way your short ones get evaporated on the valve, and long ones end up back inside. Thinking about that again, it comes back to my original (second) suggestion to end them at the same time and start separately. This way the majority of the secondary shot goes in directly and doesn't puddle.

As for fuel pressure, you don't want to go under 40psi, and you can't go over 60 or so without them locking up from the pressure and increasing opening times heaps (they open backwards against it... the atomisation and flow increase are not big enough for the downsides (though I intend to use this as a get more power HACK myself in the short term when i get home).

Once again, toluene IS gas. It burns as normal. Mixing could be a slight concern but you really don't have any control over that anyway. So long as it's consistent.
My guess is yes, you'd want to start the one further up the stream earlier
Yes, you would at low rpm, but not so much at high rpm, at high rpm, it would be much better if both injectors were way out there. Remember that its a surge of air, not a steady flow. There is also resonance shaking things up in there in the middle.

Back to point A : Single fuel users will get excellent behaviour with a single(or 2) figure setup. Dual fuel users will get good behaviour with intelligent injector choice and the same system. I still can't see how manually being able to mess with it helps?

For any rpm, you get a full 100kPa worth of normal gas from your small ones, and then as the kPa increases, so does fuel requirement, and the secondaries come in in increasing amounts WITH boost. Exactly how you would want it anyway, why not leave it largely automated? 50% toluene will give hell good results at high boost, hell, boosted f1 cars had 90% or something. It's good stuff! and cheap. 50% also drives totally normally at low load (personally can vouch this). with 250/550 setup, at full boost you will have 66% and at 100kPa you will have 0% (or close), there is no way you would want to turn the normal injectors down/off using that sort of stuff. Using more than the percentage you need for any given boost level is much the same as using it all the time, i.e. a waste...

This discussion is becoming less and less useful and more and more time gone. You only have my time knocking out code for about 2 weeks from now. Past that it will be severely reduced.

At most you will get staging starts with normal or after, staging ends before, with, or after normal. You will not get staging starts before normal.

We need a decision on this asap. I'm still unconvinced that there is need to do tables etc, but that is independent of the injection capabilities timing wise. Is there a need to end after main? I don't think so. Is there a need to run main shorter than secondary? I don't think so. Can we make something work scheduling wise inside that main injection window with one or two pit timers, yes, I think so.

Clean simple fast code > fine tuning of a rare feature.

Note those two key points and say yes or no so I can get the hell on with it..
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

I've spoken with someone that I know that has tuned quite a few cars and runs staged injection on his own vehicle.

Me: what accuracy would you be happy with timing wise?
Me: 1 deg? 0.5? 0.1?
Him: 1 degree can be 15 hp or detonation
Him: so id like .1 or better
Him: .5 would be adequate in most cases

Given that we can have much better accuracy than 0.5 (worst case) degrees at 8krpm I think the timers for fuel approach is a good one.

He said that timing adjustments yield very small gains, so worrying about the timing of the staged injectors was silly.

He said his EMS of choice uses a map vs % via staged 2d table to control it. Doing it that way opens you up to having longer pulses on the secondaries which I think is A silly and B pointless and C too difficult/unclean. If we use a table like that, I would suggest that it be map vs % of primary pulse that secondary pulse is. Or just Map vs Max primary pulse or max duty (which are equivalent anyway).

His EMS also uses fixed end point at one point, and he thinks its start, not end, which makes sense because of the distance thing.

Interestingly his EMS does timing to 0.1 degree and fuel to 0.01ms.

He muttered something about 2ms min pulse width on the secondaries, but I'm not sure if that was enforced by the system, or his choice.

What did I take from this mix of info?
  1. Relative timing of staged channels is unimportant
  2. It's probably a good idea to be able to control relative pulse widths to some extent
  3. It's OK to window the staged pulse inside the main one
  4. That our timing scheme is acceptable
  5. But that someone else agrees with Flacid about timer use. (I don't though, as I think good sequential control is key to this whole project and its largely pointless otherwise)
On that basis and a lack of input since my last post, I'll look into the timing of staged on leading, trailing, or both edges limited to inside the main pulse. It may be that the semantics of these PIT timers make it difficult to do anything like this with them, but we'll see.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

The I-bit in the condition code register is automatically set when entering an interrupt service routine. This
prevents further interrupts from occurring and is unchanged on the S12XE. You have the option of clearing
this bit and thus allowing nested interrupts where a new interrupt can be serviced before the current one is
complete.
So, you CAN do that, I'll have to keep that in mind.
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
ababkin
LQFP112 - Up with the play
Posts: 215
Joined: Tue Jan 15, 2008 5:14 pm

Re: Possible uses of our timer resources : ideas soon please!

Post by ababkin »

Admin wrote:
The I-bit in the condition code register is automatically set when entering an interrupt service routine. This
prevents further interrupts from occurring and is unchanged on the S12XE. You have the option of clearing
this bit and thus allowing nested interrupts where a new interrupt can be serviced before the current one is
complete.
So, you CAN do that, I'll have to keep that in mind.
hence my idea about logging timestamps with a higher priority ISRs to enable preempting the main ISR to avoid missing interrupts and account for the actual time of them happening in real-time.


So, are you ready to write a formal requirement spec for fuel scheduling ? (with all concepts clearly defined, ways of approaching problems well documented along with the problems themselves, and reasons for doing it in that particular way given) so we can all constructively criticize and contribute to it.
Legal disclaimer for all my posts: I'm not responsible for anything, you are responsible for everything. This is an open and free world with no strings attached.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

ababkin wrote:hence my idea about logging timestamps with a higher priority ISRs to enable preempting the main ISR to avoid missing interrupts and account for the actual time of them happening in real-time.
= a delay before scheduling occurs. Thats gotta be bad. It's also heavily complex ensuring that nothing squashes itself etc.
So, are you ready to write a formal requirement spec for fuel scheduling ? (with all concepts clearly defined, ways of approaching problems well documented along with the problems themselves, and reasons for doing it in that particular way given) so we can all constructively criticize and contribute to it.
I thought you were doing that? :-p

How many times do I have to say that that design will be drawn up based around my prototype while I look for work. Failure to look for work soon will probably result in my loss of manly functions and a warm place to sleep at night.

First I have to get a functional prototype working so that the proof of concept and algorithm is there and can be used in the design.

Besides, scheduling has nothing much to do with the mechanics of actually doing the switching, it just kicks the process off at the right time based on advance/retard required and current position.
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
AbeFM
Post Whore!
Posts: 629
Joined: Sat Feb 16, 2008 12:11 am
Location: Sunny San Diego
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by AbeFM »

First off, sorry for all the slacking, I should do a better job of championing my own cause! And, the idea of using tolulene as an additive instead of actual fuel is pretty awesome. I forget if I'd said that. Before commenting on my stuff, one more thing about interupts:

1) Does it make sense to do the scheduling then? It seems like you want to do it soon but don't really care - recording the times is important, and scheduling you can do shortly after
2) To me it seems ideal to do this (I'm assuminglower number interupts take priority, and that pri0 is reset or something) you'd do this:

Tooth pass triggers interupt, Pri2
Read timer, record exact time
*CHANGE* Pri2 to Pri4
Do scheduling
Set flag saying scheduling done
Return

Two things there: The first, can you only end the interupt-prevention, or can you change it? If not, then trigger anotehr interupt. But the idea being that scheduling is important, but not so important you want to mistime a tooth because of it.
Two - If your next tooth stops you before you finish scheduling (i.e. flag not present) you should drop the rest of that calc, and do it based on the new tooth, being the most current information.



Now, on to the fun stuff:
Admin wrote:I've spoken with someone that I know that has tuned quite a few cars and runs staged injection on his own vehicle.

Me: what accuracy would you be happy with timing wise?
Me: 1 deg? 0.5? 0.1?
Him: 1 degree can be 15 hp or detonation
Him: so id like .1 or better
Him: .5 would be adequate in most cases

Given that we can have much better accuracy than 0.5 (worst case) degrees at 8krpm I think the timers for fuel approach is a good one.
Yeah, at 12k rpm you get 14us/degree, so 10us would be a minimum. But if we can do that, disneyland!
He said that timing adjustments yield very small gains, so worrying about the timing of the staged injectors was silly.
I agree there. Timing of fueling is of minimal importance in my estimation. It'll effect atomization some amount, but basically doesn't matter.
He said his EMS of choice uses a map vs % via staged 2d table to control it. Doing it that way opens you up to having longer pulses on the secondaries which I think is A silly and B pointless and C too difficult/unclean.
I'm not sure I see why it's unclean... You figure out the two times, and you close/open (don't care which and don't think it's worth the trouble of bothering to switch it with loads - tune operation for secondaries to be optimal during peak power conditions, and at idle it doesn't matter you won't have them running anyway

His EMS also uses fixed end point at one point, and he thinks its start, not end, which makes sense because of the distance thing.

Interestingly his EMS does timing to 0.1 degree and fuel to 0.01ms.
Heh, that's interesting. Oh, ah, 0.01ms if actually ~10x worse than the spark timing. And I think those are good numbers. Actually, I think 0.5* and 0.1ms is fine, so anything better than that is awesome.
He muttered something about 2ms min pulse width on the secondaries, but I'm not sure if that was enforced by the system, or his choice.
Er, yeah. :-) Unless it has something to do with how they do the timing and using chip/timer resources.
What did I take from this mix of info?
  1. Relative timing of staged channels is unimportant
  2. It's probably a good idea to be able to control relative pulse widths to some extent
  3. It's OK to window the staged pulse inside the main one
  4. That our timing scheme is acceptable
  5. But that someone else agrees with Flacid about timer use. (I don't though, as I think good sequential control is key to this whole project and its largely pointless otherwise)
On that basis and a lack of input since my last post, I'll look into the timing of staged on leading, trailing, or both edges limited to inside the main pulse. It may be that the semantics of these PIT timers make it difficult to do anything like this with them, but we'll see.
Yeah - I agree wholeheartedly with everything in this whole post, and looking for something to move forward with I'd say this is it - except for ONE point: No reason to limit the secondaries to be longer, or shorter, than the primaries. This is a functional agrument, not one about how it should be implimented. But if you can set it up that one can be longer than the other, then heck, someone could shut off primaries if they want, and it's no more trouble for the code if it's writen that way.

I don't know if it's realisitic, but it sums up my wishlist: Staged injection, variable ratios of injections based on a table, 0.1ms and 0.5* accuracy minimum, timing unimportant for fuel.

Plus, when we're done, there will be cake.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

Firstly, you HAVE to do the scheduling in the teeth, as that is the only place that you have the data that you need when it is not stale. If you try to do this in the "main loop" (read, all the boring unimportant stuff) by the time you get the data, get to processing it, and try to schedule something, your moment is gone.

If you had looked at the demo code it goes something like this :

are we on the right tooth to schedule from?
yes : add retard/advance to the time this tooths edge rolled in, place it in timer register for appropriate injector, set state and interrupts to make the right action occur.
no, exit stage left like the pink panther.

if you are on a sched tooth, and the next one rolls in while you are working, it over writes the register, but because you took a copy straight up, that doesnt matter, then as soon as you finish, you start again in the next tooth where there is nothing to do (between injections if there are lots of teeth) and finish promptly. you have to do these calcs somewhere, and you have to do them when you have the data and KNOW it to be valid still. currently the code is taking latency and runtime into account in its actions. The ignition control will have to do this in an even more sophisticated way to work at all well.

if at high rpm you try to do this else where in a non synchronous way, you wouldn't have a hope in hell of getting it done in the main loop in time. no chance.

What advance and pulsewidth are used will be precalced, and you will use the most up to date set of data available. brilliant. on the tooth before, or the one before that or so, you sample the adcs and set the flag, then before you hit the next one, the main loop code does the fuel calcs. the code is there right now for this scheme. it is a good scheme. Jean endorsed even :-)

so yeah, sched MUST happen in the tooth that is preceding the event by the right amount. no choice there really.
____________________________

You can only end the prevention. you could change it, but that would be rediculously complex with zero need. would 100% lead to impossible to find bugs.

KISS!
____________________

disney land via bit banging, here we come...
_____________

its unclean because it causes unnecessary complications in code that we want to run fast. its unclean because you are going out of your way to do something the hard ugly way when the easy simple READABLE way will work nicely.
__________________________

limiting secondaries to be equal or shorter to primaries is another code thing, ie, less of it, much the same/better functionality and faster. when your secondaries are going to be much bigger than your primaries anyway, there is no need at all to reduce primary feed... if they are the same size, you dont want to. no matter which way you look at it, you want lots of primary and secondary at higher loads.

this thread wasnt supposed to be about staging or ignition at all, and i may bother to split it off for this reason.

it was supposed to be about OTHER uses for timers than injection and ignition.

because there have been no other valid submissions, i hereby state my intentions to use two timers for ignition and two for staged injection.

if a rotor box needs to be run at a later date, code can be fiddled to suit rotor boxs specifically and make better use of the timers in that regard : four PIT timers for ignition, 3 OC timers for main, 3 for staged (on a 20B).

this discussion seems to over i guess. your wishlist will be easily met in all regards.

Admin.
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
AbeFM
Post Whore!
Posts: 629
Joined: Sat Feb 16, 2008 12:11 am
Location: Sunny San Diego
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by AbeFM »

Ah!! I think I finally get this scheduling thing, etc, and though I'm still a little in the dark about what happens when you miss an effectively unimportant tooth while doing something important, that's the price all you folks with more than 4 teeth on your crank pay. :-) Actually, up to making sure the tooth exists, you don't care about it till it comes around again. I figure all that's taken care of.

And, I think the only real "other time" suggestions anyone mentioned were traction control related.
Post Reply