auto-sync
This commit is contained in:
parent
15d66ea45e
commit
3de8376079
|
@ -399,6 +399,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
engineConfiguration->canReadEnabled = false;
|
engineConfiguration->canReadEnabled = false;
|
||||||
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
||||||
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
// engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
||||||
|
|
||||||
|
|
||||||
|
engineConfiguration->accelLength = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EFI_SUPPORT_DODGE_NEON */
|
#endif /* EFI_SUPPORT_DODGE_NEON */
|
||||||
|
|
|
@ -22,29 +22,52 @@ EXTERN_ENGINE
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
static AccelEnrichmemnt instance;
|
static AccelEnrichmemnt instance;
|
||||||
|
static Logging *logger;
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
|
|
||||||
|
static void accelInfo() {
|
||||||
|
scheduleMsg(logger, "accel length=%d", instance.cb.getSize());
|
||||||
|
scheduleMsg(logger, "accel th=%f/mult=%f", engineConfiguration->accelEnrichmentThreshold, engineConfiguration->accelEnrichmentMultiplier);
|
||||||
|
scheduleMsg(logger, "decel th=%f/mult=%f", engineConfiguration->decelEnrichmentThreshold, engineConfiguration->decelEnrichmentMultiplier);
|
||||||
|
}
|
||||||
|
|
||||||
static void setAccelThr(float value) {
|
static void setAccelThr(float value) {
|
||||||
engineConfiguration->accelEnrichmentThreshold = value;
|
engineConfiguration->accelEnrichmentThreshold = value;
|
||||||
|
accelInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setAccelMult(float value) {
|
static void setAccelMult(float value) {
|
||||||
engineConfiguration->accelEnrichmentMultiplier = value;
|
engineConfiguration->accelEnrichmentMultiplier = value;
|
||||||
|
accelInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setDecelThr(float value) {
|
static void setDecelThr(float value) {
|
||||||
engineConfiguration->deaccelEnrichmentThreshold = value;
|
engineConfiguration->decelEnrichmentThreshold = value;
|
||||||
|
accelInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setDecelMult(float value) {
|
static void setDecelMult(float value) {
|
||||||
engineConfiguration->deaccelEnrichmentMultiplier = value;
|
engineConfiguration->decelEnrichmentMultiplier = value;
|
||||||
|
accelInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void initAccelEnrichment(void) {
|
static void setAccelLen(int len) {
|
||||||
|
instance.cb.setSize(len);
|
||||||
|
accelInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void initAccelEnrichment(Logging *sharedLogger) {
|
||||||
|
logger = sharedLogger;
|
||||||
addConsoleActionF("set_accel_th", setAccelThr);
|
addConsoleActionF("set_accel_th", setAccelThr);
|
||||||
addConsoleActionF("set_accel_mult", setAccelMult);
|
addConsoleActionF("set_accel_mult", setAccelMult);
|
||||||
addConsoleActionF("set_decel_th", setDecelThr);
|
addConsoleActionF("set_decel_th", setDecelThr);
|
||||||
addConsoleActionF("set_decel_mult", setDecelMult);
|
addConsoleActionF("set_decel_mult", setDecelMult);
|
||||||
|
addConsoleActionI("set_accel_len", setAccelLen);
|
||||||
|
addConsoleAction("accelinfo", accelInfo);
|
||||||
|
|
||||||
|
setAccelLen(engineConfiguration->accelLength);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* ! EFI_UNIT_TEST */
|
#endif /* ! EFI_UNIT_TEST */
|
||||||
|
|
||||||
|
@ -63,13 +86,13 @@ void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfig
|
||||||
//}
|
//}
|
||||||
|
|
||||||
float AccelEnrichmemnt::getEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
float AccelEnrichmemnt::getEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
float d = delta;
|
float d = cb.maxValue(cb.getSize());
|
||||||
if (d > engineConfiguration->accelEnrichmentThreshold) {
|
if (d > engineConfiguration->accelEnrichmentThreshold) {
|
||||||
return d * engineConfiguration->accelEnrichmentMultiplier;
|
return d * engineConfiguration->accelEnrichmentMultiplier;
|
||||||
}
|
}
|
||||||
if (d < engineConfiguration->deaccelEnrichmentThreshold) {
|
// if (d < engineConfiguration->deaccelEnrichmentThreshold) {
|
||||||
return d * engineConfiguration->deaccelEnrichmentMultiplier;
|
// return d * engineConfiguration->deaccelEnrichmentMultiplier;
|
||||||
}
|
// }
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +108,7 @@ void AccelEnrichmemnt::onEngineCycle(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
|
|
||||||
if (!cisnan(this->currentEngineLoad)) {
|
if (!cisnan(this->currentEngineLoad)) {
|
||||||
delta = currentEngineLoad - this->currentEngineLoad;
|
delta = currentEngineLoad - this->currentEngineLoad;
|
||||||
|
cb.add(delta);
|
||||||
maxDelta = maxF(maxDelta, delta);
|
maxDelta = maxF(maxDelta, delta);
|
||||||
minDelta = minF(minDelta, delta);
|
minDelta = minF(minDelta, delta);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,14 +29,14 @@ public:
|
||||||
float maxDelta;
|
float maxDelta;
|
||||||
float minDelta;
|
float minDelta;
|
||||||
float delta;
|
float delta;
|
||||||
|
cyclic_buffer<float> cb;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// float array[MAX_ACCEL_ARRAY_SIZE];
|
// float array[MAX_ACCEL_ARRAY_SIZE];
|
||||||
float diffEnrichment;
|
float diffEnrichment;
|
||||||
cyclic_buffer<float> cb;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void initAccelEnrichment(void);
|
void initAccelEnrichment(Logging *sharedLogger);
|
||||||
float getAccelEnrichment(void);
|
float getAccelEnrichment(void);
|
||||||
|
|
||||||
#endif /* ACC_ENRICHMENT_H_ */
|
#endif /* ACC_ENRICHMENT_H_ */
|
||||||
|
|
|
@ -545,7 +545,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
boardConfiguration->isFastAdcEnabled = true;
|
boardConfiguration->isFastAdcEnabled = true;
|
||||||
boardConfiguration->isEngineControlEnabled = true;
|
boardConfiguration->isEngineControlEnabled = true;
|
||||||
|
|
||||||
boardConfiguration->isVerboseAlternator = true;
|
boardConfiguration->isVerboseAlternator = false;
|
||||||
|
|
||||||
boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// this section was generated by config_definition.jar on Sun Mar 22 19:43:37 EDT 2015
|
// this section was generated by config_definition.jar on Sat Mar 28 17:28:27 EDT 2015
|
||||||
// begin
|
// begin
|
||||||
#include "rusefi_types.h"
|
#include "rusefi_types.h"
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -1100,11 +1100,11 @@ typedef struct {
|
||||||
/**
|
/**
|
||||||
* offset 5784
|
* offset 5784
|
||||||
*/
|
*/
|
||||||
float deaccelEnrichmentThreshold;
|
float decelEnrichmentThreshold;
|
||||||
/**
|
/**
|
||||||
* offset 5788
|
* offset 5788
|
||||||
*/
|
*/
|
||||||
float deaccelEnrichmentMultiplier;
|
float decelEnrichmentMultiplier;
|
||||||
/**
|
/**
|
||||||
* offset 5792
|
* offset 5792
|
||||||
*/
|
*/
|
||||||
|
@ -1196,4 +1196,4 @@ typedef struct {
|
||||||
} engine_configuration_s;
|
} engine_configuration_s;
|
||||||
|
|
||||||
// end
|
// end
|
||||||
// this section was generated by config_definition.jar on Sun Mar 22 19:43:37 EDT 2015
|
// this section was generated by config_definition.jar on Sat Mar 28 17:28:27 EDT 2015
|
||||||
|
|
|
@ -516,6 +516,8 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
||||||
|
|
||||||
addConsoleAction("analoginfo", printAnalogInfo);
|
addConsoleAction("analoginfo", printAnalogInfo);
|
||||||
|
|
||||||
|
initAccelEnrichment(sharedLogger);
|
||||||
|
|
||||||
initConfigActions();
|
initConfigActions();
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
addConsoleAction("reset_accel", resetAccel);
|
addConsoleAction("reset_accel", resetAccel);
|
||||||
|
|
Loading…
Reference in New Issue