From f6223df68f6c3bd510f01ddade3c9106b84ee77d Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 7 Feb 2016 22:04:14 -0500 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_neon.cpp | 2 + firmware/console/status_loop.cpp | 2 - firmware/controllers/algo/engine.cpp | 2 +- firmware/controllers/settings.cpp | 3 ++ firmware/integration/rusefi_config.txt | 8 ++-- firmware/tunerstudio/rusefi.ini | 48 ++++++++++--------- .../models/src/com/rusefi/config/Fields.java | 4 +- .../ui/src/com/rusefi/ui/FuelTunePane.java | 15 ++++++ 8 files changed, 52 insertions(+), 32 deletions(-) diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 01244c61c1..bcf297be3e 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -236,6 +236,8 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { setFrankenso0_1_joystick(engineConfiguration); // boardConfiguration->useWarmupPidAfr = true; + engineConfiguration->warmupAfrPid.pFactor = -0.2; + engineConfiguration->warmupAfrPid.dFactor = -0.02; // set_global_trigger_offset_angle 38 engineConfiguration->globalTriggerAngleOffset = 38; diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 3855b570c1..5f56f53b7f 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -259,8 +259,6 @@ static void printState(void) { float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F); float baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER); debugFloat(&logger, "fuel_base", baseFuel, 2); -// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2); -// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2); debugFloat(&logger, "fuel_lag", engine->engineState.injectorLag, 2); debugFloat(&logger, "fuel", ENGINE(actualLastInjection), 2); diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 82b9537623..8b2736b49e 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -91,7 +91,7 @@ void Engine::addConfigurationListener(configuration_callback_t callback) { Engine::Engine(persistent_config_s *config) { init(config); - engineState.warmupAfrPid.init(&config->engineConfiguration.warmupAfrPid, 0.1, 10); + engineState.warmupAfrPid.init(&config->engineConfiguration.warmupAfrPid, -0.8, 10); isEngineChartEnabled = false; sensorChartMode = SC_OFF; /** diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index e5c4fa7a7f..b48f061ef4 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -439,6 +439,9 @@ static void printTemperatureInfo(void) { scheduleMsg(&logger, "A/C relay=%s @ %s", boolToString(enginePins.acRelay.getLogicValue()), hwPortname(boardConfiguration->acRelayPin)); + scheduleMsg(&logger, "warmupPID=%d corr=%f", boardConfiguration->useWarmupPidAfr, + engine->engineState.cltFuelCorrection); + #endif } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index b6f4ef8ea5..62b37a8eb7 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -70,10 +70,10 @@ custom baro_corr_table_t 64 array, F32, @OFFSET@, [@@BARO_CORR_SIZE@@x@@BARO custom ignition_table_t 1024 array, F32, @OFFSET@, [16x16],"deg", 1, 0, -720, 720, 2 struct pid_s - float pFactor;;"value", 1, 0, 0, 1000, 2 - float iFactor;;"value", 1, 0, 0, 1000, 2 - float dFactor;;"value", 1, 0, 0, 1000, 2 - float offset;Linear addition to PID logic;"value", 1, 0, 0, 1000, 2 + float pFactor;;"value", 1, 0, 0, 1000, 3 + float iFactor;;"value", 1, 0, 0, 1000, 3 + float dFactor;;"value", 1, 0, 0, 1000, 3 + float offset;Linear addition to PID logic;"value", 1, 0, 0, 1000, 3 end_struct struct cranking_parameters_s diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 7d13959227..076aa744a6 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -41,7 +41,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Feb 06 08:58:48 EST 2016 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 07 21:17:35 EST 2016 pageSize = 16088 page = 1 @@ -480,10 +480,10 @@ page = 1 mapErrorDetectionTooLow = scalar, F32, 1888, "kPa", 1, 0, -100.0, 100.0, 2 mapErrorDetectionTooHigh = scalar, F32, 1892, "kPa", 1, 0, -100.0, 800.0, 2 step1RpmWindow = scalar, S32, 1896, "rpm", 1, 0, 0, 3000.0, 2 - idleRpmPid_pFactor = scalar, F32, 1900, "value", 1, 0, 0, 1000, 2 - idleRpmPid_iFactor = scalar, F32, 1904, "value", 1, 0, 0, 1000, 2 - idleRpmPid_dFactor = scalar, F32, 1908, "value", 1, 0, 0, 1000, 2 - idleRpmPid_offset = scalar, F32, 1912, "value", 1, 0, 0, 1000, 2 + idleRpmPid_pFactor = scalar, F32, 1900, "value", 1, 0, 0, 1000, 3 + idleRpmPid_iFactor = scalar, F32, 1904, "value", 1, 0, 0, 1000, 3 + idleRpmPid_dFactor = scalar, F32, 1908, "value", 1, 0, 0, 1000, 3 + idleRpmPid_offset = scalar, F32, 1912, "value", 1, 0, 0, 1000, 3 ;skipping idleDT offset 1916 ;skipping idleControl offset 1920 communicationPin = bits, U32, 1924, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" @@ -494,19 +494,19 @@ page = 1 consoleSerialRxPin = bits, U32, 1944, [0:6], "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" knockNoise = array, F32, 1948, [8], "v", 1, 0, 0.0, 10, 2 knockNoiseRpmBins = array, F32, 1980, [8], "RPM", 1, 0, 0.0, 18000, 2 - etb_pFactor = scalar, F32, 2012, "value", 1, 0, 0, 1000, 2 - etb_iFactor = scalar, F32, 2016, "value", 1, 0, 0, 1000, 2 - etb_dFactor = scalar, F32, 2020, "value", 1, 0, 0, 1000, 2 - etb_offset = scalar, F32, 2024, "value", 1, 0, 0, 1000, 2 + etb_pFactor = scalar, F32, 2012, "value", 1, 0, 0, 1000, 3 + etb_iFactor = scalar, F32, 2016, "value", 1, 0, 0, 1000, 3 + etb_dFactor = scalar, F32, 2020, "value", 1, 0, 0, 1000, 3 + etb_offset = scalar, F32, 2024, "value", 1, 0, 0, 1000, 3 cltIdleRpmBins = array, F32, 2028, [16], "C", 1, 0, -100.0, 250.0, 2 cltIdleRpm = array, F32, 2092, [16], "RPM", 1, 0, 0.0, 400.0, 0 targetVBatt = scalar, F32, 2156, "Volts", 1, 0, 0,30, 1 alternatorOffAboveTps = scalar, F32, 2160, "%", 1, 0, 0, 200, 2 alternatorDT = scalar, S32, 2164, "ms", 1, 0, 0, 3000, 0 - alternatorControl_pFactor = scalar, F32, 2168, "value", 1, 0, 0, 1000, 2 - alternatorControl_iFactor = scalar, F32, 2172, "value", 1, 0, 0, 1000, 2 - alternatorControl_dFactor = scalar, F32, 2176, "value", 1, 0, 0, 1000, 2 - alternatorControl_offset = scalar, F32, 2180, "value", 1, 0, 0, 1000, 2 + alternatorControl_pFactor = scalar, F32, 2168, "value", 1, 0, 0, 1000, 3 + alternatorControl_iFactor = scalar, F32, 2172, "value", 1, 0, 0, 1000, 3 + alternatorControl_dFactor = scalar, F32, 2176, "value", 1, 0, 0, 1000, 3 + alternatorControl_offset = scalar, F32, 2180, "value", 1, 0, 0, 1000, 3 tpsAccelLength = scalar, S32, 2184, "cycles", 1, 0, 1, 200, 0 tpsAccelEnrichmentThreshold = scalar, F32, 2188, "roc", 1, 0, 0, 200, 3 tpsAccelEnrichmentMultiplier = scalar, F32, 2192, "coeff", 1, 0, 0, 200, 3 @@ -522,11 +522,11 @@ page = 1 tpsDecelEnleanmentThreshold = scalar, F32, 2232, "roc", 1, 0, 0, 200, 3 tpsDecelEnleanmentMultiplier = scalar, F32, 2236, "coeff", 1, 0, 0, 200, 3 slowAdcAlpha = scalar, F32, 2240, "coeff", 1, 0, 0, 200, 3 - debugMode = bits, U32, 2244, [0:1], "ALTERNATOR", "TPS_ACCEL", "mode2", "mode3" - warmupAfrPid_pFactor = scalar, F32, 2248, "value", 1, 0, 0, 1000, 2 - warmupAfrPid_iFactor = scalar, F32, 2252, "value", 1, 0, 0, 1000, 2 - warmupAfrPid_dFactor = scalar, F32, 2256, "value", 1, 0, 0, 1000, 2 - warmupAfrPid_offset = scalar, F32, 2260, "value", 1, 0, 0, 1000, 2 + debugMode = bits, U32, 2244, [0:1], "ALTERNATOR", "TPS_ACCEL", "WARMUP_PID", "mode3" + warmupAfrPid_pFactor = scalar, F32, 2248, "value", 1, 0, 0, 1000, 3 + warmupAfrPid_iFactor = scalar, F32, 2252, "value", 1, 0, 0, 1000, 3 + warmupAfrPid_dFactor = scalar, F32, 2256, "value", 1, 0, 0, 1000, 3 + warmupAfrPid_offset = scalar, F32, 2260, "value", 1, 0, 0, 1000, 3 ;skipping unused offset 2264 le_formulas1 = array, U08, 3016, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas2 = array, U08, 3216, [200],"char", 1, 0, 0.0, 3.0, 2 @@ -1041,12 +1041,14 @@ fileVersion = { 20160122 } entry = wallFuelAmount, "fuel: wall amount", float, "%.3f" entry = baroCorrection, "baroCorrection",float,"%.3f" + entry = cltCorrection, "cltCorrection", float,"%.3f" - entry = debugFloatField1, "debug f1",float,"%.3f" - entry = debugFloatField2, "debug f2",float,"%.3f" - entry = debugFloatField3, "debug f3",float,"%.3f" - entry = debugFloatField4, "debug f4",float,"%.3f" - entry = debugFloatField5, "debug f5",float,"%.3f" + + entry = debugFloatField1, "debug f1",float,"%.4f" + entry = debugFloatField2, "debug f2",float,"%.4f" + entry = debugFloatField3, "debug f3",float,"%.4f" + entry = debugFloatField4, "debug f4",float,"%.4f" + entry = debugFloatField5, "debug f5",float,"%.4f" entry = debugIntField1, "debug i1",int,"%d" entry = debugIntField2, "debug i2",int,"%d" entry = debugIntField3, "debug i3",int,"%d" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 71eb267a7e..841b0d490e 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Feb 06 08:58:48 EST 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 07 21:17:35 EST 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int TS_FILE_VERSION = 20160122; @@ -1271,7 +1271,7 @@ public class Fields { public static final Field TPSDECELENLEANMENTTHRESHOLD = Field.create("TPSDECELENLEANMENTTHRESHOLD", 2232, FieldType.FLOAT); public static final Field TPSDECELENLEANMENTMULTIPLIER = Field.create("TPSDECELENLEANMENTMULTIPLIER", 2236, FieldType.FLOAT); public static final Field SLOWADCALPHA = Field.create("SLOWADCALPHA", 2240, FieldType.FLOAT); - public static final String[] debug_mode_e = {"ALTERNATOR", "TPS_ACCEL", "mode2", "mode3"}; + public static final String[] debug_mode_e = {"ALTERNATOR", "TPS_ACCEL", "WARMUP_PID", "mode3"}; public static final Field DEBUGMODE = Field.create("DEBUGMODE", 2244, FieldType.INT, debug_mode_e); public static final Field WARMUPAFRPID_PFACTOR = Field.create("WARMUPAFRPID_PFACTOR", 2248, FieldType.FLOAT); public static final Field WARMUPAFRPID_IFACTOR = Field.create("WARMUPAFRPID_IFACTOR", 2252, FieldType.FLOAT); diff --git a/java_console/ui/src/com/rusefi/ui/FuelTunePane.java b/java_console/ui/src/com/rusefi/ui/FuelTunePane.java index 7fbaad1d13..e91c7d3866 100644 --- a/java_console/ui/src/com/rusefi/ui/FuelTunePane.java +++ b/java_console/ui/src/com/rusefi/ui/FuelTunePane.java @@ -44,6 +44,8 @@ public class FuelTunePane { private final Table3D veTable = new Table3D(); private final Table3D changeMap = new Table3D(); private final JButton upload = new JButton("Upload"); + private final JCheckBox collect = new JCheckBox("enable"); + private final JButton clean = new JButton("clear"); private byte[] newVeMap; public FuelTunePane() { @@ -68,8 +70,19 @@ public class FuelTunePane { UploadChanges.scheduleUpload(ci); } }); + clean.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + synchronized (incomingDataPoints) { + incomingDataPoints.clear(); + } + } + }); + collect.setSelected(true); JPanel topPanel = new JPanel(new FlowLayout()); + topPanel.add(collect); + topPanel.add(clean); topPanel.add(incomingBufferSize); topPanel.add(runLogic); topPanel.add(upload); @@ -166,6 +179,8 @@ public class FuelTunePane { sc.addListener(Sensor.RPM, new SensorCentral.SensorListener() { @Override public void onSensorUpdate(double value) { + if (!collect.isSelected()) + return; int rpm = (int) value; double engineLoad = sc.getValue(Sensor.MAP); double afr = sc.getValue(Sensor.AFR);