Having Trouble Controlling Stepper Motor with TB67S128FTG Driver

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
JJMoney
 
Posts: 20
Joined: Sun Nov 27, 2022 7:01 pm

Having Trouble Controlling Stepper Motor with TB67S128FTG Driver

Post by JJMoney »

I am having trouble driving this stepper motor with my TB67S128FTG driver. I’ve ensured there is voltage at V_in (~12.2V) and VCC (~5V). Are there any other pins I should expect to have a voltage
that could help diagnose the issue? The code I’ve written is below (all of the print statements are executing):

Code: Select all

from time import sleep
import RPi.GPIO as GPIO

DIR = 24
STEP = 25
CW = 1
CCW = 0
SPR = 200 # steps per revolution: 360 / 1.8

def main():
    print("DIR = " + str(DIR))
    print("STEP = " + str(STEP))

    GPIO.setmode(GPIO.BCM)
    GPIO.setup(DIR, GPIO.OUT)
    GPIO.setup(STEP, GPIO.OUT)
    GPIO.output(DIR, CW)
    
    step_count = SPR # 1 full rotation
    delay = 0.0208
    
    for i in range(step_count):
        GPIO.output(STEP, GPIO.HIGH)
        sleep(delay)
        GPIO.output(STEP, GPIO.LOW)
        sleep(delay)
        
    print("done")
    GPIO.cleanup()

if _name_ == "__main__":
    main()
Is there something I’m overlooking in this code?

I have attached a diagram of how I have wired my Raspberry Pi to my driver along with some photos of my soldering connections.

Interestingly, I disconnected the Raspberry Pi from power and the motor sounded like it was moving until I powered up the RPi again. Did I possibly blow the motor?
Attachments
s2.jpeg
s2.jpeg (72.83 KiB) Viewed 90 times
s1.jpeg
s1.jpeg (72.82 KiB) Viewed 90 times
diagram.jpeg
diagram.jpeg (134.62 KiB) Viewed 90 times

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Having Trouble Controlling Stepper Motor with TB67S128FTG Driver

Post by adafruit_support_bill »

I don't see anything in your code to control the Enable or /Standby pins. Those need to be in the correct state for there to be any output to the motor.

Other than that, we have no firsthand experience with that motor or controller. The folks at Pololu are pretty helpful and should be able to help you out.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”