microscope observation of A4988 stepper driver NEMA 17 precision

Yesterday I leaned that microstepping is easy to program, but equal sized steps are hard to do with two-axis microscope sliding-table 5V bipolar stepper motors. I looked at scene with high precision microscope for that:

I used L293D driver for the stepper motor. I read a lot that there are better drivers like A4988, and today I used that with my only NEMA 17 stepper motor:
https://www.amazon.com/Usongshine-Stepper-Bipolar-Extruder-17HS4023/dp/B07TY4BFF2
Reason is that minimal voltage of A4988 is 8V, and I am not sure what the tiny stepper of sliding-table rated 5V does when powered with 8V. I will do that experiment later (I have three 1.60$/pc sliding tables already, and did order 10 more some time ago).

This is the setup, motor shaft upwards just below M12 180° lens mounted reversed to Raspberry HQ camera as macro lens. Because of the vibrations the stepper did, I had to clamp it and microscope holder to desk:

I used this sketch, setting MS1/MS2/MS3 to low is full-stepping. Product descriptions states that motor has 200 steps per revolution, but sketch had to do 800 steps for a full revolution:

#include <Stepper.h>

#define steps 800

Stepper myStepper(steps, 2, 3);            

void setup() {
  myStepper.setSpeed(3);
  pinMode(6, OUTPUT); digitalWrite(6, 0);
  pinMode(5, OUTPUT); digitalWrite(5, 0);
  pinMode(4, OUTPUT); digitalWrite(4, 0);
}

void loop() {
  myStepper.step(steps);
  delay(2000);
  
  myStepper.step(-steps);
  delay(2000); 
}

I took a youtube video.
800 steps clockwise, 2s pause, anticlockwise, 2s pause, clockwise, 2s pause, anticlockwise.
Microscope resolution 0.84µm/pixel here, so 1014x760 preview window is 3.40mm×2.55mm (tepper sound is quite loud):

I did cut out frames of no-movement phase and created animated .gif from those.
Precision of position is remarkable, although you can see the frame moving a few pixels right each time.
But few pixels is few micrometer, so that is fine for now (for 800 steps).
(I can control xy directions of microscope in 5µm steps, want microstepping for 1µm steps)

HermannSW:
Reason is that minimal voltage of A4988 is 8V, and I am not sure what the tiny stepper of sliding-table rated 5V does when powered with 8V.

It is normal to use much higher voltages with an A4988. I think it can go up to 35v.

The way the motor is protected is by setting the current limit on the A4988 to (or below) the max that the motor is designed for.

...R

Robin2:
It is normal to use much higher voltages with an A4988. I think it can go up to 35v.

The way the motor is protected is by setting the current limit on the A4988 to (or below) the max that the motor is designed for.

I don’t need higher voltages, the steppers are rated 5V and “current about 100mA” (my constant voltage power supply did measure 84mA):

So could it be fine to power the two steppers with 8V if limiting current to 100mA via the A4988?

I created another video, this time with only 10*2/4/8 half/quarter/eighth steps in both directions and then repeat, from this sketch:

#include <Stepper.h>

#define steps 800
#define N 10

Stepper myStepper(steps, 2, 3);            

void setup() {
  myStepper.setSpeed(3);
}

int i=1;

void loop() {
  pinMode(6, OUTPUT); digitalWrite(6, i&1);
  pinMode(5, OUTPUT); digitalWrite(5, (i>>1)&1);
  pinMode(4, OUTPUT); digitalWrite(4, 0);

  myStepper.step((1<<i)*N);
  delay(2000);
  
  myStepper.step(-(1<<i)*N);
  delay(2000);
  
  i=1+(i+1)%3;
}

Remarkably how precise positioning at the no-movement phases is even across half/quarter/eighth steps:

I would support Robin's suggestion of a slightly higher voltage.
Both voltage and current are key factors with stepper motors like the Nema 17.

The 4988 is a fine little board but there are also some slightly better ones with more microstepping.

The trinamic offers some nice extra features and they are available on the same driver board package.

