Fix first motor command by setting speed before move
This commit is contained in:
@@ -127,11 +127,11 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
|
|||||||
if ((1 == fROT_STEP_CORRECTION) && (1 == fPEN_STEP_CORRECTION))
|
if ((1 == fROT_STEP_CORRECTION) && (1 == fPEN_STEP_CORRECTION))
|
||||||
{ // if coordinatessystems are identical
|
{ // if coordinatessystems are identical
|
||||||
// set Coordinates and Speed
|
// set Coordinates and Speed
|
||||||
g_pStepperRotate->move(rotStepsEBB);
|
|
||||||
g_pStepperRotate->setSpeedInTicks(abs((float)rotStepsEBB * (float)1000 / (float)duration));
|
g_pStepperRotate->setSpeedInTicks(abs((float)rotStepsEBB * (float)1000 / (float)duration));
|
||||||
|
g_pStepperRotate->move(rotStepsEBB);
|
||||||
|
|
||||||
g_pStepperPen->move(penStepsEBB);
|
|
||||||
g_pStepperPen->setSpeedInTicks(abs((float)penStepsEBB * (float)1000 / (float)duration));
|
g_pStepperPen->setSpeedInTicks(abs((float)penStepsEBB * (float)1000 / (float)duration));
|
||||||
|
g_pStepperPen->move(penStepsEBB);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -153,11 +153,11 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
|
|||||||
float penSpeed = (float)abs(temp_penSpeed);
|
float penSpeed = (float)abs(temp_penSpeed);
|
||||||
|
|
||||||
// set Coordinates and Speed
|
// set Coordinates and Speed
|
||||||
g_pStepperRotate->move(rotStepsToGo);
|
|
||||||
g_pStepperRotate->setSpeedInTicks(rotSpeed);
|
g_pStepperRotate->setSpeedInTicks(rotSpeed);
|
||||||
|
g_pStepperRotate->move(rotStepsToGo);
|
||||||
|
|
||||||
g_pStepperPen->move(penStepsToGo);
|
|
||||||
g_pStepperPen->setSpeedInTicks(penSpeed);
|
g_pStepperPen->setSpeedInTicks(penSpeed);
|
||||||
|
g_pStepperPen->move(penStepsToGo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user