Video Tutorial on how to control large, Nema 34 Stepper motors with an Arduino, a 24V power supply and an ST-M5045 microstepping driver.
I'm no expert on this subject matter and am anticipating (hoping!) others may have comments with even better hardware or software tips and tricks - but in the meantime there doesn't seem to be much content on YouTube on driving large Steppers with Arduino's, and I've had quite a few email inquiries about it, so here it is!
In this video, we machine a 0.75" hole in a ~7LB, 15" 1/4 inch steel plate, then turn a bushing which will let us secured the plate to the stepper D-shaft.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Links for this video:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I discovered machining as an adult and am grateful to have found something I love and am able to share with others. We hope NYC CNC not only makes you a better machinist but helps you understand and learn more about how to succeed as a manufacturing entrepreneur! 5 Reasons to Use a Fixture Plate on Your CNC Machine: https://bit.ly/3sNA4uH
AI Generated·May contain errors
Video Summary
AI Generated
This video demonstrates how to drive a powerful NEMA 34 stepper motor using an Arduino and a microstep driver. The presenter covers the necessary hardware components, wiring configurations, and provides two different coding approaches to control motor speed and movement, while showcasing the motor's torque by attaching a heavy steel plate.
Hi folks, welcome to another episode of NYCCNC.
I've had a lot of questions from folks on driving large stepper motors with Arduinos,
so I wanted to do a quick video on it.
What we've got here is a 24 volt power supply, a micro step driver off eBay,
a NEMA 34 stepper motor, and an Arduino.
I'll go over the details later.
What I'm going to show you is two different ways in Arduino
we can control this stepper.
As a quick precursor to this video, I am not the expert on all this subject matter.
I can tell you some basics, like for instance,
Arduinos aren't actually the best processor to maximize some of this equipment due to the,
I believe, their processor speed.
For instance, when you add in a serial command or other Arduino commands,
you lose some speed control of the stepper.
I'll mention that later.
The bottom line, this is a pretty cheap, pretty quick way
to do some pretty cool things with some pretty powerful motors.
Let's talk hardware.
This is a 24 volt power supply.
Steppers need higher voltages.
24 volts will be fine for this application.
You'll see a lot of CNC systems even run double or triple that voltage.
This one happens to be 10 amps, the one I had laying around.
If you've got a benchtop power supply or another source for 24 volts,
just make sure it's got the amperage and you're good to go.
This is a Microstep M5045 stepper driver.
There are many of these that are similar in their signal settings,
so I would think most will be applicable.
You can read the data sheet for various current ratings and microstepping toggles.
This is a used NEMA 34 stepper motor.
This one happens to be rated at five and a half amps.
It's a little bit on the higher side.
It is 640 ounce inches.
I usually think in inch pounds, not ounce inches.
To convert ounce inches into pound inches, you just divide by 16.
So this can do...
This motor is rated at 40 inch pounds,
which means it can hold a 40 pound weight one inch out from the shaft,
or it can hold a one pound weight 40 inches out from the shaft.
So that's a pretty good amount of power.
And finally, we've got a regular Arduino.
This happens to be quite an old one, so that'll work just fine.
Let's go over the pin wiring or the layout.
I'm going to run down the left side here of the controller.
First one is pull positive.
That connects via this green jumper wire to a rail on my breadboard
that has positive five volts coming from the Arduino.
Second is pull minus.
That is connected via this black jumper wire,
and that comes over to pin nine on the Arduino.
Third is DIR direction plus.
Again, five volts via this green jumper.
Direction minus is this red jumper wire, which goes to pin eight on the Arduino.
I am not using the enable positive or the enable negative pins.
Moving down, DC ground is this blue connection here,
which is connected over to the ground on my breadboard.
The breadboard is also grounded via this green jumper wire in the top of your screen
over to the ground on the power supply.
And then the DC positive right here is the 24 volt signal,
positive signal from the power supply.
The final four connections on the stepper controller
are your two pairs for your NEMA34 stepper motor.
It seems like the common thing to do is folks use little tape flags
to show direction, speed, and control.
It does a good job.
What it doesn't do, which I think is really cool,
is show off the power of these motors.
So for you guys that follow my videos,
I primarily really run a machine shop,
and I do more of the electronic stuff as a side to that.
We've got a big quarter inch steel plate here that I had for another project.
Let's hop over to the machine shop.
We're going to drill out this hole and weld a coupling on it
so that we can fasten it to our stepper motor.
This weighs about seven pounds as is,
and we're going to add some weights to it and really show off the power of this guy.
If you're not interested in the machining part, no worries.
Jump forward to the time below you see at the bottom of this screen
to where we go over the stepper code and show the final results of this project.
We're over on the Tormach PCNC mill now.
We've got our plate bolted down to our fixture table.
We've got a set of parallels underneath where the clamps are located
that'll hold it off the fixture table
so we can mill all the way through the hole without worrying about bottoming out.
We're going to use a four flute quarter inch carbide end mill.
We're going to come down and we're going to take a few width and depth passes
to machine that out to a three quarter inch hole,
and then we'll hop over to the lathe
and turn ourselves a little bushing that we can weld in there.
And now it'll come in and take one full depth pass for a skim cut.
Three thou off the side.
Perfect.
Undo our clamps, take a look.
Looks good.
Let's just take a deburring tool and break those edges.
Okay, let's hop over to the lathe, turn our bushing.
We've got a one inch piece of steel chucked up in the lathe.
We're going to face off the front here first and then drill.
Our drilling operation is going to be a center drill
and a 27 64ths, which is slightly under half inch, and then we'll ream to half.
Slow it down just a hair for this.
Okay, that's drilled far enough so that we can get our reamer one inch deep,
which is what we want for the through hole.
We've got our 499 chucking reamer in here.
We'll turn it down even slower to a few hundred RPMs.
Okay, now let's break that edge.
While we're over here, let's break the outside edge.
We'll just turn the lathe in reverse.
It'll come and kiss like so.
Now what we're going to do, we're going to turn the outside
just to get a true OD on the part.
And then we're going to turn down our three quarter inch
bushing to weld into our plate.
Let's see where our OD is now.
And you can see we didn't actually even turn off that
complete diameter here, but that's okay.
So we're at about seven under, so 993 or so.
And we want to turn this down to about 750.
So it's 121 on the dial.
Take that in a few passes here.
We'll go 50 to start.
Another 50.
Okay, let's see where that puts us.
We're at 780.
So we're going to take 15 more per side.
And that should put us right on.
Perfect.
Let's clean up that OD a little more.
And then we're actually going to turn this down.
We only want a quarter inch sticking out.
And we've got, you know, about a 16th more.
Break some of those edges real quick.
Okay, let's part it off.
We'll be done in the lathe.
Let's test the fit.
Perfect.
Just a nice friction fit.
You can twist it, but there's no real play in that hole.
Looks good.
Like so.
Let's drill a set screw now.
And let's tap it.
Grab some cutting fluid real quick.
Perfect.
Let's go weld this together.
Threw a half inch bolt through there and tightened it down.
That'll do just fine to hold our bushing in place when we weld it.
Shouldn't move much on us at all.
I've got this set up on my plasma table.
I don't have a good welding place right now.
I've got to figure that out.
I just got the service grinder in, so I am running out of room.
This would be a great project too if you've got a rotating welding table.
It'll actually, you know, turn table the part for you
while you sit there in one position.
So I'll have to move it around a few times.
Won't end up being the prettiest weld, but it'll do just fine.
Okay, we'll let that cool for a minute.
I didn't weld right in front of the threaded hole
just to make sure none of the weld splatter got in there.
And we could always chase it out, but there's no need to.
We'll be back in a minute.
While the weld is cooling, let's take a look at the Arduino code.
This is very straightforward.
I'm not going to post this online.
You can retype it very quickly.
The first program uses a potentiometer to control the speed.
We've got that potentiometer on analog pin 3.
And we set sensor value equal to pin 0.
Pin mode 8 and 9 is outputs.
These are the direction and step pins for the stepper.
We write them low to begin with.
And the program is quite simple.
We read the potentiometer value.
Then we map it.
That potentiometer is a standard analog input.
In Arduino, that's 0 to 1023.
We're going to map that to a range of 3600 to 1.
And what that is, is that controls our delay.
And we do this opposite because we want it to go faster.
And by going faster, we reduce the delay.
So we write pin 9 high.
That's the step pin.
We delay for the value of the potentiometer.
And then we toggle it back down to low.
That's how stepper motors work here.
They alternate high-low in that pulsing.
The other program is simply the SEL stepper sketch.
You can download this library.
I did nothing to this code.
I think it even has the same pins to begin with.
And this does the ramp in and ramp out the speed.
And we'll show you here in a minute.
I threw the stepper motor in a vise just to hold it down.
Let's see how our plate fits.
Perfect.
No play at all.
Throw our set screw in.
Okay.
Let's take a look.
So the first program I've got is the potentiometer one.
And you can see in the background, I've got a little 10k potentiometer.
As I rotate it, it'll change the speed of the platter.
Let's plug in the USB.
Power up the Arduino.
Okay.
I think that's the slowest setting I've got it on.
And we'll speed it up gradually.
Just like so.
And then let's upload the other program, which is the smooth stepper.
Or sorry, the cell stepper, which will just do a nice ramped acceleration and deceleration.
And I think it changes the speed, the direction as well.
Here we go.
Yeah, there we go.
Backward and forward.
Just like so.
That's it for today, folks.
If any of you have suggestions or comments, please post them below.
If you're interested in seeing more of this and you don't subscribe, please do subscribe.
Otherwise, take care.
Thanks.