Finally, I finished reading the datasheet. It didn’t give much information about how to connect the motor controller to a micro-controller. I used the simple circuit I found from a post in Pololu’s forum: Using Dual VNH3SP30 Motor Driver with arduino @ http://forum.pololu.com/viewtopic.php?f=15&t=1923.
I connected everything according to the diagram shown above: the board with a Digital Single Output DC Power Supply, 30V/1A available in DL1, a HG312 Geared Motors (http://www.robotmarketplace.com/products/0-HG312.html) that we are using on our smartsurface, and a Arduino Duemilanove with only 1INA, 1INB, 1PWM, +5V, GND connected to Arduino Duemilanove (ATMEGA328) (I didn’t use Arduino Mega because there is a chance for mishap so I just use a cheaper board for experiments). I tested only one motor at a time and it turned out one is working and another is probably damaged during the shipping. Here are some problems I found: (I also post it to Pololu Forum, hope some pros can help me)
1)Red Light vs. Green Light:
The motor is running fine and the processor is not over heated but the red LED on the board was on all the time and I’m not sure if it’s a good sign because I assume it is green light that is supposed to be on.
2)PWM doesn’t control the speed of the motor. Not sure if I need to change PWM pin frequency on the Arduino.
Here the testing code:
void setup() {int InA1 = 7;
int InB1 = 8;
int PWM1 = 3; //PWM1 connects to pin 3
int PWM1_val = 127; //(25% = 64; 50% = 127; 75% = 191; 100% = 255)
Serial.begin(9600);
pinMode(InA1, OUTPUT);
pinMode(InB1, OUTPUT);
pinMode(PWM1, OUTPUT);
}void loop() {
digitalWrite(InA1, HIGH);
digitalWrite(InB1, LOW);
analogWrite(PWM1, PWM1_val);
}
3)Base on my circuit, how should I use EN/DIAG and CS pins and how should I program them?
For more detail: Pololu Motor Controller Testing and Troubleshooting