Use Arduino to Control a Large Stepper Motor! Part 1
Вставка
- Опубліковано 14 жов 2024
- 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 UA-cam 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:
Arduino: amzn.to/1DCzygh
Nema 34 Stepper: amzn.to/1wZVrbf
Example of similar driver: amzn.to/1wZVwvv
Breadboard: amzn.to/1aThZRX
Arduino CNC Supplies:
Linear Bearings: ebay.to/1BugvYh
Steppers: ebay.to/1xNEJ02
Timing Belt: ebay.to/1xNxthz
Pulley: ebay.to/1s0VPFj
8mm Linear Rail: ebay.to/14rPWXB
One of my favorite Servos: amzn.to/1x6ObqQ
eBay Servo: ebay.to/1DPAdhI
DIY Cheap Arduino CNC Machine: • DIY Cheap Arduino CNC ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reach us / CNC Info:
Manufacturing Entrepreneurship Resources:
www.nyccnc.com
Better Speeds & Feeds? provencut.com
Online Fusion 360 Training: bit.ly/LearnFusion
Hands-On CNC Classes: www.nyccnc.com/...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: bit.ly/3sNA4uH
Came to watch stepper motor Arduino programing and I got machining... And stayed interested the whole time. I believe this will be the second time I've subscribed. Thanks for the video.
I like how you show all the process for doing your bush! Starting from machining, welding and programming. Very cool.
Great video. You really brought it all together in this one from arduino to welding. It is really informative to see you do real work like that, and fun to watch you put all that together like it is nothing.
Thank you! Used three st-m5045 stepper controllers with an Arduino relay shield (on an Uno) to control two 35 year old M092-FD08 (current version is LS08) SloSyn NEMA 34 steppers and one M061-FD08 NEMA 23 stepper thanks to your video.
I just wanted to say that this was an excellent video and it hit close to home for me. It has been years since I found myself working with a lathe and drill press and I thought I could almost smell the machining through the screen haha!!! I'm currently also working with NEMA 34 steppers on a Senior Design Project for my Mechanical Engineering curriculum. Thank you for your post, perhaps I'll reciprocate once I have some working footage of my group's design.
Yes of course. We are designing a prototype Automated Inventory Placement and Retrieval rig. I'll message you some details and link some rough sketches. Enjoy!
Hey John! Just want you to know, that I´m very thankfull that you´re spending your time making these videos. I´m learning a lot! Thanks!!! :)
I've used the MA860H controller with a nema 34 stepper to power the rotating dome on my astronomical observatory. I use two 12v lead acid batteries to power the controller / stepper and it draws about 4 amps when running under load. The accelstepper library for arduino makes the programming fairly straightforward and there are useful usable example programs on the accelstepper site - I use the library particularly because it provides the acceleration feature used in this video. The controller can be powered by ac or DC, if you use DC, two batteries in series gives the minimum voltage on which the controller is specifies to work. There is a better controller - the DM860I (perhaps) for DC operation which has a similar spec, but can use a minimum DC voltage of 20V which is better with two batteries in series. I have found the controller to be really reliable and easy to use.
I was quite surprised when you started doing the machining. tbh that was my favorite part of it! :D
I like that you have a bottle of Dykem next to your oscilloscope. You can make just about anything that you want with those two.
Another brilliant video! It was interesting watching how you machined up the parts too 👍
That was good! I enjoyed watching you machine the part, too.
Hi John - I think you made a good selection with the Nema 34. The next size down if I remember right is a Nema 23 with a 1/4" shaft. That would only be good for smaller projects I'm thinking. Great videos.
Hi John again,
It all depends on what you want to do with the cnc. I will build a small cnc and plan for a larger one later I hope. What's hindering at this time is the cost of lead screws and locating them. I'll probably use all-thread.
You run a machine shop! Cool! I use to work in one when I was younger. Man, I could talk all day about that.
Thanks for getting back with me so fast; really surprised me. You do very good work on the lathe. The video content is very good. Thanks for your efforts.
NEMA is just a standard for the face plate size, steppers an be.longer and come in different toque.options. larger sizes do have larger max toques available though obviously.
I thought you said you were going to hang some weights on that wheel to demonstrate the power.
Looks like an old Tormach 1100 stepper, it has the paint scheme. I have a set sitting around after my upgrade, thanks for the Video!
I was thinking of building a Plasma cutter, a bit overkill for the steppers, but that the point of recycling. Is that an ATC that you are building?
Yeah just let me dangle my arm over this huge spinning hunk of metal that looks like a saw blade lol
Great Vid man. Never Enough Space in the shop! Always the way!
24:07 "Intergalatic Planetary, Planetary Intergalactic" - Beasty Boys
I'm freaking jealous! I want to come play in your shop, and increase my fabricating knowledge, as well as really get the arduino hands on :)
Hi! Great great videos, really like ur channel!
I have a question regarded to this video: Can we use a CNC shield (with out integrated motor driver) (for grbl) on the Uno and combine that with the motor driver used in THIS video?
As I'm thinking of using grbl to drive large Motor like this Nema 34, coz I think the Gshield with integrated motor driver can't handle that much the current !?
In another video, you used a TinyG. Can you please tell me: have you notice any difference in performance between using: Uno+Gshield and TinyG; and why you chose TinyG for that project?
Thank you so much!!
Very good video. However, I do have a question when you ran the toothed gear at high speed. The gear wheel does not appear to be perfectly perpendicular to the NEMA drive shaft. If you watch the outer edge of the gear you notice an optical movement at high speed. If I am incorrect, then what is causing the optical wobble?
Thanks and I love your series of videos. You do great cinematography work with the camera placement also.
Thank for a really nice and clear presentiom. Beautifully explained and demonstrated.
An Industrial Servo Motor would be awesome. Stepper and hobby Servos are fun and easy but Servos are just awesome.
Wanted to thank you for this upload. Hoping to use some of the info. from your videos to make a DIY CNC myself.
When you said you were going to "test it out", and seeing the slots in the disk, I was hoping you would hang some weights off of it to visualize the torque. :)
I was hoping for an explanation on the arduino's shortcomings regarding stepper motors that you mentioned in the early portion of the video.
Fantastic tuto. I am an experienced C programmer but know nothing about Arduino and controlling large motors is one of the things I wanna do with Arduino. Question though: how many motors could one signle Arduino board control ? pbbly a dummy question... Thx again for the vid.
Thanks for the response. I was referring to the little black box. I don't have a stepper motor, but have run DC motors using a mosfet as a switch activated by arduino and connecting the high power supply. My concern really is whether I would need to buy more hardware than I already have to run a stepper motor.
Hello! very glad you have made this video it is exactly what i need, except one thing, i am quite confused as to where the wires: ground and power wires are going, could you detail the power source more please?
Thanks! We just modified a bit the code to my application and works perfectly. Thank you so much!
In your workshop you are living my dream!
For a part like this I'm aware that concentricity is not all that
important, however it's a bad practise to make parts to dimension prior to welding. The uneven heating of the hub during welding would have contorted the assembly. Ideally the centre hole would be drilled under size, then after welding be further drilled and reamed having been located by the out side sprocket teeth. Machined on either the mill table or a lathe face plate.
Excellent intro to this setup. Thanks.
Thanks so much for this. There is frustratingly little clear documentation on making all these components play together, and this is super helpful. One question: On the driver, how did you have your switches configured? IE switches 1,2,3 off to run at 4.5A, Switch 4 on for full current, etc. Trying to tune up my motor and can't get a clear sense of where I should set the driver. Thanks!
NYC CNC Hmm. Either I'm missing it, or perhaps it's in part 2 or another video? Either way I'll watch the other videos and hopefully figure it out. Thanks again for taking the time! Much appreciated.
a great job u did there . i wanted to know if the Stepper Motor Driver 2M542 or the one u used works with ardiuno uno ! i'm using nema 17 as stepper
I bought this exact setup hoping to use a Nema 23 motor (The adafruit shield wasn't powerful enough for my project). However, the microstepper only provides 400 pulses/rev. My motor is 200 steps/rev. Does this mean I have to use half current? Sorry for such a Newb question, I hooked it up exactly and it isn't quite working. Thanks for the great vid
Fun stuff. I always enjoy playing with these sorts of things as well. Was the plate/wheel an old encoder/chopper wheel?
holly cow,, you have every equipment,, too invent anything.. great job
I loved how you tapped that set screw hole. Genius!
Yeah, at first I was like, "he's going to drill threads? wtf?" Then you turned the chuck by hand and the light bulb went off over my head. I will definitely be using that technique :)
I followed your wiring and wasn't able to adjust the motor speed by changing the Pin 9 value (0 to 255). My motor kept running at constant slow speed. Did some research and then realized the Arduino PWM signal has a fixed frequency! A better way to run the motor at different speed (and to a designated position) is by sending a controlled digital pulse train to other non-PWM pin (e.g. Pin 7).
Thank you for your tutorials. If I need to power large current dc motors, what would you recommend? Thanks again.
Thank you @NYC CNC, the video is very helpful
Thanks for sharing! I have a question about the micro step driver. For a research project I am working on I am using a NEMA 17 0.9 degree stepper motor to mix molten material in a furnace. Now I need extremely slow and accurate steps, so to ensure that precision I was wondering if the ST-M5045 would be best or if a L298 would be best. Thanks!
i love all your toys ..... always amazed about lathes ....!!!!
Hey I really appreciate you posting this tutorial! I have a quick question though...How are you running two programs at once? Thats the part I'm lost at. Are you combining both the potentiometer program and the quickstop program in one script? Any help will be greatly appreciated!
NYC CNC Ahh I see, you upload the second one at the end
NYC CNC I have the exact microstepper for a NEMA 23. Do you mind sharing the switch settings on the driver? That would be awesome!
hey friend , have you ever used the art of interference fitting ? very cool stuff the jet engine builders chill axles with dry ice in a big box then slide heated rotor hubs over them to be placed , then because of the cooling zones the outer layer of the hub inner diameter and the skin of the axle becomes tempered
NOBOX7 Jet engines! Thats how they put tyres on steam engines in 1850 nothing new under the sun as they say.
I wonder what the real first example of using that technique is? I bet its a lot older than 1850? I gonna do some googlin ))
mart fart cannons my friend they slid hot brass rings on cannons back in the day way before trains, they then contracted and made the cannon stronger
Aha I was thinking firearms and canon. The boring machine that allowed a good canon ball fit paved the way for efficient steam engines and I guess it takes some fine measurements which may have been problematic any earlier, so its probably that era.NOBOX7
+NOBOX7 The guy is a machinist. Im sure he has heard of it.
John..great video. Question...instead of welding a hub sized to the exact diameter of the hole in the plate, would it have worked to turn the hub .001" larger than the hole and then press the hub into the hole without welding?
I wonder if this would be useable for powering and controlling a turning target system on a pistol/rifle range ? The motor should have enough power.
Lovely work Mr., I would like to ask you about TB6600 stepper driver, when I read the driver data sheet they wrote that s durable for 5 amps, but when I connect a big stepper consumes 2.5 amps -6 volt , and when I increase the current to reach 1 amp the driver cut the current , have you any idea about that?
Hi, how did you setup your dip switch for current settings. Did you match it to your stepper motor current rating per phase?
Hey I have this same question! Did you find an answer? I'm not sure whether you need to match the current per phase or double the current per phase (current per phase x 2 phases).
Hi I would send gcode from an Arduino to a Fanuc OM-B series. Could you help me?
2) I would monitoring this old machine (Sigma VC1000). Monitoring I mean know when start, stop, allarm, type allarm. Any idea? Thank you.
hello guyz...can you please give me the name of all the machines you are using to work on the video....That was a very intresting video Thanx.
What do you use for cutting oil when you drill and ream the round stock?
WOW, You turned the OD CLOSE to those JAWS! I LOVE PRECISION! LOL
Is the plate out of round or out of square, or is the waving an illusion?
Can you explain the out of round appearance when spinning? Thanks.
Tricknologyinc Yeah! I was waiting for the crunch ))
Hi, like your vid very informative. Just wanted to ask something, you mentioned about loosing some speed due to arduino's processing speed but i did not see it in the video. Can you show how steppers loose speed due to arduino.
Hi All ...Very good tuto ....just 2 questions ...Have i well understood did u connect de driver DIR- and PUL- to the pin 8 and 9 of the arduino ...Is there a reason to plug the negative Driver plug to do that ? ...Why connect the DC- to the arduino ground ....Maybe i have a bad comprehension ....Not english speaking Natural....i m French ///
Very well presented and described!
Hi, it was really helpful. I am building a CNC and i bought 3 Stepmotor Deiver 9-42 V.
And i want to buy a Power Suply for my 3 x Nema23 Steppers (425oz). voltage 4.8V and 3 Ampere.
Can i connect all 3 to one power suply? And which power suply should i buy? thank u very much.
Hi, thanks for making your videos! I'm looking for a stepper that could swing an alu baseball bat up enough to give a decent whack (at variable strengths) for a fun project happening (very) soon, ideally with a direct connection to the shaft. I'm keen to get stuck in but have no steppers for reference so when selecting my stepper I'm thinking go for the bigger options then I can always control the speed via the code. In your opinion would something like this be great to use or overkill? Thanks!
Fun video! It would be cool to see you build a gizmo from start to finish.
Hi John
For the acceleration-code. did u use the same wiring? So pin 8 is still direction pin and pin 9 is the 5 volt signal? and what is pin 1 for in the acceleration-code?
I couldn't find any hint in the c++ code via visual studio, so i would be very happy about your answer!
Didn't catch which Arduino board was used, also have you or can you provide a schematic for all connections made, thanks, Jeff.
+NYC CNC yes, you did show the wiring & explained it too !!
Thanks (from a newbee to Arduino)
why do you use a separate driver device?Could this motor not be run directly from the power supply with arduino control? I enjoy your machinist videos.
Hello sir,
Thank you for sharing this !
I just have one small question; is it possible to program the Arduino to control the Motor itself through a pre determinant route? Because i want to build something that will move by its own in a path that is already set.
I hope I am making sense and I am looking forward to your reply.
haha! Enjoyed your video. Quite obvious you love machining when the majority of your electronics how-to video is machining a part for the electronics project. hehe! Cheers!
i would have made the bushing first and then the hole in the plate so i it is easier to make it accurately by trying to stick the bushing everytime i mill the pocket a little bigger into the hole until it will go in :) i hope you understand
Hey lad. Why didn't you connect the enable pins? If you did connect it to the arduino, what kind of signal would you send to it and when? Cheers
Hi, I have bought this controller and have an 8 wire stepper motor. I have wired this down (I googled it) so I have 5 leads as a unipolar motor - the four leads and a 24 volt supply (common) lead. Does this supply go into the STM5045 or direct to the 24 volt supply? Thanks for the Tutorial.. its great.
NYC CNC thanks for the reply, but I have done some more research and I THINK this is the answer (because more and more motors are coming as 8 lead nowadays). If you do it in series-Bipolar, just wire each coil end together to make four leads (problem solved) or If its Parallel-Bipolar then link each coil up and have the two common leads separate and blanked off unused. If its Unipolar-parallel then connect the centre taps up as I said, but put them into the 24 volt supply with the other four leads to your controller, but this is not for a Bipolar dariver like the STM5045 its for direct off a control board or other unipolar driver. PC-Control boards are also unipolar and getting better.
Have you ever been able to use GRBL to control a similar type motor? I'm working on a project now using GRBL and 3 motors/drivers similar to what you have here. Thanks!
Looking forward to seeing the work
and a drive belt system to keep the heat off the stepper?
Should you always spec your stepper driver for the rated current per phase of your motor, then double that for the power supply since there are two phases? Am I correct on that?
I would like to build a 2 axis autopilot for my real experimental aircraft. I would be using 2 servo motors, at least 5Nm torque 12v servo motors.It would require a baro sensor for altitude hold and a gps for heading lock. What other components would I use
Would it be fun to use these to make your own cnc retrofit on a Bridgeport mill? What size motors and power supply would you need to use these on a Bridgeport?
Follow up on "needabeermoney": Yes, I would also like to know what settings the DIP switches are set to on the black box with the white chart controller. (ST- M5045)
Hello, Could you tell me whether you are able to power a 3000oz-in geared stepper motor with a battery pack power supply(Such as larger stacked battery packs), and how would you connect it? Would the battery last very long?
Also with that power supply you use, can you power 4 stepper motors with it, or what is the maximum number of stepper motors to one of those supplies:)
John NYCCNC cool, thankyou
You should reposition the control so your arm don't get cut. I see that you reaching over the blade to make the speed adjustment . Great video learn something different.
I thought the exact same thing.
good demo. Though a bit concerned about safety. You should probably put the controller near you rather than reaching over the blade.
Hi, Thanks for posting this video. I have a 23 nema unipolar (6 wire) 24v power supply, Arduino and the ST-M5045 microstepping driver. I followed the wiring directions in your video and couldn't get my motor to work. I'm not using a potentiometer. Your breadboard has other wiring connections that I could not follow. How would you wire everything up if you weren't using a potentiometer? Any help would be appreciated. Thank you!
I have the same problem. Did you ever solve yours?
Excellent Video!
can you do a video on how to know what setting you should use for the micro step function on this driver. I'm totally lost on it
Hey man, really good job!
I have a question about RPMs of stepper motors, how much rpms are max which u operate with?
I can get only like 240rpms with my Nema 23 425oz, If i go faster, the motor just stops and produces strange noises and vibrations. What to do?
All the thing is with no load on the motor shaft.
+Matic Rožič
It's stalling.
Usually this means you're trying to accelerate too quickly, or your power supply is pushing too much, or not enough juice.
Thanks for the great video!! Awesome!!
Have one question!
Can you show me how you connect the stepper motor and the driver?
I'm having a hard time finding out where each wire should be at.
Yo dude, great project. Looks like you really now your way around a machine shop. How about a wiring schematic? Looks like a hornets nest of wires in the video which makes it really hard to follow. I've seen other videos that use some kind of app with color coded wires. If I find out the name of that app. I'll repost. Thanks.
Hi,
Is it also possible to connect these up to a Ramps 1.4 3D printer board ? i have 2 x 2.8 amps nema 23 stepper motors in my construction
since the polulu driver ( mostly mounted to ramps) only goes up to max 2 amps i am searching for a better alternative.
can i assume this is going to work on ramps since its a arduino mega ?
thanks!
Hello,
The driver that you use is specialized for acceleration / deceleration? can I use 2H504 for this kind of acceleration?
Lol that stepper motor sounds like the Transformers at 24:05. :D
NCY Hi, I wanted to ask how much is the maximum RPM that you can achieve using the arduino and Nema 34 motor without load? Thank you
Hello. Please tell me if driver for stepper motor can be only that type. i have one similar , silver colour HY-DIV168N -3.5A. It will work ? Thanks
It was very informative
I didn't come to this video to see the metalwork but I walked away from this video a subscriber who wants to cut up some hardcore steel.
GO YOU Man, i love what you do!
Hey I used the same code with the Arduino uno, and I've got a NEMA 34, 12nm and the speed is super slow, what variables could I change to get it going faster?
int sensorPin = A3;
int sensorValue = 0;
void setup() {
pinMode(8, OUTPUT); // DIR
pinMode(9, OUTPUT); // SP
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
void loop() {
sensorValue = analogRead(sensorPin);
sensorValue = map(sensorValue,0,1023,3600,1);
digitalWrite(9, HIGH);
delayMicroseconds(sensorValue);
digitalWrite(9, LOW);
delayMicroseconds(sensorValue);
}
Joy Guys
Howdy,
In your situation here, would you be able to load grbl on the arduino and control the large stepper via chili Pepper or the universal g code sender? I have some large steppers that are too powerful for the Tiny g or other arduino grbl shields.
Thanks
what kind of switch do I need to control the motor from a distance? I want to rotate the motor both ways. Please give me a suggestion asap; I have a deadline to meet. Thank you.
I like your videos, very informative,. But sometime as with this one I was expecting Arduino info but find 90% content is on your mechanical skills.
Hi, thanks for insights. Can we control 4 stepper motors with arduino mega using motor drivers for UGV design?
If I get 3 of those stepper drivers (ST-M5045 driver) and an arduino mega, does that mean I do not need to get a breakout board for the stepper drivers?
Thanks
Hi, bro. We are doing a project. For stepper motor, can we control it to turn 10 round and stop at the exact position?
Hi !
man i hope you can help me... how do you know which arduino pins to use just by trying to read the code you showed on the "quickstop" program ? i have a stepper motor drive which has CLK+, CLK- , CW+,CW- inputs but i cant figure out which pins from the arduino uno to connect. as far as i know, the CLK+ and CLk- are the inputs necessary to make the stepper move, and the CW+ and CW- are the inputs in charge of the direction of its turning.
I'm curious why you don't use other types of microcontroller/computer like Raspberry Pi.
Do I need 1 power supply for every motor? I am building a 7 axis camera control, but I don't know how to power the motors.
Hi, Thanks for the great tutes I love this channel. But I have a question on this I would appreciate some help with. So I just tried this with a 16 v lipo instead of a power supply because that's what I had. I immediately melted the wires I had connected to it and disconnected them. This was before I had even uploaded the code and the Arduino wasn't on either. So my question is why can't I use a battery in place of the power supply? The driver asks for dc power after all.
i think you connect the power polarity wrongly from the battery to the stepper motor coils, and remember, using battery have disadvantage that the current will flow with the maximum value from the battery unless using a current control circuit, so that they use power supplies.
Quick question,
It this set up something you would consider using for say a larger servo? I am about as green as it gets at arduino, but I will eventually be using it for the use of servos.
NYC CNC
Cool, Thank you =D