Protocol running.

This commit is contained in:
Holger Weber
2026-02-13 00:30:34 +01:00
parent 098c577142
commit 42e9c4d97b
6 changed files with 173 additions and 41 deletions

View File

@@ -121,6 +121,22 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
{
motorsOn();
}
if (duration == 0)
{
duration = 1;
}
if (penStepCorrection == 0)
{
penStepCorrection = 1;
}
if (rotStepCorrection == 0)
{
rotStepCorrection = 1;
}
if ((1 == rotStepCorrection) && (1 == penStepCorrection))
{ // if coordinatessystems are identical
// set Coordinates and Speed
@@ -128,11 +144,11 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
// rotMotor.setSpeed(abs((float)rotStepsEBB * (float)1000 / (float)duration));
g_pStepperRotate->move(rotStepsEBB);
g_pStepperRotate->setSpeedInTicks(abs((float)rotStepsEBB * (float)1000 / (float)duration));
// penMotor.move(penStepsEBB);
// penMotor.setSpeed(abs((float)penStepsEBB * (float)1000 / (float)duration));
g_pStepperPen->move(penStepsEBB);
g_pStepperRotate->setSpeedInTicks(abs((float)penStepsEBB * (float)1000 / (float)duration));
g_pStepperPen->setSpeedInTicks(abs((float)penStepsEBB * (float)1000 / (float)duration));
}
else
{
@@ -162,12 +178,14 @@ void prepareMove(uint16_t duration, int penStepsEBB, int rotStepsEBB)
// penMotor.move(penStepsToGo);
// penMotor.setSpeed(penSpeed);
g_pStepperPen->move(penStepsToGo);
g_pStepperRotate->setSpeedInTicks(penSpeed);
g_pStepperPen->setSpeedInTicks(penSpeed);
}
}
void moveOneStep()
{
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning())
;
// if (penMotor.distanceToGo() || rotMotor.distanceToGo())
// {
// penMotor.runSpeedToPosition(); // Moving.... moving... moving....
@@ -177,6 +195,8 @@ void moveOneStep()
void moveToDestination()
{
while (g_pStepperPen->isRunning() || g_pStepperRotate->isRunning())
;
// while (penMotor.distanceToGo() || rotMotor.distanceToGo())
// {
// penMotor.runSpeedToPosition(); // Moving.... moving... moving....