The NEMA 17 steppers I picked up from eBay as part of the stepper extruder upgrade project have round shafts; that’s not surprising, as they came with pressed-on timing gear pulleys. In their new application they’ll sport plastic herringbone gears and those have setscrews.
Both nuts have epoxy potting to prevent moving / rotating under duress. Remember to load the screw threads with beeswax and run it all the way through before you pot the nuts, lest the screw become one with the nut. Yes, the left gear fits a NEMA 23 stepper.
(Those are 14-tooth gears. I’ll actually use a 7-tooth gear, but I printed a bunch of gears to get the hang of it.)
Any time you tighten a setscrew on a motor shaft, it’ll raise a burr on the shaft. You can pull a plastic / printed gear off a ruined shaft because the burr will simply carve a gash through the plastic. A metal-hub gear or pulley will jam solid on the burr; you definitely don’t want that to happen.
The solution, which comes standard on many motor shafts, is a flatted section where the screw can raise a burr without causing a problem. In addition, the flat prevents the screw from sliding around the shaft and producing a circular scar that makes the gear impossible to remove.
Adding a flat requires a few minutes of Quality Shop Time, but will save you considerable hassle later on. Just Do It!
Mummify the motor in masking tape to keep grinding grit and metallic dust out of the shaft bearings, then grab the shaft in a smooth- or soft-jaw vise. I grabbed a machinist’s vise in the bench vise, but use what you have.
Apply a Dremel grinding stone / cutoff wheel along the shaft to produce a flat about the same width as the tip of the screw. The object of the game is to make the flat wide enough to keep the burr on the flat, but not grind half the shaft away.
Don’t grind the shaft without clamping it, because the vibration will destroy the bearings. Clamp the shaft to stabilize it and isolate the motor, then do the grinding.
Here’s the shaft after installing & removing the gear. Notice the burr:
And a detail of the burr:
It’s not like I’m over-tightening the screw, either: that’s what a hardened screw does to a soft motor shaft.