예제 #1
0
파일: vw.cpp 프로젝트: jharvey/rusefi
void setVwAba(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
	setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);

	setWholeTimingTable_d(20 PASS_CONFIG_PARAMETER_SUFFIX);
	engineConfiguration->cranking.baseFuel = 12;
	// set cranking_timing_angle 10
	engineConfiguration->crankingTimingAngle = 10;

	engineConfiguration->isCylinderCleanupEnabled = true;

	// set_whole_fuel_map 12
	setWholeFuelMap(12 PASS_CONFIG_PARAMETER_SUFFIX);

	// set global_trigger_offset_angle 93
	engineConfiguration->globalTriggerAngleOffset = 93;


	setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
//	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
	engineConfiguration->trigger.type = TT_60_2_VW;

	engineConfiguration->mafAdcChannel = EFI_ADC_1;


	//Base engine setting
	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 2.0;
	engineConfiguration->injector.flow = 320; // 30lb/h
	// set algorithm 3
	setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
	engineConfiguration->map.sensor.type = MT_GM_3_BAR;

	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	float mapRange = 110;

	setEgoSensor(ES_PLX PASS_ENGINE_PARAMETER_SUFFIX);
	setFuelTablesLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);
	setTimingLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);

	boardConfiguration->isSdCardEnabled = false;
	engineConfiguration->tpsMin = 740;
	engineConfiguration->tpsMax = 135;
}
예제 #2
0
void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
	board_configuration_s * boardConfiguration = &engineConfiguration->bc;

	engineConfiguration->trigger.type = TT_DODGE_NEON_1995;

	engineConfiguration->algorithm = LM_ALPHA_N;

	engineConfiguration->hasIatSensor = false;

	// set_rpm_hard_limit 4000
	engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
	// set_cranking_rpm 550
	engineConfiguration->cranking.rpm = 550;

	// set_cranking_fuel 5
	engineConfiguration->cranking.baseFuel = 5;

	/**
	 * that's 1995 config
	 */

	// set_whole_fuel_map 9
	setWholeFuelMap(9 PASS_ENGINE_PARAMETER);
	setWholeTimingTable(12 PASS_ENGINE_PARAMETER);

	// set_cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set_injection_mode 1
	engineConfiguration->injectionMode = IM_SEQUENTIAL;

	// set_ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	// set_firing_order 2
	engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;

	// set_global_trigger_offset_angle 497
	engineConfiguration->globalTriggerAngleOffset = 497;
	// set_ignition_offset 350
	engineConfiguration->ignitionBaseAngle = 350;
	 // set_injection_offset 510
	engineConfiguration->injectionAngle = 510 + 497;

	/**
	 * that's 1995 config
	 */

	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 0
	engineConfiguration->crankingTimingAngle = 0;

	// Frankenstein: low side - out #1: PC14
	// Frankenstein: low side - out #2: PC15
	// Frankenstein: low side - out #3: PE6
	// Frankenstein: low side - out #4: PC13
	// Frankenstein: low side - out #5: PE4
	// Frankenstein: low side - out #6: PE5
	// Frankenstein: low side - out #7: PE2
	// Frankenstein: low side - out #8: PE3
	// Frankenstein: low side - out #9: PE0
	// Frankenstein: low side - out #10: PE1
	// Frankenstein: low side - out #11: PB8
	// Frankenstein: low side - out #12: PB9

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
	boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - out #8
	boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - out #6

	boardConfiguration->fuelPumpPin = GPIOC_13; // Frankenstein: low side - out #4
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	// set_injection_pin_mode 0
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	// Frankenstein: high side #1: PE8
	// Frankenstein: high side #2: PE10

	boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: high side #1
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOE_10; // // Frankenstein: high side #2

	// set_ignition_pin_mode 0
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	setThermistorConfiguration(&engineConfiguration->clt, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->clt.bias_resistor = 2700;

	engineConfiguration->analogChartFrequency = 7;
}
예제 #3
0
void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfiguration,
		board_configuration_s *boardConfiguration) {
	// set_rpm_hard_limit 3000
	engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now

	engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NB;
	engineConfiguration->triggerConfig.isSynchronizationNeeded = TRUE;

	engineConfiguration->triggerConfig.syncRatioFrom = 0.11 * 0.7;
	engineConfiguration->triggerConfig.syncRatioTo = 0.11 * 1.3;
	engineConfiguration->triggerConfig.useRiseEdge = FALSE;
	engineConfiguration->globalTriggerAngleOffset = 276;

	// set_cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set_injection_mode 1
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	// set_ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	// set_firing_order 2
	engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;

	setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->cltThermistorConf.bias_resistor = 2700;

	setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -10, 160310, 60, 7700, 120.00, 1180);
	engineConfiguration->iatThermistorConf.bias_resistor = 2700;

	engineConfiguration->tpsAdcChannel = 3; // 15 is the old value
	engineConfiguration->vBattAdcChannel = 0; // 1 is the old value
//  engineConfiguration->map.channel = 1;
	engineConfiguration->mafAdcChannel = 1;
	engineConfiguration->cltAdcChannel = 11;
	engineConfiguration->iatAdcChannel = 13;
	engineConfiguration->afrSensor.afrAdcChannel = 2;

	boardConfiguration->idleValvePin = GPIOE_0;
	boardConfiguration->idleValvePinMode = OM_DEFAULT;

	boardConfiguration->fuelPumpPin = GPIOC_14; // Frankenstein: low side - inj #4
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
	boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
	boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6
	boardConfiguration->injectionPins[4] = GPIO_NONE;
	boardConfiguration->injectionPins[5] = GPIO_NONE;
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	boardConfiguration->ignitionPins[0] = GPIOE_10; // Frankenstein: high side #1
	boardConfiguration->ignitionPins[1] = GPIO_NONE;
	boardConfiguration->ignitionPins[2] = GPIOC_9; // // Frankenstein: high side #2
	boardConfiguration->ignitionPins[3] = GPIO_NONE;
	boardConfiguration->ignitionPinMode = OM_INVERTED;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_1;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->fanPin = GPIOE_6;
	boardConfiguration->fanPinMode = OM_DEFAULT;

	boardConfiguration->electronicThrottlePin1 = GPIO_NONE;
	boardConfiguration->idleSwitchPin = GPIO_NONE;

	// set_whole_fuel_map 3
	setWholeFuelMap(engineConfiguration, 3);


// 10 deg before TDC is default timing
}
예제 #4
0
/**
 * pin 1I/W9 - extra +5v
 * set_engine_type 14
 */
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;

	common079721_2351(engineConfiguration, boardConfiguration);

	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	setDensoTODO(config);

	engineConfiguration->globalFuelCorrection = 0.75;
	engineConfiguration->specs.displacement = 1.839;
//	engineConfiguration->algorithm = LM_PLAIN_MAF;
	setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
//	engineConfiguration->algorithm = LM_REAL_MAF;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	config->veRpmBins[0] = 800;
	config->veRpmBins[1] = 1200;
	config->veRpmBins[2] = 1600;
	config->veRpmBins[3] = 2000;
	config->veRpmBins[4] = 2400;
	config->veRpmBins[5] = 2800;
	config->veRpmBins[6] = 3200;
	config->veRpmBins[7] = 3600;
	config->veRpmBins[8] = 4100;
	config->veRpmBins[9] = 4500;
	config->veRpmBins[10] = 4900;
	config->veRpmBins[11] = 5300;
	config->veRpmBins[12] = 5700;
	config->veRpmBins[13] = 6100;
	config->veRpmBins[14] = 6500;
	config->veRpmBins[15] = 7000;

	copyFuelTable(racingFestivaVeTable, config->veTable);

