From ff40d113ab94edece3486a15d8f182e118cbe11c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 19 Oct 2023 12:32:59 -0400 Subject: [PATCH] same gear count for everyone, also honda only:small-can-board --- firmware/config/engines/honda.cpp | 2 ++ firmware/console/binary/output_channels.txt | 2 +- firmware/controllers/actuators/boost_control.cpp | 2 +- firmware/controllers/algo/gear_detector.cpp | 2 +- firmware/controllers/algo/gear_detector.h | 2 +- firmware/integration/rusefi_config.txt | 7 +++---- firmware/integration/rusefi_config_shared.txt | 2 +- firmware/tunerstudio/rusefi.input | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/firmware/config/engines/honda.cpp b/firmware/config/engines/honda.cpp index 379a833977..b2e034036d 100644 --- a/firmware/config/engines/honda.cpp +++ b/firmware/config/engines/honda.cpp @@ -12,6 +12,8 @@ void setHondaCivicBcm() { engineConfiguration->gearRatio[4] = 2.2; engineConfiguration->gearRatio[5] = 1.8; + engineConfiguration->isBoostControlEnabled = true; + #if HW_SMALL_CAN_BOARD strncpy(config->luaScript, R"( -- this controls onCanRx rate as well! diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index 0cb09f661c..b39e5da002 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -118,7 +118,7 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2 int16_t autoscale accelerationX;@@GAUGE_NAME_ACCEL_X@@;"G",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 2 int16_t autoscale accelerationY;@@GAUGE_NAME_ACCEL_Y@@;"G",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 2 - uint8_t detectedGear;@@GAUGE_NAME_DETECTED_GEAR@@;"", 1, 0, 0, @@GEARS_COUNT@@, 0 + uint8_t detectedGear;@@GAUGE_NAME_DETECTED_GEAR@@;"", 1, 0, 0, @@TCU_GEAR_COUNT@@, 0 uint8_t maxTriggerReentrant;;"", 1, 0, 0, 100, 0 int16_t autoscale rawLowFuelPressure;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3 diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index c414213fc1..c4c3971bdc 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -239,7 +239,7 @@ void startBoostPin() { &engine->executor, &enginePins.boostPin, engineConfiguration->boostPwmFrequency, - 0 + /*dutyCycle*/0 ); #endif /* EFI_UNIT_TEST */ } diff --git a/firmware/controllers/algo/gear_detector.cpp b/firmware/controllers/algo/gear_detector.cpp index 69a94b2cff..83dc55c3fc 100644 --- a/firmware/controllers/algo/gear_detector.cpp +++ b/firmware/controllers/algo/gear_detector.cpp @@ -23,7 +23,7 @@ void GearDetector::initGearDetector() { return; } - if (gearCount > GEARS_COUNT) { + if (gearCount > TCU_GEAR_COUNT) { criticalError("too many gears"); return; } diff --git a/firmware/controllers/algo/gear_detector.h b/firmware/controllers/algo/gear_detector.h index d79154231e..8c364911cb 100644 --- a/firmware/controllers/algo/gear_detector.h +++ b/firmware/controllers/algo/gear_detector.h @@ -27,5 +27,5 @@ private: float m_gearboxRatio = 0; size_t m_currentGear = 0; - float m_gearThresholds[GEARS_COUNT - 1]; + float m_gearThresholds[TCU_GEAR_COUNT - 1]; }; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index d1dbd16fb5..304b33dda1 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -158,7 +158,6 @@ struct_no_prefix engine_configuration_s #define IDLE_VE_SIZE 4 #define TCU_SOLENOID_COUNT 6 -#define TCU_GEAR_COUNT 10 #define RANGE_INPUT_COUNT 6 @@ -1141,7 +1140,7 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\ #define AUX_SPEED_SENSOR_COUNT 2 brain_input_pin_e[AUX_SPEED_SENSOR_COUNT iterate] auxSpeedSensorInputPin; - uint8_t totalGearsCount;;"", 1, 0, 1, @@GEARS_COUNT@@, 0 + uint8_t totalGearsCount;;"", 1, 0, 1, @@TCU_GEAR_COUNT@@, 0 custom InjectionTimingMode 1 bits, U08, @OFFSET@, [0:1], "End of injection", "Start of injection", "Center of injection" InjectionTimingMode injectionTimingMode;Sets what part of injection's is controlled by the injection phase table. @@ -1454,7 +1453,7 @@ tChargeMode_e tChargeMode; output_pin_e[4 iterate] stepper_raw_output; - uint16_t[GEARS_COUNT iterate] autoscale gearRatio;;"ratio", 0.01, 0, 0, 30, 2 + uint16_t[TCU_GEAR_COUNT iterate] autoscale gearRatio;;"ratio", 0.01, 0, 0, 30, 2 uint16_t vvtActivationDelayMs;We need to give engine time to build oil pressure without diverting it to VVT;"ms", 1, 0, 0, 65000, 0 @@ -1548,7 +1547,7 @@ pin_input_mode_e[LUA_DIGITAL_INPUT_COUNT iterate] luaDigitalInputPinModes; uint8_t autoscale rpmHardLimitHyst;Hysterisis: if the hard limit is 7200rpm and rpmHardLimitHyst is 200rpm, then when the ECU sees 7200rpm, fuel/ign will cut, and stay cut until 7000rpm (7200-200) is reached;"RPM", 10, 0, 0, 2500, 0 uint16_t autoscale benchTestOffTime;Time between bench test pulses;"ms", 0.1, 0, 0, 2000, 1 uint8_t autoscale boostCutPressureHyst;Hysterisis: if hard cut is 240kpa, and boostCutPressureHyst is 20, when the ECU sees 240kpa, fuel/ign will cut, and stay cut until 240-20=220kpa is reached;"kPa (absolute)", 0.5, 0, 0, 125, 1 - uint8_t[GEARS_COUNT] autoscale gearBasedOpenLoopBoostAdder;Boost duty cycle added by gear;"%", 0.5, 0, 0, 100, 1 + uint8_t[TCU_GEAR_COUNT] autoscale gearBasedOpenLoopBoostAdder;Boost duty cycle added by gear;"%", 0.5, 0, 0, 100, 1 uint32_t benchTestCount;How many test bench pulses do you want;"", 1, 0, 0, 10000000, 0 uint8_t autoscale iacByTpsHoldTime;How long initial IAC adder is held before starting to decay.;"seconds", 0.1, 0, 0, 25, 1 diff --git a/firmware/integration/rusefi_config_shared.txt b/firmware/integration/rusefi_config_shared.txt index 18ce64e9d2..e00a4ae86e 100644 --- a/firmware/integration/rusefi_config_shared.txt +++ b/firmware/integration/rusefi_config_shared.txt @@ -19,7 +19,7 @@ #define PACK_MULT_FUEL_FLOW 200 #define PACK_MULT_VSS 100 -#define GEARS_COUNT 8 +#define TCU_GEAR_COUNT 10 #define EGT_CHANNEL_COUNT 8 #define MAX_CYLINDER_COUNT 12 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 042887b26a..aef7568e85 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1551,7 +1551,7 @@ gaugeCategory = Sensors - Raw gaugeCategory = Transmission desiredGearGauge = tcuDesiredGear, @@GAUGE_NAME_DESIRED_GEAR@@, "gear", -1, 10, -1, -1, 10, 10, 0, 0 currentGearGauge = tcuCurrentGear, @@GAUGE_NAME_CURRENT_GEAR@@, "gear", -1, 10, -1, -1, 10, 10, 0, 0 - detectedGearGauge = detectedGear, @@GAUGE_NAME_DETECTED_GEAR@@, "gear", 0, @@GEARS_COUNT@@, 0, 0, @@GEARS_COUNT@@, @@GEARS_COUNT@@, 0, 0 + detectedGearGauge = detectedGear, @@GAUGE_NAME_DETECTED_GEAR@@, "gear", 0, @@TCU_GEAR_COUNT@@, 0, 0, @@TCU_GEAR_COUNT@@, @@TCU_GEAR_COUNT@@, 0, 0 speedToRpmRatioGauge = speedToRpmRatio, @@GAUGE_NAME_GEAR_RATIO@@, "", 0, 100, 0, 0, 100, 100, 4, 4 ISSGauge = ISSValue, @@GAUGE_NAME_ISS@@, "RPM", 0, {rpmHardLimit + 2000}, 200, {cranking_rpm}, {rpmHardLimit - 500}, {rpmHardLimit}, 0, 0 tcRatioGauge = tcRatio, @@GAUGE_NAME_TC_RATIO@@, "", 0, 100, 0, 0, 100, 100, 4, 4