fix ABC speed bug
parent
51c087ae6d
commit
4f51b92d4b
|
@ -243,22 +243,34 @@ int StepperControl::moveToCoords(double xDestScaled, double yDestScaled, double
|
||||||
|
|
||||||
if (xMaxSpd > 0 && xMaxSpd < speedMax[0])
|
if (xMaxSpd > 0 && xMaxSpd < speedMax[0])
|
||||||
{
|
{
|
||||||
speedMax[0] = xMaxSpd;
|
commandSpeed[0] = xMaxSpd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
commandSpeed[0] = speedMax[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yMaxSpd > 0 && yMaxSpd < speedMax[1])
|
if (yMaxSpd > 0 && yMaxSpd < speedMax[1])
|
||||||
{
|
{
|
||||||
speedMax[1] = yMaxSpd;
|
commandSpeed[1] = yMaxSpd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
commandSpeed[1] = speedMax[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zMaxSpd > 0 && zMaxSpd < speedMax[2])
|
if (zMaxSpd > 0 && zMaxSpd < speedMax[2])
|
||||||
{
|
{
|
||||||
speedMax[2] = zMaxSpd;
|
commandSpeed[2] = zMaxSpd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
commandSpeed[2] = speedMax[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
axisX.setMaxSpeed(speedMax[0]);
|
axisX.setMaxSpeed(commandSpeed[0]);
|
||||||
axisY.setMaxSpeed(speedMax[1]);
|
axisY.setMaxSpeed(commandSpeed[1]);
|
||||||
axisZ.setMaxSpeed(speedMax[2]);
|
axisZ.setMaxSpeed(commandSpeed[2]);
|
||||||
|
|
||||||
// Load coordinates into axis class
|
// Load coordinates into axis class
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ private:
|
||||||
|
|
||||||
bool homeIsUp[3] = {false, false, false};
|
bool homeIsUp[3] = {false, false, false};
|
||||||
long speedMax[3] = {0, 0, 0 };
|
long speedMax[3] = {0, 0, 0 };
|
||||||
|
long commandSpeed[3] = { 0, 0, 0 };
|
||||||
long speedMin[3] = { 0, 0, 0 };
|
long speedMin[3] = { 0, 0, 0 };
|
||||||
long speedHome[3] = { 0, 0, 0 };
|
long speedHome[3] = { 0, 0, 0 };
|
||||||
long stepsAcc[3] = { 0, 0, 0 };
|
long stepsAcc[3] = { 0, 0, 0 };
|
||||||
|
|
Loading…
Reference in New Issue