Encoder attached to Motor via Gear Reduction

Due to some design constraints, we are trying to place the encoder on the center pulley (driven gear) instead of on the motor pulley (driver gear).

The picture above is a design of a 3:1 gear reduction between the motor and the encoder. We are using the AMT102 encoders.

To solve the EncoderErorr: CPR_POLEPAIRS_MISMATCH we multiplied the number of pole pairs by 3 and now full calibration works and the encoder also finds its index. We want to confirm if this is okay to do.

Also, how do we tweak the vel_gain and pos_gain values now that the motor moves 3 times the encoder?

1 Like

This is OK to do, but the index will be wrong… it needs to be a single pulse per revolution of the motor, or you risk an uncontrollable motor. Unless the real pole_pairs number is divisible by 3 maybe? Not sure…

Divide by 3 should be fine.


I’m working on the same project with @Vihaan_Shah. Changing the vel_gain / pos_gain values in any way does not seem to get the controller working. When we run the above motor-encoder setup in velocity mode & vel_ramp input mode, the motor starts spinning very quickly for a split second when we input a non-zero input_vel, and then it gets stuck like it’s in position mode and heating up.
The setup runs the same configuration we used when the encoder is attached directly to the motor (except for pole-pairs). It successfully runs full calibration mode with no errors and is able to rotate freely. But for some reason, the controller does not want to work no matter what vel_gain or pos_gain we give it.
Do you have any clues as to what’s happening and how to fix it?

Is this after a restart, or also immediately after a calibration?

We run either an index calibration or full calibration after restarting, and this still happens. Even if we try to recalibrate immediately after the problem occurs, it makes no difference.

Probe the index pin, you probably have noise on it and it’s triggering randomly.