Go Down

Topic: Problem connecting TB9051FTG Single Brushed DC Motor Driver (Read 257 times) previous topic - next topic

Meche-barr

Hello, i am trying to use the TB9051FTG motor driver to control my motor but i am unable to get it to work. I am running a simple code to see if i have my connections right. So far i am using four pins to control the motor. I have GND to GND, EN to pin 3, PWM1 to pin 4, and PWM2 to pin 5. I have the motor leads connected to out 1 and out 2. I have a 10.2 V source connected to Vin. I am not sure if im using the pins correctly or if im using all the ones i need too.

The board that i am using is the arduino MKR zero. Any help will be appreciated.

Code: [Select]
const int EN = 3;
const int PWM1 = 4;
const int PWM2 = 5;


void setup()
{
                        //set all pins as output
  pinMode(PWM1, OUTPUT);
  pinMode(PWM2, OUTPUT);
  pinMode(EN, OUTPUT);
}

void loop()
{
                        //drive forward at full speed by pulling PWM1 High
                        //and PWM2 low, while writing a full 255 to EN to
                        //control speed
  digitalWrite(PWM1, HIGH);
  digitalWrite(PWM2, LOW);
  analogWrite(EN, 255);

                        //wait 1 second
  delay(1000);

                        //Brake the motor by pulling both direction pins to
                        //the same state (in this case LOW). PWMA doesn't matter
                        //in a brake situation, but set as 0.
  digitalWrite(PWM1, LOW);
  digitalWrite(PWM2, LOW);
  analogWrite(EN, 0);

                        //wait 1 second
  delay(1000);

                        //change direction to reverse by flipping the states
                        //of the direction pins from their forward state
  digitalWrite(PWM1, LOW);
  digitalWrite(PWM2, HIGH);
  analogWrite(EN, 150);

                        //wait 1 second
  delay(1000);

                        //Brake again
  digitalWrite(PWM1, LOW);
  digitalWrite(PWM2, LOW);
  analogWrite(EN, 0);

                        //wait 1 second
  delay(1000);
}




jremington

Where did you connect the ground of the motor power supply? Please post a hand drawn wiring diagram (not Fritzing).

Also, post a link to the product page for the motor.

The information on Pololu's page describing their breakout for that chip is very informative. Make sure you have the jumpers set correctly.

Meche-barr

Where did you connect the ground of the motor power supply? Please post a hand drawn wiring diagram (not Fritzing).

Also, post a link to the product page for the motor.

I attached the hand drawn diagram. Also the Arduino is powered by USB cable.

Motor link

TomGeorge

Hi,
Motor controller unit;


Quote
[justify]It has a wide operating voltage range of 4.5 V to 28 V and can deliver a continuous 2.6 A.[/justify]
Motor;
No load current  0.5A
Stalled current 20.7A

Tom... :)


Everything runs on smoke, let the smoke out, it stops running....

jremington

Indeed, the TB9051 is totally inappropriate for that motor.

This motor driver will work, if the load is not too great.

Meche-barr

Thank you for the info. Did not read the docs more closely.

Go Up