Quite a while ago we had a thread with discussions about minimising latency to the fueling calculations etc. That thread is here :
http://www.diyefi.org/forum/viewtopic.php?f=8&t=77
I want to discuss this in more detail now.
A given block of code will have certain conditions that need to be met for it to run effectively.
Requirements/Properties :
- Priority level
- Takes X time to run
- Must be run AT a fixed frequency
- Must be run AFTER a fixed period
- Must be run BEFORE a fixed period
- Must be run based on some event(s) or condition(s) (the 3 above fall under this broad heading too)
- Others?
Additionally, after reviewing the above linked thread, I think maybe the ASM call to the SWI *could* be useful after all. If our scheduling code checks the "calcs flag" before each scheduling operation and subsequent code execution then it could call that and cause the code to run there and then. This isn't much different to what we already have though, so maybe not...
Perhaps sticking with what we have is better and just using the subsequently left over time to do everything else is best?
If we do it how it is now though, at some RPM threshold, all that will run is the math code. That is probably not the best. At the least it should be the case that even under heavy load the other tasks do not get locked out totally. Perhaps something like "always run one task after the math task" or similar. Perhaps use some timer to KNOW how much time we have between desired math executions and run enough stuff to just fill that gap or not quite fill it or something. That wouldn't be tooooo hard either.
Additionally, it would be desirable for certain things to run more often than even the fuel calcs : rpm ign cut, fuel cut, ign retard, range checking of some parameters etc. It would also be desirable for some of these things to take effect immediately. I think the best approach for ign and fuel cut based on RPM is to test this on every revolution or other spot more often decoder dependent with a simple RPM calculation.
At 6000 RPM the motor is accelerating so hard that one revolution of the crank later the motor is turning 6390 RPM.
whittlebeast wrote:I was playing with the ski today and using the 026h8 code I hit 39000 RPM / sec on one of the stabs of the throttle. With a little napkin math I am coming up wth an interesting calculation. At 6000 RPM the motor is accelerating so hard that one revolution of the crank later the motor is turning 6390 RPM. I went from 4900 RPM to 7500 RPM in .067 sec. This should put timing calcs into perspective. PS: I still let Sea-Doo do the ignition timing.
This is interesting stuff. Andy's setup is one of the most extreme I've read about in the MS world. Even on his setup if we implement this stuff all right we will be very close to correct with no correction/prediction of timing. Just by being fast and scheduled! Much better.Phil Tobin wrote:I can't post on the beta forum, but my car does 8000-9000 RPM/Sec in 1st gear, a free spin is good for over 30000 RPM/sec.
Andy posted this spreadsheet link http://www.ncs-stl.com/ms2/RevErrorCalc.xls in the same thread. (I have it cached if it disappears) He also sent me a data log back then (about 2 years ago) showing the data from his sea doo jet ski. Fairly interesting stuff indeed :-) I just reviewed my own logs and found 7130rpm/sec which isn't that high, but is probably typical of most applications I guess. None of that was free revving though, so I'm sure I could probably double that or more. WTF : http://www.diyefi.org/forum/viewtopic.php?f=6&t=308
Who would ever have thought that those operating system design papers I took years ago would come in handy now!? The were among my favourite papers anyway, but I didn't think it would be particularly useful at the end of the day.
Share your thoughts.
Fred.