I'm trying to control the position of a dc motor. Is it better to go with potentiometer or encoder and why ?
Potentiometers wear out quickly and are usually limited to 10 turns or less.
Cheap potentiometers can give better angular resolution than cheap encoders.
Encoders with optical or magnetic sensors should last for years.