Smoothing out stepper motor rotation and low rpm

I'm fairly new to controlling steppers with an Arduino UNO R3 and am trying to figure out how to get smooth movements at low rpm. I started with the cheap $3 unipolar motors from eBay, but they have too much play in their gear train and they cause quite a bit of vibration. I'm trying to run at about 4 rpm. From what I've read, microstepping should help with the vibration, so I picked up a SM-42BYG011-25 stepper and EasyDriver from SparkFun. This is a 200 step/rev motor and the driver can do 1/8 microstepping, so that gives me 1600 steps/rev. The motor runs, but movement is pretty rough at 4rpm, either regular stepping or microstepping. If I set my delays to turn at the same rpm, both regular and microstepping cause the same amount of vibration. It seems like at 1/8 microstepping, the motor is stationary until it gets the 8th pulse, then it moves a full step. Am I doing something wrong or just not understanding?

I'm running the EasyDriver from the Vin on my Arduino UNO R3. Pin 2 goes to direction, pin 3 to step, and pin 11 to both MS1 and MS2. I've tried powering from the USB on the UNO as well as running a 12V supply into the UNO. Any thoughts or suggestions? Below is my test sketch.

Thanks in advance.

int microStep = LOW;  // LOW for regular stepping, HIGH for microstepping

void setup() {
  pinMode(2, OUTPUT);  // pin 2 to direction
  pinMode(3, OUTPUT);  // pin 3 to step
  pinMode(11,OUTPUT);  // pin 11 to both MS1 and MS2
  digitalWrite(11, microStep);
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
}

void loop() {
  if (microStep == LOW) {
    // full step
    digitalWrite(3, HIGH);
    delay(32);
    digitalWrite(3, LOW);
    delay(32);
  }
  else {
    // 1/8 microstep
    digitalWrite(3, HIGH);
    delay(4);
    digitalWrite(3, LOW);
    delay(4);
  }
}

By it's nature a stepper motor steps and doesn't move smoothly. The difference in using full steps and 1/8th microstepping should be very obvious. Get it to move the exact number of steps for one full revolution.

Are you sure you have the correct connections to the EasyDriver to select the different step rates? (I think the EasyDriver defaults to 1/8 microsteps whereas the Pololu A4988 that I use defaults to full steps).

Probably not the main problem, but the delay between HIGH and LOW doesn't need to be as long as 4 millisecs. I think the Allegro chip on the EasyDriver requires a minimum pulse width of 1 microsecond. I have used 50 usecs but I know that is overkill.

The delay that governs the speed of the motor should all be between the pulses.

I initially thought a combined delay of 8 msecs would be much too fast but it is not far out if you are using 1600 steps per revolution and want 4 RPM. Have you tried it at slower and faster speeds?

The problem may be in your power supply. I have the same motor and it works fine with a Pololu A4988 driver board which is very similar to the EasyDriver.

What voltage are you using to drive the motor - the higher the better within the range allowed by the EasyDriver board. Also, of course there needs to be enough current available and the EasyDriver needs to be adjusted to limit the maximum current so you don't fry the motor.

Can you show us a diagram of your wiring - a photo of a clear pencil sketch is fine.

...R

That's a 12V 0.33A motor, for a chopper drive the supply voltage needs to be
significantly larger than the winding voltage, otherwise you won't get linear
current control. So unless you have 24V or more supply I wouldn't expect it to
be very well behaved.

In general bipolar motors for chopper drive (current control) have winding resistances in
the range 0.3 to 5 ohms - yours is 36 ohms and was intended for voltage control really.

Having said that it ought to do OK at lowish speeds with the EasyDriver from 24V or
even 18V.

You could also program the current to less than the nominal 0.33A, say about 0.2A, and
see if the voltage overhead that creates allows microstepping to behave from 12V supply.

A typical large high-performance bipolar stepper might have something like 0.6
ohm windings, 80V supply to chopper drive which programs 5A into the windings
(at stationary the 80V supply takes perhaps 200mA...) The 80V allows large amounts of
back-EMF from the motor to be overcome when spinning at 3000rpm or similar, and
significant mechanical power to be delivered at that speed (100's of W).

A smaller system would use a smaller ~2 ohm winding stepper and 24V or 36V supply
chopped down to ~1A

Robin, I've attached my circuit. Simple enough. Pulling both MS1 and MS2 high on the EasyDriver should enable 1/8 microstepping while pulling both low enables full stepping. This seems to work as at 1/8 it takes 1600 steps to do one rotation, and at full stepping it takes 200 steps. The problem is the shaft only moves once at every 8 microsteps when in 1/8 mode.

The delays I'm using give me about the correct rpm that I'm looking for.

I'm using the Vin pin on my UNO to drive the EasyDriver and motor. I've tried running the UNO on USB power as well as a 12V supply. It has the same problem either way. The motor has more torque and the steps are much more powerful on the 12V supply, but it still only moves once for every 8 microsteps.

Mark, running above 12V isn't an option. I'm just starting out working with motors, so I don't understand much about the specs yet. I haven't played with the current adjustment pot on the EasyDriver yet. It's adjustable from 150mA/phase to 750mA/phase, I don't know what it comes set to from the factory. From what you're saying, if I turn it down to 150-200, it might work?

Thanks,
Andy

I use the Pololu chopper drivers, not the Easy Driver, but if they work the same way the current limit feature MUST be properly enabled in order for the microstepping to work.

The microstepping works by adjusting the relative current levels in the two windings appropriately and if the upper limit is not set correctly (to something a bit less than the maximum for your power supply and motor), then microstepping doesn't work at all.

So my understanding above, that I need to turn down the current limit, is correct?

Thanks,
Andy

You don't seem to have any connection to the gnd and +5v connections at the lower left of the driver board. I'm surprised it works at all. The power for controlling the board is quite separate from the motor power so that you can connect a much higher voltage to the motor power connections. You need at least 12v there for that motor.

You need to match the current limit to your motor so that the driver board won't allow too much current to flow through the motor.

...R

The +5V and ground at the lower left of the EasyDriver are outputs from the voltage regulator, not inputs.

Andy

ajreynolds:
The +5V and ground at the lower left of the EasyDriver are outputs from the voltage regulator, not inputs.

Thanks. That's another difference from the Pololu A4988 driver.

...R

1 Like

Adjusting the current limiting pot was the solution. I turned it all the way down (my pot is backwards, so I had to turn it to the max position for minimum current). Now it's much smoother and I can tell it's microstepping. I've also discovered that the motor runs well on 5V, which will my voltage regulators much happier.

Thanks for the help.

Andy