stepper setup usability

only:uaefi
This commit is contained in:
rusefi 2024-08-22 19:11:10 -04:00
parent b54b37aef6
commit 895fda7752
5 changed files with 19 additions and 20 deletions

View File

@ -62,8 +62,8 @@ void setBoardConfigOverrides() {
static void setDefaultETBPins() {
// users would want to override those if using H-bridges for stepper idle control
setupTLE9201(/*PWM controlPin*/Gpio::MM100_OUT_PWM3, Gpio::MM100_OUT_PWM4, Gpio::MM100_SPI2_MISO);
setupTLE9201(/*PWM controlPin*/Gpio::MM100_OUT_PWM5, Gpio::MM100_SPI2_MOSI, Gpio::MM100_USB1ID, 1);
setupTLE9201IncludingStepper(/*PWM controlPin*/Gpio::MM100_OUT_PWM3, Gpio::MM100_OUT_PWM4, Gpio::MM100_SPI2_MISO);
setupTLE9201IncludingStepper(/*PWM controlPin*/Gpio::MM100_OUT_PWM5, Gpio::MM100_SPI2_MOSI, Gpio::MM100_USB1ID, 1);
}
/**

View File

@ -47,8 +47,10 @@ void setBoardConfigOverrides() {
}
void setBoardDefaultConfiguration() {
setupTLE9201(/*PWM controlPin*/Gpio::MM100_OUT_PWM3, Gpio::MM100_OUT_PWM4, Gpio::MM100_SPI2_MISO);
setupTLE9201(/*PWM controlPin*/Gpio::MM100_OUT_PWM5, Gpio::MM100_SPI2_MOSI, Gpio::MM100_USB1ID, 1);
// GM stepper: DC2 positive#4/negative#5 to pins A/B
// DC1 positive#1/negative#2 to pin D/C
setupTLE9201IncludingStepper(/*PWM controlPin*/Gpio::MM100_OUT_PWM3, Gpio::MM100_OUT_PWM4, Gpio::MM100_SPI2_MISO);
setupTLE9201IncludingStepper(/*PWM controlPin*/Gpio::MM100_OUT_PWM5, Gpio::MM100_SPI2_MOSI, Gpio::MM100_USB1ID, 1);
setHellenMMbaro();

View File

@ -18,22 +18,6 @@ void setStepperHw() {
engineConfiguration->injector.flow = 482.5;
setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
#ifdef HW_HELLEN_UAEFI121
// on SBC style stepper IAC fully-extended valve shaft would give least idle air
// fully-retracted valve shaft would give most idle air
// DC2 positive#4/negative#5 to pins A/B
engineConfiguration->stepperDcIo[0].controlPin = Gpio::MM100_OUT_PWM5; // DC2_PWM
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::MM100_SPI2_MOSI; // DC2_DIR
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[0].disablePin = Gpio::MM100_USB1ID;
// DC1 positive#1/negative#2 to pin D/C
engineConfiguration->stepperDcIo[1].controlPin = Gpio::MM100_OUT_PWM3; // DC1_PWM
engineConfiguration->stepperDcIo[1].directionPin1 = Gpio::MM100_OUT_PWM4; // DC1_DIR
engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[1].disablePin = Gpio::MM100_SPI2_MISO; // ETB_DIS
#endif
#ifdef HW_HELLEN_8CHAN
// using 8chan pinout for DC1: A26 (OUT_DC1+ AH pin "D") and A27 (OUT_DC1- AL pin "C")
engineConfiguration->stepperDcIo[0].controlPin = Gpio::H144_GP_IO4; // DC1_PWM

View File

@ -370,3 +370,15 @@ void setupTLE9201(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex) {
// we only have pwm/dir, no dira/dirb
engineConfiguration->etb_use_two_wires = false;
}
void setupTLE9201IncludingStepper(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex) {
setupTLE9201(controlPin, direction, disable, dcIndex);
// on SBC style stepper IAC fully-extended valve shaft would give least idle air
// fully-retracted valve shaft would give most idle air
int stepperIndexWeirdness = 1 - dcIndex;
engineConfiguration->stepperDcIo[stepperIndexWeirdness].controlPin = controlPin;
engineConfiguration->stepperDcIo[stepperIndexWeirdness].directionPin1 = direction;
engineConfiguration->stepperDcIo[stepperIndexWeirdness].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[stepperIndexWeirdness].disablePin = disable;
}

View File

@ -13,6 +13,7 @@ void setGDIFueling();
void setGdiWallWetting();
void setInline4();
void setupTLE9201(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex = 0);
void setupTLE9201IncludingStepper(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex = 0);
#define DEFAULT_CRANKING_DWELL_MS 6
#define DEFAULT_CRANKING_ANGLE 6