diff --git a/firmware/config/engines/vw.cpp b/firmware/config/engines/vw.cpp index edc7285c24..4a23530a6e 100644 --- a/firmware/config/engines/vw.cpp +++ b/firmware/config/engines/vw.cpp @@ -16,6 +16,7 @@ EXTERN_CONFIG; // VW_ABA +// set engine_type 32 void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); @@ -52,6 +53,9 @@ void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->ignitionPins[3] = GPIO_UNASSIGNED; engineConfiguration->ignitionPinMode = OM_DEFAULT; + engineConfiguration->idlePositionSensor = EFI_ADC_3; // PA3 + engineConfiguration->wastegatePositionSensor = EFI_ADC_4; // PA4 + float mapRange = 110; setEgoSensor(ES_PLX PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8a77056cd8..f9b4a15f87 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -948,6 +948,10 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->tps2Max = convertVoltageTo10bitADC(5); engineConfiguration->tps2SecondaryMin = convertVoltageTo10bitADC(0); engineConfiguration->tps2SecondaryMax = convertVoltageTo10bitADC(5); + engineConfiguration->idlePositionMin = PACK_MULT_VOLTAGE * 0; + engineConfiguration->idlePositionMax = PACK_MULT_VOLTAGE * 5; + engineConfiguration->wastegatePositionMin = PACK_MULT_VOLTAGE * 0; + engineConfiguration->wastegatePositionMax = PACK_MULT_VOLTAGE * 5; engineConfiguration->tpsErrorDetectionTooLow = -10; // -10% open engineConfiguration->tpsErrorDetectionTooHigh = 110; // 110% open diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 3fc4069e63..0273ede232 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -337,7 +337,7 @@ static void printAnalogInfo(void) { printAnalogChannelInfo("MAF", engineConfiguration->mafAdcChannel); for (int i = 0; i < FSIO_ANALOG_INPUT_COUNT ; i++) { adc_channel_e ch = engineConfiguration->fsioAdc[i]; - printAnalogChannelInfo("fsio", ch); + printAnalogChannelInfo("FSIO analog", ch); } printAnalogChannelInfo("AFR", engineConfiguration->afr.hwChannel); @@ -352,10 +352,6 @@ static void printAnalogInfo(void) { printAnalogChannelInfo("HIP9011", engineConfiguration->hipOutputChannel); - for (int i = 0; i < FSIO_ANALOG_INPUT_COUNT ; i++) { - printAnalogChannelInfo("FSIO", engineConfiguration->fsioAdc[i]); - } - printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel PASS_ENGINE_PARAMETER_SUFFIX), engineConfiguration->vbattDividerCoeff); } diff --git a/firmware/init/sensor/init_tps.cpp b/firmware/init/sensor/init_tps.cpp index 717deef156..4ef08b7ea2 100644 --- a/firmware/init/sensor/init_tps.cpp +++ b/firmware/init/sensor/init_tps.cpp @@ -78,8 +78,8 @@ static void initTpsFuncAndRedund(RedundantSensor& redund, LinearFunc& func, Func } void initTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - float min = CONFIG(tpsErrorDetectionTooLow); - float max = CONFIG(tpsErrorDetectionTooHigh); + percent_t min = CONFIG(tpsErrorDetectionTooLow); + percent_t max = CONFIG(tpsErrorDetectionTooHigh); if (!CONFIG(consumeObdSensors)) { initTpsFunc(tpsFunc1p, tpsSens1p, CONFIG(tps1_1AdcChannel), CONFIG(tpsMin), CONFIG(tpsMax), min, max); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 6e8dbec4a9..a5b4daf18f 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -474,8 +474,9 @@ bit issue_294_30; bit issue_294_31,si_example,nada_example; -int16_t tpsMin;Closed throttle. todo: extract these two fields into a structure\nSee also tps1_1AdcChannel\nset tps_min X;"ADC", 1, 0, 0, 1023, 0 -int16_t tpsMax;Full throttle. tpsMax value as 10 bit ADC value. Not Voltage!\nSee also tps1_1AdcChannel\nset tps_max X;"ADC", 1, 0, 0, 1023, 0 +!todo: extract these two fields into a structure +int16_t tpsMin;+Closed throttle, 1 volt = 200 units.\nSee also tps1_1AdcChannel\nset tps_min X;"ADC", 1, 0, 0, 1023, 0 +int16_t tpsMax;+Full throttle.\nSee also tps1_1AdcChannel\nset tps_max X;"ADC", 1, 0, 0, 1023, 0 int16_t tpsErrorDetectionTooLow;+TPS error detection: what throttle % is unrealistically low?\nAlso used for accelerator pedal error detection if so equiped.;"%", 1, 0, -10, 0, 0 int16_t tpsErrorDetectionTooHigh;+TPS error detection: what throttle % is unrealistically high?\nAlso used for accelerator pedal error detection if so equiped.;"%", 1, 0, 100, 110, 0 @@ -728,17 +729,17 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fas pin_input_mode_e throttlePedalUpPinMode; uint8_t fsio_visible acIdleExtraOffset;+Additional idle PID offset while A/C is active;"Percent", 1, 0, 0, 255, 0 - int can2SleepPeriodMs;CANbus thread period, ms;"ms", 1, 0, 0, 1000.0, 2 - uint16_t wastegatePositionMin;Voltage when the wastegate is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 - uint16_t wastegatePositionMax;Voltage when the wastegate is fully open.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 - uint16_t idlePositionMin;Voltage when the idle valve is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 - uint16_t idlePositionMax;Voltage when the idle valve is open.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 + int can2SleepPeriodMs;+CANbus thread period, ms;"ms", 1, 0, 0, 1000.0, 2 + uint16_t wastegatePositionMin;+Voltage when the wastegate is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 + uint16_t wastegatePositionMax;+Voltage when the wastegate is fully open.\nYou probably don't have one of these!\n1 volt = 1000 units;"mv", 1, 0, 0, 5000, 0 + uint16_t idlePositionMin;+Voltage when the idle valve is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0 + uint16_t idlePositionMax;+Voltage when the idle valve is open.\nYou probably don't have one of these!\n1 volt = 1000 units;"mv", 1, 0, 0, 5000, 0 uint16_t tempHpfpStart;;"units", 1, 0, -20, 100, 0 uint16_t tempHpfpDuration;;"units", 1, 0, -20, 100, 0 - uint32_t tunerStudioSerialSpeed;Secondary TTL channel baud rate;"BPs", 1, 0, 0,1000000, 0 + uint32_t tunerStudioSerialSpeed;+Secondary TTL channel baud rate;"BPs", 1, 0, 0,1000000, 0 float compressionRatio;+Just for reference really, not taken into account by any logic at this point;"CR", 1, 0, 0, 300.0, 1