Exemplo n.º 1
0
void setLadaKalina(DECLARE_ENGINE_PARAMETER_F) {
	setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
	disableLCD(boardConfiguration);

	boardConfiguration->HD44780_rs = GPIO_UNASSIGNED;
	boardConfiguration->HD44780_e = GPIO_UNASSIGNED;
	boardConfiguration->HD44780_db4 = GPIO_UNASSIGNED;
	boardConfiguration->HD44780_db5 = GPIO_UNASSIGNED;
	boardConfiguration->HD44780_db6 = GPIO_UNASSIGNED;
	boardConfiguration->HD44780_db7 = GPIO_UNASSIGNED;


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

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

	engineConfiguration->globalTriggerAngleOffset = 114;

	boardConfiguration->ignitionPins[0] = GPIOE_14;
	boardConfiguration->ignitionPins[1] = GPIOC_7;
	boardConfiguration->ignitionPins[2] = GPIOC_9;
	boardConfiguration->ignitionPins[3] = GPIOE_12;

	boardConfiguration->useStepperIdle = true;
	boardConfiguration->fuelPumpPin = GPIOC_13;
	boardConfiguration->mainRelayPin = GPIOD_7;

	boardConfiguration->idle.stepperDirectionPin = GPIOE_15;
	boardConfiguration->idle.stepperStepPin = GPIOE_13;
	engineConfiguration->stepperEnablePin = GPIOE_11;



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

}
Exemplo n.º 2
0
void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
	board_configuration_s * boardConfiguration = &engineConfiguration->bc;
	engineConfiguration->trigger.type = TT_DODGE_NEON_2003;
	setFrankenso_01_LCD(boardConfiguration);
	setFrankenso0_1_joystick(engineConfiguration);

	// set_global_trigger_offset_angle 50
	engineConfiguration->globalTriggerAngleOffset = 50;
	// set_injection_offset 0
	engineConfiguration->injectionAngle = 0;

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

	/**
	 * that's NGC config
	 *
	 * set_cranking_fuel 5
	 */
	engineConfiguration->cranking.baseFuel = 5;

	/**
	 * 77C
	 * 1200 rpm
	 * fuel 3
	 *
	 * 88C
	 * fuel 2.8
	 *
	 * set_whole_fuel_map 12
	 */
	//setWholeFuelMap(12 PASS_ENGINE_PARAMETER);
	copyFuelTable(alphaNfuel, config->fuelTable);
	//setWholeTimingTable(12 PASS_ENGINE_PARAMETER);
	copyTimingTable(fromDyno, config->ignitionTable);

	// 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->injector.flow = 199;

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

	boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED;

	/**
	 * PA4 Wideband O2 Sensor
	 */
	engineConfiguration->afr.hwChannel = EFI_ADC_4;

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

	/**
	 * http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board
	 */
	// Frankenso low out #1: PE6 main relay
	// Frankenso low out #2: PE5 alternator field control
	// 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->mainRelayPin = GPIOE_6;

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

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

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

	/**
	 * Frankenso analog #1 PC2 ADC12 CLT
	 * Frankenso analog #2 PC1 ADC11 IAT
	 * Frankenso analog #3 PA0 ADC0
	 * Frankenso analog #4 PC3 ADC13
	 * Frankenso analog #5 PA2 ADC2
	 * Frankenso analog #6 PA1 ADC1
	 * Frankenso analog #7 PA4 ADC4 WBO AFR
	 * Frankenso analog #8 PA3 ADC3
	 * Frankenso analog #9 PA7 ADC7
	 * Frankenso analog #10 PA6 ADC6 MAP
	 * Frankenso analog #11 PC5 ADC15 TPS
	 * Frankenso analog #12 PC4 ADC14 VBatt
	 */


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

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

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

	boardConfiguration->adcHwChannelEnabled[0] = ADC_SLOW; // ADC0 - PA0
	boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; // just for test
	boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW; // just for test
	boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW; // just for test

	boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
	boardConfiguration->adcHwChannelEnabled[5] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[6] = ADC_FAST;
	boardConfiguration->adcHwChannelEnabled[7] = ADC_SLOW; // just for test

	boardConfiguration->adcHwChannelEnabled[8] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[9] = ADC_OFF;
	boardConfiguration->adcHwChannelEnabled[10] = ADC_OFF;
	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_FAST; // 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;


	boardConfiguration->analogChartMode = AC_MAP;
	boardConfiguration->isFastAdcEnabled = true;
	engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;

#if EFI_HIP_9011 || defined(__DOXYGEN__)
	setHip9011FrankensoPinout();
#endif
	engineConfiguration->cylinderBore = 87.5;

//	boardConfiguration->clutchDownPin = GPIOC_12;
	boardConfiguration->clutchDownPinMode = PI_PULLUP;
	boardConfiguration->clutchUpPin = GPIOD_3;
	boardConfiguration->clutchUpPinMode = PI_PULLUP;

	// alt GPIOC_12
	
	/**
	 * set_fsio_setting 0 0.11
	 */
	engineConfiguration->bc.fsio_setting[0] = 0.2;
#if EFI_FSIO || defined(__DOXYGEN__)
	boardConfiguration->fsio_setting[0] = 0.55;
	setFsioExt(0, GPIOE_5, "0 fsio_setting", 400 PASS_ENGINE_PARAMETER);
#endif

	boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
	engineConfiguration->hasVehicleSpeedSensor = true;

	engineConfiguration->fanOnTemperature = 85;
	engineConfiguration->fanOffTemperature = 80;

//	boardConfiguration->tunerStudioSerialSpeed = 9600;
	boardConfiguration->tunerStudioSerialSpeed = 38400;
	engineConfiguration->algorithm = LM_SPEED_DENSITY;

	boardConfiguration->alternatorControlPin = GPIOD_5;
	engineConfiguration->alternatorControlPFactor = 22;

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


	boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
	boardConfiguration->idle.stepperStepPin = GPIOE_12;

	engineConfiguration->mapAccelLength = 12;
}
Exemplo n.º 3
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
}