//	boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
//	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// in case of SOHC distributor we only have one signal
//	boardConfiguration->triggerInputPins[0] = GPIOA_5; // 2E White CKP
//	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;

	// in case of DOHC distributor we have two signals
	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// Denso 195500-2180
	engineConfiguration->injector.flow = 265;

	engineConfiguration->hasBaroSensor = false;

	engineConfiguration->hasMapSensor = true;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DENSO183;
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;

	setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
	engineConfiguration->afr.hwChannel = EFI_ADC_2; // Frankenso analog #5

	// set_idle_position 10
	boardConfiguration->manIdlePosition = 10;

	setWholeIatCorrTimingTable(0 PASS_ENGINE_PARAMETER);


	// set_global_trigger_offset_angle -37
	engineConfiguration->globalTriggerAngleOffset = -37;
	// set_ignition_offset 0
	engineConfiguration->ignitionOffset = 0;
	// set_injection_offset 0
	engineConfiguration->injectionOffset = 0;

	// todo: change to 15?
	// set_cranking_timing_angle 3
	engineConfiguration->crankingTimingAngle = 3;
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_fuel 9
	engineConfiguration->cranking.baseFuel = 9;

	setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 105, 5);
	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
	// set_whole_fuel_map 5
	setWholeFuelMap(5 PASS_ENGINE_PARAMETER);
	setMap(config->afrTable, 13.5);

	setSingleCoilDwell(engineConfiguration);
	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	// individual coils
	// W6  PC9
	// W8  PC7
	// W12 PE8
	// W13 PE12



	/**
	 * Outputs
	 */
	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5 MIL
	// Frankenso low out #3:
	// Frankenso low out #4:
	// Frankenso low out #5: PE3 VICS solenoid
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE0<>PD5
	// Frankenso low out #8: PE2 INJ
	// Frankenso low out #9: PB9 IDLE
	// Frankenso low out #10: PE1<>PD3 INJ 1&3
	// Frankenso low out #11: PB8
	// Frankenso low out #12: PB7

	boardConfiguration->injectionPins[0] = GPIOD_3;
	boardConfiguration->injectionPins[1] = GPIOE_2;


	//setDefaultCrankingFuel(engineConfiguration);
	engineConfiguration->cranking.baseFuel = 5;

	// 40% idle is good default
	boardConfiguration->idle.solenoidFrequency = 300;
	boardConfiguration->idle.solenoidPin = GPIOB_9;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_5;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->tunerStudioSerialSpeed = 19200;

	commonFrankensoAnalogInputs(engineConfiguration);
	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;
	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

	// we have a 1999 Auto Miata TB mounted on this car
	engineConfiguration->hasTpsSensor = true;
	engineConfiguration->tpsMin = 115; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 630; // convert 12to10 bit (ADC/4)

	engineConfiguration->tpsAdcChannel = EFI_ADC_3;
//	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->mafAdcChannel = EFI_ADC_0;
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	engineConfiguration->iat.adcChannel = EFI_ADC_11;

	// todo: 8.2 or 10k?
	engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;

	// VICS solenoid
	/**
	 * to test
	 * set_fsio_setting 0 5000
	 */
	engineConfiguration->bc.fsio_setting[0] = 5000;
	// set_fsio_expression 1 "rpm 0 fsio_setting >"
	setFsioExt(0, GPIOE_3, "rpm 0 fsio_setting >", 150 PASS_ENGINE_PARAMETER);


	// warning light
	/**
	 * to test
	 * set_fsio_setting 1 1800
	 * set_fsio_setting 2 95
	 * set_fsio_setting 3 14
	 *
	 * set_fsio_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
	 * eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
	 */
	engineConfiguration->bc.fsio_setting[1] = 6200; // RPM threshold
	engineConfiguration->bc.fsio_setting[2] = 90; // CLT threshold
	engineConfiguration->bc.fsio_setting[3] = 13.5; // voltage threshold

	setFsio(1, GPIOC_13, "rpm 1 fsio_setting > coolant 2 fsio_setting > | vbatt 3 fsio_setting < |" PASS_ENGINE_PARAMETER);


	config->ignitionRpmBins[0] = 800;
	config->ignitionRpmBins[1] = 1200;
	config->ignitionRpmBins[2] = 1600;
	config->ignitionRpmBins[3] = 2000;
	config->ignitionRpmBins[4] = 2400;
	config->ignitionRpmBins[5] = 2800;
	config->ignitionRpmBins[6] = 3200;
	config->ignitionRpmBins[7] = 3600;
	config->ignitionRpmBins[8] = 4100;
	config->ignitionRpmBins[9] = 4500;
	config->ignitionRpmBins[10] = 4900;
	config->ignitionRpmBins[11] = 5300;
	config->ignitionRpmBins[12] = 5700;
	config->ignitionRpmBins[13] = 6100;
	config->ignitionRpmBins[14] = 6500;
	config->ignitionRpmBins[15] = 7000;
	copyTimingTable(racingFestivaIgnitionTable, config->ignitionTable);

	//	boardConfiguration->useWarmupPidAfr = true;
		engineConfiguration->warmupAfrPid.pFactor = -0.2;
		engineConfiguration->warmupAfrPid.iFactor = -0.0005;
	//	engineConfiguration->warmupAfrPid.dFactor = -0.02;
		engineConfiguration->debugMode = WARMUP_ENRICH;

	// end of Ford Escort GT config
}
예제 #5
0
/**
 * @brief	Global default engine configuration
 * This method sets the global engine configuration defaults. These default values are then
 * overridden by engine-specific defaults and the settings are saved in flash memory.
 *
 * This method is invoked only when new configuration is needed:
 *  * recently re-flashed chip
 *  * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION
 *  * 'rewriteconfig' command
 *  * 'set_engine_type X' command
 */
void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
#if (! EFI_UNIT_TEST) || defined(__DOXYGEN__)
	memset(&persistentState.persistentConfiguration, 0, sizeof(persistentState.persistentConfiguration));
#endif
	prepareVoidConfiguration(engineConfiguration);

	boardConfiguration->mafSensorType = Bosch0280218037;
	setBosch0280218037(config);

	engineConfiguration->injector.lag = 1.0;

	engineConfiguration->acCutoffLowRpm = 700;
	engineConfiguration->acCutoffHighRpm = 5000;

	initTemperatureCurve(IAT_CURVE_SIZE, config->iatFuelCorrBins, config->iatFuelCorr);
	initTemperatureCurve(CLT_CURVE_SIZE, config->cltFuelCorrBins, config->cltFuelCorr);

	initTemperatureCurve(CLT_CURVE_SIZE, config->cltIdleCorrBins, config->cltIdleCorr);

	engineConfiguration->tachPulseDuractionMs = 4;
	engineConfiguration->tachPulseTriggerIndex = 4;

	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -40, 1.5);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -30, 1.5);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -20, 1.42);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, -10, 1.36);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 0, 1.28);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 10, 1.19);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 20, 1.12);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 30, 1.10);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 40, 1.06);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 50, 1.06);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 60, 1.03);
	setTableValue(config->cltIdleCorrBins, config->cltIdleCorr, CLT_CURVE_SIZE, 70, 1.01);


	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -30, 1.5);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -20, 1.42);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -10, 1.36);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 0, 1.28);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 10, 1.19);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 20, 1.12);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 30, 1.10);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 40, 1.06);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 50, 1.06);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 60, 1.03);
	setTableValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01);

	for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) {
		engineConfiguration->injector.battLagCorrBins[i] = 12 - VBAT_INJECTOR_CURVE_SIZE / 2 + i;
		engineConfiguration->injector.battLagCorr[i] = 0; // zero extra time by default
	}

	setConstantDwell(4 PASS_ENGINE_PARAMETER); // 4ms is global default dwell
	engineConfiguration->useConstantDwellDuringCranking = false;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);
	setTimingLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setTimingRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

	setTableBin2(engineConfiguration->map.samplingAngleBins, MAP_ANGLE_SIZE, 800, 7000, 1);
	setTableBin2(engineConfiguration->map.samplingAngle, MAP_ANGLE_SIZE, 100, 130, 1);
	setTableBin2(engineConfiguration->map.samplingWindowBins, MAP_ANGLE_SIZE, 800, 7000, 1);
	setTableBin2(engineConfiguration->map.samplingWindow, MAP_ANGLE_SIZE, 50, 50, 1);

	// set_whole_timing_map 3
	setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
	setMap(config->afrTable, 14.7);

	setDefaultVETable(PASS_ENGINE_PARAMETER_F);

	setMap(config->injectionPhase, -180);
	setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT);
	setFuelTablesLoadBin(10, 160 PASS_ENGINE_PARAMETER);
	setDefaultIatTimingCorrection(PASS_ENGINE_PARAMETER_F);

	setThermistorConfiguration(&engineConfiguration->clt, 0, 9500, 23.8889, 2100, 48.8889, 1000);
	engineConfiguration->clt.config.bias_resistor = 1500;

	setThermistorConfiguration(&engineConfiguration->iat, 32, 9500, 75, 2100, 120, 1000);
