Nema 17 Stepper Motor Weak Torque (Pololu A4988)

I’m attempting to run a Nema 17 stepper motor using the Pololu A4988 stepper motor driver. I’m running the motor with a Teensy 4.0, an Arduino-based microcontroller. The main issue I’m running into is the fact that the motor outputs quite weak torque. I can stop the motor’s shaft by installing a handle and just applying some weak force with any of my fingers.


Component Data:


I’ve created a simple setup in order to run a single motor as a test run, according to the following wiring diagram:

1

The setup:


As of now, the connections are not soldered, as I’m currently just testing it. However, I’m not wiring the motor through the breadboard, instead I directly connected them to the A4988 driver with some 20 AWG wires via the connectors on the wires. For testing purposes I’m running the motor with 24V from my DC power supply, with the default current limit driver setting.

I’ve also printed out and press-fitted a handle onto the motor shaft, so that I could use to measure how strong of a torque the motors output.

The code I’m running on the Teensy:

const int dirPin = 10;
const int stepPin = 11;
const int stepNum = 400;
const int stepDelay = 6000;

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

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

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

  Serial.println("Spinning!");

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

  delay(1000);
}

Basically I’m sending pulses via the Step pin on the Teensy and delaying by 6000 microseconds after every state change on the Step pin.

The setup above allows me to spin the motor in the desired directions and desired amount of steps, however the torque the motor provides is considerably weak. I’m able to halt the printed arm and the shaft of the motor with any of my fingers without much force.


Someone on a different forum reccomended to try and set the current limit on the motor.

I followed the exact steps of this tutorial, and I set the Vref voltage by turning the current limit screw on my A4988 driver with a scredriwer, and watching the voltage across that screw and a GND on my multimeter.
As far as I understand, I need to know the sensing resistance of my A4988 driver chip in order to plug that value into the equation in order to determine my required value for Vref. The equation as far as I understand is Vref = Imot * 8 * Rsen. According to the tutorial and the Pololu datasheet on the A4988 driver, the sensing resistance can be located on a pair of resistors on the chip.

Here is an image of my specific A4988 driver:

It’s a bit hard to tell, but I’m pretty sure that those small resistors say R068, which I understand stands for 0.068 Ohms of resistance.

According to the datasheet of the motor I’m using, the rated current is 1A, which is the default setup that these drivers come with. Since I’m supplying 24V with my DC power supply to the motor, I wanted to try and see whether I can supply more current to my motor, and see whether that improves the situation. I wanted to try and apply 2A of current, which means that, according to the equation above, I’d need to set the value of Vref to 1.6V. I went ahead and did that according to the tutorial, and tried to power the motor. This time the current supplied by my power supply would be significantly higher, sticking around 1.7A - 1.8A during the motor stepping.

However, as positive as this looked, the motor was still unfortunately not strong enough to surpass my fingers.


I also tried to microstep the motor by connecting the MS pins into different combinations;

8

Unfortunately, that did not appear to improve the situation either, instead if made the torque even weaker.


After these trials, I consulted a friend who mentioned something I have not thought of before;

It is my understanding that a 2-phase stepper motor works by sending pulses to each one of the two bipolar coils. The current sent in these pulses energizes the coils, and creates the magnetic field that result in the movement of the motor. These pulses are created by whichever controller is controlling the driver, in my case it’s the Teensy 4.0.

In the code I’m running on the Teensy, the actual pulses (sent via the step pin to the driver) are created by the following lines of code:

for (int i = 0; i < stepNum; i++)
{
  digitalWrite(stepPin, HIGH);
  delayMicroseconds(stepDelay);  // Delay 1
  digitalWrite(stepPin, LOW);
  delayMicroseconds(stepDelay);  // Delay 2
}

Where I alternate the step pin between HIGH and LOW, and the actual step takes place on the transition from HIGH to LOW.

Now, as far as I understand, Delay 1 in the diagram above represents the pulse width, while Delay 2 represents the pulse delay. So far I’ve only tested running these motors with both of the delays shown above being the same length. However, I was wondering whether the mystery of the low torque lies within the durations of these two delays.

What ratio between these two delay values would be appropriate for running these motors?


Another thing I’ve thought of was to try and view the actual pulses using an oscilloscope.

I conntected the oscilloscope across one of the two coils of on the driver, while it was running the motor. I wanted to track both the holding and stepping voltages on the coil. The results surprised me.

