I'm using a DC gear motor (from this kit, plastic gears) driven by a L298N module controlled by a STM32 BluePill. The motor voltage supplied to the L298N is 9V from a variable voltage AC adapter with a max current of 1A. The STM32 is powered from USB. The STM32 and L298N share a ground circuit.
I'm using a PWM signal from the STM32 to the Motor A Enable pin of the L298N to control the voltage applied to the motor. The Input 1/2 pins are driven correctly to rotate the motor in one direction.
When I start with a low duty cycle to produce a low voltage, the motor does not start turning and simply makes a high pitched whining noise. As I increase the duty cycle and thus voltage, the whining noise increases in pitch and eventually at a specific duty cycle the motor will suddenly start turning at quite a high speed. Once it's turning, if I reduce the duty cycle below that threshold, the motor will continue turning albeit at a slower speed. If I reduce it further, the speed of the motor becomes uneven and eventually stops and the whining noise resumes.
I don't understand what's happening here. Am I not controlling it correctly? Is the torque produced by the motor at low voltage not high enough to overcome the friction of the gears and inertia of the motor?
Motor specs:
- Operating Voltage: 3-6V DC
- Reduction ratio: 1:48
- When the voltage is 6V:
- No-load current: 200mA
- No-load speed: 200±10%rpm
- When the voltage is 3V:
- No-load current: 150mA
- No-load speed: 90±10%rpm