// todo: this value is way off! I am pretty sure temp coeffs are off also
	engineConfiguration->iat.config.bias_resistor = 2700;


	engineConfiguration->step1rpm = 3000;
 	engineConfiguration->step1timing = 10;
	engineConfiguration->step1RpmWindow = 500;
	engineConfiguration->step1fuelCutEnable = false;
	engineConfiguration->step1SparkCutEnable = false;
	engineConfiguration->step1RpmWindow = 500;

	engineConfiguration->rpmHardLimit = 7000;
	engineConfiguration->cranking.rpm = 550;
	engineConfiguration->cutFuelOnHardLimit = true;
	engineConfiguration->cutSparkOnHardLimit = true;

	engineConfiguration->noAccelAfterHardLimitPeriodSecs = 3;

	setTableBin2(engineConfiguration->crankingTpsCoef, CRANKING_CURVE_SIZE, 1, 1, 1);
	setTableBin2(engineConfiguration->crankingTpsBins, CRANKING_CURVE_SIZE, 0, 100, 1);

	config->crankingFuelCoef[0] = 5; // base cranking fuel adjustment coefficient
	config->crankingFuelBins[0] = -20; // temperature in C
	config->crankingFuelCoef[1] = 3.7;
	config->crankingFuelBins[1] = -10;
	config->crankingFuelCoef[2] = 2.6;
	config->crankingFuelBins[2] = 5;
	config->crankingFuelCoef[3] = 2.4;
	config->crankingFuelBins[3] = 20;
	config->crankingFuelCoef[4] = 2.1;
	config->crankingFuelBins[4] = 35;
	config->crankingFuelCoef[5] = 1.8;
	config->crankingFuelBins[5] = 50;
	config->crankingFuelCoef[6] = 1.5;
	config->crankingFuelBins[6] = 65;
	config->crankingFuelCoef[7] = 1;
	config->crankingFuelBins[7] = 90;

	config->crankingCycleCoef[0] = 2;
	config->crankingCycleBins[0] = 10;
	config->crankingCycleCoef[1] = 1;
	config->crankingCycleBins[1] = 31;
	config->crankingCycleCoef[2] = 1;
	config->crankingCycleBins[2] = 52;
	config->crankingCycleCoef[3] = 0.5;
	config->crankingCycleBins[3] = 73;
	config->crankingCycleCoef[4] = 0.5;
	config->crankingCycleBins[4] = 74;
	config->crankingCycleCoef[5] = 0.5;
	config->crankingCycleBins[5] = 75;
	config->crankingCycleCoef[6] = 0.5;
	config->crankingCycleBins[6] = 76;
	config->crankingCycleCoef[7] = 0.5;
	config->crankingCycleBins[7] = 77;

	engineConfiguration->cranking.baseFuel = 5;

	engineConfiguration->analogInputDividerCoefficient = 2;

	engineConfiguration->crankingChargeAngle = 70;
	engineConfiguration->timingMode = TM_DYNAMIC;
	engineConfiguration->fixedModeTiming = 50;

	// performance optimization
	boardConfiguration->sensorChartMode = SC_OFF;

	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;

	engineConfiguration->pedalPositionChannel = EFI_ADC_NONE;

	engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;

	engineConfiguration->ignitionMode = IM_ONE_COIL;
	engineConfiguration->globalTriggerAngleOffset = 0;
	engineConfiguration->injectionOffset = 0;
	engineConfiguration->ignitionOffset = 0;
	engineConfiguration->overrideCrankingIgnition = true;
	engineConfiguration->sensorChartFrequency = 20;

	engineConfiguration->algorithm = LM_PLAIN_MAF;

	engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15;

	engineConfiguration->fanOnTemperature = 75;
	engineConfiguration->fanOffTemperature = 70;

	engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
	engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
	engineConfiguration->tpsErrorLowValue = convertVoltageTo10bitADC(0.2);
	engineConfiguration->tpsErrorHighValue = convertVoltageTo10bitADC(6);

	engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
	engineConfiguration->canSleepPeriod = 50;
	engineConfiguration->canReadEnabled = true;
	engineConfiguration->canWriteEnabled = false;

	setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 2;
	/**
	 * By the way http://users.erols.com/srweiss/tableifc.htm has a LOT of data
	 */
	engineConfiguration->injector.flow = 200;

	engineConfiguration->displayMode = DM_HD44780;

	engineConfiguration->logFormat = LF_NATIVE;
	engineConfiguration->directSelfStimulation = false;

	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;

	engineConfiguration->HD44780width = 20;
	engineConfiguration->HD44780height = 4;

	engineConfiguration->vRefAdcChannel = EFI_ADC_NONE;
	engineConfiguration->vbattAdcChannel = EFI_ADC_NONE;
	engineConfiguration->clt.adcChannel = EFI_ADC_6;
	engineConfiguration->iat.adcChannel = EFI_ADC_7;
	engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
	engineConfiguration->afr.hwChannel = EFI_ADC_14;

	engineConfiguration->cylinderBore = 87.5;

	setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER);

	engineConfiguration->globalFuelCorrection = 1;

	engineConfiguration->map.sensor.type = MT_MPX4250;

	engineConfiguration->baroSensor.type = MT_CUSTOM;
	engineConfiguration->baroSensor.valueAt0 = 0;
	engineConfiguration->baroSensor.valueAt5 = 500;

	engineConfiguration->hasMapSensor = true;
	engineConfiguration->hasMafSensor = true;
	engineConfiguration->hasTpsSensor = true;
	engineConfiguration->hasAfrSensor = true;
	engineConfiguration->hasIatSensor = true;
	engineConfiguration->hasCltSensor = true;
	engineConfiguration->hasBaroSensor = false;
	engineConfiguration->isEngineChartEnabled = true;

	engineConfiguration->useOnlyFrontForTrigger = false;

	boardConfiguration->idle.solenoidFrequency = 200;
	// set_idle_position 50
	boardConfiguration->idlePosition = 50;
	engineConfiguration->targetIdleRpm = 1200;
//	engineConfiguration->idleMode = IM_AUTO;
	engineConfiguration->idleMode = IM_MANUAL;

	engineConfiguration->acSwitchAdc = EFI_ADC_NONE;

	engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE;

	boardConfiguration->useSerialPort = true;
	boardConfiguration->useStepperIdle = false;

	boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
	boardConfiguration->idle.stepperStepPin = GPIOE_12;
	engineConfiguration->stepperEnablePin = GPIOE_14;
	engineConfiguration->idleStepperReactionTime = 10;
	engineConfiguration->idleStepperTotalSteps = 150;

#if EFI_PROD_CODE || defined(__DOXYGEN__)
	engineConfiguration->engineChartSize = 300;
#else
	// need more events for automated test
	engineConfiguration->engineChartSize = 400;
