auto-sync

This commit is contained in:
rusEfi 2015-11-11 23:01:18 -05:00
parent 791bb2c444
commit 9b17b963d0
9 changed files with 60 additions and 86 deletions

View File

@ -420,7 +420,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->algorithm = LM_SPEED_DENSITY;
boardConfiguration->alternatorControlPin = GPIOD_5;
engineConfiguration->alternatorControlPFactor = 22;
engineConfiguration->alternatorControl.pFactor = 22;
// engineConfiguration->isCanEnabled = true;
boardConfiguration->canTxPin = GPIOB_6;

View File

@ -72,7 +72,7 @@ void setDodgeRam1996(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->alternatorControlPin = GPIOD_7;
engineConfiguration->alternatorControlPFactor = 22;
engineConfiguration->alternatorControl.pFactor = 22;
boardConfiguration->idle.solenoidPin = GPIOC_13;
boardConfiguration->idle.solenoidFrequency = 300;

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Nov 11 21:40:26 EST 2015
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Nov 11 21:47:19 EST 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -1319,15 +1319,7 @@ typedef struct {
/**
* offset 1908
*/
float idlePFactor;
/**
* offset 1912
*/
float idleIFactor;
/**
* offset 1916
*/
float idleDFactor;
pid_s idlePid;
/**
* offset 1920
*/
@ -1371,15 +1363,7 @@ typedef struct {
/**
* offset 2016
*/
float etbPFactor;
/**
* offset 2020
*/
float etbIFactor;
/**
* offset 2024
*/
float etbDFactor;
pid_s etb;
/**
* offset 2028
*/
@ -1406,15 +1390,7 @@ typedef struct {
/**
* offset 2172
*/
float alternatorControlPFactor;
/**
* offset 2176
*/
float alternatorControlIFactor;
/**
* offset 2180
*/
float alternatorControlDFactor;
pid_s alternatorControl;
/**
* offset 2184
*/
@ -1595,4 +1571,4 @@ typedef struct {
} persistent_config_s;
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Nov 11 21:40:26 EST 2015
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Nov 11 21:47:19 EST 2015

View File

@ -668,11 +668,13 @@
#define mapErrorHighValue_offset 1900
#define step1RpmWindow_offset 1904
#define step1RpmWindow_offset_hex 770
#define idlePFactor_offset 1908
#define idlePFactor_offset_hex 774
#define idleIFactor_offset 1912
#define idleIFactor_offset_hex 778
#define idleDFactor_offset 1916
#define idlePid_offset 1908
#define idlePid_offset_hex 774
#define idlePid_pFactor_offset 1908
#define idlePid_pFactor_offset_hex 774
#define idlePid_iFactor_offset 1912
#define idlePid_iFactor_offset_hex 778
#define idlePid_dFactor_offset 1916
#define idleDT_offset 1920
#define idleDT_offset_hex 780
#define idleControl_offset 1924
@ -689,9 +691,10 @@
#define consoleSerialRxPin_offset 1948
#define knockNoiseBins_offset 1952
#define knockNoise_offset 1984
#define etbPFactor_offset 2016
#define etbIFactor_offset 2020
#define etbDFactor_offset 2024
#define etb_offset 2016
#define etb_pFactor_offset 2016
#define etb_iFactor_offset 2020
#define etb_dFactor_offset 2024
#define unused3_offset 2028
#define targetVBatt_offset 2156
#define alternatorOffAboveTps_offset 2160
@ -700,11 +703,12 @@
#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 alternatorControl_offset 2172
#define alternatorControl_pFactor_offset 2172
#define alternatorControl_iFactor_offset 2176
#define alternatorControl_iFactor_offset_hex 880
#define alternatorControl_dFactor_offset 2180
#define alternatorControl_dFactor_offset_hex 884
#define tpsAccelLength_offset 2184
#define tpsAccelLength_offset_hex 888
#define tpsAccelEnrichmentThreshold_offset 2188

View File

@ -51,21 +51,21 @@ static msg_t AltCtrlThread(int param) {
}
static void applySettings(void) {
altPid.updateFactors(engineConfiguration->alternatorControlPFactor, 0, 0);
altPid.updateFactors(engineConfiguration->alternatorControl.pFactor, 0, 0);
}
void showAltInfo(void) {
scheduleMsg(logger, "alt=%s @%s t=%dms", boolToString(engineConfiguration->isAlternatorControlEnabled),
hwPortname(boardConfiguration->alternatorControlPin),
engineConfiguration->alternatorDT);
scheduleMsg(logger, "p=%f/i=%f/d=%f offset=%f", engineConfiguration->alternatorControlPFactor,
scheduleMsg(logger, "p=%f/i=%f/d=%f offset=%f", engineConfiguration->alternatorControl.pFactor,
0, 0, engineConfiguration->alternatorOffset); // todo: i & d
scheduleMsg(logger, "vbatt=%f/duty=%f/target=%f", getVBatt(PASS_ENGINE_PARAMETER_F), currentAltDuty,
engineConfiguration->targetVBatt);
}
void setAltPFactor(float p) {
engineConfiguration->alternatorControlPFactor = p;
engineConfiguration->alternatorControl.pFactor = p;
scheduleMsg(logger, "setAltPid: %f", p);
applySettings();
showAltInfo();
@ -88,7 +88,7 @@ void setDefaultAlternatorParameters(void) {
engineConfiguration->targetVBatt = 14;
engineConfiguration->alternatorOffset = 0;
engineConfiguration->alternatorControlPFactor = 30;
engineConfiguration->alternatorControl.pFactor = 30;
engineConfiguration->alternatorDT = 100;
}

View File

@ -114,32 +114,32 @@ static void showEthInfo(void) {
scheduleMsg(&logger, "etbControlPin1=%s duty=%f", hwPortname(boardConfiguration->etbControlPin1),
currentEtbDuty);
scheduleMsg(&logger, "close dir=%s", hwPortname(boardConfiguration->etbDirectionPin2));
scheduleMsg(&logger, "etb P=%f I=%f D=%f dT=%d", engineConfiguration->etbPFactor,
engineConfiguration->etbIFactor,
scheduleMsg(&logger, "etb P=%f I=%f D=%f dT=%d", engineConfiguration->etb.pFactor,
engineConfiguration->etb.iFactor,
0.0,
boardConfiguration->etbDT);
}
static void apply(void) {
pid.updateFactors(engineConfiguration->etbPFactor, engineConfiguration->etbIFactor, 0);
pid.updateFactors(engineConfiguration->etb.pFactor, engineConfiguration->etb.iFactor, 0);
}
static void setEtbPFactor(float value) {
engineConfiguration->etbPFactor = value;
engineConfiguration->etb.pFactor = value;
apply();
showEthInfo();
}
static void setEtbIFactor(float value) {
engineConfiguration->etbIFactor = value;
engineConfiguration->etb.iFactor = value;
apply();
showEthInfo();
}
void setDefaultEtbParameters(void) {
engineConfiguration->pedalPositionMax = 6;
engineConfiguration->etbPFactor = 1;
engineConfiguration->etbIFactor = 0.5;
engineConfiguration->etb.pFactor = 1;
engineConfiguration->etb.iFactor = 0.5;
boardConfiguration->etbDT = 100;
}

View File

@ -77,9 +77,9 @@ static void showIdleInfo(void) {
hwPortname(boardConfiguration->idle.solenoidPin));
}
scheduleMsg(logger, "idleControl=%s", getIdle_control_e(engineConfiguration->idleControl));
scheduleMsg(logger, "idle P=%f I=%f D=%f dT=%d", engineConfiguration->idlePFactor,
engineConfiguration->idleIFactor,
engineConfiguration->idleDFactor,
scheduleMsg(logger, "idle P=%f I=%f D=%f dT=%d", engineConfiguration->idlePid.pFactor,
engineConfiguration->idlePid.iFactor,
engineConfiguration->idlePid.dFactor,
engineConfiguration->idleDT);
}
@ -212,19 +212,19 @@ static void apply(void) {
}
static void setIdlePFactor(float value) {
engineConfiguration->idlePFactor = value;
engineConfiguration->idlePid.pFactor = value;
apply();
showIdleInfo();
}
static void setIdleIFactor(float value) {
engineConfiguration->idleIFactor = value;
engineConfiguration->idlePid.iFactor = value;
apply();
showIdleInfo();
}
static void setIdleDFactor(float value) {
engineConfiguration->idleDFactor = value;
engineConfiguration->idlePid.dFactor = value;
apply();
showIdleInfo();
}
@ -236,9 +236,9 @@ static void setIdleDT(int value) {
}
void setDefaultIdleParameters(void) {
engineConfiguration->idlePFactor = 0.1f;
engineConfiguration->idleIFactor = 0.05f;
engineConfiguration->idleDFactor = 0.0f;
engineConfiguration->idlePid.pFactor = 0.1f;
engineConfiguration->idlePid.iFactor = 0.05f;
engineConfiguration->idlePid.dFactor = 0.0f;
engineConfiguration->idleDT = 10;
}

View File

@ -588,9 +588,7 @@ baro_corr_table_t baroCorrTable;
float mapErrorLowValue;kPa value which is too low to be true;"kPa", 1, 0, -100.0, 100.0, 2
float mapErrorHighValue;kPa value which is too high to be true;"kPa", 1, 0, -100.0, 800.0, 2
int step1RpmWindow;RPMs prior to step1rpm point where ignition advance is retarded;"rpm", 1, 0, 0, 3000.0, 2
float idlePFactor;
float idleIFactor;
float idleDFactor;
pid_s idlePid;
int idleDT;
idle_control_e idleControl;
brain_pin_e communicationPin;
@ -601,9 +599,7 @@ baro_corr_table_t baroCorrTable;
brain_pin_e consoleSerialRxPin;
float[8] knockNoiseBins;
float[8] knockNoise;
float etbPFactor;
float etbIFactor;
float etbDFactor;
pid_s etb;
int[32] unused3;
@ -611,10 +607,8 @@ float etbDFactor;
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
pid_s alternatorControl;
int tpsAccelLength;;"len", 1, 0, 1, 200, 3
float tpsAccelEnrichmentThreshold;;"roc", 1, 0, 0, 200, 3
float tpsAccelEnrichmentMultiplier;;"coeff", 1, 0, 0, 200, 3

View File

@ -40,7 +40,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 Wed Nov 11 21:40:26 EST 2015
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Nov 11 21:47:19 EST 2015
pageSize = 15288
page = 1
@ -477,9 +477,9 @@ page = 1
mapErrorLowValue = scalar, F32, 1896, "kPa", 1, 0, -100.0, 100.0, 2
mapErrorHighValue = scalar, F32, 1900, "kPa", 1, 0, -100.0, 800.0, 2
step1RpmWindow = scalar, S32, 1904, "rpm", 1, 0, 0, 3000.0, 2
;skipping idlePFactor offset 1908
;skipping idleIFactor offset 1912
;skipping idleDFactor offset 1916
idlePid_pFactor = scalar, F32, 1908, "value", 1, 0, 0, 1000, 2
idlePid_iFactor = scalar, F32, 1912, "value", 1, 0, 0, 1000, 2
idlePid_dFactor = scalar, F32, 1916, "value", 1, 0, 0, 1000, 2
;skipping idleDT offset 1920
;skipping idleControl offset 1924
communicationPin = bits, U32, 1928, [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"
@ -490,17 +490,17 @@ page = 1
consoleSerialRxPin = bits, U32, 1948, [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"
;skipping knockNoiseBins offset 1952
;skipping knockNoise offset 1984
;skipping etbPFactor offset 2016
;skipping etbIFactor offset 2020
;skipping etbDFactor offset 2024
etb_pFactor = scalar, F32, 2016, "value", 1, 0, 0, 1000, 2
etb_iFactor = scalar, F32, 2020, "value", 1, 0, 0, 1000, 2
etb_dFactor = scalar, F32, 2024, "value", 1, 0, 0, 1000, 2
;skipping unused3 offset 2028
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
alternatorOffset = scalar, F32, 2168, "%", 1, 0, 0, 100, 2
alternatorControlPFactor = scalar, F32, 2172, "value", 1, 0, 0, 1000, 2
alternatorControlIFactor = scalar, F32, 2176, "value", 1, 0, 0, 1000, 2
alternatorControlDFactor = scalar, F32, 2180, "value", 1, 0, 0, 1000, 2
alternatorControl_pFactor = scalar, F32, 2172, "value", 1, 0, 0, 1000, 2
alternatorControl_iFactor = scalar, F32, 2176, "value", 1, 0, 0, 1000, 2
alternatorControl_dFactor = scalar, F32, 2180, "value", 1, 0, 0, 1000, 2
tpsAccelLength = scalar, S32, 2184, "len", 1, 0, 1, 200, 3
tpsAccelEnrichmentThreshold = scalar, F32, 2188, "roc", 1, 0, 0, 200, 3
tpsAccelEnrichmentMultiplier = scalar, F32, 2192, "coeff", 1, 0, 0, 200, 3
@ -1329,8 +1329,8 @@ fileVersion = { 20150625 }
field = "#PID control"
field = "dTime", alternatorDT
field = "offset", alternatorOffset
field = "P factor", alternatorControlPFactor
field = "I factor", alternatorControlIFactor
field = "P factor", alternatorControl_pFactor
field = "I factor", alternatorControl_iFactor
field = "#% duty = Pterm + Iterm + Dterm + offset%"
dialog = energySystems, "Battery and Alternator Settings", yAxis