Stepper motor hangs

I'm working on project using an Arduino Nano, TMC2208 driver and this stepper motor: https://www.oyostepper.com/images/upload/File/8HS15-0304S.pdf. I'm finding that the stepper starts rotating fine, but at a certain position stops moving and starts clicking. Before I crank up the VREF, I wanted to check with this group to see if I've done anything else stupid. I don't want to burn anything out by blindly cranking up the VREF.

The spot where it stops turning is the same no matter what. Without power, the spindle spins freely. I am not adding any load to the spindle yet, so it shouldn't be having a harder time moving something at any place in the revolution.

The wiring I'm using looks like this:

The code I'm using looks like the following:

#include "SimpleStepper.h"

void SimpleStepper::init() {
    pinMode(_enablePin, OUTPUT);
    pinMode(_directionPin, OUTPUT);
    pinMode(_stepPin, OUTPUT);

    digitalWrite(_directionPin, Direction::CW);
    digitalWrite(_stepPin, LOW);

    setEnabled(true);
}

void SimpleStepper::setDirection(Direction direction) {
    digitalWrite(_directionPin, direction);
}

void SimpleStepper::setEnabled(bool enabled) {
    digitalWrite(_enablePin, enabled ? LOW : HIGH);
}

void SimpleStepper::step() {
    digitalWrite(_stepPin, HIGH);
    delay(5);
    digitalWrite(_stepPin, LOW);
}
#include <Arduino.h>
#include "SimpleStepper.h"

/*
https://fabacademy.org/2022/labs/kannai/Instruction/tips/stepper_TMC2208/

RMS Current = MAX CURRENT / 1.41
VREF = ((RMS Current x 2.5) / 1.77)

RMS Current = 0.3 / 1.41 = 0.212765957
VREF = (0.212765957 x 2.5) / 1.77) = 0.531914894 / 1.77 = 0.300516889
*/
#define EN_PIN 4
#define DIR_PIN 8
#define STEP_PIN 7
#define STEPS_PER_REVOLUTION 200

SimpleStepper stepper(EN_PIN, DIR_PIN, STEP_PIN);

void rotateFullRevolution() {
  for (int i = 0; i < STEPS_PER_REVOLUTION; i++) {
    stepper.step();
    delay(100);
  }
}

/**
 * @brief Standard Arduino setup routine.  Called once.
 */
void setup() {
  Serial.begin(9600);
  stepper.init();
  stepper.setEnabled(true);
}

/**
 * @brief Standard Arduino method called repeatedly
 */
void loop() {
  stepper.setDirection(Direction::CW);
  rotateFullRevolution();

  stepper.setDirection(Direction::CCW);
  rotateFullRevolution();
}

Thanks for any pointers!
Craig

You may be experiencing resonance. Set mirostepping to x4 or more and try it.

Also the mechanical setup can mitigate resonance. A belt driver is bettervdamped than a lead screw or gear train.

That stepper and that driver stepper might be a wrong combination. The datasheet for the motor says 40 Ohm, 300 mA. Current control works best on low resistance steppers.
Also, don't run motor currents via breadboards. 300 mA is a bit high in my oppinion.

That's a high impedance motor (40Ω), you need a higher supply voltage, at least 24V. Have you tried microstepping, (X2 or x4)?

FWIW... I'm trying to build Marble Clock "Time Rolls On" by HFoG - Thingiverse . I was having trouble finding that particular stepper driver, so I fell back to the TMC2208 which is easy to find. I haven't tried microstepping in part because I haven't set up UART to make those settings easier.

I'm kind of a dummy relative to some of this. Can anyone point me to an explanation of why the microstepping makes a difference in this case? I can look at switching to 24V since I have it connected to a bench power supply to see if that makes a difference. I would need to rewire the power to the Arduino, but that would be easy enough.

Also - I was just trying to test things out via breadboard to see if I had the wiring right.

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