#endif

	engineConfiguration->engineCycle = 720;

	engineConfiguration->primingSquirtDurationMs = 5;

	engineConfiguration->isInjectionEnabled = true;
	engineConfiguration->isIgnitionEnabled = true;
	engineConfiguration->isCylinderCleanupEnabled = true;
	engineConfiguration->secondTriggerChannelEnabled = true;

	engineConfiguration->isMapAveragingEnabled = true;
	engineConfiguration->isMilEnabled = true;
	engineConfiguration->isFuelPumpEnabled = true;
	engineConfiguration->isTunerStudioEnabled = true;
	engineConfiguration->isWaveAnalyzerEnabled = true;
	engineConfiguration->isIdleThreadEnabled = true;

	engineConfiguration->acIdleRpmBump = 200;
	engineConfiguration->knockDetectionWindowStart = 35;
	engineConfiguration->knockDetectionWindowEnd = 135;

	engineConfiguration->fuelLevelSensor = EFI_ADC_NONE;
	boardConfiguration->fuelLevelEmptyTankVoltage = 0;
	boardConfiguration->fuelLevelFullTankVoltage = 5;

	engineConfiguration->hipOutputChannel = EFI_ADC_NONE;

	/**
	 * this is RPM. 10000 rpm is only 166Hz, 800 rpm is 13Hz
	 */
	boardConfiguration->triggerSimulatorFrequency = 1200;

	boardConfiguration->triggerErrorPin = GPIO_UNASSIGNED;

	boardConfiguration->max31855spiDevice = SPI_NONE;
	for (int i = 0; i < EGT_CHANNEL_COUNT; i++) {
		boardConfiguration->max31855_cs[i] = GPIO_UNASSIGNED;
	}
	for (int i = 0; i < LE_COMMAND_COUNT; i++) {
		boardConfiguration->fsioPins[i] = GPIO_UNASSIGNED;
		config->le_formulas[i][0] = 0;
		boardConfiguration->fsioDigitalInputs[i] = GPIO_UNASSIGNED;
		engineConfiguration->fsioInputModes[i] = PI_DEFAULT;
	}

	boardConfiguration->triggerSimulatorPins[0] = GPIOD_1;
	boardConfiguration->triggerSimulatorPins[1] = GPIOD_2;
	boardConfiguration->triggerSimulatorPins[2] = GPIO_UNASSIGNED;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_DEFAULT;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_DEFAULT;
	boardConfiguration->triggerSimulatorPinModes[2] = OM_DEFAULT;

	setFrankenstein_01_LCD(boardConfiguration);

	strcpy(config->timingMultiplier, "1");
	strcpy(config->timingAdditive, "0");

	engineConfiguration->hip9011SpiDevice = SPI_DEVICE_2;

	engineConfiguration->isAlternatorControlEnabled = true;

	engineConfiguration->isGpsEnabled = false;
	boardConfiguration->gps_rx_pin = GPIOB_7;
	boardConfiguration->gps_tx_pin = GPIOB_6;

	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5;
	boardConfiguration->logicAnalyzerPins[0] = GPIO_UNASSIGNED;
	boardConfiguration->logicAnalyzerPins[1] = GPIO_UNASSIGNED; // GPIOE_5 is a popular option (if available)
	boardConfiguration->logicAnalyzerPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->logicAnalyzerPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->vehicleSpeedSensorInputPin = GPIO_UNASSIGNED;
	engineConfiguration->vehicleSpeedCoef = 1.0f;

	boardConfiguration->logicAnalyzerMode[0] = false;
	boardConfiguration->logicAnalyzerMode[1] = false;

	engineConfiguration->mapErrorLowValue = 5;
	engineConfiguration->mapErrorHighValue = 250;

	boardConfiguration->idleThreadPeriod = 100;
	boardConfiguration->consoleLoopPeriod = 200;
	boardConfiguration->lcdThreadPeriod = 300;
	boardConfiguration->generalPeriodicThreadPeriod = 50;
	boardConfiguration->useLcdScreen = true;

	boardConfiguration->boardTestModeJumperPin = GPIOB_0;

	boardConfiguration->canDeviceMode = CD_USE_CAN2;
	boardConfiguration->canTxPin = GPIOB_6;
	boardConfiguration->canRxPin = GPIOB_12;

	// set this to SPI_DEVICE_3 to enable stimulation
	boardConfiguration->digitalPotentiometerSpiDevice = SPI_NONE;
	boardConfiguration->digitalPotentiometerChipSelect[0] = GPIOD_7;
	boardConfiguration->digitalPotentiometerChipSelect[1] = GPIO_UNASSIGNED;
	boardConfiguration->digitalPotentiometerChipSelect[2] = GPIOD_5;
	boardConfiguration->digitalPotentiometerChipSelect[3] = GPIO_UNASSIGNED;

	boardConfiguration->is_enabled_spi_1 = false;
	boardConfiguration->is_enabled_spi_2 = false;
	boardConfiguration->is_enabled_spi_3 = true;

	boardConfiguration->spi1mosiPin = GPIOB_5;
	boardConfiguration->spi1misoPin = GPIOB_4;
	boardConfiguration->spi1sckPin = GPIOB_3; // please note that this pin is also SWO/SWD - Single Wire debug Output

	boardConfiguration->spi2mosiPin = GPIOB_15;
	boardConfiguration->spi2misoPin = GPIOB_14;
	boardConfiguration->spi2sckPin = GPIOB_13;

	boardConfiguration->spi3mosiPin = GPIOB_5;
	boardConfiguration->spi3misoPin = GPIOB_4;
	boardConfiguration->spi3sckPin = GPIOB_3;

	boardConfiguration->hip9011Gain = 1;

	boardConfiguration->sdCardCsPin = GPIOD_4;
	boardConfiguration->isSdCardEnabled = true;
	boardConfiguration->isFastAdcEnabled = true;
	boardConfiguration->isEngineControlEnabled = true;

	boardConfiguration->isVerboseAlternator = false;

	boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;

	engineConfiguration->mapAccelLength = 6;
	engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa
	engineConfiguration->mapAccelEnrichmentMultiplier = 2;

	engineConfiguration->tpsAccelLength = 12;
	engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle
	engineConfiguration->tpsAccelEnrichmentMultiplier = 0.05;
}
예제 #6
0
static void setWholeFuelMapCmd(float value) {
	scheduleMsg(&logger, "Setting whole fuel map to %f", value);
	setWholeFuelMap(engineConfiguration, value);
}
예제 #7
0
void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
	board_configuration_s * boardConfiguration = &engineConfiguration->bc;

	engineConfiguration->analogInputDividerCoefficient = 2;
	boardConfiguration->analogChartMode = AC_TRIGGER;

	// chartsize 450
	engineConfiguration->digitalChartSize = 450;

//	setAlgorithm(LM_PLAIN_MAF);
	setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
	engineConfiguration->injector.flow = 750;

	boardConfiguration->tunerStudioSerialSpeed = 38400;
	engineConfiguration->rpmHardLimit = 6000;

//	setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
//	engineConfiguration->trigger.type = TT_ONE_PLUS_TOOTHED_WHEEL_60_2;
//	engineConfiguration->injectionMode = IM_SEQUENTIAL;
//	boardConfiguration->triggerInputPins[0] = GPIOC_6;
//	boardConfiguration->triggerInputPins[1] = GPIOA_5;

	setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	boardConfiguration->triggerInputPins[0] = GPIOA_5;
	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;

