Does this sound doable with an '328 family processor? I’m thinking 0.05425 uS resolution is faster than the uC clock speed, so not possible to get there?
"I have some questions about yet another project (still part of the same larger project). Are you familiar at all with how RC servos work? Brief rundown - servo receives a pulse every 20ms or so, and the width of that pulse basically defines an absolute position that the motor should seek out, generally within a range of 180 degrees the servo can travel. The pulse width is typically between 1000uS - 2500uS. I am using a servo controller as part of this project that will control the pulse width to within 0.05425 uS resolution, within a range of 10-2390 uS.
RC servos usually use a potentiometer for position feedback and a small DC motor with high gear ratio to generate significant torque.
I need an MCU circuit built that will basically act as an digital RC servo controller, like that typically found inside an RC servo, but it will use an optical encoder for feedback and a stepper motor as the source of motion. The MCU will need to read a typical servo control pulse and translate that in to a desired target position for the optical encoder. It will immediately output TTL step/direction pulses to a separate stepper driver until the desired encoder position is reached. The MCU will constantly be comparing the target position with the actual position of the encoder and correcting the position if it is not in the correct place. If the position is correct (within a certain “dead-band” window) no step pulses will be outputted.
The tricky part might be that the step pulses must be output within a specified rate of acceleration/deceleration to avoid exceeding the possible physical acceleration rate of the motor. That rate would be determined through testing and permanently programmed in to the MCU. Beyond that the MCU would need to constantly monitor how close it is getting to its destination and reduce the step frequency accordingly to avoid overshooting the destination.
A few other features would be necessary on the board, like the ability to slowly “home” to a nearby index mark on the optical encoder upon power-up, then define that as the zero position (typically this is the “center” of the servo travel range, defined by a 1500uS pulse width). Furthermore, a scale factor would be set via a couple jumpers, allowing the number of encoder pulses travelled per uS of pulse width to be varied. This would allow the total allowable travel of the motor to be varied."