diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 8bd348652e..257ddfb334 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -28,6 +28,7 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->injectionMode = IM_BATCH; + engineConfiguration->twoWireBatch = true; // chartsize 600 engineConfiguration->engineChartSize = 600; @@ -38,8 +39,8 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->injector.flow = 330; engineConfiguration->specs.displacement = 2.0; - // set_global_trigger_offset_angle 0 - engineConfiguration->globalTriggerAngleOffset = 0; + // set_global_trigger_offset_angle 282 + engineConfiguration->globalTriggerAngleOffset = 282; // set_cranking_timing_angle 15 engineConfiguration->crankingTimingAngle = 8; @@ -62,10 +63,10 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { // set_whole_timing_map 10 setWholeTimingTable(10 PASS_ENGINE_PARAMETER); - // http://i.imgur.com/fclVzvu.jpg - setCommonNTCSensor(&engineConfiguration->clt); - // http://i.imgur.com/2hI67yW.jpg - setThermistorConfiguration(&engineConfiguration->iat, 13, 56000, 50, 9000, 80.0, 2700); + // http://s1.micp.ru/tOb0U.png + setThermistorConfiguration(&engineConfiguration->clt, -15, 5900, 23, 1750, 97, 165); + // http://s2.micp.ru/I6Cfe.png + setThermistorConfiguration(&engineConfiguration->iat, 23, 1750, 41, 810, 97, 165); engineConfiguration->iat.config.bias_resistor = 1820; commonFrankensoAnalogInputs(engineConfiguration); @@ -77,6 +78,15 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->map.sensor.type = MT_SUBY_DENSO; + // http://s2.micp.ru/vJ9Sd.png + engineConfiguration->mapAccelLength = 12; + engineConfiguration->mapAccelEnrichmentThreshold = 1; + engineConfiguration->mapAccelEnrichmentMultiplier = 0.25; + + engineConfiguration->tpsAccelLength = 12; + engineConfiguration->tpsAccelEnrichmentThreshold = 10; + engineConfiguration->tpsAccelEnrichmentMultiplier = 0.06; + // todo engineConfiguration->afr.hwChannel = EFI_ADC_3; setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER); diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index c736c9a7c1..97f10f40fc 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -163,6 +163,8 @@ case TT_NISSAN: return "TT_NISSAN"; case TT_2JZ: return "TT_2JZ"; +case TT_ROVER_K: + return "TT_ROVER_K"; } return NULL; } diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index d9b9682c82..bff57b86a7 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -159,7 +159,9 @@ typedef enum { TT_2JZ = 25, - TT_UNUSED = 26, // this is used if we want to iterate over all trigger types + TT_ROVER_K = 26, + + TT_UNUSED = 27, // this is used if we want to iterate over all trigger types Force_4b_trigger_type = ENUM_32_BITS, } trigger_type_e; diff --git a/firmware/controllers/trigger/trigger.mk b/firmware/controllers/trigger/trigger.mk index e65e260da0..12ea1ce87f 100644 --- a/firmware/controllers/trigger/trigger.mk +++ b/firmware/controllers/trigger/trigger.mk @@ -12,7 +12,8 @@ TRIGGER_DECODERS_SRC_CPP = \ $(PROJECT_DIR)/controllers/trigger/trigger_nissan.cpp \ $(PROJECT_DIR)/controllers/trigger/trigger_subaru.cpp \ $(PROJECT_DIR)/controllers/trigger/trigger_toyota.cpp \ - $(PROJECT_DIR)/controllers/trigger/trigger_gm.cpp + $(PROJECT_DIR)/controllers/trigger/trigger_gm.cpp \ + $(PROJECT_DIR)/controllers/trigger/trigger_rover.cpp TRIGGER_SRC_CPP = \ $(PROJECT_DIR)/controllers/trigger/trigger_emulator_algo.cpp \ diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 4c34558510..78a07b53ac 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -33,6 +33,7 @@ #include "trigger_subaru.h" #include "trigger_nissan.h" #include "trigger_toyota.h" +#include "trigger_rover.h" #include "auto_generated_enums.h" #include "trigger_structure.h" #include "efiGpio.h" @@ -509,6 +510,10 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET initializeNissan(triggerShape); break; + case TT_ROVER_K: + initializeRoverK(triggerShape); + break; + default: firmwareError("initializeTriggerShape() not implemented: %d", triggerConfig->type); ; diff --git a/firmware/controllers/trigger/trigger_rover.cpp b/firmware/controllers/trigger/trigger_rover.cpp new file mode 100644 index 0000000000..d7f595218e --- /dev/null +++ b/firmware/controllers/trigger/trigger_rover.cpp @@ -0,0 +1,50 @@ +/* + * @file trigger_rover.cpp + * + * @date Dec 27, 2015 + * todo: ask PhilTheGeek to sign contributor agreement + */ + +#include "trigger_rover.h" + +void initializeRoverK(TriggerShape *s) { + s->initialize(FOUR_STROKE_CRANK_SENSOR, false); + + float tooth = 20; + +// s->setTriggerSynchronizationGap(2.0); + s->isSynchronizationNeeded = false; + + float base = 0; + + for (int i = 0; i < 2; i++) { + s->addEvent(base + tooth / 2, T_PRIMARY, TV_RISE); + s->addEvent(base + tooth, T_PRIMARY, TV_FALL); + base += tooth; + } + base += tooth; + for (int i = 0; i < 2; i++) { + s->addEvent(base + tooth / 2, T_PRIMARY, TV_RISE); + s->addEvent(base + tooth, T_PRIMARY, TV_FALL); + base += tooth; + } + base += tooth; + for (int i = 0; i < 14; i++) { + s->addEvent(base + tooth / 2, T_PRIMARY, TV_RISE); + s->addEvent(base + tooth, T_PRIMARY, TV_FALL); + base += tooth; + } + base += tooth; + for (int i = 0; i < 3; i++) { + s->addEvent(base + tooth / 2, T_PRIMARY, TV_RISE); + s->addEvent(base + tooth, T_PRIMARY, TV_FALL); + base += tooth; + } + base += tooth; + for (int i = 0; i < 11; i++) { + s->addEvent(base + tooth / 2, T_PRIMARY, TV_RISE); + s->addEvent(base + tooth, T_PRIMARY, TV_FALL); + base += tooth; + } + +} diff --git a/firmware/controllers/trigger/trigger_rover.h b/firmware/controllers/trigger/trigger_rover.h new file mode 100644 index 0000000000..0f8ba4b44c --- /dev/null +++ b/firmware/controllers/trigger/trigger_rover.h @@ -0,0 +1,15 @@ +/* + * @file trigger_rover.h + * + * @date Dec 27, 2015 + * todo: ask PhilTheGeek to sign contributor agreement + */ + +#ifndef CONTROLLERS_TRIGGER_TRIGGER_ROVER_H_ +#define CONTROLLERS_TRIGGER_TRIGGER_ROVER_H_ + +#include "trigger_structure.h" + +void initializeRoverK(TriggerShape *s); + +#endif /* CONTROLLERS_TRIGGER_TRIGGER_ROVER_H_ */ diff --git a/java_console/build.xml b/java_console/build.xml index d1fc6bf946..7159e005cb 100644 --- a/java_console/build.xml +++ b/java_console/build.xml @@ -74,7 +74,7 @@ - +