Allow moving a non-homed motor (but print a warning)

This commit is contained in:
2026-06-08 13:19:01 +02:00
parent a84992b4cd
commit 28875dec25
+7 -5
View File
@@ -358,15 +358,17 @@ asynStatus sinqAxis::move(double position, int relative, double minVelocity,
// =========================================================================
/*
Check if the motor is allowed to move: If the motor hasn't been homed in the
past and has an incremental encoder, it needs to be homed first!
If the motor has an incremental encoder and has not been homed yet, inform
the user with a warning, but allow the move anyway.
*/
getAxisParamChecked(this, encoderType, &encType);
getAxisParamChecked(this, motorStatusHomed, &motorStatHomed);
if (strcmp(encType, IncrementalEncoder) == 0 && motorStatHomed == 0) {
setAxisParamChecked(this, motorErrorMessage,
"Motor needs to be homed first.");
return asynError;
asynPrint(pC_->pasynUser(), ASYN_TRACE_WARNING,
"Controller \"%s\", axis %d => %s, line "
"%d:\nMoving axis with incremental encoder which hasn't been "
"homed yet. Reported position values might be wrong.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
}
// Store the target position internally