Add option to power stepper motor constantly. Fixes #1031

This commit is contained in:
Josh Stewart 2023-05-17 08:17:26 +10:00
parent 4e157ce504
commit b49c6b6ab8
5 changed files with 11 additions and 4 deletions

View File

@ -1044,7 +1044,7 @@ page = 9
boostByGearEnabled = bits, U08, 153, [4:5], "Off", "Multiplied %", "Constant limit", "INVALID"
blankfield = bits, U08, 153, [6:6], "",""
unused9_153 = bits, U08, 153, [7:7], "Off", "On"
iacStepperPower = bits, U08, 153, [7:7], "When Active", "Always"
iacMaxSteps = scalar, U08, 154, "Steps", 3, 0, 0, {iacStepHome-3}, 0
idleAdvStartDelay = scalar, U08, 155, "S", 0.1, 0.0, 0.0, 25.5, 1
@ -2077,11 +2077,12 @@ menuDialog = main
iacStepHome = "Homing steps to perform on startup. Must be greater than the fully open steps value"
iacMaxSteps = "Maximum number of steps the IAC can be moved away from the home position. Should always be less than Homing steps."
iacStepHyster = "The minimum number of steps to move in any one go."
iacStepperPower = "Power the stepper motor only when performing a step (Default) or constantly. If unsure, choose Only When Active."
iacAlgorithm = "Selects method of idle control.\nNone = no idle control valve.\nOn/Off valve.\nPWM valve (2,3 wire).\nStepper Valve (4,6,8 wire)."
iacPWMdir = "Normal PWM valves increase RPM with higher duty. If RPM decreases with higher duty then select Reverse"
iacPWMrun = "Determines if the idle valve runs before engine is cranked over. This can help starting the engine by letting more air in before the RPM sync is achieved."
iacCLminValue = "When using closed loop idle control, this is the minimum position value that the PID loop will allow. Combined with the maximum value, this specifies the working range of your idle valve"
iacCLmaxValue = "When using closed loop idle control, this is the maximum position value that the PID loop will allow. Combined with the minimum value, this specifies the working range of your idle valve"
iacCLminValue = "When using closed loop idle control, this is the minimum position value that the PID loop will allow. Combined with the maximum value, this specifies the working range of your idle valve"
iacCLmaxValue = "When using closed loop idle control, this is the maximum position value that the PID loop will allow. Combined with the minimum value, this specifies the working range of your idle valve"
iacTPSlimit = "When using OL+CL idle control, if the TPS is higher than this value closed loop idle resets the integral of the PID (To prevent RPM dips coming back to idle)"
iacRPMlimitHysteresis = "When using closed loop idle control, if the closed loop Target RPM + this value is higher than the actual RPM, closed loop idle resets the integral of the PID (To prevent RPM dips coming back to idle)"
iacFastTemp = "Below this temperature, the idle output will be high (On). Above this temperature, it will turn off."

View File

@ -1160,6 +1160,8 @@ struct config9 {
byte iacCoolTime : 3; // how long to wait for the stepper to cool between steps
byte boostByGearEnabled : 2;
byte blankField : 1;
byte iacStepperPower : 1; //Whether or not to power the stepper motor when not in use
byte iacMaxSteps; // Step limit beyond which the stepper won't be driven. Should always be less than homing steps. Stored div 3 as per home steps.
byte idleAdvStartDelay; //delay for idle advance engage

View File

@ -21,6 +21,7 @@
#define STEPPER_FORWARD 0
#define STEPPER_BACKWARD 1
#define STEPPER_POWER_WHEN_ACTIVE 0
#define IDLE_TABLE_SIZE 10
enum StepperStatus {SOFF, STEPPING, COOLING}; //The 2 statuses that a stepper can have. STEPPING means that a high pulse is currently being sent and will need to be turned off at some point.

View File

@ -326,7 +326,7 @@ static inline byte checkForStepping(void)
{
//Means we're in COOLING status but have been in this state long enough. Go into off state
idleStepper.stepperStatus = SOFF;
digitalWrite(pinStepperEnable, HIGH); //Disable the DRV8825
if(configPage9.iacStepperPower == STEPPER_POWER_WHEN_ACTIVE) { digitalWrite(pinStepperEnable, HIGH); } //Disable the DRV8825
}
}
else

View File

@ -696,6 +696,9 @@ void doUpdates(void)
//Oil Pressure protection delay added. Set to 0 to match existing behaviour
configPage10.oilPressureProtTime = 0;
//Option to power stepper motor constantly was added. Default to previous behaviour
configPage9.iacStepperPower = 0;
writeAllConfig();
storeEEPROMVersion(21);
}