2016-10-04 10:03:25 -07:00
|
|
|
/*
|
|
|
|
* @file mazda_miata_vvt.cpp
|
|
|
|
*
|
2016-10-04 12:02:36 -07:00
|
|
|
* set_engine_type 47
|
|
|
|
*
|
2016-10-04 10:03:25 -07:00
|
|
|
* @date Oct 4, 2016
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2016
|
|
|
|
* http://rusefi.com/forum/viewtopic.php?f=3&t=1095
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mazda_miata_vvt.h"
|
2016-10-04 12:02:36 -07:00
|
|
|
#include "custom_engine.h"
|
2016-10-04 10:03:25 -07:00
|
|
|
|
2016-10-04 11:00:58 -07:00
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
|
|
|
void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
2016-10-04 12:02:36 -07:00
|
|
|
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
|
|
|
|
|
|
|
engineConfiguration->hasMapSensor = true;
|
|
|
|
|
2016-11-13 20:02:33 -08:00
|
|
|
engineConfiguration->trigger.type = TT_MIATA_VVT;
|
2016-11-14 20:01:47 -08:00
|
|
|
setOperationMode(engineConfiguration, FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR);
|
2016-10-04 12:02:36 -07:00
|
|
|
engineConfiguration->specs.displacement = 1.8;
|
|
|
|
|
2016-11-12 21:01:42 -08:00
|
|
|
boardConfiguration->triggerInputPins[0] = GPIOA_5;
|
|
|
|
boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->camInput = GPIOC_6;
|
|
|
|
|
2016-11-14 20:01:47 -08:00
|
|
|
// set vvt_mode 3
|
|
|
|
engineConfiguration->vvtMode = MIATA_NB2;
|
2016-11-12 21:01:42 -08:00
|
|
|
boardConfiguration->vvtCamSensorUseRise = true;
|
2016-11-17 20:02:17 -08:00
|
|
|
engineConfiguration->vvtOffset = -70;
|
2016-11-12 21:01:42 -08:00
|
|
|
|
2016-11-23 20:02:35 -08:00
|
|
|
// boardConfiguration->fuelPumpPin = GPIOD_5; // todo: rewire my board to default E_4
|
|
|
|
|
2016-11-24 19:02:34 -08:00
|
|
|
// set_global_trigger_offset_angle 670
|
|
|
|
engineConfiguration->globalTriggerAngleOffset = 670;
|
2016-11-23 20:02:35 -08:00
|
|
|
|
2016-11-17 20:02:17 -08:00
|
|
|
// enable trigger_details
|
|
|
|
engineConfiguration->isPrintTriggerSynchDetails = false;
|
2016-11-12 21:01:42 -08:00
|
|
|
|
2016-11-23 19:03:11 -08:00
|
|
|
// todo: change to 15?
|
2016-11-24 19:02:34 -08:00
|
|
|
// set_cranking_timing_angle 0
|
2016-11-23 19:03:11 -08:00
|
|
|
engineConfiguration->crankingTimingAngle = 3;
|
|
|
|
// set_cranking_fuel 9
|
|
|
|
engineConfiguration->cranking.baseFuel = 9;
|
|
|
|
|
|
|
|
boardConfiguration->ignitionPins[0] = GPIOE_14;
|
|
|
|
boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
|
|
|
boardConfiguration->ignitionPins[2] = GPIOC_9;
|
|
|
|
boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
|
|
|
|
|
2016-11-17 20:02:17 -08:00
|
|
|
|
|
|
|
// 0.0825
|
|
|
|
// 0.1375
|
|
|
|
// 6.375
|
|
|
|
// 10.625
|
|
|
|
boardConfiguration->nb2ratioFrom = 8.50 * 0.75;
|
2016-11-23 20:02:35 -08:00
|
|
|
boardConfiguration->nb2ratioTo = 14;
|
2016-11-17 20:02:17 -08:00
|
|
|
engineConfiguration->nbVvtIndex = 0;
|
2016-11-14 20:01:47 -08:00
|
|
|
|
2016-11-12 21:01:42 -08:00
|
|
|
|
2016-10-04 12:02:36 -07:00
|
|
|
engineConfiguration->specs.cylindersCount = 4;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
2016-10-04 11:00:58 -07:00
|
|
|
|
2016-10-09 10:04:53 -07:00
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
|
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
2016-10-04 11:00:58 -07:00
|
|
|
}
|
2016-10-04 10:03:25 -07:00
|
|
|
|
|
|
|
|