auto-sync
This commit is contained in:
parent
7bff37858f
commit
020228c058
|
@ -26,5 +26,6 @@ ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
|
|||
$(PROJECT_DIR)/config/engines/test_engine.cpp \
|
||||
$(PROJECT_DIR)/config/engines/mitsubishi.cpp \
|
||||
$(PROJECT_DIR)/config/engines/gm_2_2.cpp \
|
||||
$(PROJECT_DIR)/config/engines/dodge_ram.cpp
|
||||
$(PROJECT_DIR)/config/engines/dodge_ram.cpp \
|
||||
$(PROJECT_DIR)/config/engines/vw.cpp
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* @file vw.cpp
|
||||
*
|
||||
* set_engine_type 32
|
||||
*
|
||||
* @date May 24, 2015
|
||||
* @author Andrey Belomutskiy, (c) 2012-2015
|
||||
*/
|
||||
|
||||
#include "main.h"
|
||||
#include "vw.h"
|
||||
#include "custom_engine.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* @file vw.h
|
||||
*
|
||||
* @date May 24, 2015
|
||||
* @author Andrey Belomutskiy, (c) 2012-2015
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ENGINES_VW_H_
|
||||
#define CONFIG_ENGINES_VW_H_
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
void setVwAba(DECLARE_ENGINE_PARAMETER_F);
|
||||
|
||||
#endif /* CONFIG_ENGINES_VW_H_ */
|
|
@ -78,6 +78,8 @@ case SUBARU_2003_WRX:
|
|||
return "SUBARU_2003_WRX";
|
||||
case TEST_ENGINE:
|
||||
return "TEST_ENGINE";
|
||||
case VW_ABA:
|
||||
return "VW_ABA";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "sachs.h"
|
||||
#include "gm_2_2.h"
|
||||
#include "dodge_ram.h"
|
||||
#include "vw.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
|
@ -363,7 +364,6 @@ 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;
|
||||
|
@ -692,6 +692,9 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
case DODGE_RAM:
|
||||
setDodgeRam1996(PASS_ENGINE_PARAMETER_F);
|
||||
break;
|
||||
case VW_ABA:
|
||||
setVwAba(PASS_ENGINE_PARAMETER_F);
|
||||
break;
|
||||
case TEST_ENGINE:
|
||||
setTestEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated by config_definition.jar on Sun May 24 09:49:35 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sun May 24 11:16:32 EDT 2015
|
||||
// begin
|
||||
#include "rusefi_types.h"
|
||||
typedef struct {
|
||||
|
@ -396,11 +396,7 @@ typedef struct {
|
|||
/**
|
||||
* offset 232
|
||||
*/
|
||||
float unusedADC[15];
|
||||
/**
|
||||
* offset 292
|
||||
*/
|
||||
float targetVBatt;
|
||||
float unusedADC[16];
|
||||
/**
|
||||
* offset 296
|
||||
*/
|
||||
|
@ -565,10 +561,9 @@ typedef struct {
|
|||
*/
|
||||
brain_pin_e hip9011IntHoldPin;
|
||||
/**
|
||||
* Turn off alternator output above specified TPS
|
||||
* offset 656
|
||||
*/
|
||||
float alternatorOffAboveTps;
|
||||
int unused113234;
|
||||
/**
|
||||
* offset 660
|
||||
*/
|
||||
|
@ -662,7 +657,7 @@ typedef struct {
|
|||
/**
|
||||
* offset 868
|
||||
*/
|
||||
int alternatorDT;
|
||||
int unused2342342;
|
||||
/** total size 872*/
|
||||
} board_configuration_s;
|
||||
|
||||
|
@ -939,7 +934,7 @@ typedef struct {
|
|||
/**
|
||||
* offset 604
|
||||
*/
|
||||
float alternatorOffset;
|
||||
int unused123;
|
||||
/**
|
||||
* @see hasBaroSensor
|
||||
* offset 608
|
||||
|
@ -1125,15 +1120,7 @@ typedef struct {
|
|||
/**
|
||||
* offset 1624
|
||||
*/
|
||||
float alternatorControlPFactor;
|
||||
/**
|
||||
* offset 1628
|
||||
*/
|
||||
float alternatorControlIFactor;
|
||||
/**
|
||||
* offset 1632
|
||||
*/
|
||||
float alternatorControlDFactor;
|
||||
int unsed2342342[3];
|
||||
/**
|
||||
* offset 1636
|
||||
*/
|
||||
|
@ -1165,7 +1152,38 @@ typedef struct {
|
|||
/**
|
||||
* offset 1748
|
||||
*/
|
||||
int unused3[109];
|
||||
int unused3[102];
|
||||
/**
|
||||
* offset 2156
|
||||
*/
|
||||
float targetVBatt;
|
||||
/**
|
||||
* Turn off alternator output above specified TPS
|
||||
* offset 2160
|
||||
*/
|
||||
float alternatorOffAboveTps;
|
||||
/**
|
||||
* PID dTime
|
||||
* offset 2164
|
||||
*/
|
||||
int alternatorDT;
|
||||
/**
|
||||
* Linear addition to PID logic
|
||||
* offset 2168
|
||||
*/
|
||||
float alternatorOffset;
|
||||
/**
|
||||
* offset 2172
|
||||
*/
|
||||
float alternatorControlPFactor;
|
||||
/**
|
||||
* offset 2176
|
||||
*/
|
||||
float alternatorControlIFactor;
|
||||
/**
|
||||
* offset 2180
|
||||
*/
|
||||
float alternatorControlDFactor;
|
||||
/**
|
||||
* offset 2184
|
||||
*/
|
||||
|
@ -1345,4 +1363,4 @@ typedef struct {
|
|||
} persistent_config_s;
|
||||
|
||||
// end
|
||||
// this section was generated by config_definition.jar on Sun May 24 09:49:35 EDT 2015
|
||||
// this section was generated by config_definition.jar on Sun May 24 11:16:32 EDT 2015
|
||||
|
|
|
@ -99,7 +99,9 @@ typedef enum {
|
|||
|
||||
DODGE_RAM = 31,
|
||||
|
||||
ET_UNUSED = 32,
|
||||
VW_ABA = 32,
|
||||
|
||||
ET_UNUSED = 33,
|
||||
|
||||
Force_4b_engine_type = ENUM_32_BITS,
|
||||
} engine_type_e;
|
||||
|
|
|
@ -196,7 +196,7 @@
|
|||
#define afr_v2_offset_hex 254
|
||||
#define afr_value2_offset 600
|
||||
#define afr_value2_offset_hex 258
|
||||
#define alternatorOffset_offset 604
|
||||
#define unused123_offset 604
|
||||
#define baroSensor_offset 608
|
||||
#define baroSensor_offset_hex 260
|
||||
#define baroSensor_valueAt0_offset 608
|
||||
|
@ -296,8 +296,6 @@
|
|||
#define digitalPotentiometerChipSelect4_offset_hex 354
|
||||
#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
|
||||
|
@ -437,8 +435,8 @@
|
|||
#define fsioFrequency16_offset 1270
|
||||
#define hip9011CsPin_offset 1272
|
||||
#define hip9011IntHoldPin_offset 1276
|
||||
#define alternatorOffAboveTps_offset 1280
|
||||
#define alternatorOffAboveTps_offset_hex 500
|
||||
#define unused113234_offset 1280
|
||||
#define unused113234_offset_hex 500
|
||||
#define fsio_setting1_offset 1284
|
||||
#define fsio_setting1_offset_hex 504
|
||||
#define fsio_setting2_offset 1288
|
||||
|
@ -520,7 +518,7 @@
|
|||
#define fsioDigitalInputs14_offset 1480
|
||||
#define fsioDigitalInputs15_offset 1484
|
||||
#define fsioDigitalInputs16_offset 1488
|
||||
#define alternatorDT_offset 1492
|
||||
#define unused2342342_offset 1492
|
||||
#define hasMapSensor_offset 1496
|
||||
#define hasIatSensor_offset 1496
|
||||
#define hasBaroSensor_offset 1496
|
||||
|
@ -603,11 +601,8 @@
|
|||
#define fsioInputModes16_offset_hex 650
|
||||
#define externalKnockSenseAdc_offset 1620
|
||||
#define externalKnockSenseAdc_offset_hex 654
|
||||
#define alternatorControlPFactor_offset 1624
|
||||
#define alternatorControlPFactor_offset_hex 658
|
||||
#define alternatorControlIFactor_offset 1628
|
||||
#define alternatorControlDFactor_offset 1632
|
||||
#define alternatorControlDFactor_offset_hex 660
|
||||
#define unsed2342342_offset 1624
|
||||
#define unsed2342342_offset_hex 658
|
||||
#define idleStepperTotalSteps_offset 1636
|
||||
#define idleStepperTotalSteps_offset_hex 664
|
||||
#define stepperEnablePin_offset 1640
|
||||
|
@ -622,6 +617,18 @@
|
|||
#define baroCorrTable_offset 1684
|
||||
#define baroCorrTable_offset_hex 694
|
||||
#define unused3_offset 1748
|
||||
#define targetVBatt_offset 2156
|
||||
#define alternatorOffAboveTps_offset 2160
|
||||
#define alternatorOffAboveTps_offset_hex 870
|
||||
#define alternatorDT_offset 2164
|
||||
#define alternatorDT_offset_hex 874
|
||||
#define alternatorOffset_offset 2168
|
||||
#define alternatorOffset_offset_hex 878
|
||||
#define alternatorControlPFactor_offset 2172
|
||||
#define alternatorControlIFactor_offset 2176
|
||||
#define alternatorControlIFactor_offset_hex 880
|
||||
#define alternatorControlDFactor_offset 2180
|
||||
#define alternatorControlDFactor_offset_hex 884
|
||||
#define tpsAccelLength_offset 2184
|
||||
#define tpsAccelLength_offset_hex 888
|
||||
#define tpsAccelEnrichmentThreshold_offset 2188
|
||||
|
|
|
@ -34,9 +34,9 @@ static float currentAltDuty;
|
|||
static msg_t AltCtrlThread(int param) {
|
||||
chRegSetThreadName("AlternatorController");
|
||||
while (true) {
|
||||
chThdSleepMilliseconds(boardConfiguration->alternatorDT);
|
||||
chThdSleepMilliseconds(engineConfiguration->alternatorDT);
|
||||
|
||||
currentAltDuty = engineConfiguration->alternatorOffset + altPid.getValue(boardConfiguration->targetVBatt, getVBatt(PASS_ENGINE_PARAMETER_F), 1);
|
||||
currentAltDuty = engineConfiguration->alternatorOffset + altPid.getValue(engineConfiguration->targetVBatt, getVBatt(PASS_ENGINE_PARAMETER_F), 1);
|
||||
if (boardConfiguration->isVerboseAlternator) {
|
||||
scheduleMsg(logger, "alt duty: %f/vbatt=%f/p=%f/i=%f/d=%f int=%f", currentAltDuty, getVBatt(PASS_ENGINE_PARAMETER_F),
|
||||
altPid.getP(), altPid.getI(), altPid.getD(), altPid.getIntegration());
|
||||
|
@ -56,11 +56,11 @@ static void applySettings(void) {
|
|||
void showAltInfo(void) {
|
||||
scheduleMsg(logger, "alt=%s @%s t=%dms", boolToString(engineConfiguration->isAlternatorControlEnabled),
|
||||
hwPortname(boardConfiguration->alternatorControlPin),
|
||||
boardConfiguration->alternatorDT);
|
||||
engineConfiguration->alternatorDT);
|
||||
scheduleMsg(logger, "p=%f/i=%f/d=%f offset=%f", engineConfiguration->alternatorControlPFactor,
|
||||
0, 0, engineConfiguration->alternatorOffset); // todo: i & d
|
||||
scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(PASS_ENGINE_PARAMETER_F), currentAltDuty,
|
||||
boardConfiguration->targetVBatt);
|
||||
engineConfiguration->targetVBatt);
|
||||
}
|
||||
|
||||
void setAltPFactor(float p) {
|
||||
|
@ -80,14 +80,15 @@ static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
|
|||
}
|
||||
|
||||
void setDefaultAlternatorParameters(void) {
|
||||
boardConfiguration->alternatorOffAboveTps = 120;
|
||||
engineConfiguration->alternatorOffAboveTps = 120;
|
||||
|
||||
boardConfiguration->alternatorControlPin = GPIO_UNASSIGNED;
|
||||
boardConfiguration->alternatorControlPinMode = OM_DEFAULT;
|
||||
engineConfiguration->targetVBatt = 14;
|
||||
|
||||
engineConfiguration->alternatorOffset = 0;
|
||||
engineConfiguration->alternatorControlPFactor = 30;
|
||||
boardConfiguration->alternatorDT = 100;
|
||||
engineConfiguration->alternatorDT = 100;
|
||||
}
|
||||
|
||||
void initAlternatorCtrl(Logging *sharedLogger) {
|
||||
|
|
|
@ -21,12 +21,9 @@
|
|||
#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__)
|
||||
|
||||
#include "engine_controller.h"
|
||||
|
||||
#include "datalogging.h"
|
||||
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
static bool needToWriteConfiguration = false;
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
#ifndef FLASH_MAIN_H_
|
||||
#define FLASH_MAIN_H_
|
||||
|
||||
#include "engine_configuration.h"
|
||||
#include "engine.h"
|
||||
|
||||
#define FLASH_DATA_VERSION 8100
|
||||
#define FLASH_DATA_VERSION 8201
|
||||
|
||||
void readFromFlash(void);
|
||||
void initFlash(Logging *sharedLogger, Engine *engine);
|
||||
|
|
|
@ -171,6 +171,8 @@ const char* getConfigurationName(engine_type_e engineType) {
|
|||
return "BMWe34";
|
||||
case TEST_ENGINE:
|
||||
return "Test";
|
||||
case VW_ABA:
|
||||
return "VW_ABA";
|
||||
case SACHS:
|
||||
return "SACHS";
|
||||
case GM_2_2:
|
||||
|
@ -946,7 +948,7 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
#if EFI_PROD_CODE
|
||||
} else if (strEqualCaseInsensitive(paramStr, "alt_t")) {
|
||||
if (valueI > 10) {
|
||||
boardConfiguration->alternatorDT = valueI;
|
||||
engineConfiguration->alternatorDT = valueI;
|
||||
}
|
||||
showAltInfo();
|
||||
} else if (strEqualCaseInsensitive(paramStr, "alt_offset")) {
|
||||
|
@ -955,7 +957,7 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
setAltPFactor(valueF);
|
||||
#endif
|
||||
} else if (strEqualCaseInsensitive(paramStr, "targetvbatt")) {
|
||||
boardConfiguration->targetVBatt = valueF;
|
||||
engineConfiguration->targetVBatt = valueF;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ end_struct
|
|||
|
||||
afr_sensor_s afr;@see hasAfrSensor
|
||||
|
||||
float alternatorOffset;
|
||||
int unused123;
|
||||
|
||||
air_pressure_sensor_config_s baroSensor;@see hasBaroSensor
|
||||
|
||||
|
@ -351,8 +351,7 @@ 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"
|
||||
float[15] unusedADC;
|
||||
float targetVBatt;
|
||||
float[16] unusedADC;
|
||||
|
||||
|
||||
brain_input_pin_e[3 iterate] triggerInputPins;
|
||||
|
@ -419,8 +418,7 @@ custom fsio_pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0,
|
|||
|
||||
brain_pin_e hip9011CsPin;
|
||||
brain_pin_e hip9011IntHoldPin;
|
||||
float alternatorOffAboveTps;Turn off alternator output above specified TPS;"%", 1, 0, 0, 200, 2
|
||||
|
||||
int unused113234;
|
||||
custom fsio_setting_t 4 scalar, F32, @OFFSET@, "Val", 1, 0, 0, 18000, 0
|
||||
fsio_setting_t[LE_COMMAND_COUNT iterate] fsio_setting;
|
||||
brain_pin_e spi1mosiPin;
|
||||
|
@ -450,7 +448,7 @@ brain_input_pin_e vehicleSpeedSensorInputPin;
|
|||
pin_input_mode_e clutchUpPinMode;
|
||||
brain_pin_e[LE_COMMAND_COUNT iterate] fsioDigitalInputs;These input pins allow us to pull toggle buttons state;
|
||||
|
||||
int alternatorDT;
|
||||
int unused2342342;
|
||||
|
||||
|
||||
end_struct
|
||||
|
@ -526,9 +524,7 @@ custom pin_input_mode_e 4 scalar, F32, @OFFSET@, "ms", 1, 0, 0, 200, 1
|
|||
pin_input_mode_e[LE_COMMAND_COUNT iterate] fsioInputModes;
|
||||
|
||||
adc_channel_e externalKnockSenseAdc;
|
||||
float alternatorControlPFactor;
|
||||
float alternatorControlIFactor;
|
||||
float alternatorControlDFactor;
|
||||
int[3] unsed2342342;
|
||||
int idleStepperTotalSteps;;"count", 1, 0, 5, 3000, 0
|
||||
brain_pin_e stepperEnablePin;
|
||||
|
||||
|
@ -540,7 +536,15 @@ float[BARO_CORR_SIZE] baroCorrPressureBins;;"kPa", 1, 0, 0.0, 200,
|
|||
float[BARO_CORR_SIZE] baroCorrRpmBins;;"RPM", 1, 0, 0.0, 18000, 2
|
||||
|
||||
baro_corr_table_t baroCorrTable;
|
||||
int[109] unused3;
|
||||
int[102] unused3;
|
||||
|
||||
float targetVBatt;;"Volts", 1, 0, 0,30, 1
|
||||
float alternatorOffAboveTps;Turn off alternator output above specified TPS;"%", 1, 0, 0, 200, 2
|
||||
int alternatorDT;PID dTime;"ms", 1, 0, 0, 3000, 0
|
||||
float alternatorOffset;Linear addition to PID logic;"%", 1, 0, 0, 100, 2
|
||||
float alternatorControlPFactor;;"value", 1, 0, 0, 1000, 2
|
||||
float alternatorControlIFactor;;"value", 1, 0, 0, 1000, 2
|
||||
float alternatorControlDFactor;;"value", 1, 0, 0, 1000, 2
|
||||
|
||||
int tpsAccelLength;;"len", 1, 0, 1, 200, 3
|
||||
float tpsAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3
|
||||
|
|
|
@ -291,5 +291,5 @@ int getRusEfiVersion(void) {
|
|||
return 123; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||
return 3211; // this is here to make the compiler happy about the unused array
|
||||
return 20150523;
|
||||
return 20150524;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// This file was generated by Version2Header
|
||||
// Wed Apr 29 20:09:03 EDT 2015
|
||||
// Sun May 24 11:32:47 EDT 2015
|
||||
#ifndef VCS_VERSION
|
||||
#define VCS_VERSION "7963"
|
||||
#define VCS_VERSION "8220"
|
||||
#endif
|
||||
|
|
|
@ -543,6 +543,8 @@ void testTriggerDecoder(void) {
|
|||
testTriggerDecoder3("neon NGC", DODGE_NEON_2003, 0, 0.4786, 0.0, CHRYSLER_NGC_GAP);
|
||||
testTriggerDecoder2("sachs", SACHS, 0, 0.4800, 0.000);
|
||||
|
||||
testTriggerDecoder2("vw ABA", VW_ABA, 0, 0.7500, 0.25);
|
||||
|
||||
testMazda323();
|
||||
|
||||
testStartupFuelPumping();
|
||||
|
|
Loading…
Reference in New Issue