Hello everyone,
I'm trying to control a DC motor using a raspberry pi 4 and the MD20A driver in python language. I'm familar with arduino programming but I'm new in python world.
I manage to start the motor but when I reduce the PWM it starts to make some noise and vibrations. I tried to increase the frequency to fix it and it's better but there are still this noise and vibrations at low PWM.
[ ... ]
Does anyone has ideas ?
Your motor controller board probably needs a stable sequence of pulses to reliably drive the connected motor at a known speed. Ref: https://www.cytron.io/p-20amp-6v-30v-dc-motor-driver
Generating pulses via software controlled PWM using an interpreted language (Python) running under the control of a multi-user time-shared OS (RasPiOS/Debian/Linux) will not give you the reliability and precision needed.
An Arduino - or an RPi-designed microcontroller such as an RPi Pico - will be a better choice for this application.
If you want to persist with your RPi4 board then investigate hardware-timed PWM. That will probably mean moving away from the unsupported RPi.GPIO library.
Statistics: Posted by B.Goode — Wed Oct 30, 2024 11:31 am