Automatic splined machine for motor shaft