Nema17 does not work


Hi. I connected it like the picture, but the motor doesn't work. It doesn't even vibrate and it doesn't work at all.
I used Nema17(17HS8401) and tmc2208. I used a 12V 3A adapter for the motor and connected to the computer with a usb port for the Arduino board.

It's a reference image.

DIR = 4 pin
STEP = 3 pin
EN = 2 pin

M2B = red
M2A = blue
M1A = green
M1B = black

I used 25V 100uf capacitor. The driver current was adjusted to 1.4amps

const int stepPin = 3; 
const int dirPin = 4; 
const int enPin = 2;   

void setup() {

  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enPin, OUTPUT);


  digitalWrite(enPin, HIGH);
}

void loop() {

  digitalWrite(enPin, LOW);

  digitalWrite(dirPin, HIGH);

  for(int i = 0; i < 200; i++) { 
    digitalWrite(stepPin, HIGH); 
    delayMicroseconds(700);    
    digitalWrite(stepPin, LOW); 
    delayMicroseconds(700);
  }

  delay(1000);


  digitalWrite(enPin, HIGH);

  delay(3000);
}

I can't tell from the photo, but do you have the motor coil pairs identified correctly?

The stepping rate is very high, might be to high. Make the step pulse high some 50 microseconds long and the delay to the next pulse 50 ms. When the motor rotates, trim the 50 ms down.

Where is the Logic Power Supply?

I used the multimeter to check the coil pair. I think they are connected correctly

After adjusting the stepping rate, the motor rotates. But it doesn't keep rotating in one direction, it keeps changing direction.

Can You describe those changes a bit closer? Does it change every hour or so?

It changes direction randomly without a certain rule.

Sounds like an open input somewhere. Please post schematics. Pen and paper usualky works. Remember pin names, power suplis etc.

Maybe check that the coils aren't crossed?

image

vs:

vs

image

They are intentionally crossed here so that the neighbouring wires are each connected to a coil at the other end of the cable. At the motor this is not the case with these type of connectors.

This Minbea 17PM-J801-P1VS FH5-1034 has the separate coils on the opposite ends of the connector:

...and doesn't require interchanging for either a Pololu B1B2A1A2 labeled driver:

image

or a Pololu 2B2A1A1B labeled driver.

image

or

image

I meant that one should check that your actual motor coil wiring matches your driver's actual connections. It's sometimes hard to tell by assumptions about the labeling, coloring, or ordering.

Is this a 4- or a 6-wire stepper? All steppers I came across so far with these 6-pin connectors and no centre tap of the coils ( 4 wire steppers ) are wired with crossover pattern. And that fits to this page of the used 17HS8401 motor. But of course there may be others too.

In any case it's always a good idea to check the wiring with a meter. And @ryohi_hyo already told us that he did so.

So I don't think that is the problem. And this type of wiring error usually leads to not changing the direction at all. @ryohi_hyo wrote it is changing randomly - which is a bit odd. Maybe there's a loose connection somewhere... :thinking:

There's 6 pins on the motor, but the wiring harness that came with it has only 4 wires, looking much like the pic in top post. On my stepper, the three pins on the left have a center tap with 1.1 ohms between them, 2.2ohms total, and the right three wires are the same. As on this Minbea 17PM-K data page

I might hard-wire the DIR pin to GND or + and see if that keeps it uni-directional.

1 Like

That fits into my world view again :innocent:, because the motor itself is then a 6-wire stepper motor.

Sounds like a good idea :sunglasses:

1 Like

It works fine after reconnecting. The only thing that has changed is the heat sink attached to the driver. Maybe there's a loose connection...

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