fix ABC speed bug

pull/100/head
gabrielburnworth 2017-12-16 15:11:03 -08:00
parent 51c087ae6d
commit 4f51b92d4b
2 changed files with 19 additions and 6 deletions

View File

@ -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

View File

@ -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 };