Hello,
I am using a Toshiba TG6549PG H-Bridge to control a 12v DC motor. The reason I went for the TG6549 is because it can handle about 3.5A steady (The motor in it's application would draw around 2.5A).
Here is the datasheet http://www.toshiba.com/taec/components2/Datasheet_Sync/261/3626.pdf
I've run in to the following issues: I have full speed/power in one direction, and very little in the other. The H-Bridge uses four pins, one for standby, one for PWM to control the speed and one for each direction. I have connected the H-Bridge according to the typical application outlined in the datasheet for 12v Vcc, with arduino pins 2 & 4 going to IN1 and IN2, arduino pin ~11 to PWM on the TG6549. I have two buttons, one is for full-speed CW, the other full-speed CCW.
From what I can tell, there is something wrong with my code or the arduino board itself (though I tried it out with an UNO and a MEGA), or maybe the connections yet. I tried the H-Bridge manually, supplying 5V and GND from the arduino and trying the buttons w/ their pulldown resistors directly to the IN1 and IN2 pins, and tied the PWM and SB pins to 5v as well and I get full speed in each direction no problem. That's why I figure its my code... anyways here it is, it's probably a rookie mistake...
//Toshiba TB6549PG Motor Driver Test
//PINOUT
//Input
const int ctrlFwdPin = 7; //0-5v Signal to Arduino Pin 50
const int ctrlRevPin = 8; //0-5v Signal to Arduino Pin 52
//Output
const int fwdSig = 2; //0-5v Signal to in1 pin on Driver
const int revSig = 4; //0-5v Signal to in2 pin on Driver
const int pwmSig = 11; //PWM Signal to PWM pin on Driver
//const int sbSig = 25; //0-5v Signal to SB(Stanby) pin on Driver
//Variables
int ctrlFwdStat = 0;
int ctrlRevStat = 0;
void setup() {
//Pin Setup
pinMode(ctrlFwdPin, INPUT);
pinMode(ctrlRevPin, INPUT);
pinMode(fwdSig, OUTPUT);
pinMode(revSig, OUTPUT);
//pinMode(sbSig, OUTPUT);
pinMode(12, OUTPUT);
}
void loop() {
ctrlFwdStat = digitalRead(ctrlFwdPin);
ctrlRevStat = digitalRead(ctrlRevPin);
if(ctrlFwdStat == HIGH) {
digitalWrite(12, HIGH);
analogWrite(pwmSig, 255);
digitalWrite(revSig, LOW);
digitalWrite(fwdSig, HIGH);
}
if(ctrlRevStat == HIGH) {
digitalWrite(12, HIGH);
analogWrite(pwmSig, 255);
digitalWrite(fwdSig, LOW);
digitalWrite(revSig, HIGH);
}
else {
digitalWrite(12, LOW);
//digitalWrite(sbSig, HIGH);
digitalWrite(pwmSig, HIGH);
digitalWrite(revSig, HIGH);
digitalWrite(fwdSig, HIGH);
}
}
Right now I have the SB pin tied to 5V and commented it out in my code just to see if that made a difference. The best results I get is if I set IN1 & IN2 high (short stop) in the else() statement and then in the direction that has trouble I get some movement, but not much. It doesn't seem to matter if I give it a PWM signal, it will move proportionally slower. Maybe I have to set the the PWM frequency? (which I have no idea where to start).
Thanks in advance!