etb_test_hw

This commit is contained in:
rusefi 2021-10-10 16:29:45 -04:00
parent e3196a7bbd
commit fe69616859
2 changed files with 27 additions and 14 deletions

View File

@ -939,6 +939,12 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
addConsoleAction("ethinfo", showEthInfo);
addConsoleAction("etbreset", etbReset);
addConsoleActionI("etb_freq", setEtbFrequency);
// this command is useful for real hardware test with known cheap hardware
addConsoleAction("etb_test_hw", [](){
setToyota89281_33010_pedal_position_sensor(PASS_CONFIG_PARAMETER_SIGNATURE);
});
#endif /* EFI_PROD_CODE */
pedal2tpsMap.init(config->pedalToTpsTable, config->pedalToTpsPedalBins, config->pedalToTpsRpmBins);
@ -1028,26 +1034,15 @@ void setEtbWastegatePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX) {
}
}
static void toyota89281_33010_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
void setToyota89281_33010_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->throttlePedalUpVoltage = 0;
engineConfiguration->throttlePedalWOTVoltage = 4.1;
engineConfiguration->throttlePedalSecondaryUpVoltage = 0.73;
engineConfiguration->throttlePedalSecondaryWOTVoltage = 4.9;
}
void setProteusHitachiEtbDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// EFI_ADC_12: "Analog Volt 3"
engineConfiguration->tps1_2AdcChannel = EFI_ADC_12;
// EFI_ADC_13: "Analog Volt 4"
engineConfiguration->tps2_1AdcChannel = EFI_ADC_13;
// EFI_ADC_0: "Analog Volt 5"
engineConfiguration->tps2_2AdcChannel = EFI_ADC_0;
// EFI_ADC_1: "Analog Volt 6"
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_1;
toyota89281_33010_pedal_position_sensor(PASS_CONFIG_PARAMETER_SIGNATURE);
// EFI_ADC_2: "Analog Volt 7"
engineConfiguration->throttlePedalPositionSecondAdcChannel = EFI_ADC_2;
void setHitachiEtbCalibration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setToyota89281_33010_pedal_position_sensor(PASS_CONFIG_PARAMETER_SIGNATURE);
setHitachiEtbBiasBins(PASS_CONFIG_PARAMETER_SIGNATURE);
@ -1066,4 +1061,20 @@ void setProteusHitachiEtbDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
CONFIG(tps1SecondaryMax) = CONFIG(tps2SecondaryMax) = 161;
}
void setProteusHitachiEtbDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setHitachiEtbCalibration(PASS_CONFIG_PARAMETER_SIGNATURE);
// EFI_ADC_12: "Analog Volt 3"
engineConfiguration->tps1_2AdcChannel = EFI_ADC_12;
// EFI_ADC_13: "Analog Volt 4"
engineConfiguration->tps2_1AdcChannel = EFI_ADC_13;
// EFI_ADC_0: "Analog Volt 5"
engineConfiguration->tps2_2AdcChannel = EFI_ADC_0;
// EFI_ADC_1: "Analog Volt 6"
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_1;
// EFI_ADC_2: "Analog Volt 7"
engineConfiguration->throttlePedalPositionSecondAdcChannel = EFI_ADC_2;
}
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */

View File

@ -16,6 +16,8 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void setEtbIdlePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX);
void setEtbWastegatePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX);
void setToyota89281_33010_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setHitachiEtbCalibration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setDefaultEtbParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);