Encoders for smart motion control