@ballscrewbob
Thanks for the trinamic link, and I agree with you and Robin wrt A4988 and NEMA 17 motors.

But I want to add micro-stepping to the tiny stepper motors of my 1.60$/pc two-axis sliding table that provide 5µm steps per half-step. They are rated 5V and "current about 100mA" (my constant voltage power supply did measure 84mA). The question is, can I power these tiny steppers with A4988 with 8V (or more)?

https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=210605&start=75#p1677057

HermannSW:
They are rated 5V and "current about 100mA" (my constant voltage power supply did measure 84mA). The question is, can I power these tiny steppers with A4988 with 8V (or more)?

IF (and I don't know the answer) it is possible to adjust the current limit on the A4988 down to 100mA (or 85mA) then you can use any voltage that the A4988 can accept.

If the A4988 won't go down to 100mA it may be worth studying the Allegro A4988 datasheet to see if it could work at a lower current level with different current-sense resistors.

...R

@Robin2

Thanks I had forgotten about the resistor trick !

HermannSW:
I don't need higher voltages, the steppers are rated 5V and "current about 100mA" (my constant voltage power supply did measure 84mA)

Steppers are current-driven, the higher the supply to the A4988 the faster you can spin the stepper, and
with more torque at speed too, as the voltage overcomes inductive and motional back-EMF. Stepper drivers
are constant-current buck converters in effect, so are power efficient - more supply voltage and they draw
less current from the supply.

@Robin2, @battlescrewbob,@MarkT
Thanks for all the information.

I have non-Pololu A4988 stepper drivers that I used to turn my NEMA 17 motor until now without current limit setting.
They look different to the Polulu A4988 drivers, for which RCS can be determined visually.
I did measure VREF=585mV, whatever that means.

The Pololu pages are informative and speak of “measure VREF”, but don’t tell how:

I found the answer in a Pololu video, you can measure VREF at potentiometer screw (this is for different motor driver):

Robin2:
IF (and I don’t know the answer) it is possible to adjust the current limit on the A4988 down to 100mA (or 85mA) then you can use any voltage that the A4988 can accept.

I turned the screw, and it is possible to set VREF to any value including 0V.

Because I wanted to use the method from Pololu page
VREF=8⋅IMAX⋅RCS
I bought a Pololu A4988 in the past. It is the new model with RCS=68mV.

So for 100mA current limit I need to set VREF to 80.10.068=54mV.
I was able to set the currently in use non-Pololu A4988 to 54mV without problems.

Next I will have to solder 4 connections to one stepper motor of unused sofar sliding table, and headers to the Pololu A4988 driver for testing with it. I will not touch the working fine two-axis sliding table for the first experiments.

I am pretty sure this will allow me to drive sliding-table 5V motor with micro-stepping, and 1/16 stepping will hopefully result in 5µm/8=0.625µm equal spaced steps – I will verify that under microscope.

If that will work, I will use oscilloscope/logic analyzer to see what A4988 does differently to my micro-stepping of sliding-table stepper with L293D, that showed very unequal step sizes under microscope.

The A4988 and L293D are two complexly different animals.

L293D being about a gazillion year old technology.
Comparison will be like chalk and cheese ;D

I had problems to get A4988 driver to work with one stepper motor from new two-axis sliding-table.
I was able to move that newly soldered stepper motor without A4988.
Problem might be my bad soldering of headers to the Pololu A4988, or something else.

I received Pololu DRV8834 low voltage stepper driver yesterday:

Since output range is 2.5..10.8V, I just did use Arduino Uno 5V as VMOT.
I did set VREF=50mV for current limit of 100mA.

And it really worked, I used 1/8 step and sliding table did move from left to right, and then from right to left with 8*250=2000 1/8 microsteps:

Tomorrow I will connect DRV8834 driver to the x direction stepper motor of existing sliding-table with micrometer on top. Under microscope (with 0.21µm/pixel resolution) I will see whether the spacing for single 1/8 microsteps is uniformly or not (1/2 microstepping had 5µm wide steps, so expected step width for 1/8 is 1.25µm(!)).
Even better, DRV8834 allows for 1/16 and 1/32 as well ...