DuaneDegn. Thank you. I ran the code, and it seems to be runnig fine, but when I change the angle values from 47 .. 108 to 20 .. 130 the servo will shoot to one of the end positions and will get locked there.
I think the end stop is not stopping the servo fast enough.
The only way for the servo code in reply #18 to lock up is for the the end switch state to not change.
You have a homemade disc. You don't know exactly where in the open slot window the end stop see's enough IR to switch. If it the code works with overshoot, but not at at the exact servo positions you code in, it's likely not a timing issue but a state issue.