1

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?

  • 1
    Most servo motors have encoders which output a 2-phase quadrature signal. Once a homing reference is done it's just a matter of counting pulses to keep track of position. See if my answer to https://electronics.stackexchange.com/a/456851/73158 helps. Also https://electronics.stackexchange.com/a/251630/73158 and https://electronics.stackexchange.com/a/227936/73158. Then maybe you can narrow down your question a bit. – Transistor Oct 26 '20 at 22:29
  • Is this a real industrial servo motor, or an RC model toy servo? –  Oct 26 '20 at 22:52
  • @BrianDrummond this is a real industrial servo motor. – seldomseenkid Oct 26 '20 at 23:07
  • @Transistor Yes, thank you, that is certainly helpful. I just need to know the formulas used to obtain the lens positions so precisely. – seldomseenkid Oct 26 '20 at 23:29
  • Then your question seems to be, "What is the relationship between lens position and focal length?" (which isn't an electronics design question) but possibly followed by, "How is this implemented in an electronic design?" (which would be an electronics design question). – Transistor Oct 27 '20 at 07:35
  • @Transistor thank you, yes. I don't know how to build the question correctly, which is also why it is giving me a hard time finding out more about this. – seldomseenkid Oct 27 '20 at 16:09

0 Answers0