//	engineConfiguration->useOnlyFrontForTrigger = true;

	engineConfiguration->specs.cylindersCount = 6;
	engineConfiguration->specs.displacement = 2.91;
	engineConfiguration->specs.firingOrder = FO_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4;
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;


	engineConfiguration->ignMathCalculateAtIndex = 16;

	setConstantDwell(3 PASS_ENGINE_PARAMETER); // a bit shorter dwell
	engineConfiguration->useConstantDwellDuringCranking = true;
	engineConfiguration->ignitionDwellForCrankingMs = 5;

	// todo: check the digital sniffer while simulating
	// set_global_trigger_offset_angle 84
	engineConfiguration->globalTriggerAngleOffset = 84;

	setWholeFuelMap(6 PASS_ENGINE_PARAMETER);
	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);

	board_configuration_s *bc = &engineConfiguration->bc;
	bc->malfunctionIndicatorPin = GPIO_UNASSIGNED;

//	bc->isFastAdcEnabled = true;

	bc->injectionPinMode = OM_INVERTED;
	bc->injectionPins[0] = GPIOB_8; // #1
	bc->injectionPins[1] = GPIOE_2; // #2
	bc->injectionPins[2] = GPIOE_3; // #3
	bc->injectionPins[3] = GPIOE_4; // #4
	bc->injectionPins[4] = GPIOE_5; // #5
	bc->injectionPins[5] = GPIOE_6; // #6

	bc->ignitionPinMode = OM_INVERTED;

	bc->ignitionPins[0] = GPIOB_5; // #1
	bc->ignitionPins[2] = GPIOB_6; // #3
	bc->ignitionPins[4] = GPIOB_7; // #5

	bc->triggerErrorPin = GPIO_UNASSIGNED;

	boardConfiguration->clutchUpPin = GPIOD_3;
	boardConfiguration->clutchUpPinMode = PI_PULLUP;

	boardConfiguration->fuelPumpPin = GPIOD_4;

	boardConfiguration->idle.solenoidPin = GPIOC_14;
	boardConfiguration->idle.solenoidPinMode = OM_INVERTED;
	boardConfiguration->idle.solenoidFrequency = 300;
	// set_idle_pwm 50
	boardConfiguration->idlePosition = 50;

	boardConfiguration->sdCardCsPin = GPIO_UNASSIGNED;
	boardConfiguration->is_enabled_spi_2 = false;
	boardConfiguration->is_enabled_spi_3 = false;
	boardConfiguration->max31855spiDevice = SPI_NONE;

	// turbocharger boost control solenoid: TODO output: GPIOE_6
	// water injection #1 TODO GPIOD_7
	// water injection #2 TODO GPIOE_2


	/**
	 * emulating the 60-0 trigger takes some resources, let's keep it slow by default
	 * rpm 200
	 */
	bc->triggerSimulatorFrequency = 200;

	engineConfiguration->map.sensor.type = MT_MPX4250;

//	engineConfiguration->hasCltSensor = false;
//	engineConfiguration->hasIatSensor = false;
	engineConfiguration->hasCltSensor = true;
	engineConfiguration->hasIatSensor = true;

	setThermistorConfiguration(&engineConfiguration->clt, -10, 9300, 20, 2500, 80, 335);
	engineConfiguration->iat.bias_resistor = 2200;

	setThermistorConfiguration(&engineConfiguration->iat, -10, 9300, 20, 2500, 80, 335);
	engineConfiguration->clt.bias_resistor = 2200;


