mirror of https://github.com/rusefi/rusefi.git
parent
71799f3f3d
commit
83f8b168f6
|
@ -235,9 +235,9 @@ void EtbController::onConfigurationChange(pid_s* previousConfiguration) {
|
|||
if (m_motor && !m_pid.isSame(previousConfiguration)) {
|
||||
m_shouldResetPid = true;
|
||||
}
|
||||
m_dutyRocAverage.init(engineConfiguration->etbRocExpAverageLength);
|
||||
m_dutyAverage.init(engineConfiguration->etbExpAverageLength);
|
||||
doInitElectronicThrottle();
|
||||
m_dutyRocAverage.init(engineConfiguration->etbRocExpAverageLength);
|
||||
m_dutyAverage.init(engineConfiguration->etbExpAverageLength);
|
||||
doInitElectronicThrottle();
|
||||
}
|
||||
|
||||
void EtbController::showStatus() {
|
||||
|
@ -321,9 +321,9 @@ expected<percent_t> EtbController::getSetpointEtb() {
|
|||
percent_t targetPosition = idlePosition + getLuaAdjustment();
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
targetPosition += engineConfiguration->ALSEtbAdd;
|
||||
}
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
targetPosition += engineConfiguration->ALSEtbAdd;
|
||||
}
|
||||
#endif /* EFI_ANTILAG_SYSTEM */
|
||||
|
||||
// Apply any adjustment that this throttle alone needs
|
||||
|
@ -401,7 +401,7 @@ expected<percent_t> EtbController::getOpenLoop(percent_t target) {
|
|||
&& m_function != DC_IdleValve) {
|
||||
etbFeedForward = interpolate2d(target, config->etbBiasBins, config->etbBiasValues);
|
||||
} else {
|
||||
etbFeedForward = 0;
|
||||
etbFeedForward = 0;
|
||||
}
|
||||
|
||||
return etbFeedForward;
|
||||
|
@ -566,10 +566,10 @@ bool EtbController::checkStatus() {
|
|||
#endif /* EFI_TUNER_STUDIO */
|
||||
|
||||
if (!isEtbMode()) {
|
||||
// no validation for h-bridge or idle mode
|
||||
return true;
|
||||
}
|
||||
// ETB-specific code belo. The whole mix-up between DC and ETB is shameful :(
|
||||
// no validation for h-bridge or idle mode
|
||||
return true;
|
||||
}
|
||||
// ETB-specific code belo. The whole mix-up between DC and ETB is shameful :(
|
||||
|
||||
m_pid.iTermMin = engineConfiguration->etb_iTermMin;
|
||||
m_pid.iTermMax = engineConfiguration->etb_iTermMax;
|
||||
|
@ -621,7 +621,7 @@ bool EtbController::checkStatus() {
|
|||
|
||||
etbErrorCode = (int8_t)localReason;
|
||||
|
||||
return localReason == TpsState::None;
|
||||
return localReason == TpsState::None;
|
||||
}
|
||||
|
||||
void EtbController::update() {
|
||||
|
@ -638,7 +638,7 @@ void EtbController::update() {
|
|||
return;
|
||||
}
|
||||
|
||||
bool isOk = checkStatus();
|
||||
bool isOk = checkStatus();
|
||||
|
||||
if (!isOk) {
|
||||
// If engine is stopped and so configured, skip the ETB update entirely
|
||||
|
|
|
@ -94,13 +94,13 @@ private:
|
|||
// todo: rename to m_targetErrorAccumulator
|
||||
ErrorAccumulator m_errorAccumulator;
|
||||
|
||||
/**
|
||||
* @return true if OK, false if should be disabled
|
||||
*/
|
||||
bool checkStatus();
|
||||
bool isEtbMode() {
|
||||
return m_function == DC_Throttle1 || m_function == DC_Throttle2;
|
||||
}
|
||||
/**
|
||||
* @return true if OK, false if should be disabled
|
||||
*/
|
||||
bool checkStatus();
|
||||
bool isEtbMode() {
|
||||
return m_function == DC_Throttle1 || m_function == DC_Throttle2;
|
||||
}
|
||||
|
||||
ExpAverage m_dutyRocAverage;
|
||||
ExpAverage m_dutyAverage;
|
||||
|
|
|
@ -317,7 +317,7 @@ float IdleController::getIdlePosition(float rpm) {
|
|||
|
||||
bool isAutomaticIdle = tps.Valid && engineConfiguration->idleMode == IM_AUTO;
|
||||
|
||||
isVerboseIAC = engineConfiguration->isVerboseIAC && isAutomaticIdle;
|
||||
isVerboseIAC = engineConfiguration->isVerboseIAC && isAutomaticIdle;
|
||||
if (isVerboseIAC) {
|
||||
efiPrintf("Idle state %s", getIdle_state_e(idleState));
|
||||
getIdlePid()->showPidStatus("idle");
|
||||
|
|
|
@ -159,9 +159,9 @@ void stopVvtControlPins() {
|
|||
}
|
||||
|
||||
void initVvtActuators() {
|
||||
if (engineConfiguration->vvtControlMinRpm < engineConfiguration->cranking.rpm) {
|
||||
engineConfiguration->vvtControlMinRpm = engineConfiguration->cranking.rpm;
|
||||
}
|
||||
if (engineConfiguration->vvtControlMinRpm < engineConfiguration->cranking.rpm) {
|
||||
engineConfiguration->vvtControlMinRpm = engineConfiguration->cranking.rpm;
|
||||
}
|
||||
|
||||
vvtTable1.init(config->vvtTable1, config->vvtTable1LoadBins,
|
||||
config->vvtTable1RpmBins);
|
||||
|
|
|
@ -54,15 +54,15 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
|
|||
);
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
|
||||
engine->antilagController.timingALSCorrection = interpolate3d(
|
||||
config->ALSTimingRetardTable,
|
||||
config->alsIgnRetardLoadBins, throttleIntent,
|
||||
config->alsIgnRetardrpmBins, rpm
|
||||
);
|
||||
advanceAngle += engine->antilagController.timingALSCorrection;
|
||||
}
|
||||
}
|
||||
#endif /* EFI_ANTILAG_SYSTEM */
|
||||
|
||||
// Add any adjustments if configured
|
||||
|
@ -79,7 +79,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
|
|||
// get advance from the separate table for Idle
|
||||
#if EFI_IDLE_CONTROL
|
||||
if (engineConfiguration->useSeparateAdvanceForIdle &&
|
||||
engine->module<IdleController>()->isIdlingOrTaper()) {
|
||||
engine->module<IdleController>()->isIdlingOrTaper()) {
|
||||
float idleAdvance = interpolate2d(rpm, config->idleAdvanceBins, config->idleAdvance);
|
||||
|
||||
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
|
||||
|
@ -92,15 +92,15 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
|
|||
|
||||
#if EFI_LAUNCH_CONTROL
|
||||
if (engine->launchController.isLaunchCondition && engineConfiguration->enableLaunchRetard) {
|
||||
if (engineConfiguration->launchSmoothRetard) {
|
||||
float launchAngle = engineConfiguration->launchTimingRetard;
|
||||
int launchRpm = engineConfiguration->launchRpm;
|
||||
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
|
||||
if (engineConfiguration->launchSmoothRetard) {
|
||||
float launchAngle = engineConfiguration->launchTimingRetard;
|
||||
int launchRpm = engineConfiguration->launchRpm;
|
||||
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
|
||||
// interpolate timing from rpm at launch triggered to full retard at launch launchRpm + launchTimingRpmRange
|
||||
return interpolateClamped(launchRpm, advanceAngle, launchRpmWithTimingRange, launchAngle, rpm);
|
||||
} else {
|
||||
return engineConfiguration->launchTimingRetard;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* EFI_LAUNCH_CONTROL */
|
||||
|
||||
|
|
|
@ -396,17 +396,17 @@ float getBaroCorrection() {
|
|||
|
||||
percent_t getFuelALSCorrection(int rpm) {
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
|
||||
auto AlsFuelAdd = interpolate3d(
|
||||
if (engine->antilagController.isAntilagCondition) {
|
||||
float throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
|
||||
auto AlsFuelAdd = interpolate3d(
|
||||
config->ALSFuelAdjustment,
|
||||
config->alsFuelAdjustmentLoadBins, throttleIntent,
|
||||
config->alsFuelAdjustmentrpmBins, rpm
|
||||
);
|
||||
return AlsFuelAdd;
|
||||
} else
|
||||
);
|
||||
return AlsFuelAdd;
|
||||
} else
|
||||
#endif /* EFI_ANTILAG_SYSTEM */
|
||||
{
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ void LaunchControlBase::update() {
|
|||
or it is supposed to be referencing 'launchTimingRpmRange'?
|
||||
+ (engineConfiguration->enableLaunchRetard ? engineConfiguration->launchAdvanceRpmRange : 0)
|
||||
*/
|
||||
+ engineConfiguration->hardCutRpmRange;
|
||||
+ engineConfiguration->hardCutRpmRange;
|
||||
|
||||
if (!combinedConditions) {
|
||||
// conditions not met, reset timer
|
||||
|
|
Loading…
Reference in New Issue