PDA

View Full Version : Dual VNH2SP30 assembly



Grumpybeard
02-06-2014, 04:15 AM
Hi,

Just received my dual VNH2SP3which I will use to drive AEG motors.

First time ever soldered capacitors to a PCB :) I understand the shorter leg marked with the "negative strip indicator" is indeed the negative, but I'm unsure as to which way around to put the legs into the holes.


5359


There is a round solder pad and a square solder pad per capacitor. I can see a little "+" marked against one of the round pads (left one on image), but checking on internet search I see conflicting indications about whether round/square pad is negative/positive (I don't know if there is a standard???).

Apologies for this numpty newbie question but grateful for a confirmation, many thanks.

Th232
02-06-2014, 04:47 AM
If in doubt, I do a continuity test between the pads and V+/GND. Usually a good chance of one of them being connected in that fashion.

With that said, I'd probably go with the round pad being positive, given the marking you pointed out. Also, all the ground pins appear to be square, looking at the pads on the left and right edges of the board.

Grumpybeard
02-06-2014, 09:42 AM
OK so I've put this board together, hooked up power (7v), and nothing.

I have not hooked up any motors or signal pins, just power to vin and gnd. At the least I had expected a power led.

Any ideas?

jwatte
02-06-2014, 11:14 AM
The square pad usually means "pin 1," and sometimes, but not always, GND is on "pin 1."
On for example the Raspberry Pi, pin 1 is VCC and pin 5 is GND.
The fact that there is a + on the solder mask (white drawings) is good, though; that's what you should be following. If they put a "+" next to a pad that is ground, they'd be almost criminally negligent :-)

Pololu usually has some good hook-up guides. Do they have one for this controller? I've used exactly the same controller, and it's worked fine for me, but I forget whether it has a power LED or not. It may also have "enable" pins that need to be pulled high or low...

jwatte
02-06-2014, 11:17 AM
The schematic on the Pololu site does not show a power LED:

http://a.pololu-files.com/picture/0J411.600.jpg

Also note that it shows a separate need for VCC vs VBAT. You should probably provide a regulated logic voltage on the VCC pin, in addition to motor power on VBAT.

tician
02-06-2014, 11:24 AM
Their schematic (http://www.pololu.com/picture/view/0J411) lists no LEDs except direction indicators when the driver is running.



In a typical application, the power connections are made on one end of the board, and the control connections are made on the other end. +5 volts must be supplied to the board through the smaller 0.1"-spaced pins; the input voltage is available at those pins as well, but the connection is not intended for currents exceeding a few amps. The diagnostic pins can be left disconnected if you do not want to monitor the fault conditions of the motor drivers. INA and INB control the direction of each motor, and the PWM pins turns the motors on or off.

Since the LEDs are in parallel with the driver outputs, you should be able to test the LEDs without connecting any motors to the outputs. Just apply the +VMOT and +5V, plus a few logic pins and the LEDs should start lighting up.

Grumpybeard
02-06-2014, 11:31 AM
This really helps and is a little comforting, as today has not been a great one, so fingers crossed I've not ****** it.

Within the next day or so I will hook it up to a spare arduino as per the wiring setup below (minus motors) to test.

Cheers fellas.

5362

P.S. Must learn to read schematics and recognise how an L.E.D. (amongst other components) looks!

jwatte
02-06-2014, 10:43 PM
You don't need an Arduino to test it. If you have a breadboard and some jumper wires, you can set a particular pin high or low by just connecting it to GND/+5V.

Grumpybeard
02-09-2014, 10:00 AM
She lives! Just hooked up to Arduino with test sketch below and able to get red/green leds alternating which I imagine signifies on/off for the coded forward/reverse motion if I had a motor connected.

My software is currently designed to enable firing one or both guns according to selection by "pilot". As I understand it, INA1 and INB1 are set according to the following truth table.


INA1 INB1
0 0 Brake to GND
0 1 CCW
1 0 CW
1 1 Brake to VCC

http://www.pololu.com/file/0J52/vnh2sp30.pdf

In addition to signal for PWM, and 5V/GND, I have two connections to set INA1 and INB1. So 5 connections in total for 1 gun.


To add another gun and yet retain independent speed control I imagine I just need to add 1 additional PWM connection - I can share the INA1 and INB1 with INA2 and INB2? Plus 5V and GND can be shared?


I would also appreciate if someone can explain the practical implication and difference between "brake to gnd" and "brake to vcc".


Thanks to all who helped.



int InA1 = 6;
int InB1 = 7;
int PWM1 = 3;
int PWM1_val = 64;


void setup() {
Serial.begin(9600);
pinMode(InA1, OUTPUT);
pinMode(InB1, OUTPUT);
pinMode(PWM1, OUTPUT);
}


void loop() {
digitalWrite(InA1, HIGH);
digitalWrite(InB1, LOW);
analogWrite(PWM1, PWM1_val);
delay(500);
digitalWrite(InA1, LOW);
digitalWrite(InB1, HIGH);
delay(500);
}

jwatte
02-09-2014, 11:46 AM
As far as I know, there's not much difference between "brake to GND" and "brake to VCC." Sometimes, braking will generate some EMI, and you may perhaps want that connected to one rail over the other for some reason.

Note that you don't want to be running the gun motors counterclockwise (backwards.)

Grumpybeard
02-10-2014, 01:59 AM
Thanks jwatte for reminding me to keep it CW.

Going on from what you said before regards testing, I in fact do not need to tie up precious pins setting INA1 to HIGH and INB1 to LOW, I can just tie them to 5v and GND. Setting PWM to 0 to stop firing.

I could always have INA1 to a pin for high and low to switch between CW and brake to GND.

Thanks.

jwatte
02-10-2014, 06:29 PM
Or you could set PWM high and tie your PWM output to INA1 to fire (with pwm) or brake, with a single signal.