Get rid of knockDetectionWindowEnd that was used by HIP9011 only
Use knockSamplingDuration instead
This commit is contained in:
parent
8ec850c4da
commit
3705b7f820
|
@ -331,6 +331,7 @@ static void setDefaultBoostOpenLoopParameters() {
|
|||
static void setDefaultEngineNoiseTable() {
|
||||
setRpmTableBin(config->knockNoiseRpmBins);
|
||||
|
||||
engineConfiguration->knockDetectionWindowStart = 15.0 + 5.0;
|
||||
engineConfiguration->knockSamplingDuration = 45;
|
||||
|
||||
setArrayValues(config->knockBaseNoise, -20);
|
||||
|
@ -600,12 +601,6 @@ static void setDefaultEngineConfiguration() {
|
|||
engineConfiguration->nitrousDeactivationRpm = engine_configuration_defaults::NITROUS_DEACTIVATION_RPM;
|
||||
engineConfiguration->nitrousDeactivationRpmWindow = engine_configuration_defaults::NITROUS_DEACTIVATION_RPM_WINDOW;
|
||||
|
||||
/* these two are used for HIP9011 only
|
||||
* Currently this is offset from fire event, not TDC */
|
||||
/* TODO: convert to offset from TDC */
|
||||
engineConfiguration->knockDetectionWindowStart = 15.0 + 5.0;
|
||||
engineConfiguration->knockDetectionWindowEnd = 15.0 + 45.0;
|
||||
|
||||
engineConfiguration->triggerSimulatorRpm = DEFAULT_SELT_STIM_RPM;
|
||||
engineConfiguration->simulatorCamPosition[0] = DEFAULT_SELT_STIM_VVT0;
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ void hip9011_onFireEvent(uint8_t cylinderNumber, efitick_t nowNt) {
|
|||
{ startIntegration, &instance });
|
||||
|
||||
scheduleByAngle(&hardware.endTimer, nowNt,
|
||||
engineConfiguration->knockDetectionWindowEnd,
|
||||
engineConfiguration->knockDetectionWindowStart + engineConfiguration->knockSamplingDuration,
|
||||
{ endIntegration, &instance });
|
||||
} else {
|
||||
#if EFI_HIP_9011_DEBUG
|
||||
|
@ -658,7 +658,7 @@ static void showHipInfo() {
|
|||
|
||||
efiPrintf(" Window start %.2f end %.2f",
|
||||
engineConfiguration->knockDetectionWindowStart,
|
||||
engineConfiguration->knockDetectionWindowEnd);
|
||||
engineConfiguration->knockDetectionWindowStart + engineConfiguration->knockSamplingDuration);
|
||||
|
||||
if (!instance.adv_mode) {
|
||||
efiPrintf(" Adc input %d (%.2f V)",
|
||||
|
|
|
@ -138,9 +138,7 @@ int HIP9011::getIntegrationIndexByRpm(float rpm) {
|
|||
}
|
||||
|
||||
void HIP9011::setAngleWindowWidth(DEFINE_HIP_PARAMS) {
|
||||
float new_angleWindowWidth =
|
||||
GET_CONFIG_VALUE(knockDetectionWindowEnd) -
|
||||
GET_CONFIG_VALUE(knockDetectionWindowStart);
|
||||
float new_angleWindowWidth = GET_CONFIG_VALUE(knockSamplingDuration);
|
||||
if (new_angleWindowWidth < 0) {
|
||||
#if EFI_PROD_CODE
|
||||
warning(ObdCode::CUSTOM_KNOCK_WINDOW, "invalid knock window");
|
||||
|
|
|
@ -56,21 +56,21 @@ public:
|
|||
engineConfiguration->hip9011Gain, \
|
||||
engineConfiguration->hip9011Prescaler, \
|
||||
engineConfiguration->knockDetectionWindowStart, \
|
||||
engineConfiguration->knockDetectionWindowEnd
|
||||
engineConfiguration->knockSamplingDuration
|
||||
|
||||
#define FORWARD_HIP_PARAMS \
|
||||
cylinderBore, \
|
||||
hip9011Gain, \
|
||||
hip9011Prescaler, \
|
||||
knockDetectionWindowStart, \
|
||||
knockDetectionWindowEnd
|
||||
knockSamplingDuration
|
||||
|
||||
#define DEFINE_HIP_PARAMS \
|
||||
float cylinderBore, \
|
||||
float hip9011Gain, \
|
||||
uint8_t hip9011Prescaler, \
|
||||
float knockDetectionWindowStart, \
|
||||
float knockDetectionWindowEnd
|
||||
float knockSamplingDuration
|
||||
|
||||
|
||||
#define GET_CONFIG_VALUE(x) x
|
||||
|
|
|
@ -1130,7 +1130,7 @@ bit watchOutForLinearTime
|
|||
int16_t warningPeriod;set warningPeriod X;"seconds", 1, 0, 0, 60, 0
|
||||
|
||||
float knockDetectionWindowStart;;"angle", 1, 0, -1000, 1000, 2
|
||||
float knockDetectionWindowEnd;;"angle", 1, 0, -1000, 1000, 2
|
||||
uint32_t unusedKnockWindow
|
||||
|
||||
|
||||
float idleStepperReactionTime;;"ms", 1, 0, 1, 300, 0
|
||||
|
|
|
@ -4093,7 +4093,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
|
|||
panel = knockThresholdCurve, Center
|
||||
|
||||
; Engine->hip9011 Settings
|
||||
dialog = hipHardware
|
||||
dialog = hipHardware, "HIP9011 hardware settings"
|
||||
field = "SPI device", hip9011SpiDevice, {isHip9011Enabled == 1}
|
||||
field = "ChipSelect pin", hip9011CsPin, {isHip9011Enabled == 1}
|
||||
field = "ChipSelect mode", hip9011CsPinMode, {isHip9011Enabled == 1}
|
||||
|
@ -4101,13 +4101,14 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
|
|||
field = "IntHold pin mode", hip9011IntHoldPinMode, {isHip9011Enabled == 1}
|
||||
field = "hip Output/stm input", hipOutputChannel, {isHip9011Enabled == 1}
|
||||
|
||||
dialog = hipSettings
|
||||
dialog = hipSettings, "HIP9011 software settings"
|
||||
field = "prescaler", hip9011Prescaler, {isHip9011Enabled == 1}
|
||||
field = "knockDetectionWindowStart", knockDetectionWindowStart, {isHip9011Enabled == 1}
|
||||
field = "knockDetectionWindowEnd", knockDetectionWindowEnd, {isHip9011Enabled == 1}
|
||||
field = "Cylinder bore", cylinderBore, {isHip9011Enabled == 1}
|
||||
|
||||
dialog = hipCurve, "Knock threshold"
|
||||
dialog = hipCurve, "Knock sensing"
|
||||
field = "Cylinder bore", cylinderBore
|
||||
field = "Band Freq override", knockBandCustom
|
||||
field = "knockDetectionWindowStart", knockDetectionWindowStart
|
||||
field = "knockSamplingDuration", knockSamplingDuration
|
||||
panel = knockThresholdCurve
|
||||
|
||||
dialog = hipFunction, "HIP9011 Settings (knock decoder)"
|
||||
|
|
Loading…
Reference in New Issue