We needed an encoder on the PG27 motor. We had a PG71 that was not in use and had an encoder. I took them apart but discovered that the motors had different size gears on them. But after the first set of planetary gears the back gears were the same size but different depth. So I took out the first set of planetary gears and punched out the pins and moved them to the other set in the base plate so that they would mess with the new motors gear. The circular base has to stay with the original gear box. But the small gears have to stay with the motor so that the gears all mesh with the correct teeth number. So that is why it is necessary to move the pins so that they match the spacing necessary for the different gears to make good contact with the box housing and enough room for the motor gear size.
The image below gives a visual of what I did.