Calibration/homing speed parameter
parent
7ca8130a95
commit
0b6f5705d5
|
@ -1243,9 +1243,9 @@ void StepperControl::loadMotorSettings()
|
|||
|
||||
CurrentState::getInstance()->setStepsPerMm(stepsPerMm[0], stepsPerMm[1], stepsPerMm[2]);
|
||||
|
||||
axisX.loadMotorSettings(speedMax[0], speedMin[0], stepsAcc[0], timeOut[0], homeIsUp[0], motorInv[0], endStInv[0], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[0], motor2Inv[0], endStEnbl[0], motorStopAtHome[0], motorMaxSize[0], motorStopAtMax[0]);
|
||||
axisY.loadMotorSettings(speedMax[1], speedMin[1], stepsAcc[1], timeOut[1], homeIsUp[1], motorInv[1], endStInv[1], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[1], motor2Inv[1], endStEnbl[1], motorStopAtHome[1], motorMaxSize[1], motorStopAtMax[1]);
|
||||
axisZ.loadMotorSettings(speedMax[2], speedMin[2], stepsAcc[2], timeOut[2], homeIsUp[2], motorInv[2], endStInv[2], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[2], motor2Inv[2], endStEnbl[2], motorStopAtHome[2], motorMaxSize[2], motorStopAtMax[2]);
|
||||
axisX.loadMotorSettings(speedMax[0], speedMin[0], speedHome[0], stepsAcc[0], timeOut[0], homeIsUp[0], motorInv[0], endStInv[0], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[0], motor2Inv[0], endStEnbl[0], motorStopAtHome[0], motorMaxSize[0], motorStopAtMax[0]);
|
||||
axisY.loadMotorSettings(speedMax[1], speedMin[1], speedHome[1], stepsAcc[1], timeOut[1], homeIsUp[1], motorInv[1], endStInv[1], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[1], motor2Inv[1], endStEnbl[1], motorStopAtHome[1], motorMaxSize[1], motorStopAtMax[1]);
|
||||
axisZ.loadMotorSettings(speedMax[2], speedMin[2], speedHome[2], stepsAcc[2], timeOut[2], homeIsUp[2], motorInv[2], endStInv[2], MOVEMENT_INTERRUPT_SPEED, motor2Enbl[2], motor2Inv[2], endStEnbl[2], motorStopAtHome[2], motorMaxSize[2], motorStopAtMax[2]);
|
||||
|
||||
primeMotors();
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ unsigned int StepperControlAxis::calculateSpeed(long sourcePosition, long curren
|
|||
unsigned long halfway = ((endPos - staPos) / 2) + staPos;
|
||||
//unsigned long halfway = ((destinationPosition - sourcePosition) / 2) + sourcePosition;
|
||||
|
||||
// Set the minimum speed if the position would be out of bounds
|
||||
// Set the homing speed if the position would be out of bounds
|
||||
if (
|
||||
(curPos < staPos || curPos > endPos)
|
||||
// ||
|
||||
|
@ -110,7 +110,8 @@ unsigned int StepperControlAxis::calculateSpeed(long sourcePosition, long curren
|
|||
// (!motorHomeIsUp && currentPosition <= 0) || (motorHomeIsUp && currentPosition >= 0) ||)
|
||||
)
|
||||
{
|
||||
newSpeed = minSpeed;
|
||||
newSpeed = motorSpeedHome;
|
||||
//newSpeed = minSpeed;
|
||||
movementCrawling = true;
|
||||
movementMoving = true;
|
||||
}
|
||||
|
@ -395,13 +396,14 @@ void StepperControlAxis::StepperControlAxis::loadPinNumbers(int step, int dir, i
|
|||
}
|
||||
|
||||
void StepperControlAxis::loadMotorSettings(
|
||||
long speedMax, long speedMin, long stepsAcc, long timeOut, bool homeIsUp, bool motorInv,
|
||||
long speedMax, long speedMin, long speedHome, long stepsAcc, long timeOut, bool homeIsUp, bool motorInv,
|
||||
bool endStInv, long interruptSpeed, bool motor2Enbl, bool motor2Inv, bool endStEnbl,
|
||||
bool stopAtHome, long maxSize, bool stopAtMax)
|
||||
{
|
||||
|
||||
motorSpeedMax = speedMax;
|
||||
motorSpeedMin = speedMin;
|
||||
motorSpeedHome = speedHome;
|
||||
motorStepsAcc = stepsAcc;
|
||||
motorTimeOut = timeOut;
|
||||
motorHomeIsUp = homeIsUp;
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
StepperControlAxis();
|
||||
|
||||
void loadPinNumbers(int step, int dir, int enable, int min, int max, int step2, int dir2, int enable2);
|
||||
void loadMotorSettings(long speedMax, long speedMin, long stepsAcc, long timeOut, bool homeIsUp, bool motorInv, bool endStInv, long interruptSpeed, bool motor2Enbl, bool motor2Inv, bool endStEnbl, bool stopAtHome, long maxSize, bool stopAtMax);
|
||||
void loadMotorSettings(long speedMax, long speedMin, long speedHome, long stepsAcc, long timeOut, bool homeIsUp, bool motorInv, bool endStInv, long interruptSpeed, bool motor2Enbl, bool motor2Inv, bool endStEnbl, bool stopAtHome, long maxSize, bool stopAtMax);
|
||||
void loadCoordinates(long sourcePoint, long destinationPoint, bool home);
|
||||
void setMaxSpeed(long speed);
|
||||
|
||||
|
@ -102,6 +102,7 @@ private:
|
|||
// motor settings
|
||||
long motorSpeedMax; // maximum speed in steps per second
|
||||
long motorSpeedMin; // minimum speed in steps per second
|
||||
long motorSpeedHome; // homing speed in steps per second
|
||||
long motorStepsAcc; // number of steps used for acceleration
|
||||
long motorTimeOut; // timeout in seconds
|
||||
bool motorHomeIsUp; // direction to move when reached 0 on axis but no end stop detected while homing
|
||||
|
|
Loading…
Reference in New Issue