- Thu Oct 06, 2022 4:32 pm
#58820
So right now the rolling limiter implementation is fairly basic (just toggles ignition between cylinders).
What I am thinking is a better rolling limiter approach is to use an RNG, and to set a duty cycle.
So for example:
Say our rev limit is 6000 RPM
At some set RPM before the rev limit we compute a duty cycle for how much to cut ignition for.
So lets say we start cutting at 5800 RPM.
At 5800RPM the duty cycle is 0%, so nothing is cut
At 5900RPM the duty cycle is 50%, so we cut 50% of all ignition events per revolutuon.
The calculation would look like something like:
if GetRandom16BitNumber() <= 2^16*50%: then cut ignition for that rev cycle -- im thinking we could run this check against each cylinder too.
I realize its a random number but once we are at around 3000rpm (50 RNG events per second) say, the probabilities will line up roughly with the duty cycle.
At 5900RPM the duty is 100% so calc is:
if GetRandom16BitNumber() <= 2^16*100% which is always true.
Thoughts? The nice thing about this implementation is that with a fastRNG it would be very simple and gradually cut off ignition as we approach the rev limiter. I plan to implement this for my car, and if others are interested I can make the code more general.
What I am thinking is a better rolling limiter approach is to use an RNG, and to set a duty cycle.
So for example:
Say our rev limit is 6000 RPM
At some set RPM before the rev limit we compute a duty cycle for how much to cut ignition for.
So lets say we start cutting at 5800 RPM.
At 5800RPM the duty cycle is 0%, so nothing is cut
At 5900RPM the duty cycle is 50%, so we cut 50% of all ignition events per revolutuon.
The calculation would look like something like:
if GetRandom16BitNumber() <= 2^16*50%: then cut ignition for that rev cycle -- im thinking we could run this check against each cylinder too.
I realize its a random number but once we are at around 3000rpm (50 RNG events per second) say, the probabilities will line up roughly with the duty cycle.
At 5900RPM the duty is 100% so calc is:
if GetRandom16BitNumber() <= 2^16*100% which is always true.
Thoughts? The nice thing about this implementation is that with a fastRNG it would be very simple and gradually cut off ignition as we approach the rev limiter. I plan to implement this for my car, and if others are interested I can make the code more general.