Steppers and the Motor Shield

Axman Surplus is awesome.

I've been thinking of building a CNC. There are a number of articles on the web that'll walk you through building a CNC, including this one on how to build a desktop CNC. That one, in particular, could use a tool I already have - a Dremel.

Anyway, a CNC is complicated. There's a whole language used for communicating with CNC's called g-code, that is pretty much a complete mystery to me. Then there's taking 3-d models and converting them to g-code, and probably any number of details I don't have figured out.

It'd be a bigger project than I've tackled so far. But like anything, I've got to start somewhere, so I figured I'd start with equipment I already have. In this case I'm referring to the Motor Shield I got from Adafruit. I built it a while back and then set it aside and never used it. So I figured this was a good time.

I'd already figured out how to run a servo on the Arduino, but the Motor Shield has pins set aside to do this. It used to have a specific library too, but it looks like the folks at Arduino came up with their own. Anyway, using the example in Layada's tutorial worked right away, no troubles.

The real power in a CNC are the stepper motors. These are specialized motors that can spin in very small, descrete movements in either directions. Two steppers set opposite each over can control X and Y axis. A third stepper - or a servo - can control up an down.

I really don't understand how servo motors work, but I sort of don't need to. I hook it up and tell it where to go in code. With steppers, though - it's sort of different. Different steppers hook up different ways. There are unipolar and bipolar, 5-lead, 6-lead, and 8-lead. How you hook it up - even to something like the Motor Shield, which goes out of it's way to make it easier on you - makes a difference.

So needed to get some stepper motors. I could have ordered some online, but that'd mean waiting a bit and possibly paying more than I really want. Instead, I called the good folks at Axman surplus and asked them whether they sold stepper motors. They said they did and had a selection. Beyond that they couldn't say anything about what kind of steppers they had. Not surprising if you've ever been to Axman. It's a unique experience.

My friend Chad was up from Rochester for the weekend so I dragged him and my son over to the Axman in St. Paul off of University Avenue. After 30 minutes or so of just wandering the aisles - a process the cannot be avoided in such a place - we made it to area where all the motors were. There I found quite a few stepper motors, including some very similar to what is suggested on Adafruit's site: an Airpax C82290-M2. It's a 5 volt, 7.5 degree stepper motor - again, very similar to the examples. I bought 3.

The trick with these steppers is that they have 8 wires - more than the examples in the tutorial. The eight wires came in pairs: two red, two black, two yellow, and two grey. I tried first by tying together the pairs an hooking them up to the shield. Running the code didn't have the results I'd expected - the motor just shifted clock-wise and counter.

So followed some links suggested by the tutorial and eventually ran into one that talked about how to reverse engineer the purpose of the wires. And this link is pretty much the whole reason I posted today. It helped me figure how that the two red and two gray wires can be joined and then the black and yellow's mixed. I hooked these up to the motor shield and ran the example code as was. And now that link is here in the cloud for the next stepper I can't figure out.

Eventually I hope to create a simple plotter with all this. Probably a fixed pen or pencil over a moving platform that'll hold a sheet of paper. I'm not sure whether this little steppers are powerful enough for that, but I'll find out soon enough.

That's all I've got for now. No code since anything I used is available in the tutorial. More, hopefully, as I continue building something.


Comments

Popular posts from this blog

Makelangelo

CNC Mill: the Shapeoko 2

The Skywalker Family