In one embodiment, an optical encoder device is provided with an optical encoder to detect codewheel/codestrip positions; a housing to accommodate the optical encoder; a first tapered guidepost protruding from a sidewall of the optical encoder housing; and a second tapered guidepost protruding from the sidewall of the optical encoder housing and extending substantially parallel to the first tapered guidepost. Other embodiments are also disclosed.