This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Incremental encoder

I am in possession of an incremental encoder, mounted on the shaft of an electrical machine. The encoder gives 1000 ppr. From the manual I read that it was a good idea to configure timer 3 in incremental interface mode. Also I configured it to trigger on any transition of T3IN only. Signal A from the encoder is physically coneceted to input port 3.4, and signal B to port 3.6. With the current software implementation I am able to relate counter clockwise shaft revolution with a negative decreasing value and vice versa.
However I have some trouble figuring out how to relate the magnitude of the values to a given physical position of the shaft. Does anyone have an idea how to do that?

Parents
  • Incremental encoders come in all sorts of resolutions, anywhere from 1 cycle per revolution to at least 72,000 counts per revolution. Only you and your manual know exactly what you have. You haven't mentioned a part number yet.

    The shaft angle, in degrees, is a measurement with 360 counts per revolution. In grads, it's 400 counts per revolution. In radians, it's 2 pi counts per revolution. All you need to do to convert is scale the number of counts you have received since the zero point to degrees, based on how many counts the encoder provides in a full revolution. If you have a 1000 ppr encoder, then (counts * 360 / 1000) gives you degrees. You'll want to zero "counts" when the Z signal is asserted. Your application may prefer all positive angles (0-360) rather than negative ones (-180 to 180). So you might add to counts by a full revolution to avoid negative numbers.

    If your encoder really is generating 2 or 3 counts per revolution, then the resolution will be very low, 180 or 120 degrees per pulse. This could be fine for applications like measuring shaft speed for control feedback, or too low for applications like precise positioning using a stepper motor.

Reply
  • Incremental encoders come in all sorts of resolutions, anywhere from 1 cycle per revolution to at least 72,000 counts per revolution. Only you and your manual know exactly what you have. You haven't mentioned a part number yet.

    The shaft angle, in degrees, is a measurement with 360 counts per revolution. In grads, it's 400 counts per revolution. In radians, it's 2 pi counts per revolution. All you need to do to convert is scale the number of counts you have received since the zero point to degrees, based on how many counts the encoder provides in a full revolution. If you have a 1000 ppr encoder, then (counts * 360 / 1000) gives you degrees. You'll want to zero "counts" when the Z signal is asserted. Your application may prefer all positive angles (0-360) rather than negative ones (-180 to 180). So you might add to counts by a full revolution to avoid negative numbers.

    If your encoder really is generating 2 or 3 counts per revolution, then the resolution will be very low, 180 or 120 degrees per pulse. This could be fine for applications like measuring shaft speed for control feedback, or too low for applications like precise positioning using a stepper motor.

Children