auxSpeed1

This commit is contained in:
rusefillc 2022-09-20 23:00:42 -04:00
parent 7152972437
commit 05b84d21e6
5 changed files with 11 additions and 2 deletions

View File

@ -573,6 +573,8 @@ static void updateMiscSensors() {
engine->outputChannels.wastegatePositionSensor = Sensor::getOrZero(SensorType::WastegatePosition);
engine->outputChannels.ISSValue = Sensor::getOrZero(SensorType::InputShaftSpeed);
engine->outputChannels.auxSpeed1 = Sensor::getOrZero(SensorType::AuxSpeed1);
engine->outputChannels.auxSpeed2 = Sensor::getOrZero(SensorType::AuxSpeed2);
#if HAL_USE_ADC
engine->outputChannels.internalMcuTemperature = getMCUInternalTemperature();

View File

@ -56,7 +56,9 @@ void FrequencySensor::onEdge(efitick_t nowNt) {
eventCounter++;
float frequency = 1 / m_edgeTimer.getElapsedSecondsAndReset(nowNt);
frequency = m_filter.filter(frequency);
if (useBiQuad) {
frequency = m_filter.filter(frequency);
}
postRawValue(frequency, nowNt);
}

View File

@ -14,6 +14,9 @@ public:
void initIfValid(brain_pin_e pin, SensorConverter &converter, float filterParameter);
void deInit();
// sad workaround: we are not good at BiQuad configuring
bool useBiQuad = true;
void onEdge(efitick_t nowNt);
int eventCounter = 0;

View File

@ -23,7 +23,8 @@ public:
void initAuxSpeedSensors() {
auxSpeed1.initIfValid(engineConfiguration->auxSpeedSensorInputPin[0], converter, 0.05f);
auxSpeed1.useBiQuad = engineConfiguration->useBiQuadOnAuxSpeedSensors;
auxSpeed1.initIfValid(engineConfiguration->auxSpeedSensorInputPin[0], converter, engineConfiguration->auxFrequencyFilter);
auxSpeed2.initIfValid(engineConfiguration->auxSpeedSensorInputPin[1], converter, 0.05f);
}

View File

@ -1162,6 +1162,7 @@ gaugeCategory = Sensors - Extra 2
wastegatePosGauge = wastegatePositionSensor, @@GAUGE_NAME_WG_POSITION@@, "%", 0, 100, 0, 0, 100, 100, 1, 1
idlePosSensGauge = idlePositionSensor, @@GAUGE_NAME_IDLE_POSITION@@, "%", 0, 100, 0, 0, 100, 100, 1, 1
currentEnginePhaseGauge = currentEngineDecodedPhase, "Engine Phase", "deg", 0, 720, 0, 0, 720, 720, 0, 0
auxSpeed1Gauge = auxSpeed1, "Aux Freq Input1", "hz", 0, 30000, 0, 0, 30000, 30000, 0, 0
gaugeCategory = ECU Status
warningCounterGauge = warningCounter, @@GAUGE_NAME_WARNING_COUNT@@, "", 0, 100, 0, 0, 100, 100, 0, 0