Close

TODO: Microstepping

A project log for CD/DVD mechanisms and cartesian thinggie[s?]

DVD-laser-etcher, dremmel-router, possibly a 3D printer? Who knows!

eric-hertzEric Hertz 09/13/2015 at 00:060 Comments

Alright, so I got a bit carried-away in the last log-entry where I claimed that "steppers are easy". But certainly an already-built-in stepper is easier than attaching a position-sensor on a built-in DC-motor, and designing a feedback loop...

Anyhow, I noticed that when I turned the knob too fast, the steppers will definitely miss steps, especially with *any* additional loading. We're not talking very fast, here, when compared to the speed the carriage moves back and forth when seeking data. Add to that: I'm running the motor-drivers at 12V, which seems absurdly high for these tiny motors, they should be doing fine, right? So, certainly, the DVD-drive's designer must've done something different...

I'm no expert on any of this...

...but I know that with unipolar stepper motors (the kind where there are four windings, paired together, and each pair sharing a common wire) microstepping helps tremendously. While the name sounds like it's used to rotate the motor in smaller steps, and in fact kind-of can, it has another benefit... strength. In a unipolar stepper, it makes some amount of sense... imagine you're turning on one winding at a time in a clockwise-fashion... Then only one winding is ever holding the shaft in position. And at the moment when you turn the previous winding off, and the next one on, the motor is far away from the next position, and therefore the magnetic force is pretty weak... Here it'll likely lose a step. So, one way to help that is to allow two windings to be on simultaneously, briefly...

E.G. Only the first winding is powered. The motor will be held in the first position (the first step). Now turn on the second winding (leaving the first on). Now the motor will be held halfway between the first and second positions/steps. So, we've half-stepped. AND we have the benefit that two windings are powered at the same time, which means there's a reasonable amount of magnetic holding-force. (Note, again, that without half-stepping, there would be no way to have any holding force anywhere inbetween two steps. But the motor is a physical object, it doesn't just teleport from the first step to the second, so without half-stepping, it would be very weak between every two steps). Great!

Actually, that's pretty much it. Microstepping can take it a bit further by lowering the power on the first winding and increasing the power on the second, so say you've got half-power on the first and full-power on the second, the motor might hold somewhere around 3/4ths of the way between the two steps. Do this sorta thing a bunch and you've got some pretty smooth motion AND holding-force in all the inbetween positions.

BUT, what I don't quite get, is how a bipolar stepper could be stronger if it's microstepped, or even *how* to microstep it. First of all, it seems to me, the de-facto means for driving a bipolar stepper is to use quadrature and H-Bridges that alternate the polarities of the windings, rather than turning them off and on. Typically, both windings are *always* on in one polarity or the other. So we've already achieved the benefits of the half-stepping case, discussed above, right?

(And here's where I get further confused, because... doesn't the electrical polarity of the winding affect the magnetic polarity? So, then, the point must be that the motor's shaft is attached to something already magnetized, which the windings either attract or repel... Right? Yet, I'm almost certain I've read that unipolar stepper motors (as in, "all") can be converted to a bipolar by simply tying the loose wires in each pair together... Except, wouldn't that require that its rotor be magnetized, which isn't necessarily a requirement for a unipolar design...? Or maybe it's that all rotors are magnetized... but I'm almost certain, again, that I've seen unipolars swapped around in both common-positive and common-negative configurations... which would mean in one case the powered windings would *attract* the rotor, and the other would *repel* it, the former would certainly be stronger! Anyways, something to ponder...)

Anyhow, apparently, microstepping not only exists (which I figured it did) for bipolar steppers, but it *also* adds to the strength of a motion... according to this page:

http://www.embedded.com/design/configurable-systems/4217719/2/A-simple-algorithm-for-microstepping-a-bipolar-stepper-motor

Now, that page gets a bit too technical for my liking... Seriously, we've got to measure the current just to be able to microstep? I think there's a halfway inbetween; somewhere between the "ideal" engineered method, and the caveman's single-stepping approach... Something that'll work pretty good, while still being somewhat easy to comprehend... I figure this: Just think of it like PWM... (Except, in this case, the winding's not off or on, it's forward or reverse-polarized.) Then just think of ramping up that PWM on one winding and ramping it down on the other. Pretty simple, really... No current-measurement necessary. And, frankly, not even needing to use a sine-wave (though surely that'd be more effective). I've done this with unipolars, and was quite pleased with the outcome, but this'll be my first attempt with a bipolar. It might go sour, who knows... Those motors are getting quite warm already... maybe current measurement will be in my future.

This image is from that page:

If I get the explanation correctly, VREFA/B are the *measured* voltage across a reference-resistor, thus representing the current drawn by the winding. The explanation makes it sound like we want to control VREFA/B... I guess, technically, in the long-run, that's what we're going for. But without a feedback loop that seems a bit difficult. And adding a feedback loop seems like a lot of work... We've got direct control over the polarity of the outputs to the windings... Switching that quickly, e.g. via PWM, that's kinda like direct control of the voltage going into the windings. We could probably look at the windings like an inductor and use math, but I have a feeling the motion of the motor would change it from the ideal inductor equation a bit... Further, the explanation in that article suggests that there may be reason to use different curves than a sine-wave, for different motors/loads. (In other words, obviously, it doesn't have to be a perfect sine-wave, heck it was a square-wave before). Why not just consider the plots labelled Current A/B to represent the PWM value...(where the bottom of the wave is PWM=0%, the top is PWM=100%)? That seems to make sense to me. And, further, I don't want to deal with a sine-wave. Why not triangular...? This is all basically what I said before the image, now I'm kinda wondering why I put it here to confuse us.

Discussions