//	/**
//	 * This saves a couple of ticks in trigger emulation methods
//	 * TODO: add some smart logic to detect unneeded trigger simulation pins?
//	 * TODO: but probably not worth it
//	 */
//	bc->triggerSimulatorPins[1] = GPIO_UNASSIGNED;

	boardConfiguration->triggerSimulatorPins[0] = GPIOD_1;
	boardConfiguration->triggerSimulatorPins[1] = GPIOD_2;
	bc->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
}
예제 #8
0
void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_F) {
	board_configuration_s *boardConfiguration = &engineConfiguration->bc;
	engineConfiguration->engineType = MITSU_4G93;

	engineConfiguration->trigger.type = TT_MITSU;

	engineConfiguration->specs.cylindersCount = 4;
	engineConfiguration->specs.displacement = 1.800;

	// set_ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;

	// set_global_trigger_offset_angle 671
	engineConfiguration->globalTriggerAngleOffset = 671;

	// set_cranking_rpm 550
	engineConfiguration->cranking.rpm = 550;
	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 715
	engineConfiguration->crankingTimingAngle = -715;

	// set_whole_fuel_map 3
	setWholeFuelMap(3 PASS_ENGINE_PARAMETER);

	// set_cranking_fuel 4
	engineConfiguration->cranking.baseFuel = 4;

//	/**
//	 * 29150 Ohm @ 40C
//	 * 10160 Ohm @ 70C
//	 * 1270 Ohm @ 150C
//	 */
//	setThermistorConfiguration(&engineConfiguration->clt, 40, 29150, 70, 10160, 150, 1270);

	setCommonNTCSensor(&engineConfiguration->clt);


	engineConfiguration->clt.bias_resistor = 2700;

	// Frankenstein: low side - out #1: PC14
	// Frankenstein: low side - out #2: PC15
	// Frankenstein: low side - out #3: PE6
	// Frankenstein: low side - out #4: PC13
	// Frankenstein: low side - out #5: PE4
	// Frankenstein: low side - out #6: PE5
	// Frankenstein: low side - out #7: PE2
	// Frankenstein: low side - out #8: PE3
	// Frankenstein: low side - out #9: PE0
	// Frankenstein: low side - out #10: PE1
	// Frankenstein: low side - out #11: PB8
	// Frankenstein: low side - out #12: PB9

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
	boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - out #8
	boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - out #6


	// Frankenstein: high side #1: PE8
	// Frankenstein: high side #2: PE10

	boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: high side #1
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOE_10; // // Frankenstein: high side #2
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	engineConfiguration->HD44780width = 20;
	engineConfiguration->HD44780height = 4;

	initEgoSensor(&engineConfiguration->afr, ES_Innovate_MTX_L);
#if EFI_FSIO || defined(__DOXYGEN__)
	setFsio(0, GPIOD_11, "rpm 5500 >" PASS_ENGINE_PARAMETER);
#endif
}
예제 #9
0
파일: dodge_neon.cpp 프로젝트: jmt42/rusefi
void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfiguration,
		board_configuration_s *boardConfiguration) {
	engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON_2003;
	setFrankenso_01_LCD(boardConfiguration);

	// set_global_trigger_offset_angle 46
	engineConfiguration->globalTriggerAngleOffset = 46;
	engineConfiguration->needSecondTriggerInput = false;

	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	engineConfiguration->displacement = 1.996;
	engineConfiguration->cylindersCount = 4;

	/**
	 * that's NGC config
	 *
	 * set_cranking_fuel 5
	 */
	engineConfiguration->crankingSettings.baseCrankingFuel = 5;

	/**
	 * 77C
	 * 1200 rpm
	 * fuel 3
	 *
	 * 88C
	 * fuel 2.8
	 *
	 * set_whole_fuel_map 12
	 */
	setWholeFuelMap(engineConfiguration, 12);
	setWholeTimingTable(engineConfiguration, 12);

	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 70;
	// set_cranking_timing_angle 710
	engineConfiguration->crankingTimingAngle = 710;


	/**
	 * bosch 4G1139
	 * http://forum.2gn.org/viewtopic.php?t=21657
	 */
	engineConfiguration->injectorFlow = 199;

	// I want to start with a simple Alpha-N
	engineConfiguration->algorithm = LM_ALPHA_N;
	setFuelLoadBin(engineConfiguration, 0, 100);
	setTimingLoadBin(engineConfiguration, 0, 100);

	boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;

	/**
	 * PA4 Wideband O2 Sensor
	 */
	engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_4;

	commonFrankensoAnalogInputs(engineConfiguration);
	engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;

	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5
	// Frankenso low out #3: PD7 coolant fan relay
	// Frankenso low out #4: PC13 idle valve solenoid
	// Frankenso low out #5: PE3 fuel pump relay
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE1 (do not use with discovery!)
	// Frankenso low out #8: PE2 injector #3
	// Frankenso low out #9: PB9 injector #2
	// Frankenso low out #10: PE0 (do not use with discovery!)
	// Frankenso low out #11: PB8 injector #1
	// Frankenso low out #12: PB7 injector #4

	boardConfiguration->fanPin = GPIOD_7;

	boardConfiguration->injectionPins[0] = GPIOB_8;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOE_2;
	boardConfiguration->injectionPins[3] = GPIOB_7;

	boardConfiguration->ignitionPins[0] = GPIOC_9;
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOE_8;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	boardConfiguration->idleValvePin = GPIOC_13;
	boardConfiguration->idleSolenoidFrequency = 300;

	boardConfiguration->fuelPumpPin = GPIOE_3;
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->gps_rx_pin = GPIO_UNASSIGNED;
	boardConfiguration->gps_tx_pin = GPIO_UNASSIGNED;

	boardConfiguration->triggerInputPins[0] = GPIOA_5;
	boardConfiguration->triggerInputPins[1] = GPIOC_6;

	setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->cltThermistorConf.bias_resistor = 10000;

	setThermistorConfiguration(&engineConfiguration->iatThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->iatThermistorConf.bias_resistor = 10000;

	/**
	 * MAP PA6
	 */
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_6;

	boardConfiguration->adcHwChannelEnabled[0] = ADC_FAST; // ADC0 - PA0 - MAP
	boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT
	boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT
	boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR
	boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt
	boardConfiguration->adcHwChannelEnabled[15] = ADC_SLOW; // TPS



	/**
	 * TPS
	 */
	engineConfiguration->tpsAdcChannel = EFI_ADC_15;
	engineConfiguration->tpsMin = 125; // convert 12to10 bit (ADC/4)
	engineConfiguration->tpsMax = 625; // convert 12to10 bit (ADC/4)

	/**
	 * IAT D15/W7
	 */
	engineConfiguration->iatAdcChannel = EFI_ADC_11;

	/**
	 * CLT D13/W9
	 */
	engineConfiguration->cltAdcChannel = EFI_ADC_12;
}
예제 #10
0
파일: rover_v8.cpp 프로젝트: jharvey/rusefi
void setRoverv8(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
	setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
	// set trigger_type 9
	engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;

	boardConfiguration->is_enabled_spi_2 = false;
	boardConfiguration->isHip9011Enabled = false;
	setFrankenstein_01_LCD(boardConfiguration);

	engineConfiguration->specs.displacement = 3.528;
	engineConfiguration->specs.cylindersCount = 8;
	engineConfiguration->specs.firingOrder = FO_1_8_4_3_6_5_7_2;

	// set_rpm_hard_limit 4000
	engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
	// set_cranking_rpm 350
	engineConfiguration->cranking.rpm = 350;

	// set_whole_fuel_map 3
	setWholeFuelMap(3 PASS_CONFIG_PARAMETER_SUFFIX);

	// set cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set injection_mode 1
	engineConfiguration->injectionMode = IM_SEQUENTIAL;

	// set ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	boardConfiguration->ignitionPinMode = OM_INVERTED;

    // set_ignition_channels
    boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: low side - out #x (?)
    boardConfiguration->ignitionPins[7] = GPIOE_10; // Frankenstein: low side - out #x (?)
    boardConfiguration->ignitionPins[3] = GPIOE_12; // Frankenstein: low side - out #x (?)
    boardConfiguration->ignitionPins[2] = GPIOE_14; // Frankenstein: low side - out #x (?)

	// Frankenstein: low side - out #1: PC14
	// Frankenstein: low side - out #2: PC15
	// Frankenstein: low side - out #3: PE6
	// Frankenstein: low side - out #4: PC13
	// Frankenstein: low side - out #5: PE4
	// Frankenstein: low side - out #6: PE5
	// Frankenstein: low side - out #7: PE2
	// Frankenstein: low side - out #8: PE3
	// Frankenstein: low side - out #9: PE0
	// Frankenstein: low side - out #10: PE1
	// Frankenstein: low side - out #11: PB8
	// Frankenstein: low side - out #12: PB9

	boardConfiguration->injectionPins[0] = GPIOC_14; // Frankenstein: low side - out #1
	boardConfiguration->injectionPins[1] = GPIOC_15; // Frankenstein: low side - out #2
	boardConfiguration->injectionPins[2] = GPIOE_6; // Frankenstein: low side - out #3
	boardConfiguration->injectionPins[3] = GPIOC_13; // Frankenstein: low side - out #4
    boardConfiguration->injectionPins[4] = GPIOE_4; // Frankenstein: low side - out #5
    boardConfiguration->injectionPins[5] = GPIOE_5; // Frankenstein: low side - out #6
    boardConfiguration->injectionPins[6] = GPIOE_2; // Frankenstein: low side - out #7
    boardConfiguration->injectionPins[7] = GPIOE_3; // Frankenstein: low side - out #8

// not valid ICU pin	boardConfiguration->vehicleSpeedSensorInputPin = GPIOC_2;

	//GPIOE_0 AND GPIOE_1 are bad pins since they conflict with accelerometer
	//no malfunction indicator pin needed, since we use CAN_BUS_MAZDA_RX8
	//boardConfiguration->fuelPumpPin = GPIOE_0; // Frankenstein: low side - out #9
	//boardConfiguration->malfunctionIndicatorPin = GPIOE_1; // Frankenstein: low side - out #10
	boardConfiguration->fuelPumpPin = GPIOB_8; // Frankenstein: low side - out #11
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
	boardConfiguration->mainRelayPin  = GPIOB_9; // Frankenstein: low side - out #12

    boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
    boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

    setCommonNTCSensor(&engineConfiguration->clt);
    engineConfiguration->clt.config.bias_resistor = 2700;
    setCommonNTCSensor(&engineConfiguration->iat);
    engineConfiguration->iat.config.bias_resistor = 2700;

    engineConfiguration->tpsAdcChannel = EFI_ADC_3; //Frankenstein: inp2
    engineConfiguration->vbattAdcChannel = EFI_ADC_0; //Frankenstein: inp5
    engineConfiguration->clt.adcChannel = EFI_ADC_11;
    engineConfiguration->iat.adcChannel = EFI_ADC_13;

    setCommonNTCSensor(&engineConfiguration->clt);
    engineConfiguration->clt.config.bias_resistor = 2700;
    setCommonNTCSensor(&engineConfiguration->iat);
    engineConfiguration->iat.config.bias_resistor = 2700;

    /**
     * TPS 0% 0.9v
     * TPS 100% 2.34v
     */
    engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
    engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);

    // Stepper logic:
    boardConfiguration->idle.stepperDirectionPin = GPIOB_10;
    boardConfiguration->idle.stepperStepPin = GPIOB_15;
    engineConfiguration->stepperEnablePin = GPIOB_14;
    engineConfiguration->idleStepperReactionTime = 10;
    engineConfiguration->idleStepperTotalSteps = 150;

    boardConfiguration->useStepperIdle = false;

	// set injection_pin_mode 0
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	boardConfiguration->canTxPin = GPIOB_6;
	boardConfiguration->canRxPin = GPIOB_12;
	engineConfiguration->canWriteEnabled = true;
	engineConfiguration->canReadEnabled = false;
	engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;


    setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);

    // todo: make this official Frankenstein joystick?
    boardConfiguration->joystickCenterPin = GPIOD_8;
    boardConfiguration->joystickAPin = GPIOD_10;
    boardConfiguration->joystickBPin = GPIO_UNASSIGNED;
    boardConfiguration->joystickCPin = GPIO_UNASSIGNED;
    boardConfiguration->joystickDPin = GPIOD_11;

}
예제 #11
0
void setDodgeNeonEngineConfiguration(engine_configuration_s *engineConfiguration,
		board_configuration_s *boardConfiguration) {
	engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON;

	engineConfiguration->engineLoadMode = LM_TPS;

	// set_rpm_hard_limit 4000
	engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
	// set_cranking_rpm 550
	engineConfiguration->crankingSettings.crankingRpm = 550;

	// since CLT is not wired up yet let's just use same value for min and max
	// set_cranking_fuel_max 6 40
	engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
	engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;

	// set_cranking_fuel_min 6 -40
	engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
	engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;

	// set_whole_fuel_map 3
	setWholeFuelMap(engineConfiguration, 3);

	engineConfiguration->triggerConfig.syncRatioFrom = 0.72 * 0.8;
	engineConfiguration->triggerConfig.syncRatioTo = 0.72 * 1.3;

	engineConfiguration->triggerConfig.isSynchronizationNeeded = TRUE;
	engineConfiguration->triggerConfig.useRiseEdge = FALSE;
	engineConfiguration->needSecondTriggerInput = TRUE;

	// set_cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set_injection_mode 1
	engineConfiguration->injectionMode = IM_SEQUENTIAL;

	// set_ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	// set_firing_order 2
	engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;

	// set_global_trigger_offset_angle 497
	engineConfiguration->globalTriggerAngleOffset = 497;
	// set_ignition_offset 350
	engineConfiguration->ignitionOffset = 350;
	 // set_injection_offset 510
	engineConfiguration->injectionOffset = 510;

	// set_cranking_charge_angle 70
	engineConfiguration->crankingChargeAngle = 7;
	// set_cranking_timing_angle 0
	engineConfiguration->crankingTimingAngle = 0;

	// Frankenstein: low side - inj #1: PC14
	// Frankenstein: low side - inj #2: PC15
	// Frankenstein: low side - inj #3: PE6
	// Frankenstein: low side - inj #4: PC13
	// Frankenstein: low side - inj #5: PE4
	// Frankenstein: low side - inj #6: PE5
	// Frankenstein: low side - inj #7: PE2
	// Frankenstein: low side - inj #8: PE3
	// Frankenstein: low side - inj #9: PE0
	// Frankenstein: low side - inj #10: PE1
	// Frankenstein: low side - inj #11: PB8
	// Frankenstein: low side - inj #12: PB9

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
	boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
	boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6

	boardConfiguration->fuelPumpPin = GPIOC_13; // Frankenstein: low side - inj #4
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	// set_injection_pin_mode 0
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	// Frankenstein: high side #1: PE8
	// Frankenstein: high side #2: PE10

	boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: high side #1
	boardConfiguration->ignitionPins[1] = GPIO_NONE;
	boardConfiguration->ignitionPins[2] = GPIOE_10; // // Frankenstein: high side #2

	// set_ignition_pin_mode 0
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->cltThermistorConf.bias_resistor = 2700;

	engineConfiguration->analogChartFrequency = 7;
}
예제 #12
0
/**
 * pin 1I/W9 - extra +5v
 * set_engine_type 14
 */
