Skip to content

Commit

Permalink
Add a delay after move with backlash
Browse files Browse the repository at this point in the history
  • Loading branch information
pchev committed Mar 24, 2018
1 parent f2b813f commit 8723653
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cu_focuser.pas
Expand Up @@ -133,12 +133,14 @@ procedure T_focuser.SetPositionInt(p:integer);
if FBacklashDirection then
begin
msg(Format(rsFocuserMoveT, [inttostr(p)])+' + '+inttostr(FBacklash)+' '+rsBacklashComp);
SetPosition(p+FBacklash) // backlash IN, go OUT first
SetPosition(p+FBacklash); // backlash IN, go OUT first
Wait(1); // some focuser need a delay to refresh their position
end
else
begin
msg(Format(rsFocuserMoveT, [inttostr(p)])+' - '+inttostr(FBacklash)+' '+rsBacklashComp);
SetPosition(p-FBacklash); // backlash OUT, go IN first
Wait(1); // some focuser need a delay to refresh their position
end;
end;
msg(Format(rsFocuserMoveT, [inttostr(p)]));
Expand All @@ -152,12 +154,14 @@ procedure T_focuser.SetRelPositionInt(p:integer);
if FBacklashDirection then begin // want to go OUT, backlash IN
msg(Format(rsFocuserMoveB, [inttostr(FFocusdirection*p)])+', '+rsBacklashComp+' + '+inttostr(FBacklash));
SetRelPosition(p+FBacklash); // go more OUT than required
Wait(1); // some focuser need a delay to refresh their position
FocusIN; // go IN by backlash
SetRelPosition(FBacklash);
end
else begin // want to go IN, backlash OUT
msg(Format(rsFocuserMoveB, [inttostr(FFocusdirection*p)])+', '+rsBacklashComp+' - '+inttostr(FBacklash));
SetRelPosition(p+FBacklash); // go more IN than required
Wait(1); // some focuser need a delay to refresh their position
FocusOUT; // go OUT by backlash
SetRelPosition(FBacklash)
end;
Expand Down

0 comments on commit 8723653

Please sign in to comment.