Please, help me with DualVNH5019 Motor Driver Shield

Please, tell me what could be the problem
Arduino Mega entertain separately from the USB-out laptop, and motor drivers Pololu DualVNH5019 Motor Driver Shield separately from the battery voltage 12,75 V or adapter from router 8V.
When i use the test firmware Demo, the second motor is always get error “M2 fault” in serial monitor, and the program stops.
I’m delete code when we use second motor. Download to arduino and start it.
LEDs whats say about work my motors is lights , when I check the output voltage i get 3.91 V at the input 12,75 V.
If I connect the motor with shield, i get the output voltage is 0.
Please tell me how to fix this problem, i use the library during December 2012, changed some of the pins to communicate with the Mega.
A month ago, everything worked.
Is it possible to apply a voltage to the shield and use it, but the motor is not connected are used?

P.S. I hope that my driver is not death…
P.P.S. sorry for my bad english :smiley:

Hello.

I am not entirely sure what it is you are saying, and I am not sure yet what the problem is. Could you please tell me more about your setup? It sounds like you could be using either a 12.75V or 8V power supply for your Arduino and/or motor driver. Could you please clarify exactly how you are supplying power and at what voltage? Is the blue ARDVIN=VOUT shorting block on or off? (Are you powering the Arduino and the shield from motor power, or are you providing separate power to the Arduino and the shield?) You can find more information about powering the shield inside the Shield Connections section of the VNH5019 shield’s user’s guide:

pololu.com/docs/0J49/all#3.c

Could you please attach a picture of your setup that clearly shows all of your connections? Also, could you tell me which pins you specifically changed? Additionally, could you post the simplest version of your code that you think should work?

Good day!
I’m use a battery(12.75V) or power supply from router(8V) for power to the Motor Shield and USB-out from my notebook for power to the Arduino Mega. :slight_smile:
I use separate power to the Arduino and the Motor Shield.
I swap pins on Arduino like this
(Motor Shield → Arduino) :arrow_right:
M2EN/DIAG (12 Pin) → (5 Pin);
M2PWM (10 Pin) → (12 Pin);
M1PWM (9 Pin) → (11 Pin);

This scheme I used two times. Its worked one month ago… But now I don’t know what happens.
Now I can’t find post where one person get this swap scheme.

I use this code:

#include "DualVNH5019MotorShield.h" 
  
DualVNH5019MotorShield md; 
  
void stopIfFault() 
{ 
  if (md.getM1Fault()) 
  { 
    Serial.println("M1 fault"); 
    while(1); 
  } 
} 
  
void setup() 
{ 
  Serial.begin(115200); 
  Serial.println("Dual VNH5019 Motor Shield"); 
  md.init(); 
} 
  
void loop() 
{ 
  for (int i = 0; i <= 400; i++) 
  { 
    md.setM1Speed(i); 
    stopIfFault(); 
    if (i%200 == 100) 
    { 
      Serial.print("M1 current: "); 
      Serial.println(md.getM1CurrentMilliamps()); 
    } 
    delay(2); 
  } 
    
  for (int i = 400; i >= -400; i--) 
  { 
    md.setM1Speed(i); 
    stopIfFault(); 
    if (i%200 == 100) 
    { 
      Serial.print("M1 current: "); 
      Serial.println(md.getM1CurrentMilliamps()); 
    } 
    delay(2); 
  } 
    
  for (int i = -400; i <= 0; i++) 
  { 
    md.setM1Speed(i); 
    stopIfFault(); 
    if (i%200 == 100) 
    { 
      Serial.print("M1 current: "); 
      Serial.println(md.getM1CurrentMilliamps()); 
    } 
    delay(2); 
  } 
}

It looks like you are reassigning the pins from their default assignments, possibly without changing the corresponding library code. If the Freeduino is a clone of the Arduino Mega, you should be able to use the shield with the default pin assignments, except it will not support 20kHz PWM. If you want to get 20kHz PWM, you might find the following forum post useful.