VVT is no longer aux pid

This commit is contained in:
rusefillc 2021-10-28 23:51:46 -04:00
parent 64ecbb16ab
commit 5f4fa50682
9 changed files with 47 additions and 47 deletions

View File

@ -143,7 +143,7 @@ void setBoardDefaultConfiguration(void) {
engineConfiguration->fan2Pin = GPIOD_9; engineConfiguration->fan2Pin = GPIOD_9;
engineConfiguration->enableFan2WithAc = true; engineConfiguration->enableFan2WithAc = true;
engineConfiguration->mainRelayPin = GPIOI_2; // OUT_LOW3 engineConfiguration->mainRelayPin = GPIOI_2; // OUT_LOW3
engineConfiguration->auxPidPins[0] = GPIOI_0; // 4R - VVT (O5) engineConfiguration->vvtPins[0] = GPIOI_0; // 4R - VVT (O5)
engineConfiguration->tachOutputPin = GPIOD_13; // 3O - TACH (PWM7) engineConfiguration->tachOutputPin = GPIOD_13; // 3O - TACH (PWM7)
engineConfiguration->alternatorControlPin = GPIOD_15; // 3M - ALTERN (PWM6) engineConfiguration->alternatorControlPin = GPIOD_15; // 3M - ALTERN (PWM6)

View File

@ -55,7 +55,7 @@ void setProteusHondaElement2003(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->injectionPins[2] = PROTEUS_LS_6; engineConfiguration->injectionPins[2] = PROTEUS_LS_6;
engineConfiguration->injectionPins[3] = PROTEUS_LS_5; engineConfiguration->injectionPins[3] = PROTEUS_LS_5;
engineConfiguration->auxPidPins[0] = PROTEUS_HS_2; engineConfiguration->vvtPins[0] = PROTEUS_HS_2;
engineConfiguration->malfunctionIndicatorPin = PROTEUS_LS_10; engineConfiguration->malfunctionIndicatorPin = PROTEUS_LS_10;
engineConfiguration->idle.solenoidPin = PROTEUS_LS_15; engineConfiguration->idle.solenoidPin = PROTEUS_LS_15;

View File

@ -239,7 +239,7 @@ void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
copyArray(config->vvtTable1LoadBins, vvt18fsioLoadBins); copyArray(config->vvtTable1LoadBins, vvt18fsioLoadBins);
copyTable(config->vvtTable1, fsio_table_vvt_target); copyTable(config->vvtTable1, fsio_table_vvt_target);
engineConfiguration->auxPidFrequency[0] = 300; // VVT solenoid control engineConfiguration->vvtOutputFrequency[0] = 300; // VVT solenoid control
// VVT closed loop // VVT closed loop
engineConfiguration->auxPid[0].pFactor = 2; engineConfiguration->auxPid[0].pFactor = 2;
@ -394,7 +394,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// engineConfiguration->vehicleSpeedSensorInputPin = GPIOA_8; // engineConfiguration->vehicleSpeedSensorInputPin = GPIOA_8;
engineConfiguration->auxPidPins[0] = GPIOE_3; // VVT solenoid control engineConfiguration->vvtPins[0] = GPIOE_3; // VVT solenoid control
// /** // /**
// * set_fsio_setting 1 0.55 // * set_fsio_setting 1 0.55
// */ // */
@ -596,7 +596,7 @@ static void setMiataNB2_MRE_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// # TLE8888 high current low side: VVT1 IN10 / OUT6 // # TLE8888 high current low side: VVT1 IN10 / OUT6
// TLE8888_PIN_6: "7 - Lowside 1" // TLE8888_PIN_6: "7 - Lowside 1"
engineConfiguration->auxPidPins[0] = TLE8888_PIN_6; // VVT solenoid control engineConfiguration->vvtPins[0] = TLE8888_PIN_6; // VVT solenoid control
// TLE8888_PIN_23: "33 - GP Out 3" // TLE8888_PIN_23: "33 - GP Out 3"
engineConfiguration->malfunctionIndicatorPin = TLE8888_PIN_23; engineConfiguration->malfunctionIndicatorPin = TLE8888_PIN_23;
@ -750,7 +750,7 @@ void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE)
engineConfiguration->alternatorControlPin = GPIOA_8; // "Highside 2" # pin 1/black35 engineConfiguration->alternatorControlPin = GPIOA_8; // "Highside 2" # pin 1/black35
engineConfiguration->auxPidPins[0] = GPIOB_5; // VVT solenoid control # pin 8/black35 engineConfiguration->vvtPins[0] = GPIOB_5; // VVT solenoid control # pin 8/black35
// high-side driver with +12v VP jumper // high-side driver with +12v VP jumper
engineConfiguration->tachOutputPin = GPIOA_9; // tachometer engineConfiguration->tachOutputPin = GPIOA_9; // tachometer

View File

@ -102,7 +102,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->fuelPumpPin = TLE8888_PIN_22; engineConfiguration->fuelPumpPin = TLE8888_PIN_22;
engineConfiguration->tachOutputPin = TLE8888_PIN_16; engineConfiguration->tachOutputPin = TLE8888_PIN_16;
engineConfiguration->alternatorControlPin = TLE8888_PIN_17; engineConfiguration->alternatorControlPin = TLE8888_PIN_17;
engineConfiguration->auxPidPins[0] = TLE8888_PIN_6; // VVT solenoid control engineConfiguration->vvtPins[0] = TLE8888_PIN_6; // VVT solenoid control
#endif /* BOARD_TLE8888_COUNT */ #endif /* BOARD_TLE8888_COUNT */
engineConfiguration->mainRelayPin = GPIO_UNASSIGNED; engineConfiguration->mainRelayPin = GPIO_UNASSIGNED;
@ -136,7 +136,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
#endif /* STM32_HAS_GPIOF */ #endif /* STM32_HAS_GPIOF */
setFsioExt (3, GPIOE_0, "0.15 90 coolant 120 min max 90 - 30 / 0.8 * +", 25 PASS_CONFIG_PARAMETER_SUFFIX); setFsioExt (3, GPIOE_0, "0.15 90 coolant 120 min max 90 - 30 / 0.8 * +", 25 PASS_CONFIG_PARAMETER_SUFFIX);
#endif #endif
// is this needed? engineConfiguration->auxPidFrequency[3] = 25; // is this needed? engineConfiguration->vvtOutputFrequency[3] = 25;
CONFIG(etb_use_two_wires) = true; CONFIG(etb_use_two_wires) = true;
#if defined(STM32_HAS_GPIOF) && STM32_HAS_GPIOF #if defined(STM32_HAS_GPIOF) && STM32_HAS_GPIOF
CONFIG(etbIo[0].directionPin1) = GPIOF_15; CONFIG(etbIo[0].directionPin1) = GPIOF_15;
@ -161,7 +161,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// VVT Settings // VVT Settings
engineConfiguration->auxPidFrequency[0] = 300; engineConfiguration->vvtOutputFrequency[0] = 300;
engineConfiguration->fsio_setting[0] = 0.0; engineConfiguration->fsio_setting[0] = 0.0;
engineConfiguration->auxPid[0].pFactor = 2; engineConfiguration->auxPid[0].pFactor = 2;
engineConfiguration->auxPid[0].iFactor = 0.005; engineConfiguration->auxPid[0].iFactor = 0.005;
@ -169,7 +169,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->auxPid[0].offset = 33; engineConfiguration->auxPid[0].offset = 33;
engineConfiguration->auxPid[0].minValue = 24; engineConfiguration->auxPid[0].minValue = 24;
engineConfiguration->auxPid[0].maxValue = 44; engineConfiguration->auxPid[0].maxValue = 44;
engineConfiguration->auxPidFrequency[0] = 300; engineConfiguration->vvtOutputFrequency[0] = 300;
engineConfiguration->fsio_setting[0] = 0.0; engineConfiguration->fsio_setting[0] = 0.0;

View File

@ -130,7 +130,7 @@ void setToyota_2jz_vics(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->fsio_setting[14] = 175 - 45; engineConfiguration->fsio_setting[14] = 175 - 45;
engineConfiguration->fsio_setting[15] = 175 + 45; engineConfiguration->fsio_setting[15] = 175 + 45;
engineConfiguration->auxPidPins[0] = GPIOE_3; // VVT solenoid control engineConfiguration->vvtPins[0] = GPIOE_3; // VVT solenoid control
// Mazda VVT settings have nothing to do wit Toyota 2JZ settings but those are a good starting point for settings // Mazda VVT settings have nothing to do wit Toyota 2JZ settings but those are a good starting point for settings
setMazdaNB2VVTSettings(PASS_CONFIG_PARAMETER_SIGNATURE); setMazdaNB2VVTSettings(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -33,7 +33,7 @@ void VvtController::init(int index, int bankIndex, int camIndex, const ValueProv
} }
int VvtController::getPeriodMs() { int VvtController::getPeriodMs() {
return isBrainPinValid(engineConfiguration->auxPidPins[index]) ? return isBrainPinValid(engineConfiguration->vvtPins[index]) ?
GET_PERIOD_LIMITED(&engineConfiguration->auxPid[index]) : NO_PIN_PERIOD; GET_PERIOD_LIMITED(&engineConfiguration->auxPid[index]) : NO_PIN_PERIOD;
} }
@ -102,16 +102,16 @@ void VvtController::setOutput(expected<percent_t> outputValue) {
static VvtController instances[CAM_INPUTS_COUNT] CCM_OPTIONAL; static VvtController instances[CAM_INPUTS_COUNT] CCM_OPTIONAL;
static void turnAuxPidOn(int index) { static void turnAuxPidOn(int index) {
if (!isBrainPinValid(engineConfiguration->auxPidPins[index])) { if (!isBrainPinValid(engineConfiguration->vvtPins[index])) {
return; return;
} }
startSimplePwmExt(&instances[index].m_pwm, "Aux PID", startSimplePwmExt(&instances[index].m_pwm, "Aux PID",
&engine->executor, &engine->executor,
engineConfiguration->auxPidPins[index], engineConfiguration->vvtPins[index],
&instances[index].m_pin, &instances[index].m_pin,
// todo: do we need two separate frequencies? // todo: do we need two separate frequencies?
engineConfiguration->auxPidFrequency[0], 0.1); engineConfiguration->vvtOutputFrequency[0], 0.1);
} }
void startVvtControlPins() { void startVvtControlPins() {

View File

@ -211,7 +211,7 @@ static void setFsioPidOutputPin(const char *indexStr, const char *pinName) {
efiPrintf("invalid pin name [%s]", pinName); efiPrintf("invalid pin name [%s]", pinName);
return; return;
} }
engineConfiguration->auxPidPins[index] = pin; engineConfiguration->vvtPins[index] = pin;
efiPrintf("VVT pid pin #%d [%s]", (index + 1), hwPortname(pin)); efiPrintf("VVT pid pin #%d [%s]", (index + 1), hwPortname(pin));
} }
@ -510,7 +510,7 @@ static void showFsioInfo(void) {
showFsio("fuel", fuelPumpLogic); showFsio("fuel", fuelPumpLogic);
for (int i = 0; i < CAM_INPUTS_COUNT ; i++) { for (int i = 0; i < CAM_INPUTS_COUNT ; i++) {
brain_pin_e pin = engineConfiguration->auxPidPins[i]; brain_pin_e pin = engineConfiguration->vvtPins[i];
if (isBrainPinValid(pin)) { if (isBrainPinValid(pin)) {
efiPrintf("VVT pid #%d [%s]", (i + 1), efiPrintf("VVT pid #%d [%s]", (i + 1),
hwPortname(pin)); hwPortname(pin));

View File

@ -1252,7 +1252,7 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0, 300, 2
float mapHighValueVoltage;MAP voltage for low point;"v", 1, 0, 0, 10, 2 float mapHighValueVoltage;MAP voltage for low point;"v", 1, 0, 0, 10, 2
float egoValueShift;EGO value correction;"value", 1, 0, -10, 10, 2 float egoValueShift;EGO value correction;"value", 1, 0, -10, 10, 2
output_pin_e[CAM_INPUTS_COUNT iterate] auxPidPins; output_pin_e[CAM_INPUTS_COUNT iterate] vvtPins;
spi_device_e cj125SpiDevice; spi_device_e cj125SpiDevice;
pin_output_mode_e cj125CsPinMode; pin_output_mode_e cj125CsPinMode;
@ -1264,7 +1264,7 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0, 300, 2
float tChargeMaxRpmMinTps;;"mult", 1, 0, 0, 3, 4 float tChargeMaxRpmMinTps;;"mult", 1, 0, 0, 3, 4
float tChargeMaxRpmMaxTps;;"mult", 1, 0, 0, 3, 4 float tChargeMaxRpmMaxTps;;"mult", 1, 0, 0, 3, 4
fsio_pwm_freq_t[CAMS_PER_BANK iterate] auxPidFrequency; fsio_pwm_freq_t[CAMS_PER_BANK iterate] vvtOutputFrequency;
uint8_t fan1ExtraIdle;+Additional idle % when fan #1 is active;"%", 1, 0, 0, 100, 0 uint8_t fan1ExtraIdle;+Additional idle % when fan #1 is active;"%", 1, 0, 0, 100, 0
int alternatorPwmFrequency;;"Hz", 1, 0, 0, 3000, 0 int alternatorPwmFrequency;;"Hz", 1, 0, 0, 3000, 0
int unused2260;;"units", 1, 0, -20, 100, 0 int unused2260;;"units", 1, 0, -20, 100, 0

View File

@ -509,12 +509,12 @@ enable2ndByteCanID = false
requiresPowerCycle = idle_solenoidFrequency requiresPowerCycle = idle_solenoidFrequency
requiresPowerCycle = boostPwmFrequency requiresPowerCycle = boostPwmFrequency
requiresPowerCycle = alternatorPwmFrequency requiresPowerCycle = alternatorPwmFrequency
requiresPowerCycle = auxPidFrequency1 requiresPowerCycle = vvtOutputFrequency1
requiresPowerCycle = auxPidFrequency2 requiresPowerCycle = vvtOutputFrequency2
requiresPowerCycle = auxPidPins1 requiresPowerCycle = vvtPins1
requiresPowerCycle = auxPidPins2 requiresPowerCycle = vvtPins2
requiresPowerCycle = auxPidPins3 requiresPowerCycle = vvtPins3
requiresPowerCycle = auxPidPins4 requiresPowerCycle = vvtPins4
requiresPowerCycle = fsioOutputPins1 requiresPowerCycle = fsioOutputPins1
requiresPowerCycle = fsioOutputPins2 requiresPowerCycle = fsioOutputPins2
@ -2463,10 +2463,10 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "servo#3", servoOutputPins3 field = "servo#3", servoOutputPins3
field = "servo#4", servoOutputPins4 field = "servo#4", servoOutputPins4
field = "servo#5", servoOutputPins5 field = "servo#5", servoOutputPins5
field = "VVT Pin #1", auxPidPins1 field = "VVT Pin #1", vvtPins1
field = "VVT Pin #2", auxPidPins2 field = "VVT Pin #2", vvtPins2
field = "VVT Pin #3", auxPidPins3 field = "VVT Pin #3", vvtPins3
field = "VVT Pin #4", auxPidPins4 field = "VVT Pin #4", vvtPins4
field = "Aux Valve #1", auxValves1 field = "Aux Valve #1", auxValves1
field = "Aux Valve #2", auxValves2 field = "Aux Valve #2", auxValves2
field = "TLE8888 Chip Select", tle8888_cs @@if_ts_show_spi field = "TLE8888 Chip Select", tle8888_cs @@if_ts_show_spi
@ -3001,28 +3001,28 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
dialog = vvtPidDialog0, "Configuration" dialog = vvtPidDialog0, "Configuration"
commandButton = "Enable VVT#1 debug mode", cmd_test_debug_mode_vvt commandButton = "Enable VVT#1 debug mode", cmd_test_debug_mode_vvt
field = "VVT solenoid bank 1 intake", auxPidPins1 field = "VVT solenoid bank 1 intake", vvtPins1
field = "VVT solenoid bank 1 exhaust", auxPidPins2 field = "VVT solenoid bank 1 exhaust", vvtPins2
field = "VVT solenoid bank 2 intake", auxPidPins3 field = "VVT solenoid bank 2 intake", vvtPins3
field = "VVT solenoid bank 2 exhaust", auxPidPins4 field = "VVT solenoid bank 2 exhaust", vvtPins4
field = "PWM frequency", auxPidFrequency1, {auxPidPins1 != 0 || auxPidPins2 != 0} field = "PWM frequency", vvtOutputFrequency1, {vvtPins1 != 0 || vvtPins2 != 0}
field = "Detailed status in console", isVerboseAuxPid1, {auxPidPins1 != 0 || auxPidPins2 != 0} field = "Detailed status in console", isVerboseAuxPid1, {vvtPins1 != 0 || vvtPins2 != 0}
dialog = vvtPidDialog1, "Intake PID" dialog = vvtPidDialog1, "Intake PID"
field = "offset", auxPid1_offset, {auxPidPins1 != 0} field = "offset", auxPid1_offset, {vvtPins1 != 0}
field = "P factor", auxPid1_pFactor, {auxPidPins1 != 0} field = "P factor", auxPid1_pFactor, {vvtPins1 != 0}
field = "I factor", auxPid1_iFactor, {auxPidPins1 != 0} field = "I factor", auxPid1_iFactor, {vvtPins1 != 0}
field = "D factor", auxPid1_dFactor, {auxPidPins1 != 0} field = "D factor", auxPid1_dFactor, {vvtPins1 != 0}
field = "Min", auxPid1_minValue, {auxPidPins1 != 0} field = "Min", auxPid1_minValue, {vvtPins1 != 0}
field = "Max", auxPid1_maxValue, {auxPidPins1 != 0} field = "Max", auxPid1_maxValue, {vvtPins1 != 0}
dialog = vvtPidDialog2, "Exhaust PID" dialog = vvtPidDialog2, "Exhaust PID"
field = "offset", auxPid2_offset, {auxPidPins2 != 0} field = "offset", auxPid2_offset, {vvtPins2 != 0}
field = "P factor", auxPid2_pFactor, {auxPidPins2 != 0} field = "P factor", auxPid2_pFactor, {vvtPins2 != 0}
field = "I factor", auxPid2_iFactor, {auxPidPins2 != 0} field = "I factor", auxPid2_iFactor, {vvtPins2 != 0}
field = "D factor", auxPid2_dFactor, {auxPidPins2 != 0} field = "D factor", auxPid2_dFactor, {vvtPins2 != 0}
field = "Min", auxPid2_minValue, {auxPidPins2 != 0} field = "Min", auxPid2_minValue, {vvtPins2 != 0}
field = "Max", auxPid2_maxValue, {auxPidPins2 != 0} field = "Max", auxPid2_maxValue, {vvtPins2 != 0}
dialog = vvtPidDialog, "VVT Configuration & PID", border dialog = vvtPidDialog, "VVT Configuration & PID", border
panel = vvtPidDialog0, West panel = vvtPidDialog0, West