From d558b1372e3860b7dc7beb4e637f1b4634dc949a Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 18 Mar 2020 00:12:31 -0400 Subject: [PATCH] v12 & ETB progress --- .../config/boards/microrusefi/mapping.yaml | 6 ++-- firmware/config/engines/bmw_m73.cpp | 2 ++ firmware/config/engines/bmw_m73_mre.cpp | 25 ++++++++++++++ firmware/controllers/engine_controller.cpp | 2 +- java_console/ui/src/com/rusefi/Launcher.java | 2 +- .../rusefi/ui/engine/EngineSnifferPanel.java | 2 +- .../com/rusefi/ui/etb/EtbCommandsPanel.java | 33 +++++++++++++------ 7 files changed, 56 insertions(+), 16 deletions(-) diff --git a/firmware/config/boards/microrusefi/mapping.yaml b/firmware/config/boards/microrusefi/mapping.yaml index e156c7587b..cfc69e8032 100644 --- a/firmware/config/boards/microrusefi/mapping.yaml +++ b/firmware/config/boards/microrusefi/mapping.yaml @@ -52,7 +52,7 @@ analog_inputs: EFI_ADC_3: "22 - AN temp 4" # PA4 EFI_ADC_4: "28 - AN volt 10" - # PA6 + # PA6 pull-down R31 EFI_ADC_6: "26 - AN volt 2" # PA7 EFI_ADC_7: "31 - AN volt 3" @@ -64,9 +64,9 @@ analog_inputs: EFI_ADC_10: "27 - AN volt 1" # PC1 EFI_ADC_11: "Battery Sense" - # PC2 + # PC2 pull-down R131 EFI_ADC_12: "19 - AN volt 4" - # PC3 + # PC3 TPS pull-down R41 EFI_ADC_13: "20 - AN volt 5" # PC4 EFI_ADC_14: "32 - AN volt 6" diff --git a/firmware/config/engines/bmw_m73.cpp b/firmware/config/engines/bmw_m73.cpp index d438791d2e..d85b3a990e 100644 --- a/firmware/config/engines/bmw_m73.cpp +++ b/firmware/config/engines/bmw_m73.cpp @@ -4,6 +4,8 @@ * https://github.com/rusefi/rusefi_documentation/wiki/BMW_e38_750 * * https://rusefi.com/wiki/index.php?title=Hardware:OEM_connectors#134_pin + * https://github.com/rusefi/rusefi_documentation/wiki/HOWTO_electronic_throttle_body + * Ignition module https://rusefi.com/forum/viewtopic.php?f=4&t=286 * * 1/2 plugs black * 2/2 plugs grey diff --git a/firmware/config/engines/bmw_m73_mre.cpp b/firmware/config/engines/bmw_m73_mre.cpp index 4b0aa4e6db..327a9d1194 100644 --- a/firmware/config/engines/bmw_m73_mre.cpp +++ b/firmware/config/engines/bmw_m73_mre.cpp @@ -4,6 +4,8 @@ * https://github.com/rusefi/rusefi_documentation/wiki/BMW_e38_750 * * https://rusefi.com/wiki/index.php?title=Hardware:OEM_connectors#134_pin + * https://github.com/rusefi/rusefi_documentation/wiki/HOWTO_electronic_throttle_body + * Ignition module https://rusefi.com/forum/viewtopic.php?f=4&t=286 * * 1/2 plugs black * 2/2 plugs grey @@ -23,6 +25,11 @@ * * * Plug #3 52 pin + * ECU pin 2: OUT ORG injector #4 + * ECU pin 6: GND ECU + * ECU pin 15: OUT ORG injector #2 + * ECU pin 27: OUT GRN injector #6 + * ECU pin 28: OUT BLU injector #5 * ECU pin 32: IN WHT VR positive crankshaft sensor * ECU pin 40: OUT BRN/BLK GRN injector #3 * ECU pin 41: OUT BRN/WHT BLU injector #1 @@ -55,5 +62,23 @@ void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->injectionMode = IM_BATCH; + // set_analog_input_pin pps PA7 + // EFI_ADC_7: "31 - AN volt 3" - PA7 + CONFIG(throttlePedalPositionAdcChannel) = EFI_ADC_7; + + // enable ETB + // set_rpn_expression 8 "0" + setFsio(7, GPIOC_8, "0" PASS_CONFIG_PARAMETER_SUFFIX); + + + CONFIG(debugMode) = DBG_ELECTRONIC_THROTTLE_PID; + engineConfiguration->etb.pFactor = 2.00; + engineConfiguration->etb.iFactor = 0.35; + + + //set tps_min 891 + CONFIG(tpsMin) = 891; + //set tps_max 177 + CONFIG(tpsMax) = 177; } diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index ff12cb10eb..eec6b622bd 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -849,6 +849,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 201200311; + return 201200317; } #endif /* EFI_UNIT_TEST */ diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index 5ac89a5255..fc7575f9f2 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -49,7 +49,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20200311; + public static final int CONSOLE_VERSION = 20200317; public static final String INI_FILE_PATH = System.getProperty("ini_file_path", ".."); public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", ".."); public static final String TOOLS_PATH = System.getProperty("tools_path", "."); diff --git a/java_console/ui/src/com/rusefi/ui/engine/EngineSnifferPanel.java b/java_console/ui/src/com/rusefi/ui/engine/EngineSnifferPanel.java index 1d697894d6..ee1cceea6c 100644 --- a/java_console/ui/src/com/rusefi/ui/engine/EngineSnifferPanel.java +++ b/java_console/ui/src/com/rusefi/ui/engine/EngineSnifferPanel.java @@ -134,7 +134,7 @@ public class EngineSnifferPanel { if (!LinkManager.isLogViewer()) { JPanel lowerButtons = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0)); - lowerButtons.add(new ConfigField(Fields.GLOBALTRIGGERANGLEOFFSET, "Triger Offset").getContent()); + lowerButtons.add(new ConfigField(Fields.GLOBALTRIGGERANGLEOFFSET, "Trigger Offset").getContent()); lowerButtons.add(new BitConfigField(Fields.VERBOSETRIGGERSYNCHDETAILS, "Verbose trigger Sync").getContent()); lowerButtons.add(new BitConfigField(Fields.ISENGINECHARTENABLED, "Collect Engine Data").getContent()); lowerButtons.add(new ConfigField(Fields.SENSORCHARTFREQUENCY, "Frequency").getContent()); diff --git a/java_console/ui/src/com/rusefi/ui/etb/EtbCommandsPanel.java b/java_console/ui/src/com/rusefi/ui/etb/EtbCommandsPanel.java index 540ba65742..9b8ce34ccc 100644 --- a/java_console/ui/src/com/rusefi/ui/etb/EtbCommandsPanel.java +++ b/java_console/ui/src/com/rusefi/ui/etb/EtbCommandsPanel.java @@ -5,11 +5,13 @@ import com.rusefi.core.Sensor; import com.rusefi.ldmp.generated.ElectronicThrottleMeta; import com.rusefi.ui.config.BitConfigField; import com.rusefi.ui.config.ConfigField; +import com.rusefi.ui.config.EnumConfigField; import com.rusefi.ui.livedocs.LiveDocPanel; import com.rusefi.ui.storage.Node; import com.rusefi.ui.util.UiUtils; import com.rusefi.ui.widgets.AnyCommand; import com.rusefi.ui.widgets.DetachedSensor; +import org.jetbrains.annotations.NotNull; import org.putgemin.VerticalFlowLayout; import javax.swing.*; @@ -25,12 +27,6 @@ public class EtbCommandsPanel { public EtbCommandsPanel() { content.add(new DirectDrivePanel().getContent()); - JPanel spotsPane = new JPanel(new VerticalFlowLayout()); - spotsPane.setBorder(BorderFactory.createTitledBorder("Magic Spots")); - MagicSpotsFinder magicSpotsFinder = new MagicSpotsFinder(); - spotsPane.add(UiUtils.wrap(magicSpotsFinder.getButton())); - spotsPane.add(magicSpotsFinder.getPoints()); - JPanel testParameters = new JPanel(new VerticalFlowLayout()); testParameters.setBorder(BorderFactory.createTitledBorder("Try PID settings")); EtbTestSequence etbTestSequence = new EtbTestSequence(); @@ -53,16 +49,33 @@ public class EtbCommandsPanel { content.setBorder(BorderFactory.createTitledBorder("Commands")); content.add(testParameters); - content.add(spotsPane); - content.add(UiUtils.wrap(new EtbMonteCarloSequence().getButton())); - content.add(UiUtils.wrap(new EtbReturnToNeutral().getContent())); content.add(AnyCommand.createArea(new Node(), CMD_ETB_DUTY + " " + "10", false, false).getContent()); + JPanel mockPpsPanel = new JPanel(new VerticalFlowLayout()); + mockPpsPanel.setBorder(BorderFactory.createTitledBorder("Mock PPS")); + mockPpsPanel.add(DetachedSensor.createMockVoltageSlider(Sensor.PPS)); - content.add(DetachedSensor.createMockVoltageSlider(Sensor.PPS)); + + content.add(mockPpsPanel); content.add(LiveDocPanel.createPanel("ETB", ElectronicThrottleMeta.CONTENT)); + + content.add(new EnumConfigField(Fields.DEBUGMODE, "Debug Mode").getContent()); + + content.add(createMagicSpotsPanel()); + content.add(UiUtils.wrap(new EtbMonteCarloSequence().getButton())); + content.add(UiUtils.wrap(new EtbReturnToNeutral().getContent())); + } + + @NotNull + private JPanel createMagicSpotsPanel() { + JPanel spotsPane = new JPanel(new VerticalFlowLayout()); + spotsPane.setBorder(BorderFactory.createTitledBorder("Magic Spots")); + MagicSpotsFinder magicSpotsFinder = new MagicSpotsFinder(); + spotsPane.add(UiUtils.wrap(magicSpotsFinder.getButton())); + spotsPane.add(magicSpotsFinder.getPoints()); + return spotsPane; } public JComponent getContent() {