Kickstart mode

It's all about the code!
Post Reply
Kavabanga
Posts: 66
Joined: Sat Apr 13, 2019 9:07 pm

Kickstart mode

Post by Kavabanga »

Hello everybody!

Since Slack channels are not the best way to discuss some new things as I've been thinking for a long time, I decided to try the Forum...

My engine runs on the RusEFI and feels good. Check this: https://rusefi.com/forum/viewtopic.php?f=18&t=1584
Everything works properly except one thing: the engine starts very bad because the firmware isn't able to handle kickstart engines.
Because of that, my engine can start after third or second kick or can start after one minute of unsuccessful tries as well. Usually it pisses me off, so I decided to try to find a solution without hard code re-making.
Additionally, the one possible trigger wheel for use in my case is 2-0 trigger wheel on the camshaft with the firmware set on "4 stroke engine without camshaft sensor" and "single tooth" trigger wheel in the TS. Because of that I can use simultaneous ignition and injection modes only. But the main problem is that even in the current configuration I can start my engine in case the both cylinders works properly only. If one injector or spark plug or anything else works not as it should or doesn't work at all and because of that one cylinder doesn't work, the engine can be started be towing only. That makes me really worried in long trips...
So, let's finish with the introduction and get to next point.

So, as I know, we can split our engine control logic on two parts: before synchronisation and after.
In my engine in case I use 4-1 trigger wheel on the camshaft (this is the only one option where I can put sensor and wheel) I will not get any problems if I spark and inject to both cylinders every time a tooth gets out from the sensor while synchronisation is false in case I have TDC right after one concrete tooth (I checked this logic with 4-1 trigger wheel and usual ignition system with carburetors. It works great even when RPM is above idle limit.) And right after synchronisation gets true, the firmware can work as it should: with phase injection and so on.
I know about scheduler which requires information about ignition coil charge time and I have two options here:
1. When a tooth gets in the hall sensor, firmware starts to charge coils and make injection. Right after a tooth has got out from the hall sensor, firmware just discharges coils.
2. When a tooth gets out from the hall sensor, we just tell the scheduler that 6 msecs later we got to spark and inject
Of course, for that thing usual cranking logic must be turned off
And I'd like to start from easy way and just edit the MCU code without TunerStudio files changing
What do you think about options? What is easier to implement? Any suggestions?
Of course, the second option will not be able start the engine properly and ignition timing setting will not be as easy as it should and as higher the RPM as later the ignition will be, but when the synchronisation will true (less than 600 RPM I guess) everything will get fine, so on that RPM late ignition isn't so bad I think..

But I decided to use the first variant of logic and wrote some code which I'm gonna put in a separated cpp file when it gets better and workable :

int protecttime;
if (shaft_is_synchronised == false){
engineConfiguration->isIgnitionEnabled = false; //turn off "the official" ignition sestem in order to control it by this part of the code
if(curSignal == SHAFT_PRIMARY_RISING){ // if we see that tooth goes in the sensor
protecttime = US2MS(getTimeNowUs());
enginePins.coils[0] -> setHigh(); //start 1st cylinder coil charge
enginePins.coils[1] -> setHigh(); // start 2nd cylinder coil charge
if ((US2MS(getTimeNowUs())-protecttime)>500){ // if we don't see any trigger events more that 0.5 sec
enginePins.coils[0] -> setLow(); //discharge 1st cylinder coil in orger to avoid overheating of ignition sysem components
enginePins.coils[1] -> setLow(); // discharge 2st cylinder coil in orger to avoid overheating of ignition sysem components
}

if(curSignal == SHAFT_PRIMARY_FALLING){ // if we see that tooth goes out from the sensor
enginePins.coils[0] -> setLow(); //discharge 1st cylinder coil in orger to spark
enginePins.coils[1] -> setLow(); // discharge 2st cylinder coil in orger to spark
}

} else {
engineConfiguration->isIgnitionEnabled = true; // when the shaft is synchronised we turn on "normal" ignition
}


Any suggestions, questions, comments, criticism?
Kavabanga
Posts: 66
Joined: Sat Apr 13, 2019 9:07 pm

Re: Kickstart mode

Post by Kavabanga »

As practice has shown, I wasn't far from the destination point :D

This topic will probably be never updated, so, go here to keep in touch

https://rusefi.com/forum/viewtopic.php?f=18&t=1584&start=30
Post Reply