auto-sync
This commit is contained in:
parent
38b3771a4b
commit
b81b53c00a
|
@ -7,8 +7,12 @@
|
||||||
*
|
*
|
||||||
* http://wilbo666.pbworks.com/w/page/37134472/2JZ-GTE%20JZS147%20Aristo%20Engine%20Wiring
|
* http://wilbo666.pbworks.com/w/page/37134472/2JZ-GTE%20JZS147%20Aristo%20Engine%20Wiring
|
||||||
*
|
*
|
||||||
|
* NON VVTi
|
||||||
* set_engine_type 38
|
* set_engine_type 38
|
||||||
*
|
*
|
||||||
|
* VVTi
|
||||||
|
* set_engine_type 44
|
||||||
|
*
|
||||||
* @date Dec 30, 2015
|
* @date Dec 30, 2015
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2016
|
* @author Andrey Belomutskiy, (c) 2012-2016
|
||||||
*/
|
*/
|
||||||
|
@ -19,7 +23,7 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
static void common2jz(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F); // default pinout
|
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F); // default pinout
|
||||||
|
|
||||||
engineConfiguration->isCanEnabled = true;
|
engineConfiguration->isCanEnabled = true;
|
||||||
|
@ -30,27 +34,6 @@ void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
// set_ignition_mode 1
|
// set_ignition_mode 1
|
||||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||||
|
|
||||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
|
||||||
engineConfiguration->trigger.type = TT_2JZ_1_12;
|
|
||||||
|
|
||||||
//// temporary while I am fixing trigger bug
|
|
||||||
// setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
|
||||||
// //set_trigger_type 16
|
|
||||||
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
|
||||||
// engineConfiguration->trigger.customTotalToothCount = 36;
|
|
||||||
// engineConfiguration->trigger.customSkippedToothCount = 2;
|
|
||||||
//
|
|
||||||
// engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
||||||
// engineConfiguration->twoWireBatchIgnition = true;
|
|
||||||
//
|
|
||||||
// engineConfiguration->crankingInjectionMode = IM_BATCH;
|
|
||||||
// engineConfiguration->injectionMode = IM_BATCH;
|
|
||||||
// engineConfiguration->twoWireBatchInjection = true;
|
|
||||||
|
|
||||||
// boardConfiguration->triggerInputPins[0] = GPIOA_5;
|
|
||||||
// boardConfiguration->triggerInputPins[1] = GPIOC_6;
|
|
||||||
|
|
||||||
|
|
||||||
boardConfiguration->ignitionPins[0] = GPIOE_14;
|
boardConfiguration->ignitionPins[0] = GPIOE_14;
|
||||||
boardConfiguration->ignitionPins[1] = GPIOC_7;
|
boardConfiguration->ignitionPins[1] = GPIOC_7;
|
||||||
boardConfiguration->ignitionPins[2] = GPIOC_9;
|
boardConfiguration->ignitionPins[2] = GPIOC_9;
|
||||||
|
@ -72,7 +55,6 @@ void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
engineConfiguration->engineChartSize = 450;
|
engineConfiguration->engineChartSize = 450;
|
||||||
|
|
||||||
// engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
// engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||||
boardConfiguration->isSdCardEnabled = false;
|
|
||||||
|
|
||||||
engineConfiguration->map.sensor.type = MT_CUSTOM;
|
engineConfiguration->map.sensor.type = MT_CUSTOM;
|
||||||
|
|
||||||
|
@ -85,8 +67,41 @@ void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
setThermistorConfiguration(&engineConfiguration->clt, -20, 15000, 40, 1200, 120.0, 200.0);
|
setThermistorConfiguration(&engineConfiguration->clt, -20, 15000, 40, 1200, 120.0, 200.0);
|
||||||
setThermistorConfiguration(&engineConfiguration->iat, -20, 15000, 40, 1200, 120.0, 200.0);
|
setThermistorConfiguration(&engineConfiguration->iat, -20, 15000, 40, 1200, 120.0, 200.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
common2jz(PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
|
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||||
|
engineConfiguration->trigger.type = TT_2JZ_1_12;
|
||||||
|
|
||||||
|
//// temporary while I am fixing trigger bug
|
||||||
|
// setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||||
|
// //set_trigger_type 16
|
||||||
|
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||||
|
// engineConfiguration->trigger.customTotalToothCount = 36;
|
||||||
|
// engineConfiguration->trigger.customSkippedToothCount = 2;
|
||||||
|
//
|
||||||
|
// engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||||
|
// engineConfiguration->twoWireBatchIgnition = true;
|
||||||
|
//
|
||||||
|
// engineConfiguration->crankingInjectionMode = IM_BATCH;
|
||||||
|
// engineConfiguration->injectionMode = IM_BATCH;
|
||||||
|
// engineConfiguration->twoWireBatchInjection = true;
|
||||||
|
|
||||||
|
// boardConfiguration->triggerInputPins[0] = GPIOA_5;
|
||||||
|
// boardConfiguration->triggerInputPins[1] = GPIOC_6;
|
||||||
|
|
||||||
|
boardConfiguration->isSdCardEnabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void setToyota_2jz_vics(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
common2jz(PASS_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
|
boardConfiguration->isSdCardEnabled = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F);
|
void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F);
|
||||||
|
void setToyota_2jz_vics(DECLARE_ENGINE_PARAMETER_F);
|
||||||
|
|
||||||
#endif /* CONFIG_ENGINES_TOYOTA_JZS147_H_ */
|
#endif /* CONFIG_ENGINES_TOYOTA_JZS147_H_ */
|
||||||
|
|
|
@ -124,7 +124,8 @@ typedef struct {
|
||||||
float engineLoadDelta; // 228
|
float engineLoadDelta; // 228
|
||||||
float speedToRpmRatio; // 232
|
float speedToRpmRatio; // 232
|
||||||
int warningCounter; // 236
|
int warningCounter; // 236
|
||||||
int unused3[9];
|
int lastErrorCode; // 240
|
||||||
|
int unused3[8];
|
||||||
} TunerStudioOutputChannels;
|
} TunerStudioOutputChannels;
|
||||||
|
|
||||||
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */
|
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */
|
||||||
|
|
|
@ -196,6 +196,7 @@ static void printSensors(Logging *log, bool fileFormat) {
|
||||||
}
|
}
|
||||||
|
|
||||||
reportSensorI(log, fileFormat, "warn", "count", engine->engineState.warningCounter);
|
reportSensorI(log, fileFormat, "warn", "count", engine->engineState.warningCounter);
|
||||||
|
reportSensorI(log, fileFormat, "error", "code", engine->engineState.lastErrorCode);
|
||||||
|
|
||||||
reportSensorF(log, fileFormat, "knck_c", "count", engine->knockCount, 0);
|
reportSensorF(log, fileFormat, "knck_c", "count", engine->knockCount, 0);
|
||||||
reportSensorF(log, fileFormat, "knck_v", "v", engine->knockVolts, 2);
|
reportSensorF(log, fileFormat, "knck_v", "v", engine->knockVolts, 2);
|
||||||
|
@ -704,6 +705,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
tsOutputChannels->warningCounter = engine->engineState.warningCounter;
|
tsOutputChannels->warningCounter = engine->engineState.warningCounter;
|
||||||
|
tsOutputChannels->lastErrorCode = engine->engineState.lastErrorCode;
|
||||||
|
|
||||||
tsOutputChannels->knockNowIndicator = engine->knockCount > 0;
|
tsOutputChannels->knockNowIndicator = engine->knockCount > 0;
|
||||||
tsOutputChannels->knockEverIndicator = engine->knockEver;
|
tsOutputChannels->knockEverIndicator = engine->knockEver;
|
||||||
|
|
|
@ -44,6 +44,8 @@ case CHEVY_C20_1973:
|
||||||
return "CHEVY C20";
|
return "CHEVY C20";
|
||||||
case TOYOTA_JZS147:
|
case TOYOTA_JZS147:
|
||||||
return "TOYOTA_JZS147";
|
return "TOYOTA_JZS147";
|
||||||
|
case TOYOTA_2JZ_GTE_VVTi:
|
||||||
|
return "2JZ_GTE_VVTi";
|
||||||
case GEO_STORM:
|
case GEO_STORM:
|
||||||
return "GEO_STORM";
|
return "GEO_STORM";
|
||||||
case LADA_KALINA:
|
case LADA_KALINA:
|
||||||
|
|
|
@ -134,6 +134,11 @@ EngineState::EngineState() {
|
||||||
engineNoiseHipLevel = 0;
|
engineNoiseHipLevel = 0;
|
||||||
injectorLag = 0;
|
injectorLag = 0;
|
||||||
warningCounter = 0;
|
warningCounter = 0;
|
||||||
|
lastErrorCode = 0;
|
||||||
|
targetAFR = 0;
|
||||||
|
tpsAccelEnrich = 0;
|
||||||
|
tChargeK = 0;
|
||||||
|
currentVE = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
|
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
|
@ -123,6 +123,7 @@ public:
|
||||||
float clt;
|
float clt;
|
||||||
|
|
||||||
int warningCounter;
|
int warningCounter;
|
||||||
|
int lastErrorCode;
|
||||||
|
|
||||||
float airMass;
|
float airMass;
|
||||||
|
|
||||||
|
|
|
@ -924,6 +924,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
||||||
case CHEVY_C20_1973:
|
case CHEVY_C20_1973:
|
||||||
set1973c20(PASS_ENGINE_PARAMETER_F);
|
set1973c20(PASS_ENGINE_PARAMETER_F);
|
||||||
break;
|
break;
|
||||||
|
case TOYOTA_2JZ_GTE_VVTi:
|
||||||
case TOYOTA_JZS147:
|
case TOYOTA_JZS147:
|
||||||
setToyota_jzs147EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
setToyota_jzs147EngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -116,7 +116,7 @@ typedef enum {
|
||||||
|
|
||||||
CHEVY_C20_1973 = 37,
|
CHEVY_C20_1973 = 37,
|
||||||
|
|
||||||
TOYOTA_JZS147 = 38,
|
TOYOTA_JZS147 = 38, // 2JZ-GTE NON VVTi
|
||||||
|
|
||||||
LADA_KALINA = 39,
|
LADA_KALINA = 39,
|
||||||
|
|
||||||
|
@ -129,7 +129,9 @@ typedef enum {
|
||||||
|
|
||||||
HONDA_600 = 43,
|
HONDA_600 = 43,
|
||||||
|
|
||||||
ET_UNUSED = 44,
|
TOYOTA_2JZ_GTE_VVTi = 44,
|
||||||
|
|
||||||
|
ET_UNUSED = 45,
|
||||||
|
|
||||||
Force_4b_engine_type = ENUM_32_BITS,
|
Force_4b_engine_type = ENUM_32_BITS,
|
||||||
} engine_type_e;
|
} engine_type_e;
|
||||||
|
|
|
@ -70,6 +70,7 @@ int warning(obd_code_e code, const char *fmt, ...) {
|
||||||
timeOfPreviousWarning = now;
|
timeOfPreviousWarning = now;
|
||||||
|
|
||||||
engine->engineState.warningCounter++;
|
engine->engineState.warningCounter++;
|
||||||
|
engine->engineState.lastErrorCode = code;
|
||||||
|
|
||||||
resetLogging(&logger); // todo: is 'reset' really needed here?
|
resetLogging(&logger); // todo: is 'reset' really needed here?
|
||||||
appendMsgPrefix(&logger);
|
appendMsgPrefix(&logger);
|
||||||
|
|
|
@ -190,10 +190,6 @@ const char* getConfigurationName(engine_type_e engineType) {
|
||||||
return "GM_2_2";
|
return "GM_2_2";
|
||||||
case DODGE_RAM:
|
case DODGE_RAM:
|
||||||
return "DODGE_RAM";
|
return "DODGE_RAM";
|
||||||
case MAZDA_626:
|
|
||||||
return "Mazda626";
|
|
||||||
case TOYOTA_JZS147:
|
|
||||||
return "TOYOTA_JZS147";
|
|
||||||
default:
|
default:
|
||||||
return getEngine_type_e(engineType);
|
return getEngine_type_e(engineType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,11 +110,11 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int eventIndex, bool limitedF
|
||||||
|
|
||||||
ENGINE(actualLastInjection) = injectionDuration;
|
ENGINE(actualLastInjection) = injectionDuration;
|
||||||
if (cisnan(injectionDuration)) {
|
if (cisnan(injectionDuration)) {
|
||||||
warning(OBD_PCM_Processor_Fault, "NaN injection pulse");
|
warning(CUSTOM_OBD_30, "NaN injection pulse");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (injectionDuration < 0) {
|
if (injectionDuration < 0) {
|
||||||
warning(OBD_PCM_Processor_Fault, "Negative injection pulse %f", injectionDuration);
|
warning(CUSTOM_OBD_31, "Negative injection pulse %f", injectionDuration);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,10 +362,10 @@ static ALWAYS_INLINE void scheduleIgnitionAndFuelEvents(int rpm, int revolutionI
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine->engineState.dwellAngle == 0) {
|
if (engine->engineState.dwellAngle == 0) {
|
||||||
warning(OBD_PCM_Processor_Fault, "dwell is zero?");
|
warning(CUSTOM_OBD_32, "dwell is zero?");
|
||||||
}
|
}
|
||||||
if (engine->engineState.dwellAngle > maxAllowedDwellAngle) {
|
if (engine->engineState.dwellAngle > maxAllowedDwellAngle) {
|
||||||
warning(OBD_PCM_Processor_Fault, "dwell angle too long: %f", engine->engineState.dwellAngle);
|
warning(CUSTOM_OBD_33, "dwell angle too long: %f", engine->engineState.dwellAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that
|
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that
|
||||||
|
@ -431,7 +431,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECL
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limitedSpark || limitedFuel) {
|
if (limitedSpark || limitedFuel) {
|
||||||
warning(OBD_PCM_Processor_Fault, "skipping stroke due to rpm=%d", rpm);
|
warning(CUSTOM_OBD_34, "skipping stroke due to rpm=%d", rpm);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__)
|
#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__)
|
||||||
|
|
|
@ -842,6 +842,7 @@ fileVersion = { 20160702 }
|
||||||
engineLoadDelta = scalar,F32, 228, "value", 1, 0
|
engineLoadDelta = scalar,F32, 228, "value", 1, 0
|
||||||
speedToRpmRatio = scalar,F32, 232, "value", 1, 0
|
speedToRpmRatio = scalar,F32, 232, "value", 1, 0
|
||||||
warningCounter = scalar,U32, 236, "count", 1, 0
|
warningCounter = scalar,U32, 236, "count", 1, 0
|
||||||
|
lastErrorCode = scalar,U32, 240, "error", 1, 0
|
||||||
|
|
||||||
egoCorrection = { 100 }
|
egoCorrection = { 100 }
|
||||||
time = { timeNow }
|
time = { timeNow }
|
||||||
|
@ -1132,6 +1133,7 @@ fileVersion = { 20160702 }
|
||||||
debugIntField3Gauge = debugIntField3, "debug i3", "%", 0, 100, 0, 0, 100, 100, 0, 0
|
debugIntField3Gauge = debugIntField3, "debug i3", "%", 0, 100, 0, 0, 100, 100, 0, 0
|
||||||
speedToRpmRatioGauge = speedToRpmRatio, "speed2rpm", "", 0, 100, 0, 0, 100, 100, 4, 4
|
speedToRpmRatioGauge = speedToRpmRatio, "speed2rpm", "", 0, 100, 0, 0, 100, 100, 4, 4
|
||||||
warningCounterGauge = warningCounter, "warn", "", 0, 100, 0, 0, 100, 100, 0, 0
|
warningCounterGauge = warningCounter, "warn", "", 0, 100, 0, 0, 100, 100, 0, 0
|
||||||
|
lastErrorCodeGauge = lastErrorCode, "error", "", 0, 100, 0, 0, 100, 100, 0, 0
|
||||||
|
|
||||||
|
|
||||||
[FrontPage]
|
[FrontPage]
|
||||||
|
@ -1232,6 +1234,7 @@ fileVersion = { 20160702 }
|
||||||
entry = debugIntField2, "debug i2",int,"%d"
|
entry = debugIntField2, "debug i2",int,"%d"
|
||||||
entry = debugIntField3, "debug i3",int,"%d"
|
entry = debugIntField3, "debug i3",int,"%d"
|
||||||
entry = warningCounter, "warn",int,"%d"
|
entry = warningCounter, "warn",int,"%d"
|
||||||
|
entry = lastErrorCode, "error",int,"%d"
|
||||||
|
|
||||||
entry = tCharge, "tCharge",float,"%.3f"
|
entry = tCharge, "tCharge",float,"%.3f"
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ public enum Sensor {
|
||||||
debugIntField3(SensorCategory.OPERATIONS, FieldType.INT, 220, BackgroundColor.MUD, 0, 5),
|
debugIntField3(SensorCategory.OPERATIONS, FieldType.INT, 220, BackgroundColor.MUD, 0, 5),
|
||||||
|
|
||||||
warningCounter(SensorCategory.OPERATIONS, FieldType.INT, 236, BackgroundColor.MUD, 0, 5),
|
warningCounter(SensorCategory.OPERATIONS, FieldType.INT, 236, BackgroundColor.MUD, 0, 5),
|
||||||
|
lastErrorCode(SensorCategory.OPERATIONS, FieldType.INT, 240, BackgroundColor.MUD, 0, 5),
|
||||||
|
|
||||||
RPM(SensorCategory.SENSOR_INPUTS, FieldType.INT, 0, BackgroundColor.RED, 0, 8000),
|
RPM(SensorCategory.SENSOR_INPUTS, FieldType.INT, 0, BackgroundColor.RED, 0, 8000),
|
||||||
TIME_SECONDS(SensorCategory.OPERATIONS, FieldType.INT, 224, BackgroundColor.MUD, 0, 5),
|
TIME_SECONDS(SensorCategory.OPERATIONS, FieldType.INT, 224, BackgroundColor.MUD, 0, 5),
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class SensorLogger {
|
||||||
Sensor.debugIntField2,
|
Sensor.debugIntField2,
|
||||||
Sensor.debugIntField3,
|
Sensor.debugIntField3,
|
||||||
Sensor.warningCounter,
|
Sensor.warningCounter,
|
||||||
|
Sensor.lastErrorCode,
|
||||||
|
|
||||||
Sensor.MAF, Sensor.IAT};
|
Sensor.MAF, Sensor.IAT};
|
||||||
private static long fileStartTime;
|
private static long fileStartTime;
|
||||||
|
|
Loading…
Reference in New Issue