Apologies about posting such a basic question, but I’m having some trouble using my Raspberry Pi 2B with a VNH5019 motor driver carrier. I simply want to control the speed of my motor using the hardware pin on the Raspberry Pi PWM1 pinout (GPIO pin 23, header pin 33, see all pinouts).
I have connected the power for my motor to the OUTA and OUTB pins on the VNH5019, and the board is connected to a 12V 1A power supply. Also, the INA and INB are connected to RasPi header pins 16 and 18 respectively. The PWM pin on VNH5019 is connected to RasPi header 33 as mentioned above. I’m also giving 5V logic power and ground from the RasPi to the VNH board. I have attached a few picture of my setup.
I have been trying to use the wiringpi library and the pwmWrite function, but I never get any rotation in the motor. Alternatively, when I just output a constant HIGH signal to the pin, the motor will spin at max speed just fine. Not sure what i’m doing wrong, but if you know of any ways to control the speed of the motor with the VNH5019 and a Raspberry Pi, I would love any guidance. I’ve also included my code for reference.
I have also been playing around with the DRV8835 Raspberry Pi library, which seems fairly straightforward and I don’t understand why the same code approach isn’t working in this case.
Thank you so much, always appreciate how helpful everyone on this forum is.
motorTest.py (1.2 KB)