Wednesday 2 July 2014

motor - How is this extremely high-resolution stepping achieved?


This question pertains to this video as well as this one by the same person demonstrating his results with a stepper motor (along with a really neat testing method involving a laser spot on a wall a few meters away!).



How did he achieve this kind of high-resolution stepping behavior of < 0.04° steps (with 1-second holding at each step) on a standard, gearless 1.8° stepper motor?


The person claims to use "sine wave patterns" with Arduino's analogWrite function.


I am familiar with microstepping, but:




  • how is this done within an Arduino sketch and without some hardware like DRV8825 or L6470?




  • and how is he able to hold the position so definitely and accurately, something that articles about microstepping usually warn isn't exactly guaranteed?





(Obviously, there is no clear way to measure precision and accuracy here with the videos' limited provided information. However, approximating the wall's flat surface as part of a circle centered on the stepper, we can see that there are very fine steps formed by the laser spot -- as well as a fairly small deviation between expected and observed angle for each step, especially in the 2nd video I linked.)



Answer



If you look at the notes on the videos, you'll see that he is microstepping. He explicitly states that he is driving the stepper with sine waves. The simplest way to do this is with the PWM outputs feeding the amplitude control of the two stepper drivers.


Begin by noting that 1.8 degrees divided by .04 degrees is ~45, and since a standard stepper quadrature waveform takes 4 steps to complete a cycle, this implies a microstep resolution of 4 x 45, or 180 microsteps per cycle. In fact, it's pretty clear that he is using 64 microsteps nominal.


If n is the step count per excitation revolution (that is, microsteps per every 4 nominal steps) , let n = 0 to 255. For each successive n, find the step angle A = 360/n. Then find $$ X = 127\sin(A) +128$$ and $$ Y = 127\cos(A) +128$$ and use the analogWrite function to produce the PWM versions of these quantities. When applied to the control inputs to standard 1.8 degree steppers, you'll get a nominal step size of $$S = \frac{4\times{1.8}}{256} =.028\text{degrees}$$


Also note that, if you look closely at the videos, the step-to-step distance is not constant, and that is only to be expected.


No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...