Using NEMA17 stepper motor with TMC2208 microstepping

Hi!!
I have successfully connected a TMC2208 driver to a stepper motor for a project I am working on. However, it seems like even if I set the pins which control the microstepping setting to the highest option (so to get 1/256 microstepping), I only get 1/16 (so a total of 3200 steps per rotation). I am using a shield which is not for the TMC2208 driver, but even if I breadboard the driver and manually set the MS1 and MS2 pins to HIGH, I still only get 1/16 microstepping.
I have tried using no library and AccelStepper and they both give the same result. I am counting the number of steps based on the following code. Am I missing something? Is it that the driver interpolates and some steps are simply not accounted for in the Arduino IDE?

#include <AccelStepper.h>

// Define stepper motor connections
#define STEP_PIN 2
#define DIR_PIN 4

// Set the number of steps per revolution and microstepping mode
const long STEPS_PER_REV = 3200;   // Full steps per revolution

bool done = false;

// Create an instance of AccelStepper
AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

void setup() {
  Serial.begin(115200);

  // Set the maximum speed and acceleration of the stepper motor
  stepper.setMaxSpeed(0.25 * STEPS_PER_REV);      // 0.2 rotations per second
  stepper.setAcceleration(2.0 * STEPS_PER_REV);  // 2 rotations per second squared

  // Set the initial position and enable the stepper motor
  stepper.setCurrentPosition(0);
  stepper.enableOutputs();
}

void loop() {

  // Move the stepper motor for 20 rotations
  if (!done) {
    stepper.move(-20 * STEPS_PER_REV);
    stepper.setSpeed(0.25 * STEPS_PER_REV);
    done = true;
  }

  // Update the stepper motor
  stepper.runSpeedToPosition();
}

The TMC2208 has 4 microstepping settings from MS1 and MS2 configuration. (i.e. 2,4,8,16).

To get other microstep settings, you need to configure the module from UART.

https://github.com/bigtreetech/BIGTREETECH-TMC2208-V3.0/blob/master/TMC2208-V3.0%20manual.pdf

1 Like

Check the data sheet, page 8.

It looks like you will have to connect to the UART to set higher than x16.

The TMCStepper library worked for me and my TMC2209 drivers to set parameters using the UART.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.