Uno R3 and TMC 2208 Contorolling NEMA 17 not rotating fully

Hello, I am having an issue controlling a NEMA 17 motor that has a 100:1 gearbox using an Arduino R3 Uno and a TMC 2208 Stepper Motor Driver.

An image of my setup will be below along with the diagrams I used to wire it. The power source is a 12V 2A wall outlet to DC supply. I followed [this](https://www.youtube.com /watch?v=7spK_BkMJys) guide to set it up, and was sure to connect the clk and pdn pins. The resistor was also tuned to output 1.2 amps


So, with this setup I am having issues with getting consistent rotations. This particular NEMA 17 motor would generally have 200 steps/rev. With the 100:1 gearbox it came with, that bumps it up to 20,000 steps/rev at the output shaft.

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

//steps per rotation
const int STEPS_PER_REV= 20000;

void setup(){
  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);
}

void loop(){
  //Clockwise
  digitalWrite(dirPin,HIGH);

  //One Rotation SLow
  for(int x=0;x < STEPS_PER_REV;x++){
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(200);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(200);

  }
//  delay(500);
}

The above code allows the motor to run continuiously. This shows me that the circuit is powerful enough to turn the motor constantly. The delay is removed so the for loop just happens constantly.

With the delay added back in, results are odd

With STEPS_PER_REV= 200 - Short steps with random long stops
with STEPS_PER_REV= 2000 -Longer steps with random long stops
with STEPS_PER_REV= 20000 - About 1/8th rev with random stops
with STEPS_PER_REV= 40000 - literally nothing happens

Running that current, 1.2 Amp through a breadboard is No, No.
That power supply might not be up to the task. Go for a 5 or 10 Amp supply.

The TMC2208 is rated for a maximum continuous load of 1.2A, so I think the 2A power supply should be sufficient.

You are definetly right about the breadboard though. I will solder the wires from the supply directly to the driver instead of through a breadboard.

I am still curious as to why I am able to run it continuously without a delay, but with a delay involved those random stops occur.

Thanks for your response.

The TMC 2208 is rated for 2 amps PER PHASE! your stepper motor has TWO windings, two phase motor. So total amps could actually 4 amp power required for rated torque.

1 Like

Or 2.4 if the OP limits the current as he indicates.... Anyway, the power supply needs upgrading.

Current is never more than 140% of set current for two phases.

Nema 17 is the 1.7inch size of the motor's mounting plate.
It tells us nothing about the electrical specs of the motor.
If this is a hybrid/high impedance stepper, then a 12volt supply might not be enough.
Please post the model number of the motor, so we can check.
Leo..

Here is a link to the motor I purchased,

STEPPERONLINE Nema 17 Geared Stepper Motor L=39mm 1.68A Gear Ratio 100:1 High Precision Planetary Gearbox for 3D Printer CNC Robot Amazon.com

I will say the stepper motor driver is already getting pretty hot as it is.

This is a ~2.7volt/1.68A motor. The 12volt/2A supply should be ok for that.
The 1.2A driver is under-rated for that 1.7A motor, which might not be a problem, as long as you have adjusted the driver to 1.2A. And yes, running things at it's max will make them run hot.

I think you should try to drive the motor with a stepper library, with acceleration/deceleration.
AccelStepper seem popular.
Leo..

Yes, you're certainly right about the motor being rated for a higher current than the driver. I did limit the driver to 1.2A using the little screw potentiometer and just accepted that 0.5A wasted.

I did try the accelstepper library but had somewhat similar results. Small movements can be consistent but I am unable to make a full rotation occur without inexplicable stopping.

Did you code the stepper acceleration for a 200steps/rev motor,
and steps/rev for 20,000.
Leo..

I will try soon and let you know what happens.

That suggests that either the motor driver is overheating and shutting down, or the power supply is overloaded and shutting down.

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