diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 9fa72f244c..3a15ef31ec 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -199,6 +199,79 @@ expected EtbController::getOpenLoop(percent_t target) const { return ff; } +expected EtbController::getClosedLoopAutotune(percent_t actualThrottlePosition) { + // Estimate gain at 60% position - this should be well away from the spring and in the linear region + bool isPositive = actualThrottlePosition > 60.0f; + + float autotuneAmplitude = 20; + + // End of cycle - record & reset + if (!isPositive && m_lastIsPositive) { + efitick_t now = getTimeNowNt(); + + // Determine period + float tu = NT2US((float)(now - m_cycleStartTime)) / 1e6; + m_cycleStartTime = now; + + // Determine amplitude + float a = m_maxCycleTps - m_minCycleTps; + + // Filter - it's pretty noisy since the ultimate period is not very many loop periods + constexpr float alpha = 0.05; + m_a = alpha * a + (1 - alpha) * m_a; + m_tu = alpha * tu + (1 - alpha) * m_tu; + + // Reset bounds + m_minCycleTps = 100; + m_maxCycleTps = 0; + + // Math is for Åström–Hägglund (relay) auto tuning + // https://warwick.ac.uk/fac/cross_fac/iatl/reinvention/archive/volume5issue2/hornsey + + // Publish to TS state +#if EFI_TUNER_STUDIO + if (engineConfiguration->debugMode == DBG_ETB_AUTOTUNE) { + // a - amplitude of output (TPS %) + + tsOutputChannels.debugFloatField1 = m_a; + float b = 2 * autotuneAmplitude; + // b - amplitude of input (Duty cycle %) + tsOutputChannels.debugFloatField2 = b; + // Tu - oscillation period (seconds) + tsOutputChannels.debugFloatField3 = m_tu; + + // Ultimate gain per A-H relay tuning rule + // Ku + float ku = 4 * b / (3.14159f * m_a); + tsOutputChannels.debugFloatField4 = ku; + + // The multipliers below are somewhere near the "no overshoot" + // and "some overshoot" flavors of the Ziegler-Nichols method + // Kp + tsOutputChannels.debugFloatField5 = 0.35f * ku; + // Ki + tsOutputChannels.debugFloatField6 = 0.25f * ku / m_tu; + // Kd + tsOutputChannels.debugFloatField7 = 0.08f * ku * m_tu; + } +#endif + } + + m_lastIsPositive = isPositive; + + // Find the min/max of each cycle + if (actualThrottlePosition < m_minCycleTps) { + m_minCycleTps = actualThrottlePosition; + } + + if (actualThrottlePosition > m_maxCycleTps) { + m_maxCycleTps = actualThrottlePosition; + } + + // Bang-bang control the output to induce oscillation + return autotuneAmplitude * (isPositive ? -1 : 1); +} + expected EtbController::getClosedLoop(percent_t target, percent_t actualThrottlePosition) { if (m_shouldResetPid) { m_pid.reset(); @@ -215,75 +288,7 @@ expected EtbController::getClosedLoop(percent_t target, percent_t act // Only allow autotune with stopped engine if (GET_RPM() == 0 && engine->etbAutoTune) { - bool isPositive = actualThrottlePosition > target; - - float autotuneAmplitude = 20; - - // End of cycle - record & reset - if (!isPositive && m_lastIsPositive) { - efitick_t now = getTimeNowNt(); - - // Determine period - float tu = NT2US((float)(now - m_cycleStartTime)) / 1e6; - m_cycleStartTime = now; - - // Determine amplitude - float a = m_maxCycleTps - m_minCycleTps; - - // Filter - it's pretty noisy since the ultimate period is not very many loop periods - constexpr float alpha = 0.05; - m_a = alpha * a + (1 - alpha) * m_a; - m_tu = alpha * tu + (1 - alpha) * m_tu; - - // Reset bounds - m_minCycleTps = 100; - m_maxCycleTps = 0; - - // Math is for Åström–Hägglund (relay) auto tuning - // https://warwick.ac.uk/fac/cross_fac/iatl/reinvention/archive/volume5issue2/hornsey - - // Publish to TS state -#if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_ETB_AUTOTUNE) { - // a - amplitude of output (TPS %) - - tsOutputChannels.debugFloatField1 = m_a; - float b = 2 * autotuneAmplitude; - // b - amplitude of input (Duty cycle %) - tsOutputChannels.debugFloatField2 = b; - // Tu - oscillation period (seconds) - tsOutputChannels.debugFloatField3 = m_tu; - - // Ultimate gain per A-H relay tuning rule - // Ku - float ku = 4 * b / (3.14159f * m_a); - tsOutputChannels.debugFloatField4 = ku; - - // The multipliers below are somewhere near the "no overshoot" - // and "some overshoot" flavors of the Ziegler-Nichols method - // Kp - tsOutputChannels.debugFloatField5 = 0.35f * ku; - // Ki - tsOutputChannels.debugFloatField6 = 0.25f * ku / m_tu; - // Kd - tsOutputChannels.debugFloatField7 = 0.08f * ku * m_tu; - } -#endif - } - - m_lastIsPositive = isPositive; - - // Find the min/max of each cycle - if (actualThrottlePosition < m_minCycleTps) { - m_minCycleTps = actualThrottlePosition; - } - - if (actualThrottlePosition > m_maxCycleTps) { - m_maxCycleTps = actualThrottlePosition; - } - - // Bang-bang control the output to induce oscillation - return autotuneAmplitude * (isPositive ? -1 : 1); + return getClosedLoopAutotune(actualThrottlePosition); } else { // Normal case - use PID to compute closed loop part return m_pid.getOutput(target, actualThrottlePosition); diff --git a/firmware/controllers/actuators/electronic_throttle.h b/firmware/controllers/actuators/electronic_throttle.h index fb7dfeed1f..6b4b3f681b 100644 --- a/firmware/controllers/actuators/electronic_throttle.h +++ b/firmware/controllers/actuators/electronic_throttle.h @@ -50,6 +50,7 @@ public: expected getOpenLoop(percent_t target) const override; expected getClosedLoop(percent_t setpoint, percent_t target) override; + expected getClosedLoopAutotune(percent_t actualThrottlePosition); void setOutput(expected outputValue) override; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 71cbf07684..01ade21d58 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 19:50:25 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 21:10:37 EDT 2020 pageSize = 20000 page = 1 @@ -1759,8 +1759,8 @@ fileVersion = { 20200310 } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -2892,12 +2892,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -3901,44 +3908,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 3483a270f3..9f24338ce6 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -590,8 +590,8 @@ fileVersion = { @@TS_FILE_VERSION@@ } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -1723,12 +1723,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -2733,44 +2740,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp" diff --git a/firmware/tunerstudio/rusefi_frankenso.ini b/firmware/tunerstudio/rusefi_frankenso.ini index d81c3e1f42..686e18e4a1 100644 --- a/firmware/tunerstudio/rusefi_frankenso.ini +++ b/firmware/tunerstudio/rusefi_frankenso.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 19:51:12 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 21:14:02 EDT 2020 pageSize = 20000 page = 1 @@ -1759,8 +1759,8 @@ fileVersion = { 20200310 } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -2892,12 +2892,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -3901,44 +3908,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp" diff --git a/firmware/tunerstudio/rusefi_microrusefi.ini b/firmware/tunerstudio/rusefi_microrusefi.ini index 271b654d10..9db24de85f 100644 --- a/firmware/tunerstudio/rusefi_microrusefi.ini +++ b/firmware/tunerstudio/rusefi_microrusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 19:50:54 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 21:13:32 EDT 2020 pageSize = 20000 page = 1 @@ -1759,8 +1759,8 @@ fileVersion = { 20200310 } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -2884,12 +2884,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -3861,44 +3868,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp" diff --git a/firmware/tunerstudio/rusefi_prometheus.ini b/firmware/tunerstudio/rusefi_prometheus.ini index 56121b11fb..bb5cdc612e 100644 --- a/firmware/tunerstudio/rusefi_prometheus.ini +++ b/firmware/tunerstudio/rusefi_prometheus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 19:51:15 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 21:14:11 EDT 2020 pageSize = 20000 page = 1 @@ -1759,8 +1759,8 @@ fileVersion = { 20200310 } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -2888,12 +2888,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -3897,44 +3904,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp" diff --git a/firmware/tunerstudio/rusefi_proteus.ini b/firmware/tunerstudio/rusefi_proteus.ini index acda8f682b..f5567e2876 100644 --- a/firmware/tunerstudio/rusefi_proteus.ini +++ b/firmware/tunerstudio/rusefi_proteus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 19:51:17 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 22 21:14:49 EDT 2020 pageSize = 20000 page = 1 @@ -1759,8 +1759,8 @@ fileVersion = { 20200310 } curve = etbTpsBiasCurve, "Electronic TB Bias Curve" columnLabel = "TPS", "duty bias" - xAxis = 0, 100, 10 - yAxis = 0, 100, 10 + xAxis = 0, 50, 11 + yAxis = -40, 40, 9 xBins = etbBiasBins, TPSValue yBins = etbBiasValues gauge = TPSGauge @@ -2884,12 +2884,19 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "TPS low value detection threshold", tpsErrorDetectionTooLow, {tps1_1AdcChannel != 16} field = "TPS high value detection threshold", tpsErrorDetectionTooHigh, {tps1_1AdcChannel != 16} - dialog = pedalSensor, "Accelerator pedal" + dialog = pedalSensorLeft, "Accelerator pedal" field = "Accelerator position sensor", throttlePedalPositionAdcChannel + field = "Up voltage", throttlePedalUpVoltage + field = "Down (WOT) voltage", throttlePedalWOTVoltage field = "Accelerator position 2nd sensor", throttlePedalPositionSecondAdcChannel - field = "Up voltage", throttlePedalUpVoltage - field = "Down (WOT) voltage", throttlePedalWOTVoltage + dialog = pedalGauges + gauge = pedalPositionGauge + gauge = rawPpsPrimaryGauge + + dialog = pedalSensor, "Accelerator pedal", border + panel = pedalSensorLeft, West + panel = pedalGauges, East dialog = mc33Dialog, "GDI Dreams" field = mc33816_cs, mc33816_cs @@ -3869,44 +3876,37 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "pFactor", etb_pFactor, {throttlePedalPositionAdcChannel != 16} field = "iFactor", etb_iFactor, {throttlePedalPositionAdcChannel != 16} field = "dFactor", etb_dFactor, {throttlePedalPositionAdcChannel != 16} - field = "offset", etb_offset, {throttlePedalPositionAdcChannel != 16} field = "control period", etb_periodMs, {throttlePedalPositionAdcChannel != 16} field = "pid min", etb_minValue, {throttlePedalPositionAdcChannel != 16} field = "pid max", etb_maxValue, {throttlePedalPositionAdcChannel != 16} field = "iTermMin", etb_iTermMin, {throttlePedalPositionAdcChannel != 16} field = "iTermMax", etb_iTermMax, {throttlePedalPositionAdcChannel != 16} + dialog = etbIdleDialog, "ETB Idle" + field = "use ETB for idle", useETBforIdleControl + field = "ETB idle maximum angle", etbIdleThrottleRange dialog = etbDialogLeft field = "https://rusefi.com/s/etb" field = "Detailed status in console", isVerboseETB field = "Pause ETB control", pauseEtbControl - field = "Throttle Pedal Up", throttlePedalUpVoltage - field = "Throttle Pedal Wide Open", throttlePedalWOTVoltage field = etbCalibrationOnStart, etbCalibrationOnStart - field = "TPS#2 min", tps2Min, { tps2_1AdcChannel != 16 } - field = "TPS#2 max", tps2Max, { tps2_1AdcChannel != 16 } ; 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 panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } - panel = etbPidDialog + + dialog = etbAutotune, "PID Autotune" + field = "!Set debug mode below to 'ETB Autotune' to show results" + field = "Debug mode", debugMode + commandButton = "ETB PID Autotune", cmd_etb_autotune dialog = etbDialogRight - field = "!https://rusefi.com/s/debugmode" - field = "Neutral Position", etbNeutralPosition - field = "Debug mode", debugMode - field = "use ETB for idle", useETBforIdleControl - field = "ETB idle maximum angle", etbIdleThrottleRange - field = "Press buttons to calibrate sensors" - field = "You would have to remove air filter to move throttle manually" - commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed - commandButton = "TPS#1 wide open position", cmd_calibrate_tps_1_wot - field = "Not many vehicles have two throttle bodies but some do" - commandButton = "TPS#2 closed position", cmd_calibrate_tps_2_closed - commandButton = "TPS#2 wide open position", cmd_calibrate_tps_2_wot - commandButton = "Pedal Up", cmd_calibrate_pedal_up - commandButton = "Pedal Down", cmd_calibrate_pedal_down - commandButton = "ETB PID Autotune", cmd_etb_autotune + panel = etbIdleDialog + panel = etbPidDialog + panel = etbAutotune + + ; Neutral position handling not yet implemented! + ;field = "Neutral Position", etbNeutralPosition dialog = etbDialog, "Electronic Throttle Body (beta)", border topicHelp = "etbHelp"