diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 75de2f4f83..45c1370442 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -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(); diff --git a/firmware/controllers/sensors/frequency_sensor.cpp b/firmware/controllers/sensors/frequency_sensor.cpp index 2f2241d346..055e524530 100644 --- a/firmware/controllers/sensors/frequency_sensor.cpp +++ b/firmware/controllers/sensors/frequency_sensor.cpp @@ -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); } diff --git a/firmware/controllers/sensors/frequency_sensor.h b/firmware/controllers/sensors/frequency_sensor.h index fde566df8e..b4441ddc72 100644 --- a/firmware/controllers/sensors/frequency_sensor.h +++ b/firmware/controllers/sensors/frequency_sensor.h @@ -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; diff --git a/firmware/init/sensor/init_aux_speed_sensor.cpp b/firmware/init/sensor/init_aux_speed_sensor.cpp index 2ddc38b5aa..d9af6be3c2 100644 --- a/firmware/init/sensor/init_aux_speed_sensor.cpp +++ b/firmware/init/sensor/init_aux_speed_sensor.cpp @@ -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); } diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index b624b9ba73..7420907108 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -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