pololu / dual-vnh5019-motor-shield

Arduino library for the Pololu Dual VNH5019 Motor Driver Shield
http://www.pololu.com/product/2507
MIT License
50 stars 74 forks source link

trying to get four motors to run together #17

Open craig-w-a opened 6 years ago

craig-w-a commented 6 years ago

I have 4 12VDC motors connected to two dual VNH5019 motor drivers. but one M1A and M1B isnt powering the motor. If its not plugged in then the Led indicators lightly glow and nothing glows at all if I plug it into the motor. I tried the motors with other connection and it works fine. Could it be a connection issue?

photodude commented 6 years ago

I would suggest using my modified library if you need two dual VNH5019 motor drivers. https://github.com/photodude/DualVNH5019MotorShieldMod3 it's been specifically set up for running two Pololu Dual VNH5019 Motor Driver Shields on an Arduino Mega. (I do try to keep up with the changes from this parent library, as mine is just a modified version)

evian5019 commented 5 years ago

my modified library if you need tw

Hi photodude, I have two lineer actuator that have digital encoder. They need to work simulataneously. I use arduino uno, dual vnh5019 driver. What should I do that they can work simulataneously ?

Best Regards

photodude commented 5 years ago

@evian5019 There are a lot of limitations and library conflicts with using the Uno for this. I highly recommend using a Mega for driving 4 motors and using things like encoders. Otherwise, you will be fighting library conflicts. Also note that you will only have true PWM on timer 1 pins, so the second driver will not be using PWM for the motors unless you modify the library or use the Timer libraries for modifying the timer frequency. (you can read more about the library conflicts with various timers in the note in my modified library)

You can use my modified library for using one function/library call for both drivers, or just use proper OOP and instantiate two copies of this library. Again note: you will only have true PWM on timer 1 pins, so the second driver will not be using PWM for the motors unless you modify the library or use the Timer libraries for modifying the timer frequency.

// Initialize library for each dual VNH5019 motor driver
DualVNH5019MotorShield MotorsAB(INA1, INB1, PWM1, EN1DIAG1, CS1, INA2, INB2, PWM2, EN2DIAG2, CS2);
DualVNH5019MotorShield MotorsCD(INA3, INB3, PWM3, EN1DIAG3, CS3, INA4, INB4, PWM4, EN2DIAG4, CS4);