Cranking Pattern Recognition

It's all about the code!
Post Reply
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Cranking Pattern Recognition

Post by stefanst »

I've built a few rusEfis that run/ran approx 5 Miatas of differing generations. A recurring complaint by the drivers is the slow start. It appears that others @? experienced a similar problem, since he improved the code in this area a little.

So, today I sat down with a rusEfi, a Jimstim and a $10 eBay logic-analyzer. Took some trails of cranking at different rpms and different firmware versions and settings. This is for an NA MIata.

The new option under "cranking settings" -> "enable faster engine spinup" seems to help a bit. But we still need 2.5 crank rotations (10 ticks on the fake crank sensor) in order for the ECU to figure out where we are.
Cranking trace 363rpm fast spinup ON
Cranking trace 363rpm fast spinup ON
Fast Spinup Crank 363rpm region.png (24.82 KiB) Viewed 5375 times
Without the fast setting enabled we need 3.25 crank rotations (13 ticks on the fake crank sensor):
slow spinup crank 327rpm.png
slow spinup crank 327rpm.png (25.38 KiB) Viewed 5375 times
I also did some tests with older FW (from approx. October 2018). In all tests, it took either 13 or 17 ticks on the crank sensor before the pattern recognition kicked in.
Old FW Spinup slow.png
Old FW Spinup slow.png (25.07 KiB) Viewed 5369 times
Please note that the Jimstim always starts with the same ticks, a real engine would start in a random-ish position. So on a real engine we may get it in 11 ticks, or in 19, depending on where the camshaft sits when we start cranking.

Edit: Attached measured traces from logic analyzer.
Cranking.7z
(223.51 KiB) Downloaded 306 times
Last edited by stefanst on Mon Jan 21, 2019 2:35 am, edited 3 times in total.
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: Cranking Pattern Recognition

Post by stefanst »

While experimenting with this, I also noticed two things I thought worth mentioning:

1. Charge Angle under cranking dwell settings: This basically defines how many degrees before TDC to start dwelling the coils. I would advise AGAINST using that setting, unless you're certain you need it. Usually, afaik, electronic coils under cranking usually use a slightly longer dwell - "hotter spark". This may, or may not, be also depending on measured battery voltage. Setting a charge angle can lead to the coild dwelling for >100ms. This seems excessive and may lead to coils burning up if we do this for an extended period of time.

2. Somehow rusefi seems to get confused at really low rpms. On the NA Miata setting I was using, the coil for cylinders 2&3 fired at the wrong time and too many times, at rpms below approx. 100. It fixes itself when we up the rpms. This may have to do with the ca/crank pattern from the Jimstim. It only mimics Miata NA patterns, but may be slightly off from what rusEfi is expecting.
Fubared Coil2_3.png
Fubared Coil2_3.png (27.46 KiB) Viewed 5373 times
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: Cranking Pattern Recognition

Post by stefanst »

I just realized- I think with NA Miata 10 ticks on the CRANK portion of the CAS means 5 full revolutions of the crank, not 2.5. So 17 ticks would mean 8.5 revs. Ouch. Or, I may be wrong.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Cranking Pattern Recognition

Post by AndreyB »

Miata CRANK which for current rusEfi trigger logic is "secondary" signal is perfect for cranking. With CRANK signal only on the one hand there is no way to know current shaft position while on the other hand there is enough data to start fueling and sparking!

At the moment rusEfi does not have the logic to start fueling and sparking based on secondary trigger signals before trigger syncs. It's not great but that's the reality - after all, rusEfi is not only about Miata and at the moment I am failing to offer a general enough and elegant enough solution.

As hopefully an improvement I would rather try https://github.com/rusefi/rusefi/issues/679 - there is a change that this could improve things somewhat.

By the way we have



Shall we record a similar video with rusEfi to really compare apples to apples, also to either celebrate progress or failure in the future?
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
stefanst
contributor
contributor
Posts: 703
Joined: Wed Feb 17, 2016 12:24 am
Location: USA 08530

Re: Cranking Pattern Recognition

Post by stefanst »

russian wrote:
Mon Jan 21, 2019 2:35 am
Miata CRANK which for current rusEfi trigger logic is "secondary" signal is perfect for cranking. With CRANK signal only on the one hand there is no way to know current shaft position while on the other hand there is enough data to start fueling and sparking!

At the moment rusEfi does not have the logic to start fueling and sparking based on secondary trigger signals before trigger syncs. It's not great but that's the reality - after all, rusEfi is not only about Miata and at the moment I am failing to offer a general enough and elegant enough solution.

As hopefully an improvement I would rather try https://github.com/rusefi/rusefi/issues/679 - there is a change that this could improve things somewhat.

By the way we have



Shall we record a similar video with rusEfi to really compare apples to apples, also to either celebrate progress or failure in the future?
That's some pretty good cranking. Eventually, if we can find a dozen or so more main contributors, we can make cranking much better than stock NA Miata. We just have to store current crank / cam position in sram.
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Cranking Pattern Recognition

Post by mck1117 »

stefanst wrote:
Mon Jan 21, 2019 2:57 am
We just have to store current crank / cam position in sram.
That might not necessarily work, for a few reasons:
  1. Hall effect sensors get whacky at very low engine speeds. A single edge might end up being a few (see the very first edges of the logic analyzer trace).
  2. The engine often bumps backwards just a little bit after stopping, as it bounces off of compression on the last cylinder.
There's still improvement to be had, as in that trace it looks like we could have sync'd a full revolution earlier than we did.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Cranking Pattern Recognition

Post by AndreyB »

At the moment I suspect that something is not right with "enable faster engine spinup" implementation

On the one hand we have a unit test, but the unit test uses a one tooth trigger signal so it's not the most convincing unit test ever. My unit test with a 60/2 trigger makes me wonder if current implementation has some issues. See https://github.com/rusefi/rusefi/commit/f44d9c4bbf77dd628a4c578f77c1ef9edfe29bce on a separate branch
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
Post Reply