- changed status to open
ASCOM Relative Focuser and MaxIncrement
When using ASCOM interface with a Relative Focuser the MaxIncrement provided by the driver is not honored.
https://ascom-standards.org/Help/Developer/html/M_ASCOM_DriverAccess_Focuser_Move.htm
“If the Absolute property is False, then this is a relative positioning focuser. The Move command tells the focuser to move in a relative direction, and the Position parameter of the Move method (in this case, step distance) is an integer between minus MaxIncrement and plus MaxIncrement.”
ASCOM log:
07:50:53.615 Absolute Get GET Absolute - COM
07:50:53.615 Absolute Get False
07:50:53.623 MaxIncrement Get 20
07:51:01.656 Move Start
07:51:01.656 Move Parameter: 250
07:51:01.656 Move Calling Move - it is a COM object
Source code affected:
AscomFocuser.cs
moveAmount = Math.Min(MaxStep, Math.Abs(relativeOffsetRemaining));
Does not account for MaxIncrement only MaxStep
public Task Move(int position, CancellationToken ct, int waitInMs = 1000) {
if (_isAbsolute) {
return MoveInternalAbsolute(position, ct, waitInMs);
} else {
return MoveInternalRelative(position, ct, waitInMs);
}
}
private async Task MoveInternalRelative(int position, CancellationToken ct, int waitInMs = 1000) {
if (Connected) {
var reEnableTempComp = TempComp;
if (reEnableTempComp) {
TempComp = false;
}
var relativeOffsetRemaining = position - this.Position;
while (relativeOffsetRemaining != 0 && !ct.IsCancellationRequested) {
var moveAmount = Math.Min(MaxStep, Math.Abs(relativeOffsetRemaining));
if (relativeOffsetRemaining < 0) {
moveAmount *= -1;
}
device.Move(moveAmount);
Comments (4)
-
repo owner -
repo owner Thank you for the report. Looks like MaxStep just has to be replaced with MaxIncrement, as MaxStep is handled outside of the move method already.
-
repo owner - changed status to resolved
Fix Issue
#1261- ASCOM Relative Focuser and MaxIncrement→ <<cset 0e19efb07f64>>
-
reporter Thanks!
- Log in to comment