I have a project where I control a small DC motor and I am powering the motor with a 9 volt battery. Now I want to regulate the external power source (9Volt battery) using an adjustable linear voltage regulator to a constant voltage say 8 volts. And then I want to control the speed of the motor from the computer using PWM. Since according to my limited knowledge, PWM doesn’t maintain a “constant” speed for my motor as the battery voltage decreases.
Is this viable? Or is there a better way to do this?