Skip to content

Commit

Permalink
ETB expAverage cleanup #489
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 18, 2024
1 parent 05e5456 commit 3a394dc
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 79 deletions.
8 changes: 1 addition & 7 deletions firmware/controllers/actuators/electronic_throttle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ bool EtbController::init(dc_function_e function, DcMotor *motor, pid_s *pidParam

void EtbController::reset() {
m_shouldResetPid = true;
m_dutyRocAverage.reset();
m_dutyAverage.reset();
etbTpsErrorCounter = 0;
etbPpsErrorCounter = 0;
}
Expand All @@ -216,8 +214,7 @@ 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();
}

Expand Down Expand Up @@ -799,9 +796,6 @@ void setBoschVNH2SP30Curve() {
void setDefaultEtbParameters() {
engineConfiguration->etbIdleThrottleRange = 5;

engineConfiguration->etbExpAverageLength = 50;
engineConfiguration->etbRocExpAverageLength = 50;

setLinearCurve(config->pedalToTpsPedalBins, /*from*/0, /*to*/100, 1);
setLinearCurve(config->pedalToTpsRpmBins, /*from*/0, /*to*/8000, 1);

Expand Down
4 changes: 0 additions & 4 deletions firmware/controllers/actuators/electronic_throttle_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "sensor.h"
#include "efi_pid.h"
#include "electronic_throttle_generated.h"
#include "exp_average.h"

/**
* Hard code ETB update speed.
Expand Down Expand Up @@ -98,9 +97,6 @@ class EtbController : public IEtbController, public electronic_throttle_s {
return m_function == DC_Throttle1 || m_function == DC_Throttle2;
}

ExpAverage m_dutyRocAverage;
ExpAverage m_dutyAverage;

Timer m_jamDetectTimer;

// Pedal -> target map
Expand Down
3 changes: 0 additions & 3 deletions firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,6 @@ tChargeMode_e tChargeMode;

int8_t launchFuelAdderPercent;;"%", 1, 0, 0, 100, 0
uint8_t autoscale etbJamTimeout;Time required to detect a stuck throttle.;"sec", 0.02, 0, 0, 5, 2
uint16_t etbExpAverageLength;By the way ETB PID runs at 500hz, length in 1/500 of second here.

int16_t coastingFuelCutRpmHigh;This sets the RPM above which fuel cut is active.;"rpm", 1, 0, 0, 5000, 0
int16_t coastingFuelCutRpmLow;This sets the RPM below which fuel cut is deactivated, this prevents jerking or issues transitioning to idle;"rpm", 1, 0, 0, 5000, 0
Expand Down Expand Up @@ -1271,8 +1270,6 @@ float tChargeAirDecrLimit;Maximum allowed rate of decrease allowed for the estim

pid_s idleTimingPid

int16_t etbRocExpAverageLength;By the way ETB PID runs at 500hz, length in 1/500 of second here.

int16_t tpsAccelFractionPeriod;A delay in cycles between fuel-enrich. portions;"cycles", 1, 0, 0, 500, 0
float tpsAccelFractionDivisor;A fraction divisor: 1 or less = entire portion at once, or split into diminishing fractions;"coef", 1, 0, 0, 100, 2

Expand Down
4 changes: 2 additions & 2 deletions firmware/tunerstudio/tunerstudio.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4224,11 +4224,11 @@ dialog = tcuControls, "Transmission Settings"
field = "PWM Frequency", etbFreq
field = "Minimum ETB position", etbMinimumPosition
field = "Maximum ETB position", etbMaximumPosition
field = ""
field = "Jam detection error max", jamDetectThreshold
field = "Jam detection timeout period", etbJamTimeout
commandButton = "Temporarily disable jam detection", cmd_etb_disable_jam_detect
field = "Duty Averaging Length", etbExpAverageLength
field = "Rate of change Averaging Length", etbRocExpAverageLength

; we need the term about stepper idle in here, because there's a bug in TS that you can't have different visibility
; criteria for the same panel when used in multiple places
; todo: report bug to TS?
Expand Down
26 changes: 0 additions & 26 deletions firmware/util/math/exp_average.h

This file was deleted.

36 changes: 0 additions & 36 deletions unit_tests/tests/util/test_exp_average.cpp

This file was deleted.

1 change: 0 additions & 1 deletion unit_tests/tests/util/test_util.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


CPPSRC += $(PROJECT_DIR)/../unit_tests/tests/util/test_buffered_writer.cpp \
$(PROJECT_DIR)/../unit_tests/tests/util/test_exp_average.cpp \
$(PROJECT_DIR)/../unit_tests/tests/util/test_hash.cpp \

INCDIR += $(PROJECT_DIR)/controllers/system
Expand Down

0 comments on commit 3a394dc

Please sign in to comment.