auto-sync
This commit is contained in:
parent
58f75da571
commit
df97e5b5ef
|
@ -19,8 +19,9 @@ void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfigur
|
|||
|
||||
// base engine setting
|
||||
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
|
||||
engineConfiguration->globalTriggerAngleOffset = 144;
|
||||
engineConfiguration->cylindersCount = 4;
|
||||
engineConfiguration->displacement = 1.390;
|
||||
engineConfiguration->displacement = 1.360;
|
||||
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
|
||||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
engineConfiguration->injectionMode = IM_BATCH;
|
||||
|
@ -56,48 +57,47 @@ void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfigur
|
|||
*/
|
||||
|
||||
// See https://docs.google.com/spreadsheet/ccc?key=0Arl1FeMZcfisdEdGdUlHdWh6cVBoSzFIbkxqa1QtZ3c
|
||||
// Frankenstein analog input #1: PA1 adc1 *2.9 *0.6
|
||||
// Frankenstein analog input #2: PA3 adc3 *2.9 *1.0
|
||||
// Frankenstein analog input #3: PC3 adc13 *2.5 *0.005
|
||||
// Frankenstein analog input #4: PC1 adc11 *0.05 *1.5
|
||||
// Frankenstein analog input #5: PA0 adc0 *0.05 *0.01
|
||||
// Frankenstein analog input #6: PC2 adc12 *0.06 *1.2
|
||||
// Frankenstein analog input #7: PA4 adc4 *3.0 *0.4
|
||||
// Frankenstein analog input #8: PA2 adc2 *2.9 *0.9
|
||||
// Frankenstein analog input #9: PA6 adc6 *3.0 *6.0
|
||||
// Frankenstein analog input #10: PA7 adc7 *2.9 *2.35
|
||||
// Frankenstein analog input #11: PC4 adc14 *0.00 *0.00
|
||||
// Frankenstein analog input #12: PC5 adc15 *0.00 *0.00
|
||||
// Frankenstein analog input #1: PA1 adc1 MAP
|
||||
// Frankenstein analog input #2: PA3 adc3 TPS
|
||||
// Frankenstein analog input #3: PC3 adc13 IAT
|
||||
// Frankenstein analog input #4: PC1 adc11 CLT
|
||||
// Frankenstein analog input #5: PA0 adc0 vBatt
|
||||
// Frankenstein analog input #6: PC2 adc12
|
||||
// Frankenstein analog input #7: PA4 adc4
|
||||
// Frankenstein analog input #8: PA2 adc2
|
||||
// Frankenstein analog input #9: PA6 adc6
|
||||
// Frankenstein analog input #10: PA7 adc7
|
||||
// Frankenstein analog input #11: PC4 adc14
|
||||
// Frankenstein analog input #12: PC5 adc15
|
||||
|
||||
/**
|
||||
* MAP <need tune>
|
||||
* MAP <BOSCH 0 261 230 057>
|
||||
*/
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_1;
|
||||
engineConfiguration->map.sensor.sensorType = MT_CUSTOM;
|
||||
engineConfiguration->map.sensor.customValueAt0 = 20;
|
||||
engineConfiguration->map.sensor.customValueAt5 = 200;
|
||||
engineConfiguration->map.sensor.customValueAt0 = 10;
|
||||
engineConfiguration->map.sensor.customValueAt5 = 110;
|
||||
/**
|
||||
* TPS <need tune>
|
||||
* TPS <MAGNETI MARELLI>
|
||||
*/
|
||||
engineConfiguration->tpsAdcChannel = EFI_ADC_3;
|
||||
engineConfiguration->tpsMin = 100;
|
||||
engineConfiguration->tpsMax = 750;
|
||||
engineConfiguration->tpsMin = 433;
|
||||
engineConfiguration->tpsMax = 3248;
|
||||
/**
|
||||
* IAT
|
||||
* IAT <OEM ECU>
|
||||
*/
|
||||
engineConfiguration->iatAdcChannel = EFI_ADC_13;
|
||||
setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -20.0, 15600.0, 23.0, 2250.0, 92.0, 240.0);
|
||||
engineConfiguration->iatThermistorConf.bias_resistor = 2700; // same as OEM ECU
|
||||
engineConfiguration->iatThermistorConf.bias_resistor = 2700;
|
||||
/**
|
||||
* CLT
|
||||
* CLT <LADA Samara>
|
||||
*/
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_15;
|
||||
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
||||
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20.0, 28680.0, 25.0, 2796.0, 100.0, 177.0);
|
||||
engineConfiguration->cltThermistorConf.bias_resistor = 2700; // eah winter is hard, sensor as LADA Samara :)
|
||||
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
|
||||
/**
|
||||
* vBatt
|
||||
*/
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_0;
|
||||
engineConfiguration->vbattDividerCoeff = ((float) (2.7 + 10)) / 2.7 * 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,13 @@ extern engine_configuration_s *engineConfiguration;
|
|||
static Map3D1616 advanceMap;
|
||||
|
||||
float getBaseAdvance(int rpm, float engineLoad) {
|
||||
if (cisnan(engineLoad)) {
|
||||
warning(OBD_PCM_Processor_Fault, "NaN engine load");
|
||||
return NAN;
|
||||
}
|
||||
efiAssert(!cisnan(engineLoad), "invalid el", NAN);
|
||||
efiAssert(!cisnan(engineLoad), "invalid rpm", NAN);
|
||||
return advanceMap.getValue(engineLoad, engineConfiguration->ignitionLoadBins, (float)rpm,
|
||||
return advanceMap.getValue(engineLoad, engineConfiguration->ignitionLoadBins, (float) rpm,
|
||||
engineConfiguration->ignitionRpmBins);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,10 @@ float getIatCorrection(float iat) {
|
|||
* @return Fuel injection duration injection as specified in the fuel map, in milliseconds
|
||||
*/
|
||||
float getBaseTableFuel(int rpm, float engineLoad) {
|
||||
efiAssert(!cisnan(engineLoad), "invalid el", NAN);
|
||||
if (cisnan(engineLoad)) {
|
||||
warning(OBD_PCM_Processor_Fault, "NaN engine load");
|
||||
return NAN;
|
||||
}
|
||||
return fuelMap.getValue(engineLoad, engineConfiguration->fuelLoadBins, rpm,
|
||||
engineConfiguration->fuelRpmBins);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
|
||||
static LocalVersionHolder localVersion;
|
||||
|
||||
|
||||
static MainTriggerCallback mainTriggerCallbackInstance;
|
||||
|
||||
/**
|
||||
|
@ -77,7 +76,8 @@ static cyclic_buffer ignitionErrorDetection;
|
|||
static Logging logger;
|
||||
|
||||
static void handleFuelInjectionEvent(MainTriggerCallback *mainTriggerCallback, ActuatorEvent *event, int rpm) {
|
||||
float fuelMs = getFuelMs(rpm, mainTriggerCallback->engine) * mainTriggerCallback->engineConfiguration->globalFuelCorrection;
|
||||
float fuelMs = getFuelMs(rpm, mainTriggerCallback->engine)
|
||||
* mainTriggerCallback->engineConfiguration->globalFuelCorrection;
|
||||
if (cisnan(fuelMs)) {
|
||||
warning(OBD_PCM_Processor_Fault, "NaN injection pulse");
|
||||
return;
|
||||
|
@ -99,8 +99,7 @@ static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback,
|
|||
if (!isInjectionEnabled(mainTriggerCallback->engineConfiguration))
|
||||
return;
|
||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3");
|
||||
efiAssertVoid(eventIndex < mainTriggerCallback->engineConfiguration2->triggerShape.getLength(),
|
||||
"event index");
|
||||
efiAssertVoid(eventIndex < mainTriggerCallback->engineConfiguration2->triggerShape.getLength(), "event index");
|
||||
|
||||
/**
|
||||
* Ignition events are defined by addFuelEvents() according to selected
|
||||
|
@ -203,7 +202,8 @@ static void handleSpark(MainTriggerCallback *mainTriggerCallback, int eventIndex
|
|||
scheduling_s * sDown = ¤t->signalTimerDown;
|
||||
|
||||
float timeTillIgnitionUs = getOneDegreeTimeUs(rpm) * current->sparkPosition.angleOffset;
|
||||
scheduleTask("spark 2down", sDown, (int) timeTillIgnitionUs, (schfunc_t) &turnPinLow, (void*) current->io_pin);
|
||||
scheduleTask("spark 2down", sDown, (int) timeTillIgnitionUs, (schfunc_t) &turnPinLow,
|
||||
(void*) current->io_pin);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,6 +279,10 @@ void onTriggerEvent(trigger_event_e ckpSignalType, int eventIndex, MainTriggerCa
|
|||
return;
|
||||
}
|
||||
float advance = getAdvance(rpm, getEngineLoadT(mainTriggerCallback->engine));
|
||||
if (cisnan(advance)) {
|
||||
// error should already be reported
|
||||
return;
|
||||
}
|
||||
|
||||
float dwellAngle = dwellMs / getOneDegreeTimeMs(rpm);
|
||||
|
||||
|
@ -312,19 +316,19 @@ static void showTriggerHistogram(void) {
|
|||
|
||||
void MainTriggerCallback::init(Engine *engine, engine_configuration2_s *engineConfiguration2) {
|
||||
efiAssertVoid(engine!=NULL, "engine NULL");
|
||||
this->engine = engine;
|
||||
this->engine = engine;
|
||||
this->engineConfiguration = engine->engineConfiguration;
|
||||
efiAssertVoid(engineConfiguration!=NULL, "engineConfiguration NULL");
|
||||
this->engineConfiguration2 = engineConfiguration2;
|
||||
}
|
||||
|
||||
|
||||
static void showMainInfo(void) {
|
||||
int rpm = getRpm();
|
||||
float el = getEngineLoadT(mainTriggerCallbackInstance.engine);
|
||||
#if EFI_PROD_CODE
|
||||
scheduleMsg(&logger, "rpm %d engine_load %f", rpm, el);
|
||||
scheduleMsg(&logger, "fuel %fms timing %f", getFuelMs(rpm, mainTriggerCallbackInstance.engine), getAdvance(rpm, el));
|
||||
scheduleMsg(&logger, "fuel %fms timing %f", getFuelMs(rpm, mainTriggerCallbackInstance.engine),
|
||||
getAdvance(rpm, el));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -354,6 +358,4 @@ int isIgnitionTimingError(void) {
|
|||
return ignitionErrorDetection.sum(6) > 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* EFI_ENGINE_CONTROL */
|
||||
|
|
|
@ -27,6 +27,16 @@ public class SensorCentral {
|
|||
private SensorCentral() {
|
||||
}
|
||||
|
||||
public double getValueOrNan(Sensor sensor) {
|
||||
Double value = values.get(sensor);
|
||||
if (value == null)
|
||||
return Double.NaN;
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* todo: migrate to getValueOrNan implementation?
|
||||
*/
|
||||
public double getValue(Sensor sensor) {
|
||||
Double value = values.get(sensor);
|
||||
if (value == null)
|
||||
|
|
|
@ -62,7 +62,7 @@ public class SensorStats {
|
|||
SensorCentral.getInstance().addListener(input1, new SensorCentral.SensorListener() {
|
||||
@Override
|
||||
public void onSensorUpdate(double value) {
|
||||
double valueMs = 1.0 * (value - SensorCentral.getInstance().getValue(input2)) / WaveReport.SYS_TICKS_PER_MS;
|
||||
double valueMs = 1.0 * (value - SensorCentral.getInstance().getValueOrNan(input2)) / WaveReport.SYS_TICKS_PER_MS;
|
||||
SensorCentral.getInstance().setValue(valueMs, destination);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ import javax.swing.*;
|
|||
* @see WavePanel
|
||||
*/
|
||||
public class Launcher extends FrameHelper {
|
||||
public static final int CONSOLE_VERSION = 20140912;
|
||||
public static final int CONSOLE_VERSION = 20140913;
|
||||
public static final boolean SHOW_STIMULATOR = true;
|
||||
private final String port;
|
||||
|
||||
|
|
Loading…
Reference in New Issue