Here are two GIFs of the oscilloscope display, first as the motor is holding, second as the motor is stepping:

5
6

The thing that was very interesting to me was the fact that, while the motor is holding, there are pulses visible on the oscilloscope display. I would expect for the voltage across the coil to be stable at a certain value while the motor is holding, and not to alternate. Here is a close-up of the display while the motor is holding:

7

Why are there pulses that are visible while the motor is holding? Could that be a reason for why the motor is experiencing unusually weak torque?


At this point I’m kind running out of options with this Pololu A4988 driver.

I will also order a few of the TMC 2209 BigTreeTech drivers that a friend reccomended, which are also commonly used in devices like 3D printers. I will report if they improve the situation after testing them out.

Thank you for reading my post, any guidance is appreciated

Hello.

It looks like all of your headers are soldered, and everything else is connected either through your breadboard or jumper wires, which should be okay. However, good connections are required for electronics like these to work properly, so if you do have any poor connections (such as unsoldered headers) please try correcting that first. If you have any temporary connections that you are not confident about, please post some pictures of those and I can let you know if it seems okay.

Another immediate concern is how you are setting the current limit. Setting the current limit higher than your motor’s rated current can damage it, so it is very important to set the current limit correctly before powering the motor. Additionally, the A4988 carrier you have can handle approximately 1 A per phase without additional cooling, so operating it with a higher limit increases the chances of triggering a thermal shutdown. Please reduce the driver’s current limit to 1A (VREF = 0.54V) before doing any other testing.

To the best I can tell (it is hard to see exactly what is going on in your GIFs and your scope picture) I think your stepper motor driver is working as expected. The pulses you see while the stepper motor is holding position is a result of the driver’s active current limiting. The delays you mentioned in your code will generally only affect the motor torque if they become small enough to prevent the current from ramping all the way up.

How long is the lever you have attached to the stepper motor, and can you estimate how much force at the end of the lever will overcome the stepper motor’s holding torque? Also, can you post more information about your system’s power supply?

- Patrick

Thank you for your reply;

Thanks for specifying how to properly implement the current limit on the A4988 driver. I will make sure to set that limit to the rated current of the motor at 1A.

As far as the motor torque goes, I do not have access to tools that can measure the exact amount of torque that the motor can output. However, I can get an estimate of the capabilities of my setup.

The handle I printed out and attached to the motor shaft (visible in the image above) is 6 inches long. According to the Amazon listing page for the motor I’m using (linked above), the holding torque of this motor is stated to be around 0.45 N-meter. Since 1 N-meter is ~0.74 lb-foot, that means that a 6 inch handle on the motor should be able to carry ~0.66 lb. I tried attaching a 0.5 lb weight on the printed handle, and the motor could not support it while holding. While these values I attained ar all esimates, the 0.5 lb weight is quite a bit less than the ~0.66 lb esimate I got. Therefore, I believe that something’s off with the setup here (if my calculations here are incorrect, please feel free to correct me).

I’m using a simple DC power supply, providing 24V to the motor.

All the wires that I’m using in my setup are 20AWG, meaning that they should be able to carry up to 3A of current, which is more than any of the components in this simple setup are using. Another thing I noticed is the fact that, on the Nema 17 Amazon listing page, in the image with the specifications, the “Rated Voltage” of the motor states only 3.2V. Is that a mistake? I don’t believe that most motor drivers can even run a stepper motor at that low of a voltage. Could that be a reason for why this setup is not ideal?

The rated voltage of a stepper motor is just the voltage at which the coil draws its rated current, but if you are using a current limiting driver (like any of our stepper motor drivers, including the A4988) then powering the driver and motor from a higher voltage is fine (and even beneficial in some respects) as long as the current limit is set properly. You can find a little more elaboration about this on the A4988 carrier’s product page under the FAQs tab.

We test every unit, and as I mentioned before, the scope captures for your driver seem okay. Additionally, since you do have basic operation of your motor (you can energize it and it steps as commanded under no load), I am inclined to think that your connections are okay. That leaves your power supply and the motor itself. Can you post more details about your power supply (like a datasheet or product page link for it)? Can you also try measuring the current drawn by each coil of your stepper motor? If you are setting the current limit to 1A now, then I would expect the current draw through a coil to be around 0.7A while the driver is in full-step mode.

One possibility here is that your stepper motor was damaged while you had the current limit set too high. Do you have any other stepper motors that you could test your driver with?

- Patrick