teemuatlut / TMCStepper

MIT License
513 stars 201 forks source link

Controlling Bipolar Stepper Motor with TMC5160 BOB and Teensy 4.1 #267

Open gsimmers opened 1 year ago

gsimmers commented 1 year ago

Hello all,

I am remarkably new to this world and have been struggling trying to get this to work. I am using a Teensy 4.1 and a TMC5160 BOB v1.2 to move a bipolar stepper motor.

Despite looking through several scripts and set ups on this site that have touched on similar problems, I have simply had no success with this. I have attached a couple images that show my breadboard set up, and have included a description of the connections between the Teensy 4.1 and the TMC5160 BOB. I know how to make the bipolar stepper motor move independent of the TMC5160 BOB (and did so with custom built functions sent to the four pin inputs of the motor through the Teensy 4.1), but continue to fall short whenever I get the stepper controller involved.

If anyone has any script they know would work given my set up, I would appreciate it. At the very least, a link to a resource that actually explains how I can use the TMC5160 BOB's SPI mode for the purpose of triggering the bipolar stepper motor in relation to the Teensy 4.1. Also if this makes a difference, my TMC5160 BOB came with its R2 soldered, not R1, which I believe sets my stepper controller to be internal ramp generator active as opposed to using the STEP/DIR interface.

Set up description:

IMG_2724 IMG_2725 IMG_2726 IMG_2727

daniel-frenkel commented 1 year ago

Once again I am going to recommend you read my book because Trinamic drivers are incredibly complicated, and I make it all quite simple.

However, I do not cover the TMC5160 in the book because it is a motion controller that can be operated in step/dir mode if you desolder one of the pins. The motion controller adds a lot of complexity, but is very nice in certain situations.

I recommend re-soldering that resistor to step/dir mode then buying a copy of my book where I explain exactly how these things works.