Merge branch 'homing' into dev

This commit is contained in:
2024-08-06 12:48:20 -05:00

View File

@@ -230,8 +230,10 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
// The MD-90 will start the home routine in the direction of the last move // The MD-90 will start the home routine in the direction of the last move
// Here we first make a small move to set the desired direction before homing // Here we first make a small move to set the desired direction before homing
sprintf(pC_->outString_, "SNS %d", SMALL_NSTEPS); if (!status) {
status = pC_->writeReadController(); sprintf(pC_->outString_, "SNS %d", SMALL_NSTEPS);
status = pC_->writeReadController();
}
if (!status) { if (!status) {
status = parseReply(functionName, pC_->inString_); status = parseReply(functionName, pC_->inString_);
} }
@@ -241,18 +243,21 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
} else { } else {
sprintf(pC_->outString_, "ESB"); sprintf(pC_->outString_, "ESB");
} }
status = pC_->writeReadController(); if (!status) {
status = pC_->writeReadController();
}
if (!status) { if (!status) {
status = parseReply(functionName, pC_->inString_); status = parseReply(functionName, pC_->inString_);
} }
// Wait for the move to complete, then home if (!status) {
// Wait for the move to complete, then home
sleepTime = SLEEP_MARGIN * SMALL_NSTEPS * COUNTS_PER_STEP / maxVelocity;
std::this_thread::sleep_for(std::chrono::seconds(sleepTime));
sleepTime = SLEEP_MARGIN * SMALL_NSTEPS * COUNTS_PER_STEP / maxVelocity; sprintf(pC_->outString_, "HOM");
std::this_thread::sleep_for(std::chrono::seconds(sleepTime)); status = pC_->writeReadController();
}
sprintf(pC_->outString_, "HOM");
status = pC_->writeReadController();
if (!status) { if (!status) {
status = parseReply(functionName, pC_->inString_); status = parseReply(functionName, pC_->inString_);
} }