Engine position

It's all about the code!
Post Reply
mpeski
Posts: 7
Joined: Tue Apr 08, 2014 1:18 pm

Engine position

Post by mpeski »

Are there any documentation available how crankshaft position is calculated and how ignition callback is generated in current software ?

I'm trying to go through the software to get the idea how is it designed.
User avatar
AndreyB
Site Admin
Posts: 14343
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Engine position

Post by AndreyB »

http://rusefi.com/docs/html/

I would be happy to extend this article, so please read & ask questions.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mpeski
Posts: 7
Joined: Tue Apr 08, 2014 1:18 pm

Re: Engine position

Post by mpeski »

Ok, so is the ignition event only occurring on trigger interrupt ? I mean, can ignition be adjusted between trigger pulses ?
User avatar
AndreyB
Site Admin
Posts: 14343
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Engine position

Post by AndreyB »

Sure it can. I've just expanded the last paragraph, it now reads:
So, for this particular sensor the most precise scheduling would be possible if we schedule coil charting as '85.6 degrees after the 600 degrees position sensor event', and spark firing as '10 degrees after the 690 position sensor event'. Considering current RPM, we calculate that '10 degress after' is 2.777ms, so we schedule spark firing at '2.777ms after the 690 position sensor event', thus combining trigger events with time-based offset.
At some point I would need a native speaker to fix my broken English...
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mpeski
Posts: 7
Joined: Tue Apr 08, 2014 1:18 pm

Re: Engine position

Post by mpeski »

Ok, perfect. One more question. Time in the example, 2.777 ms, when is that calculated ?

Your English far better than mine :D
User avatar
AndreyB
Site Admin
Posts: 14343
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Engine position

Post by AndreyB »

2.777 ms is calculated within the trigger event interrupt handler when we know that this trigger event needs to schedule an output signal.

Check the handleSparkEvent method @ http://sourceforge.net/p/rusefi/code/HEAD/tree/trunk/firmware/controllers/trigger/main_trigger_callback.cpp#l117

At least I hope my Russian is better than yours.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mpeski
Posts: 7
Joined: Tue Apr 08, 2014 1:18 pm

Re: Engine position

Post by mpeski »

I think I got the picture now, looks good.

...more questions to come...
Post Reply