Idler dynamic IHOLD adjustments

pull/218/head
Alex Voinea 2022-10-13 22:22:02 +02:00 committed by D.R.racer
parent bf89030423
commit 26a7082e4f
1 changed files with 7 additions and 2 deletions

View File

@ -53,8 +53,13 @@ bool Idler::FinishHomingAndPlanMoveToParkPos() {
void Idler::FinishMove() {
currentlyEngaged = plannedMove;
if (Disengaged()) // turn off power into the Idler motor when disengaged (no force necessary)
mm::motion.Disable(mm::Idler);
if (Disengaged()) // reduce power into the Idler motor when disengaged (less force necessary)
mm::motion.DriverForAxis(axis).SetCurrents(mm::axisParams[axis].params, mm::axisParams[axis].currents);
else if (Engaged()) { // maximum motor power when the idler is engaged
hal::tmc2130::MotorCurrents tempCurrent = mm::axisParams[axis].currents;
tempCurrent.iHold = tempCurrent.iRun;
mm::motion.DriverForAxis(axis).SetCurrents(mm::axisParams[axis].params, tempCurrent);
}
}
Idler::OperationResult Idler::Disengage() {