void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) {
	engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;

	common079721_2351(engineConfiguration, boardConfiguration);

	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	setDensoTODO(config);

	engineConfiguration->globalFuelCorrection = 0.75;
	engineConfiguration->specs.displacement = 1.839;
//	engineConfiguration->algorithm = LM_PLAIN_MAF;
	engineConfiguration->algorithm = LM_SPEED_DENSITY;
//	engineConfiguration->algorithm = LM_REAL_MAF;
	boardConfiguration->tunerStudioSerialSpeed = 9600;

	setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER);
	setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER);

//	boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
//	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// in case of SOHC distributor we only have one signal
//	boardConfiguration->triggerInputPins[0] = GPIOA_5; // 2E White CKP
//	boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;

	// in case of SOHC distributor we only have one signal
	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP

	// Denso 195500-2180
	engineConfiguration->injector.flow = 265;

	engineConfiguration->hasBaroSensor = false;

	engineConfiguration->hasMapSensor = true;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DENSO183;
	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;

	setEgoSensor(ES_BPSX_D1 PASS_ENGINE_PARAMETER);
	engineConfiguration->afr.hwChannel = EFI_ADC_2;


	// set_global_trigger_offset_angle -40
	engineConfiguration->globalTriggerAngleOffset = -40;
	// set_ignition_offset 0
	engineConfiguration->ignitionOffset = 0;
	// set_injection_offset 0
	engineConfiguration->injectionOffset = 0;

	// todo: change to 15?
	// set_cranking_timing_angle 3
	engineConfiguration->crankingTimingAngle = 3;
	engineConfiguration->crankingChargeAngle = 70;

	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);
	// set_whole_fuel_map 5
	setWholeFuelMap(5 PASS_ENGINE_PARAMETER);

	setSingleCoilDwell(engineConfiguration);
	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;

	/**
	 * Outputs
	 */
	// Frankenso low out #1: PE6
	// Frankenso low out #2: PE5 MIL
	// Frankenso low out #3:
	// Frankenso low out #4:
	// Frankenso low out #5: PE3
	// Frankenso low out #6: PE4
	// Frankenso low out #7: PE0<>PD5
	// Frankenso low out #8: PE2 INJ
	// Frankenso low out #9: PB9 IDLE
	// Frankenso low out #10: PE1<>PD3 INJ 1&3
	// Frankenso low out #11: PB8
	// Frankenso low out #12: PB7

	boardConfiguration->injectionPins[0] = GPIOD_3;
	boardConfiguration->injectionPins[1] = GPIOE_2;


	//setDefaultCrankingFuel(engineConfiguration);
	engineConfiguration->cranking.baseFuel = 5;

	// 40% idle is good default
	boardConfiguration->idle.solenoidFrequency = 300;
	boardConfiguration->idle.solenoidPin = GPIOB_9;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_5;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->tunerStudioSerialSpeed = 9600;

	commonFrankensoAnalogInputs(engineConfiguration);
	setCommonNTCSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;
	setCommonNTCSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

	engineConfiguration->hasTpsSensor = false;
	engineConfiguration->tpsAdcChannel = EFI_ADC_NONE;
