Anyone know anything about stepper motors?

eric25

New Member
I have been gathering components for a cnc pcb mill. so far im in the preliminary steps of gathering parts. i started with the electronics part of the build and will build the machine itself later. im gathering the parts slowly, rail systems are kind of expensive but i got some spare 3d printer parts left over from a bed upgrade, and i got some spare linear bearings. i got a rather thick piece of acrylic salvaged from a dead monitor which would serve as a good base plate, since i have a lot of other salvage displays i figure much of the structure would be build out of acrylic and 3d printed parts. will probibly use a dremel flexi shaft as the buisness end with the dremel elsewhere to reduce the mass that needs to move around. anyway its going to be a small machine, so long as i can mill a 4x4" pcb with it.

anyway i got an old arduino (i tried building an stm32 version of grbl but had trouble flashing it to the board, using arm has some advantages, more memory and has an fpu and hardware divide that the atmel chip doesnt have) running grbl with a 4 channel cnc shield. i only have a few steppers salvaged from junk, several laser actuators from dead cd/dvd drives, and a couple mitsumi motors from an old sewing machine. at some point im going to get me some nema 17 motors like the ones on my 3d printer. not sure whether im going to use lead screw drive or belts, but im concerned that belt drive wouldnt have the torque neccisary, but that extra torque costs speed, but its going to be a small machine so thats not a big issue. anyway i cobbled up some wiring harnesses and im using some lithium ion batteries for power. anyway they are unipolar 4-wire motors. i did find a data sheet on the motors, but they didnt cover the electrical connections. the drivers have 2 channels and its not hard to trace out the two coil sets in the motors, each pair of wires to one of the chanels. but im not sure if polarity matters. the channels are powered by an h bridge and will alternate between positive and negative between steps.

anyway i connect the motors, load up bCNC with an svg file and initially i get them to spin. one motor is holding its position just fine, at least up to the limit of its hold torque. the other seems to be freely rotating at a significantly lower torque. this made me question my assumption that polarity didnt matter. maybe they are like encoders and operate with a grey code, maybe having reversed polarity on one of my coils is breaking that grey code. i rechecked my harneses and noticed that i had the coils flipped on one of them so i made them identical, matching the better of the two and im still getting one to spin freely, swapped motors/cables, controllers same difference. i tried lubricating the motors since they are all sleve bering type and have been in my junk bin for awhile. so long story short is there a right way to wire these things?is there some secret sauce that im missing?
 

Cableguy

Expert
Licensed User
Longtime User
Hi,

Nema motors work by sequentially energizing their coils. There are two coils in them, and the step and rotation sense is determined by the sequence they are energized.
If a coil stays energized, the motor will hold it's position, and the torque is somewhat determined by the max current the drivers can provide.
If a motor is turning in the "wrong" sense, then you will need to invert one of the coils connections.
I'll be glad to continue discussing this with you in DM if you so wish to.
 

hatzisn

Expert
Licensed User
Longtime User
Hi,

Nema motors work by sequentially energizing their coils. There are two coils in them, and the step and rotation sense is determined by the sequence they are energized.
If a coil stays energized, the motor will hold it's position, and the torque is somewhat determined by the max current the drivers can provide.
If a motor is turning in the "wrong" sense, then you will need to invert one of the coils connections.
I'll be glad to continue discussing this with you in DM if you so wish to.

Please continue the discussion here. This is very interesting.
 

emexes

Expert
Licensed User
Longtime User
Please continue the discussion here. This is very interesting.
+1

continue discussing this with you in DM
-1

It'd be great if you could leverage your explanation for us who are interested now, and new people in the future. 🍻

I don't have any stepper motors or drivers to experiment with here, but my first thought was: map out with a multimeter what the likely pinout-to-coil mapping is. Is it a 4-pin connection with two separate coils? 5-pin with four coils and a central common? 6-pin with two center-tapped coils? What resistance are the coils?

And then I'd be mucking about trying to determine what sequence of highs and lows (ones and zeroes) to those pins, results in what movement in which direction and with the best torque.


Drive.png
 

Cableguy

Expert
Licensed User
Longtime User
Please continue the discussion here. This is very interesting.
Sure, no problem... But it's up to the OP to do so.
Without having some kind of schematics to look at, all I can provide is theoretical insights.
What I know, I've learned it from "Franckensteining" my 3D Printer and Laser Engreaver.
It allowed me to have a deeper understanding of how "small" hardware differences affect the overall performance.
And specially, how to troubleshoot when things go sideways, as they usually do!

SO, at this time, if the previous answers were not sufficient, I will need more details about your cnc project... like hardware, schematics, etc
 

hatzisn

Expert
Licensed User
Longtime User
Sure, no problem... But it's up to the OP to do so.
Without having some kind of schematics to look at, all I can provide is theoretical insights.
What I know, I've learned it from "Franckensteining" my 3D Printer and Laser Engreaver.
It allowed me to have a deeper understanding of how "small" hardware differences affect the overall performance.
And specially, how to troubleshoot when things go sideways, as they usually do!

