An encoder alternator for an internal combustion engine has a rotor with a plurality of circumferential magnetic rotor poles in a periodic pattern except for at least one magnetic irregularity. A sensor coil is wound around a stator pole and outputs a crankshaft position sensor signal when the magnet irregularity of the rotor passes the stator pole.