//	engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
	engineConfiguration->mafAdcChannel = EFI_ADC_0;
	engineConfiguration->clt.adcChannel = EFI_ADC_12;
	engineConfiguration->iat.adcChannel = EFI_ADC_11;

	// todo: 8.2 or 10k?
	engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;

	// end of Ford Escort GT config
}
예제 #13
0
void setFordEscortGt(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
	engineConfiguration->triggerConfig.triggerType = TT_FORD_ESCORT_GT;
	engineConfiguration->needSecondTriggerInput = FALSE;

	engineConfiguration->cylindersCount = 4;
	engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
	// set_global_trigger_offset_angle 256
	engineConfiguration->globalTriggerAngleOffset = 256;
	// set_ignition_offset 170
	engineConfiguration->ignitionOffset = 170;
	// set_injection_offset 510
	engineConfiguration->injectionOffset = 59;



	setSingleCoilDwell(engineConfiguration);
	engineConfiguration->ignitionMode = IM_ONE_COIL;

	boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
	boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;

	// Frankenstein analog input #1: adc1
	// Frankenstein analog input #2: adc3
	// Frankenstein analog input #3: adc13
	// Frankenstein analog input #4: adc11
	// Frankenstein analog input #5: adc
	// Frankenstein analog input #6: adc
	// Frankenstein analog input #7: adc
	// Frankenstein analog input #8: adc
	// Frankenstein analog input #9: adc
	// Frankenstein analog input #10: adc
	// Frankenstein analog input #11: adc
	// Frankenstein analog input #12: adc
	engineConfiguration->mafAdcChannel = 1;
	engineConfiguration->tpsAdcChannel = 3;
	engineConfiguration->cltAdcChannel = 11;


	// Frankenstein: high side #1 is PE8
	// Frankenstein: high side #2 is PE10
	// Frankenstein: high side #3 is PE12
	// Frankenstein: high side #4 is PE14
	// Frankenstein: high side #5 is PC9
	// Frankenstein: high side #6 is PC7

	boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
	boardConfiguration->ignitionPins[1] = GPIO_NONE;
	boardConfiguration->ignitionPins[2] = GPIO_NONE;
	boardConfiguration->ignitionPins[3] = GPIO_NONE;
	boardConfiguration->ignitionPinMode = OM_DEFAULT;


	// Frankenstein: low side - inj #1: PC14
	// Frankenstein: low side - inj #2: PC15
	// Frankenstein: low side - inj #3: PE6
	// Frankenstein: low side - inj #4: PC13
	// Frankenstein: low side - inj #5: PE4
	// Frankenstein: low side - inj #6: PE5
	// Frankenstein: low side - inj #7: PE2
	// Frankenstein: low side - inj #8: PE3
	// Frankenstein: low side - inj #9: PE0
	// Frankenstein: low side - inj #10: PE1
	// Frankenstein: low side - inj #11: PB8
	// Frankenstein: low side - inj #12: PB9

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
	boardConfiguration->injectionPins[2] = GPIO_NONE;
	boardConfiguration->injectionPins[3] = GPIO_NONE;
	boardConfiguration->injectionPins[4] = GPIO_NONE;
	boardConfiguration->injectionPins[5] = GPIO_NONE;
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	// set_whole_fuel_map 3
	setWholeFuelMap(engineConfiguration, 3);

	// since CLT is not wired up yet let's just use same value for min and max
	// set_cranking_fuel_max 6 40
	engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
	engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;

	// set_cranking_fuel_min 6 -40
	engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
	engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;

	boardConfiguration->fuelPumpPin = GPIO_NONE; // fuel pump is not controlled by ECU on this engine

	// set_cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set_injection_mode 2
	engineConfiguration->injectionMode = IM_BATCH;

}
예제 #14
0
void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_F) {
	setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);

	setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
	engineConfiguration->trigger.type = TT_DODGE_RAM;
	engineConfiguration->injector.flow = 243.6; // 23.2lb/h
	engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;
	setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);

	// set cranking_charge_angle 30
	engineConfiguration->crankingChargeAngle = 30;

	// set_whole_fuel_map 6
	setWholeFuelMap(6 PASS_ENGINE_PARAMETER);

	//Base engine setting
	engineConfiguration->specs.cylindersCount = 8;
	engineConfiguration->specs.firingOrder = FO_1_8_4_3_6_5_7_2;
	engineConfiguration->specs.displacement = 5.2;

	boardConfiguration->triggerInputPins[0] = GPIOC_6;
	boardConfiguration->triggerInputPins[1] = GPIOA_5;

	boardConfiguration->injectionPins[0] = GPIOE_2;
	boardConfiguration->injectionPins[1] = GPIOB_9;
	boardConfiguration->injectionPins[2] = GPIOD_5;
	boardConfiguration->injectionPins[3] = GPIOB_8;

	boardConfiguration->injectionPins[4] = GPIOB_7;
	boardConfiguration->injectionPins[5] = GPIOE_3;
	boardConfiguration->injectionPins[6] = GPIOE_4;
	boardConfiguration->injectionPins[7] = GPIOD_3;

	boardConfiguration->ignitionPins[0] = GPIOC_9;
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;

	boardConfiguration->mainRelayPin = GPIOE_5;
	boardConfiguration->fuelPumpPin = GPIOE_6;
	boardConfiguration->fanPin = GPIO_UNASSIGNED;

	engineConfiguration->engineChartSize = 450;

	// set cranking_fuel 7
	engineConfiguration->cranking.baseFuel = 7;

	// set global_trigger_offset_angle -50
	engineConfiguration->globalTriggerAngleOffset = -50;

	// set_global_fuel_correction 1

	// set_whole_timing_map 10
	setWholeTimingTable(10 PASS_ENGINE_PARAMETER);


	boardConfiguration->alternatorControlPin = GPIOD_7;
	engineConfiguration->alternatorControl.pFactor = 22;

	boardConfiguration->idle.solenoidPin = GPIOC_13;
	boardConfiguration->idle.solenoidFrequency = 300;

	engineConfiguration->vbattAdcChannel = EFI_ADC_14;
//	engineConfiguration->vbattDividerCoeff = ((float) (8.93 + 41.27)) / 8.93 * 2;
	engineConfiguration->vbattDividerCoeff = 9.6;

	setDodgeSensor(&engineConfiguration->clt);
	engineConfiguration->clt.config.bias_resistor = 2700;

	setDodgeSensor(&engineConfiguration->iat);
	engineConfiguration->iat.config.bias_resistor = 2700;

	boardConfiguration->useStepperIdle = true;
}
예제 #15
0
void setMazdaMiataNb1EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
	// set_rpm_hard_limit 3000
	engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now

	engineConfiguration->trigger.type = TT_MAZDA_MIATA_NB1;

	// set cranking_injection_mode 0
	engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
	// set injection_mode 1
	engineConfiguration->injectionMode = IM_SEQUENTIAL;
	// set ignition_mode 2
	engineConfiguration->ignitionMode = IM_WASTED_SPARK;
	// set_firing_order 2
	engineConfiguration->specs.firingOrder = FO_1_3_4_2;

	setThermistorConfiguration(&engineConfiguration->clt, 0, 32500, 30, 7550, 100, 700);
	engineConfiguration->clt.config.bias_resistor = 2700;

	setThermistorConfiguration(&engineConfiguration->iat, -10, 160310, 60, 7700, 120.00, 1180);
	engineConfiguration->iat.config.bias_resistor = 2700;

	engineConfiguration->tpsAdcChannel = EFI_ADC_3; // 15 is the old value
	engineConfiguration->vbattAdcChannel = EFI_ADC_0; // 1 is the old value
//  engineConfiguration->map.channel = 1;
	engineConfiguration->mafAdcChannel = EFI_ADC_1;
	engineConfiguration->clt.adcChannel = EFI_ADC_11;
	engineConfiguration->iat.adcChannel = EFI_ADC_13;
	engineConfiguration->afr.hwChannel = EFI_ADC_2; // PA2

	boardConfiguration->idle.solenoidPin = GPIOE_0;
	boardConfiguration->idle.solenoidPinMode = OM_DEFAULT;

	boardConfiguration->fuelPumpPin = GPIOC_14; // Frankenstein: low side - out #4
	boardConfiguration->fuelPumpPinMode = OM_DEFAULT;

	boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
	boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
	boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - out #8
	boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - out #6
	boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
	boardConfiguration->injectionPinMode = OM_DEFAULT;

	boardConfiguration->ignitionPins[0] = GPIOE_10; // Frankenstein: high side #1
	boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPins[2] = GPIOC_9; // // Frankenstein: high side #2
	boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
	boardConfiguration->ignitionPinMode = OM_INVERTED;

	boardConfiguration->malfunctionIndicatorPin = GPIOE_1;
	boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;

	boardConfiguration->fanPin = GPIOE_6;
	boardConfiguration->fanPinMode = OM_DEFAULT;

	boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;

	// set_whole_fuel_map 3
	setWholeFuelMap(3 PASS_CONFIG_PARAMETER_SUFFIX);


// 10 deg before TDC is default timing

	// VICS solenoid
	/**
	 * to test
	 * set_fsio_setting 1 5000
	 */
	boardConfiguration->fsio_setting[0] = 5000;
	// (self and (rpm > 4800)) OR (rpm > 5000)
	// set_rpn_expression 1 "self rpm 4800 > & rpm 5000 > OR"
//	setFsioExt(0, GPIOE_3, "self rpm 4800 > & rpm 5000 > OR", 150 PASS_ENGINE_PARAMETER_SUFFIX);
}