This was a project I've been putting off for a couple years but finally got around to doing. It's a mounting for an encoder. Here's a picture of the visible bits:
There's some more printed parts that are non-visible, though:
The red expanding collet and the blue cone are also printed. The nut pulls a 3/8-16x3 bolt (with the cone) up into the collet, expanding it out to grip the inside of a 1.03" ID shaft. The tip of the bolt is turned down to 6mm, and the pulley rides on that area. I didn't model some of the machine parts, but the black part is a bearing housing, and the 1.03" ID shaft rides inside that bearing.
(The encoder is feeding shaft position back to a computer, which adjusts the speed controller to match the measured shaft speed against the commanded speed. It helps keep the motor from getting bogged down and causing things to break.)