Arduino Forum

Using Arduino => Motors, Mechanics, and Power => Topic started by: Meche-barr on Mar 18, 2019, 10:07 pm

Title: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: Meche-barr on Mar 18, 2019, 10:07 pm
Hello, i am trying to use the TB9051FTG motor driver (https://www.pololu.com/product/2997/) 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);
}



Title: Re: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: jremington on Mar 20, 2019, 07:17 pm
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.
Title: Re: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: Meche-barr on Mar 24, 2019, 06:48 am
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 (https://www.servocity.com/153-rpm-spur-gear-motor-w-encoder)
Title: Re: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: TomGeorge on Mar 24, 2019, 11:04 am
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... :)


Title: Re: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: jremington on Mar 24, 2019, 06:13 pm
Indeed, the TB9051 is totally inappropriate for that motor.

This motor driver (https://www.pololu.com/product/1451) will work, if the load is not too great.
Title: Re: Problem connecting TB9051FTG Single Brushed DC Motor Driver
Post by: Meche-barr on Mar 25, 2019, 02:38 am
Thank you for the info. Did not read the docs more closely.