# Problem with the pulses given by the motor encoder

I'm experimenting with differential encoder and I have some questions now. First specs: motor reduction is 14:1 on official page, encoder count 512 pulses per revolution so that mean that on one full rotation I got 512 * 14 * 4 = 28672 pulses. x4 because count rising and falling edges of both channels (A and B). Analog comparator in IC form is used to deal with differential signal (AM26LS32AC).

I assume that I need to got exactly 28672 pulses per revolution but for some reason I don't get that value. It is especially expressed when I rotate encoder 50 revolution and on 50 revolutions error is huge. I try different MCU and always got some results. I catch that error is ~0.00405% or ~116.53 pulses. My conclusion is next: error is deterministic and I "solve" problem with changing expected pulses per revolution to 28672 + 116.53. What can cause this problem? I calculate that motor reduction isn't 14 it's more 14.0567. So why encoder give wrong number of pulses? Any idea is welcome

• How exactly are you counting the pulses ? Interrupts on the MCU pin or manual polling ? How are you converting the negative going edges ? by setting the interrupt in MCU to both edges ? How fast is your interrupt handling routine ?
– AJN
Commented Jul 9, 2020 at 13:35
• Also how sure are you about the gear ratio ? I assume you did 50 revolutions so that any positioning error is effectively divided by 50.
– AJN
Commented Jul 9, 2020 at 13:37
• @AJN I count pulses in two ways: 1.External interrupt 2. Timer encoder mode, MCU works on 168MHz which is more then enough. Commented Jul 9, 2020 at 13:38
• @AJN I'm sure that gear ration in dahasheet is 14:1, error is ~1.5 degree per revolution. I need to get 28672 pulses per revolution or 1433600 pulses per 50 revolution but I got different values Commented Jul 9, 2020 at 13:42
• If you have a huge gearbox, sometimes they provide more an approximate value of the transmission ratio for mechanical engineers, but then you sometimes get an exact ratio as quotient of gearbox teeth, for example : 348/32 in some datasheet, but not always. Post a link of the gearbox. Commented Jul 9, 2020 at 13:47