Atmega motor encoder. Then for speed control you add PWM to the motor power.