SO, at this time, if the previous answers were not sufficient, I will need more details about your cnc project... like hardware, schematics, etc

I am just a spectator/reader on Eric25's project and always willing to learn something interesting that I may or may not use in the future. I have no CNC project.
 

Didier99

Member
Licensed User
I have been gathering components for a cnc pcb mill. so far im in the preliminary steps of gathering parts. i started with the electronics part of the build and will build the machine itself later. im gathering the parts slowly, rail systems are kind of expensive but i got some spare 3d printer parts left over from a bed upgrade, and i got some spare linear bearings. i got a rather thick piece of acrylic salvaged from a dead monitor which would serve as a good base plate, since i have a lot of other salvage displays i figure much of the structure would be build out of acrylic and 3d printed parts. will probibly use a dremel flexi shaft as the buisness end with the dremel elsewhere to reduce the mass that needs to move around. anyway its going to be a small machine, so long as i can mill a 4x4" pcb with it.

anyway i got an old arduino (i tried building an stm32 version of grbl but had trouble flashing it to the board, using arm has some advantages, more memory and has an fpu and hardware divide that the atmel chip doesnt have) running grbl with a 4 channel cnc shield. i only have a few steppers salvaged from junk, several laser actuators from dead cd/dvd drives, and a couple mitsumi motors from an old sewing machine. at some point im going to get me some nema 17 motors like the ones on my 3d printer. not sure whether im going to use lead screw drive or belts, but im concerned that belt drive wouldnt have the torque neccisary, but that extra torque costs speed, but its going to be a small machine so thats not a big issue. anyway i cobbled up some wiring harnesses and im using some lithium ion batteries for power. anyway they are unipolar 4-wire motors. i did find a data sheet on the motors, but they didnt cover the electrical connections. the drivers have 2 channels and its not hard to trace out the two coil sets in the motors, each pair of wires to one of the chanels. but im not sure if polarity matters. the channels are powered by an h bridge and will alternate between positive and negative between steps.

anyway i connect the motors, load up bCNC with an svg file and initially i get them to spin. one motor is holding its position just fine, at least up to the limit of its hold torque. the other seems to be freely rotating at a significantly lower torque. this made me question my assumption that polarity didnt matter. maybe they are like encoders and operate with a grey code, maybe having reversed polarity on one of my coils is breaking that grey code. i rechecked my harneses and noticed that i had the coils flipped on one of them so i made them identical, matching the better of the two and im still getting one to spin freely, swapped motors/cables, controllers same difference. i tried lubricating the motors since they are all sleve bering type and have been in my junk bin for awhile. so long story short is there a right way to wire these things?is there some secret sauce that im missing?
Do you use a stepper motor driver, or did you just make a H bridge with discrete MOSFETs?
I suggest using a stepper motor driver. They are cheap and will take care of a lot of the lower level hardware stuff, including giving you fractional steps, overcurrent protection and smooth movement. The A4988 based drivers are small and very cheap, while the TB6600 are more powerful (and typically larger as they come with a heat sink) and still cheap.
Regarding polarity, swapping polarity of a winding should not affect the torque of the motor, just the direction of rotation for a given step sequence, unless the motor was oddly optimized for one direction.
 

Cableguy

Expert
Licensed User
Longtime User
I find it curious that after 2 weeks of the fist post, the OP has not given any other info on his project, nor, given all the info already given, came up with new questions...
 

Didier99

Member
Licensed User
I find it curious that after 2 weeks of the fist post, the OP has not given any other info on his project, nor, given all the info already given, came up with new questions...
Yeah, it looks like this project is not going anywhere :)
Anyhow, I have played with stepper motors a bit and I just wanted to give my $0.02 about the drivers, they are a real help.
 

emexes

Expert
Licensed User
Longtime User
OP has not given any other info on his project, nor, given all the info already given, came up with new questions...

Probably did a cost-benefit analysis on the project. It looks great for self-education or hobby, but not for saving money.

Bit of a pity, though: driving stepper motors is an interesting topic.


On a related note: I bought an electric lawn mower a couple of weeks back, and when I cleared out the first grass jam and manually turned the mower blade, it had that very distinct steppy feel to it, so I suspect it operates similarly to a stepper motor.

Grok says more likely to be a brushless DC motor than a stepper motor, and a better term for "steppy feel" is "cogging":

 
Last edited:

rabbitBUSH

Well-Known Member
Licensed User
Longtime User
Dont really have a direct interest in this stuff but thought I would entertain myself for a few minutes and YouTube searched :

Andreas Spiess stepper motors
Q?=Andreas Spiess stepper motors

some other examples cropped up :
A One
A Two

left off others since this is just a kind of FYI posting. Spiess is a great YouTube channel ......
 
Top