1
\$\begingroup\$

I built a test jig to experiment with a friend's 16-pin A4988 stepper driver, and even added bi-directional LEDs to the outputs and, regular LEDs to the inputs, to see if it behaved as expected.

By default, it does a full circle in 200 steps, and both coils were always driven. Fine. If MS1 is set, every other step features a coil off. 200 steps rotate it half-way. Expected.

But in any jumpered "microstep" mode, and pulsing VERY slow, I can see and feel that it MERELY COUNTS steps, before the last two. For instance, at Sixteenth Stepping, the first 14 steps do nothing whatsoever. Step 15 advances a half-step, and Step 16, the next full step.

No PWM, no fractional voltages. Just counts until the final two steps, and half-steps.

So I ordered a pair of LV8729 controllers of the same 16-pin RAMPS-style from BigTree on Ali. Certainly these would microstep ... but no. Precisely the same behavior.

Anything above half-stepping, they just count until the final two pulses in the sequence. No modulated PWM, and no in-between. Half-stepping is the finest resolution available.

Does anyone have the same experience? Is there some secret to force this style of stepper driver to do real microstepping?

Have found no online references to fake microstepping on cheap stepper drivers. It is hard to imagine that millions of these are being sold, without true PWM fractional steps. Someone would notice, eh? At regular speeds though, it is difficult for a human to see.

My expectations may be amiss.

\$\endgroup\$
14
  • 1
    \$\begingroup\$ You need to observe the drive waveforms. It may be cheating as you say, or it may be that stiction and pole shapes make for non-linear torque (cogging) specific to the motor, so the first 14 steps don't move anything. \$\endgroup\$
    – user16324
    Commented Apr 14, 2021 at 12:40
  • \$\begingroup\$ #GnuReligion, I just started playing with A4988 a couple of days ago. I only tried full step with a bipolar motor with quadrature encoder A and B signals. This afternoon I used square wave 1kHz, 50%dc as step pauses. Preliminary test shows that full step, half step, 16th step mode drives the motor from slowest to fastest. I have uploaded the scope screen captures as my answer. I don't understand how you count the step movements. Do you use a very slow frequency, say 1 step pause per second, and use your eyes to do the counting? \$\endgroup\$
    – tlfong01
    Commented Apr 18, 2021 at 8:59
  • 1
    \$\begingroup\$ Thank you for engaging. I do not have an oscilloscope, and admit that for duty cycles above 15%, I may not "see" dimming of my indicator LEDs very well, and that my stepper may be cogging. But still, the discrete half-step/full-step on adjacent pulses when 1/16th stepping, seem to indicate "cheating." @tlfong01 I watched your YouTube video. Nice test rig! Your red A4988 module looks same as mine. If I understand, you use PWM on the enable pin to limit current. To see my problem, you would run full enabled, and pulse steps VERY slowly. Will make a reply video for you soon. \$\endgroup\$ Commented Apr 19, 2021 at 13:52
  • \$\begingroup\$ Just a quick reply. I did try to lower step frequency to 100Hz, but the motor started trembling. I found 400Hz drives the motor smoothly. I might try to see 1Hz to 10Hz. I have not tried PWM because I don't really understand why use PWM, because I think square wave is just PWM 50%. Anyway, I will try other duty cycles and see the difference. I will let you know perhaps tomorrow. Cheers, \$\endgroup\$
    – tlfong01
    Commented Apr 19, 2021 at 13:59
  • 1
    \$\begingroup\$ Last night, made a home-made driver with an L293D dual H-bridge. More complicated to control than the stand-alone modules; 4-wires instead of 2. Will take me a day more to write the software. I want to position the rotor BETWEEN steps. Would like to have no torsional vibration whatsoever even when turning very, very slowly. You should try use the small trim-pot on your module to regulate the output current, instead of using PWM on the enable pin. Might glue-on a heat-sink too! Your stepper is HUGE. \$\endgroup\$ Commented Apr 19, 2021 at 14:14

2 Answers 2

1
\$\begingroup\$

Short Answer: These drivers are made to work with a specific class of 3d printer steppers, and will not engage PWM in the microstep region until a given amount of current is drawn.

My problem was, that the stepper I am using to test these RAMPS style drivers is salvaged from and old 5.25 floppy. Runs at 12V, wired for bipolar operation, and has 200 full steps per rotation ... all very much like a NEMA 17, but it simply does not draw enough current to properly engage PWM, except slightly, at the very extent of the trim pot.

Now I understand these drivers are actively monitoring the current draw and adjusting the duty cycle accordingly. They are made specifically to hit full steps.

