[The extension msq has been deactivated and can no longer be displayed.]
i would suggest if shift light button can be add at engine config. at least if not using shift light, it can be as mivec/vtec/neo vvl on/off solenoid controller. those three engine use same expression solenoid trigger.
my one probably pattern no 1: inner slot with 8,2,2,2 pattern.
What is this about exactly? I've probably lost context. Is that the pattern you have and you want it added? What vehicle again exaclt / what should we call it? Just want to make sure we are talking about the same thing.
I mean it could be better if add the 360 slot. Currently I running with Speeduino with 360 slot add. I modified little bit about inner slot calculation base on above attachment.
Here is 360/ 4-8-12-16 pattern write by Josh.
void triggerSetup_Nissan360()
{
triggerFilterTime = (1000000 / (MAX_RPM / 60 * 360UL)); //Trigger filter time is the shortest possible time (in uS) that there can be between crank teeth (ie at max RPM). Any pulses that occur faster than this time will be disgarded as noise
triggerSecFilterTime = (int)(1000000 / (MAX_RPM / 60 * 2)) / 2; //Same as above, but fixed at 2 teeth on the secondary input and divided by 2 (for cam speed)
secondaryToothCount = 0; //Initially set to 0 prior to calculating the secondary window duration
secondDerivEnabled = false;
decoderIsSequential = true;
toothCurrentCount = 1;
triggerToothAngle = 2;
MAX_STALL_TIME = (3333UL * triggerToothAngle); //Minimum 50rpm. (3333uS is the time per degree at 50rpm)
}
void triggerPri_Nissan360()
{
curTime = micros();
curGap = curTime - toothLastToothTime;
//if ( curGap < triggerFilterTime ) { return; }
toothCurrentCount++; //Increment the tooth counter
//addToothLogEntry(curGap); Disable tooth logging on this decoder due to overhead
timePerDegree = curGap >> 1;; //The time per crank degree is simply the time between this tooth and the last one divided by 2
}
}
void triggerSec_Nissan360()
{
curTime2 = micros();
curGap2 = curTime2 - toothLastSecToothTime;
//if ( curGap2 < triggerSecFilterTime ) { return; }
toothLastSecToothTime = curTime2;
//OPTIONAL: Set filter at 25% of the current speed
//triggerSecFilterTime = curGap2 >> 2;
//Calculate number of primary teeth that this window has been active for
byte trigEdge;
if(configPage2.TrigEdgeSec == 0) { trigEdge = LOW; }
else { trigEdge = HIGH; }
if( (secondaryToothCount == 0) || (READ_SEC_TRIGGER() == trigEdge) ) { secondaryToothCount = toothCurrentCount; } //This occurs on the first rotation upon powerup OR the start of a secondary window
else
{
//If we reach here, we are at the end of a secondary window
byte secondaryDuration = toothCurrentCount - secondaryToothCount; //How many primary teeth have passed during the duration of this secondary window
if(currentStatus.hasSync == false)
{
if(configPage1.nCylinders == 4)
{
if( (secondaryDuration >= 15) && (secondaryDuration <= 17) ) //Duration of window = 16 primary teeth
{
toothCurrentCount = 16; //End of first window (The longest) occurs 16 teeth after TDC
currentStatus.hasSync = true;
}
else if( (secondaryDuration >= 11) && (secondaryDuration <= 13) ) //Duration of window = 12 primary teeth
{
toothCurrentCount = 102; //End of second window is after 90+12 primary teeth
currentStatus.hasSync = true;
}
else if( (secondaryDuration >= 7) && (secondaryDuration <= 9) ) //Duration of window = 8 primary teeth
{
toothCurrentCount = 188; //End of third window is after 90+90+8 primary teeth
currentStatus.hasSync = true;
}
else if( (secondaryDuration >= 3) && (secondaryDuration <= 5) ) //Duration of window = 4 primary teeth
{
toothCurrentCount = 274; //End of fourth window is after 90+90+90+4 primary teeth
currentStatus.hasSync = true;
}
else { currentStatus.hasSync = false; } //This should really never happen
}
else if(configPage1.nCylinders == 6)
{
//Pattern on the 6 cylinders is 4-8-12-16-12-8
//We can therefore only get sync on the 4 and 16 pulses as they are the only unique ones
if( (secondaryDuration >= 15) && (secondaryDuration <= 17) ) //Duration of window = 16 primary teeth
{
toothCurrentCount = 136; //End of third window is after 60+60+16 primary teeth
currentStatus.hasSync = true;
}
else if( (secondaryDuration >= 3) && (secondaryDuration <= 5) ) //Duration of window = 4 primary teeth
{
toothCurrentCount = 304; //End of sixth window is after 60+60+60+60+60+4 primary teeth
currentStatus.hasSync = true;
}
}
else { currentStatus.hasSync = false; } //This should really never happen (Only 4 and 6 cylinder engines for this patter)
}
else
{
if (configPage2.useResync == true)
{
//Already have sync, but do a verify every 720 degrees.
if(configPage1.nCylinders == 4)
{
if( (secondaryDuration >= 15) && (secondaryDuration <= 17) ) //Duration of window = 16 primary teeth
{
toothCurrentCount = 16; //End of first window (The longest) occurs 16 teeth after TDC
}
}
else if(configPage1.nCylinders == 6)
{
if(secondaryDuration == 4)
{
toothCurrentCount = 304;
}
} //Cylinder count
} //use resync
} //Has sync
} //First getting sync or not
}
uint16_t getRPM_Nissan360()
{
//Can't use stdGetRPM as there is no separate cranking RPM calc (stdGetRPM returns 0 if cranking)
uint16_t tempRPM;
if( (currentStatus.hasSync == true) && (toothLastToothTime != 0) && (toothLastMinusOneToothTime != 0) )
{
if(currentStatus.startRevolutions < 2)
{
noInterrupts();
revolutionTime = (toothLastToothTime - toothLastMinusOneToothTime) * 180;
interrupts();
}
else
{
noInterrupts();
revolutionTime = (toothOneTime - toothOneMinusOneTime) >> 1; //The time in uS that one revolution would take at current speed (The time tooth 1 was last seen, minus the time it was seen prior to that)
interrupts();
}
tempRPM = (US_IN_MINUTE / revolutionTime); //Calc RPM based on last full revolution time (Faster as /)
if(tempRPM >= MAX_RPM) { tempRPM = currentStatus.RPM; } //Sanity check
MAX_STALL_TIME = revolutionTime << 1; //Set the stall time to be twice the current RPM. This is a safe figure as there should be no single revolution where this changes more than this
}
else { tempRPM = 0; }
return tempRPM;
}
int getCrankAngle_Nissan360(int timePerDegree)
{
//As each tooth represents 2 crank degrees, we only need to determine whether we're more or less than halfway between teeth to know whether to add another 1 degrees
int crankAngle = 0;
int tempToothLastToothTime;
int tempToothLastMinusOneToothTime;
int tempToothCurrentCount;
russian wrote:I see that the code says 15,5,5,5. Do you think that 15,5,5,5 is not precise and that's us guessing? Do you think the real values are 16,4,4,4?
Thanks!!
I will do ecu setup (AFR/ignitions) by this week. If got chance and extra $$$ will do dyno again by next week. This time will be 3 ecu comparison. OEM vs Rusefi vs Speeduino.
matt wrote:Thanks!!
I will do ecu setup (AFR/ignitions) by this week. If got chance and extra $$$ will do dyno again by next week. This time will be 3 ecu comparison. OEM vs Rusefi vs Speeduino.
I'am sure not. At rpm5000 i can feel it cut something, probably fuel. No neo vvl engage if not install with oem rpm meter.
If do convertion on this engine without complete wiring harness better go to standalone ecu.
Still negative on setting up shift light. Picture attach what I'm doing.
Hey mate I'm definitely not an expert on this controller by any means, but I think you need to pick commands 1, 2, and 3 OR 1, 2, 4, and 5.
To me it looks like command 4 would overwrite command 3 and then command 5 sets the value of the variable setup in command 4 (fsio_setting(3)) I suppose if the code is bug-less it shouldn't matter, but it can't hurt to be a little more careful.
Does it work in simulation? Have you physically confirmed that your light works? How is it wired to RusEfi? If you've answered these questions earlier in the thread, well sorry for asking again!
88 Camry Alltrac - 3SFE w/ CT26.
Ran ok, but rings are fried, moved on...