We at Pololu are happy to present the Dual VNH5019 Motor Driver Shield for Arduino, an easy way to control two high-power, brushed DC motors with an Arduino or Arduino clone. The shield operates from 5.5 to 24 V and can deliver a continuous 12 A (30 A peak) per motor. Our Arduino library simplifies interfacing with the shield by providing methods for setting the motor speed and direction, reading the motor current, and checking for motor faults.
The VNH5019, just released by ST, is essentially a more versatile version of the VNH2SP30, so the dual VNH5019 motor shield's performance is similar to Sparkfun's Monster Moto shield, except with several key improvements:
Operation up to 24 V (overvoltage protection on the VNH2SP30 can kick in at 16 V).
Works with 3 V systems and 5 V systems (logic high threshold is 2.1 V on the VNH5019 compared to 3.25 V on the VNH2SP30).
Ability to power the Arduino from the motor shield through a removable jumper.
Ability to reconfigure the Arduino pin mappings if the defaults aren't convenient or to disconnect pins you don't want to use (e.g. diagnostic pins).
Motor driver pins are also broken out along the left side of the shield for general-purpose use.
The power inputs and motor outputs are on the opposite side of the board from the Arduino's USB connector and power jack, and they don't short to the grounded USB connector like on the Monster Moto.
Driver PWM pins are connected by default to Timer 1 PWM outputs rather than Timer 0 like on the Monster Moto, so ultrasonic (20 kHz) PMW frequencies can be used for quieter operation (the shield library configures the timer this way)
Arduino analog inputs aren't wasted on the driver's digital fault outputs.
Terminal blocks, 0.1" male headers, and stackable Arduino headers are included.
High-side reverse-voltage protection.
For more information, please see the dual VNH5019 motor driver shield product page. The motor shield library is available now on github, and a detailed user's guide will be available in the next few days. Please don't hesitate to ask if you have any questions, and we welcome your feedback!
I'm working on an Arduino lawn mower which runs with two DC gear motors and a brushless mowing motor.
First I ran my program on the Duemilanove without the brushless motor where the DC motors worked nice and quiet.
Then I added servo.h for running an additional brushless motor controller which unfortunately doesn't work with the Duemilanove.
With the Duemilanove:
VNH5019 uses Timer 1 which cannot be changed :~
Servo.h uses Timer 1 which cannot be changed :~
With the Mega:
VNH5019 uses Timer 1
Servo.h uses Timer 5 (I'm using Pin 11 as Pin 12 is already in use by the VNH)
The Mega now does a loud pwm-beeping (the DC-motors). (sounds like about 5-10kHz)
I took all the servo.h including etc. out of the program and tested again - the DC-Motors are still beeping. =(
For me it looks like the VNH lib doesn't set the Timer1 correctly doesn't it?
The VNH5019 motor shield connects to digital pins 9 and 10 on the Arduino. On the Uno, these pins correspond to the hardware PWM outputs of Timer 1, the ATmega328's only 16-bit timer. This allows for an ultrasonic PWM frequency. Unfortunately, for some reason, these same pins on the Arduino Mega 2560 correspond to the hardware PWM outputs of Timer 2, which is an 8-bit timer. This seems like a poor pin-assignment choice given that the Arduino Mega 2560 has four 16-bit timers that could have been assigned to those pins instead, including Timer 1, but maybe there are some other constraints I'm not aware of that led to that decision.
You will not be able to get a 20 kHz PWM from an 8-bit timer, so you will either need to live with hearing the PWM-induced whine from your motors, or you can reassign the motor driver shield's PWM pins to the PWM outputs of a 16-bit timer. The shield was designed to somewhat easily allow for customized pin assignments, and the shield user's guide explains how to do this. I suggest you reassign MIPWM to Arduino digital pin 11 and M2PWM to Arduino digital pin 12. You should also reassign M2EN/DIAG to some unused digital pin because that is assigned to digital pin 12 by default.
If you reassign the driver connections this way, the VNH5019 shield library code should just work after a few small modifications:
In DualVNH5019MotorShield::init(), delete or comment out the lines: #if defined(AVR_ATmega168)|| defined(AVR_ATmega328P) #endif
In void DualVNH5019MotorShield::setM1Speed(int speed), delete or comment out the lines: #if defined(AVR_ATmega168)|| defined(AVR_ATmega328P) #else analogWrite(_PWM1,speed * 51 / 80); // default to using analogWrite, mapping 400 to 255 #endif
The only line from that block remaining should be: OCR1A = speed;
Do the same thing for DualVNH5019MotorShield::setM2Speed(int speed), except in this case, the only line remaining should be: OCR1B = speed;
Do the same thing for the setM1Brake() and setM2Brake methods.
Remember to use the constructor that provides the shield pin mappings so that the library knows about the new location for M1EN/DIAG. Please let me know if you have any questions or run into any trouble getting it to work.
Hi, I am using pololu vnh5019 with arduino to drive the dc motor. When I upload the program to arduino, motor doesn't move at all and I got this weird error "O¤@àð". I got different error every time but its always like some special characters but nothing else. What am I doing wrong here?