All servos consist of an electrical and a mechanical interface but there are dozens of different types and millions of variations and thus hundreds of possible solutions to this problem . Unknown is your skill level, time and budget.
The object is to force the motor to an electrical equivalent position for a servo. But here it is different. The task must have detailed specs;
- start from some known initial position with attachment or random and them seek to the known start
it must seek to overcome stiction and detent forces which change direction (and thus transition thru zero torque in between the resting positions thus there are 2 minimum torque crossings per increment.
the most precise servos use some kind of rotary (or linear) digital quadrature or Gray Code encoder (or pot for limited angle) for feedback.
The Gray Code is a parallel logic expensive but absolute encode, while the rotary encoders are far simpler yet have no absolute position feedback so an optical interruptor switch is needed for “home” or zero. Then a decoder take the 2 quadrature signals and converts to step and direction for an up down (hardware/software) counter.
However a normal servo tries to seek to the next position with zero error (offset voltage) and here you want to seek and then float and measure the resulting position error of the detent. (Common to all fans and BLDC magnet motors. While a normal servo responds with “seek complete” signal here you want to float by turning off the motor to find its nearby resting position to wait for a suitable settling time such that the position error does not change more than 0.05% between suitable time intervals. Then you may want to reverse the seek direction later to this spot to measure hysteresis.
The problem arises that your drive motor must not have resting torque to bias the results of your measurement or in other words no magnetic cogging. So a reluctance style serving motor without magnets is needed.
If you were measuring the Hall sensor errors in MFG of BLDC motors , this is a critical requirement but there are many better ways that also involve temperature effects so that fans don’t stall and motors turn after power up (very common design / process flaw. It Hall sensor errors can result in stuck rotors or dither back and forth because the torque direction change is optimized by this method of placing Hall sensors just before but never past the resting detent position. Otherwise failure in any one of the resting positions. Same is true for all BLDC motors.
In my past , I have disqualified 2 vendors due to >1% failure rate in at least 1 resting position and gave them a test jig design to perform on all outgoing products to get requalified.