From 93f4afaa302cf3ce147dbf97034775d3a7a54f5b Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 12 May 2015 21:07:55 -0400 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_ram.cpp | 4 +++ .../controllers/algo/engine_configuration.cpp | 1 + ...ngine_configuration_generated_structures.h | 10 ++++-- firmware/controllers/algo/rusefi_generated.h | 32 +++--------------- firmware/controllers/alternatorController.cpp | 5 +-- firmware/controllers/flash_main.h | 2 +- firmware/controllers/settings.cpp | 8 +++-- firmware/integration/rusefi_config.txt | 3 +- java_console/ui/resources/com/rusefi/undo.jpg | Bin 0 -> 1227 bytes 9 files changed, 28 insertions(+), 37 deletions(-) create mode 100644 java_console/ui/resources/com/rusefi/undo.jpg diff --git a/firmware/config/engines/dodge_ram.cpp b/firmware/config/engines/dodge_ram.cpp index b6ece3c537..73638fb210 100644 --- a/firmware/config/engines/dodge_ram.cpp +++ b/firmware/config/engines/dodge_ram.cpp @@ -23,10 +23,14 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.type = TT_DODGE_RAM; engineConfiguration->injector.flow = 243.6; // 23.2lb/h engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003; + engineConfiguration->algorithm = LM_ALPHA_N; // 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; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index ca7384569d..ddf4288164 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -324,6 +324,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->algorithm = LM_PLAIN_MAF; engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15; + boardConfiguration->targetVBatt = 14; engineConfiguration->fanOnTemperature = 75; engineConfiguration->fanOffTemperature = 70; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 6c2d990e20..52a85d5cdd 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated by config_definition.jar on Tue May 12 14:18:57 EDT 2015 +// this section was generated by config_definition.jar on Tue May 12 20:03:20 EDT 2015 // begin #include "rusefi_types.h" typedef struct { @@ -372,7 +372,11 @@ typedef struct { /** * offset 232 */ - adc_channel_mode_e unusedADC[HW_MAX_ADC_INDEX]; + float unusedADC[15]; + /** + * offset 292 + */ + float targetVBatt; /** * offset 296 */ @@ -1298,4 +1302,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated by config_definition.jar on Tue May 12 14:18:57 EDT 2015 +// this section was generated by config_definition.jar on Tue May 12 20:03:20 EDT 2015 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 3c886d6bef..a053947970 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -290,34 +290,10 @@ #define digitalPotentiometerChipSelect3_offset_hex 350 #define digitalPotentiometerChipSelect4_offset 852 #define digitalPotentiometerChipSelect4_offset_hex 354 -#define unusedADC1_offset 856 -#define unusedADC1_offset_hex 358 -#define unusedADC2_offset 860 -#define unusedADC3_offset 864 -#define unusedADC3_offset_hex 360 -#define unusedADC4_offset 868 -#define unusedADC4_offset_hex 364 -#define unusedADC5_offset 872 -#define unusedADC5_offset_hex 368 -#define unusedADC6_offset 876 -#define unusedADC7_offset 880 -#define unusedADC7_offset_hex 370 -#define unusedADC8_offset 884 -#define unusedADC8_offset_hex 374 -#define unusedADC9_offset 888 -#define unusedADC9_offset_hex 378 -#define unusedADC10_offset 892 -#define unusedADC11_offset 896 -#define unusedADC11_offset_hex 380 -#define unusedADC12_offset 900 -#define unusedADC12_offset_hex 384 -#define unusedADC13_offset 904 -#define unusedADC13_offset_hex 388 -#define unusedADC14_offset 908 -#define unusedADC15_offset 912 -#define unusedADC15_offset_hex 390 -#define unusedADC16_offset 916 -#define unusedADC16_offset_hex 394 +#define unusedADC_offset 856 +#define unusedADC_offset_hex 358 +#define targetVBatt_offset 916 +#define targetVBatt_offset_hex 394 #define triggerInputPins1_offset 920 #define triggerInputPins1_offset_hex 398 #define triggerInputPins2_offset 924 diff --git a/firmware/controllers/alternatorController.cpp b/firmware/controllers/alternatorController.cpp index bbad233ca3..d45b851a71 100644 --- a/firmware/controllers/alternatorController.cpp +++ b/firmware/controllers/alternatorController.cpp @@ -36,7 +36,7 @@ static msg_t AltCtrlThread(int param) { while (true) { chThdSleepMilliseconds(100); - currentAltDuty = altPid.getValue(14, getVBatt(engineConfiguration), 1); + currentAltDuty = altPid.getValue(boardConfiguration->targetVBatt, getVBatt(engineConfiguration), 1); if (boardConfiguration->isVerboseAlternator) { scheduleMsg(logger, "alt duty: %f/vbatt=%f/p=%f/i=%f/d=%f int=%f", currentAltDuty, getVBatt(engineConfiguration), altPid.getP(), altPid.getI(), altPid.getD(), altPid.getIntegration()); @@ -73,7 +73,8 @@ static void showAltInfo(void) { hwPortname(boardConfiguration->alternatorControlPin)); scheduleMsg(logger, "p=%f/i=%f/d=%f", engineConfiguration->alternatorControlPFactor, 0, 0); // todo: i & d - scheduleMsg(logger, "vbatt=%f/duty=%f", getVBatt(engineConfiguration), currentAltDuty); + scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(engineConfiguration), currentAltDuty, + boardConfiguration->targetVBatt); } void initAlternatorCtrl(Logging *sharedLogger) { diff --git a/firmware/controllers/flash_main.h b/firmware/controllers/flash_main.h index a7e8219d23..f5871a2e06 100644 --- a/firmware/controllers/flash_main.h +++ b/firmware/controllers/flash_main.h @@ -12,7 +12,7 @@ #include "engine_configuration.h" #include "engine.h" -#define FLASH_DATA_VERSION 8050 +#define FLASH_DATA_VERSION 8060 void readFromFlash(void); void initFlash(Logging *sharedLogger, Engine *engine); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 2fab9e8853..e388ed01c0 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -922,9 +922,13 @@ static void setInjectorLag(float value) { } static void setValue(const char *paramStr, const char *valueStr) { - float value = atoff(valueStr); - engineConfiguration->vehicleSpeedCoef = value; + + if (strEqualCaseInsensitive(paramStr, "vsscoeff")) { + engineConfiguration->vehicleSpeedCoef = value; + } else if (strEqualCaseInsensitive(paramStr, "targetvbatt")) { + boardConfiguration->targetVBatt = value; + } } void initSettings(engine_configuration_s *engineConfiguration) { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 9491933cab..63d46e4eae 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -336,7 +336,8 @@ spi_device_e digitalPotentiometerSpiDevice;Digital Potentiometer is used by stoc brain_pin_e[DIGIPOT_COUNT iterate] digitalPotentiometerChipSelect; custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fast", "INVALID" - adc_channel_mode_e[HW_MAX_ADC_INDEX iterate] unusedADC; + float[15] unusedADC; + float targetVBatt; brain_input_pin_e[3 iterate] triggerInputPins; diff --git a/java_console/ui/resources/com/rusefi/undo.jpg b/java_console/ui/resources/com/rusefi/undo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2439e5cf31c22cffb46cd1dc5de2a55810abbc4d GIT binary patch literal 1227 zcmb7?YfMvT9LC@G+}hF>-_wijfNnipWLyRo!#2XSmN~3T6+t61VH5((0y1qN+{A5w zEM;>Df+FgWT9fHS1qU(|KOhih1{)7;9y}C2G@qs^igw}g7{16wBoev^g<@9;61%dl zLLpjLjg#TeCJ09AdQ`@31 zY3|_UiM?;!@3~aI!6!5;|MvKGA|m92rgQ=`RR|C`i&aqkLIE1F5-Fzg@pX_UJPXYY zh8)Fdq?w0ukz3&+r$MyKeroOc9ptyOOJ>;)1&%k&S9b&+aVye3JD3oB9h{C z5~*j>5|o5c3rqa=Pw3?HWQV)KX>{0O zp=AU$+Uze@qU9n#P1w_==-uJA;rqoYdw{+q^`{!^?Ljg*SdhB4vi{awR`;)*@xu11 z3sDtyaTQdt`LUM z)2UrSTYNmGnte@Qzo7o7B#`Aa(E#b3PVIj$uM-_C_o%;Y82hH+<>|hNC&h{qTR>#Y z6o`n)3pE6H7$OQLq5|*PM9t9!3+F2Gv0k3DW`&6#q~*J43xgo{q%@R#@dJb4tIRA{PLi5