First of all, to be clear, I am not very experienced with mathematics applied to electronics but I have had the interest for a while.
What is the right approach to knowing the position of a servo motor so you can display it in your computer? I know encoders are used, but I'm interested in the math happening behind all of this.
What sparkled my curiosity is that I work with a motion control robot that has a motor to control a camera lens. You can calibrate a lens by inputing the lens' physical distance to an object and assigning that number (for example, 7") to a motor position.
This motor is a servo.
The process is fairly simple, by zeroing the motor at the lens' "infinity", once you physically move the lens (the motor has a gear that aligns with the lens' teeth, thus moving along with it) you can stop at any spot (7" like stated before) and store the motor position to that.
By doing a zero position, middle point and close focus point, you essentially have the lens figured out for the system to travel end to end and be quite precise about the lens' current physical position (for example, you stop at 12" and it will be showing that in the computer)
What is the math behind this? How do you approach this challenge correctly?