speeduino icon indicating copy to clipboard operation
speeduino copied to clipboard

Rolling cut isnt cutting it

Open runesmdk opened this issue 2 years ago • 1 comments

Pun intended.

Rolling cut of just 1 event per cycle is too little.

On a 4 cylinder, it should happen over a total of 5 ignition events, 4 should cut, 1 fire, reset and repeat.

On a 6cyl, 7 events with 6 cut and 1 fire, and so forth.

That, or atleast half, like 4 cyl, 3events with 2 cut 1 fire.

That way it will keep going through the cylinders and not flood some when in the cut area.

Rolling now barely works even with very heavy retardation

runesmdk avatar Jul 22 '22 18:07 runesmdk

On my project, I've implemented a gradual rolling cut for launch control, flat shift and regular limiter.

I found this algorithm on Motec's forum https://www.motec.com.au/forum/viewtopic.php?f=11&t=175&hilit=randomiser

This video makes a great job at explaining how a professional rpm limiter works (especially the diagram at the 20 minute mark) https://youtu.be/Au-7kYO4sak

Maybe this is something worth looking into for speeduino also.

Here's a quick example:

#define LIMITER_FULL_CUT_LEVEL (0xFF)

struct Limiter
{
    uint8_t seed;    // randomizer seed, normally 75 or 151 is used
    uint8_t counter; // to keep track of the rolling cut
    uint8_t level;   // cut level, 0=no cut, 255=full cut
};

bool limiter_should_cut(Limiter* lim)
{
    if (lim == NULL) return false;

    lim->counter += lim->seed;                  // update counter
    return (lim->counter < lim->level) ||       // cut if counter is less than level
        (lim->level == LIMITER_FULL_CUT_LEVEL); // or if full cut is enabled
}

Limiter rollingCutFuel;  // to keep track of the fuel rolling cut
Limiter rollingCutSpark; // to keep track of the spark rolling cut

Then limiter_should_cut() is called in every schedule start callback to decide if we actually enable the output pin or not.

brunob45 avatar Jul 23 '22 02:07 brunob45