There are other types of driver chips that work the way I had expected, and have already built something similar with a dual H-bridge and MCU.

Lets see if I can figure out how to close this question.

\$\endgroup\$
0
\$\begingroup\$

Question

A4899's microstepping operation seems not performing as specified. Is it fake microstepping?


Answer

Short Answer

I proved that my A4988 is doing real microstepping, as specified in datasheet.


Long Answer (TLDR)

Abstract

This long answer shows how the A4988 is tested using

  1. High frequency signal, 1kHz, 50% duty cycle, using a oscilloscope to measure microstep timing/performance, and,

  2. Low frequency signal, 20Hz, 10% ~ 90% duty cycle, using a stop watch to time by hand the full step, half step, and micro step operations.


References

(1) A4988 Datasheet - Allergo

(2) A4988 Stepper Motor Driver Module - AliExpress US$0.6

(3) Fake microstepping in A4899 and LV8729 stepper-drivers? - @GnuReligion, EESE, Asked 2021apr14

(4) What could be the reasons for a stepper motor stuttering with an A4988 driver? [Locked] EESE, Asked 2021apr05

(5) What is better for precision? Stepper motor VS DC Motor [Closed] - EESE 2021apr13

(6) AliExpress HK42BYG250-001 Stepper Motor NEMA17 | High torque 1.2A 38mm stepper motor for 3D printer 42 with speed feedback

(7) Youtube video of A4988 Full Step Performance - tlfong01 2021apr18

(8) RpiMotorLib python library to drive NEMA 17 stepper for A4988 - DiyProjects 2021feb09


Appendices

Contents

Appendix A - Testing A4988 using 1kHz 50% Ducty Cycle Square Wave

Appendix B - Testing A4899 using 500Hz, 50% square wave

Appendix C - Testing A4988 Micro Stepping using 20Hz, 50%dc signa

Appendix D - Proof of concept - Motor speed is independent of PWM pulse width

Appendix E - Clarify difference between A4899's Step and Enable Signals

Appendix A - Testing A4988 using 1kHz 50% Ducty Cycle Square Wave

Chat record #1

#GnuReligion, I just started playing with A4988 a couple of days ago. I only tried full step with a bipolar motor with quadrature encoder A and B signals. This afternoon I used square wave 1kHz, 50%dc as step pauses. Preliminary test shows that full step, half step, 16th step mode drives the motor from slowest to fastest. I have uploaded the scope screen captures as my answer. I don't understand how you count the step movements. Do you use a very slow frequency, say 1 step pause per second, and use your human eyes to do the counting?


full step


full step


half step


16th step


a4988 step motor test

Youtube A4988 Test 01


Appendix B - Testing A4899 using 500Hz, 50% square wave

Full step

full


Half step not sure

not sure


Step 16

step16


Appendix C - Testing A4988 Micro Stepping using 20Hz, 50%dc signal


Configuration

  1. A4988 Setting - (a) full step, (b) half step, (c) microstepping (16th step)

  2. Step pause setting = 20 step pulses per second (20Hz, 50%dc)

  3. Stepper motor HK42BYG250-001 1.8 degrees (360 / 1,8 = 200 steps per revolution)


Results

Time taken for one revolution:

Full Step ~= 10 seconds

Half Step = ~= 20 seconds

16th Step = ~= 2:39 min ~= 159 ~=160 seconds


Conclusion

a4899 microstepping seems working OK.


Appendix D - Proof of concept - A4899 performance/Operation/Motor speed is independent of pulse width of step pulse input

Configuration

  1. Pulse frequency = 20Hz = 20 pulses per second

  2. Pulse width (a) 10% dc, (b) 20% dc, (c) 90% dc

Results

Times taken per revolution for different pulse widths: 10%, 50%, 90% are all the same: 10 seconds.

Conclusion

Motor speed is independent of pulse width.


Appendix E - Clarify difference between A4899's Step and Enable Signals

So far I have been using the Step signal to prove that A4899 can detect the microstep jumper configuration and perform the operation. But I might have misled readers that the Step pin/signal is used to control the speed of the motor. It is true that Step pulse frequency can be used to control motor speed, but I think step signal is used to position the motor, or revolutions and degrees traversed. It think it is the enable signal which can be PWM, is used to control the motor speed. So I am now extracting materials from Ref 4 and placed here for discussion.


The pin functions.

pin functions


A4899 Spec Summary

a4899 spec summary


Stepper motor spec summary

motor spec summary


Notes

The above motor spec shows that torque decreases with increasing torque. For future tests, the default 1KHz, 50%dc will be used as the default.


\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.