You’re “not an Engineer and not a Machinist” you’re “self taught”. You, Sir John, are a bad a-! Very Nice! You just pushed me over the edge to start mucking with this stuff. Thanks!
For someone that may be completely new to motors and electricity, good video. For others that have experience in both, not so much, please don't try and explain something that isn't clear for yourself, like "put current on it". You apply voltage and it "pulls", or "draws" current. Another thing "I don't really like schematics, i don't read schematics", isn't a good way to teach people. BTW pin layouts are schematics if they are not in paragraph form like in your code. Schematics are EXTREMELY helpful. Become friends with schematics. You will be amazed how many people will watch this, copy exactly what you say without doing their own research, and repeat it. **I am subscribed and I do enjoy watching the NYC CNC vids, which are very interesting and very informative, but this one so far at 2:25 got to me. Thanks, Kyle
Very nice introduction. I like that you kept in concise and kept the speed in arbitrary units and no acceleration or even motor libraries in the first video.
Thanks so much for making these videos! I couldn't find this information anywhere else, but now I've built an arduino based CNC milling machine, I couldn't have done it without these videos. Thanks bro.
Awesome! Can’t wait for more stuff like this. Also a quick little tip. Instead of doing Distance = Distance + 1; you can use Distance ++; Also if you wanted to increment a number more than one for example three you can use Distance += 3; both tricks works with negative numbers as well just replace the + with -.
For beginners, it's good to tell them Distance=Distance+1; . Then they understand the underlying process of what they're doing, rather than teaching the shortcut right off the bat.
came here recently. I am basically doing similar, just controlling the steppers via a Raspberry Pi (rather than an Arduino), and a bit lower-level (my stepper drivers are made out of raw transistors, and controlling them involves a little more than a direction-pin and a movement pulse). using them basically to build a makeshift CNC machine (mill style, with an XY table and a tool head which moves in Z), which is mostly already built (but I have some doubts about its reliability/accuracy). construction is mostly made out of OSB with some steel pipe and 3D-printed plastic parts. the steppers generally move things by spinning all-thread, with nuts used for movement (except for Z, where the nut is in a gearbox and moves the all-thread). a pair of steppers is used for Z as a single stepper was having a hard time moving the 17lb tool-head assembly. it isn't all that big (about the size of a short washing machine), but last measured, the thing was around 150 lbs. have noted, with two steppers, the motors can also move the head-assembly with a cat sitting on top of it (not where he could get injured, also the XYZ movement is pretty slow). thing is generally running at 12 volts, with an ATX PSU as the power-supply. the code is fully custom written (including the G-code interpreter and similar).
A Digital Rotary encooder can be substituted for a Pot and will have a much faster conversion rate. These operate as using the same principle as linear scales used for a DRO (usually using quadrature encoding). The issue is with Pots is they can generate a lot of noise and have trouble providing linear output near the position ends which can trip up the arduino to change speed suddenly when you move it just a tiny amount in a dead spot. I believe its possible to monitor the stepper current pulses to detect skipped steps, although I never looked into this method. Another idea is to use a timer and interrupt to provide consistent loop delays. its possible to use a timer on the arduino that sends periodic interrupts that pulses the stepper pins.Instead of adjusting a count down loop for delay you adjust the timer (hardware) delay. The issue is that the more and more code you add to your loop the less and less responsive the stepper will become. You start to run into vibration issues because your control loop will not pulse the stepper smoothly. Thats when the timer/interrupt configuration comes in handy. It might also be worthwhile using a better performance controller, such as an arm or pic-32 since arduinos have limited memory and processing capacity. I believe there are now arduino pic-32/arm kits available. Another option is the rasberry pi which runs linux but does have user controllable I/O pins. I believe some routers/3d-printers use the raspberry pi with Linux-EMC.
goood explanation and showing problems with analogread in loop. I learn that also hard way, now I like to use memory to store only data if is not changed, this method speed up a lot
Love the video, soo confused though. I have a 12v nema 17 and used easy driver with 12v supply, 1amp, easy driver got really hot and kept breaking, gone through 3 now, even the motor got hot. Am I missing something really easy people??
John because of you I am getting more interested in motors. When I was young not so much. Well, on another note Sue and I bought a house and the garage is two stories and is large enough for 4 cars and it is heated with water. Next summer I will add on to it. I applied for the Veterans app with Solid works should have that approved tomorrow or the next day. I wonder if I can make some sort of freight elevator for the garage from the ground floor to the second floor for many reasons. We shall see thanks for the vid.... Good times good times....
Hey John, another nice Arduino demo. Curious to see what interesting problems in the shop you'll be solving with them ;). You should be able to use the timer hardware in the AVR on the Arduino board to generate a fixed period pulse train without needing any involvement from the main code path. Then you can poll your pot or do whatever else on the side and just update the timer period when you need to.
I'm loving this, I just bought an arduino uno board myself for a project im working on, this is going to be a sweet little series, looking forward to seeing the next episode on arduino :)
+Liberty4Ever I was lucky to get this wonderful=== FREE DOWNLOAD Arduino Tutorial and Programming plus.google.com/105456673395930650430/posts/PWgqWWct4AF? XOXO~fZ7
Thanks for the tutorial. My Arduino is "in the mail" and hopefully it will arrive faster than the proverbial check that is in the mail. I figured I was done with programming when I retired but I guess not. Thanks for the video.
I am a mechanical engineer and currently building a 3D printer. How many motors can you attach to the Arduino board? Also do you need a big easy drive for each motor? Thank u
Why not just use the integrated millis() or micros() Arduino functions? They're probably more precise if you use them the right way. You did great anyway, nice video!
Say you are running everything off 5V power. Can you run the power supply 5V directly to the pot instead of from the Arduino? (Also for limit switches for digital pins?) Advantages/Disadvantages?
I experimented with running the small Easydriver 4.4 with 5V and it was awful! It had about zero torque. Next, I'm going to try to power my Arduino (Adafruit Trinket Pro 5V) off the Easydriver on-board regulator and power the Easydriver with a 24V PSU similar to yours. I know the Easydriver regulator can't push out more than around 70mA, and hope that the Arduino can operate with less than that. Thank you for the reply and thank for all your awesome videos!
John, There's a ridiculous amount of overhead using digitalWrite/digitalRead in Arduino programming. The language is written to be easy to learn. Writing directly to the port registers bypasses the Arduino overhead. This should give you an increase in speed between 10x - 15x.
Hello, how do I go about plotting the output speed of the motor? For my project I need to plot force from a load cell vs velocity of the motor. Thank you.
Thanks for the video! I just wanna ask, is it possible to have the stepper motor run for a certain time, then stop? I'm working on a project which includes one motor rotating for a few seconds (maybe 15-20 seconds) and stops, then another motor rotates until a mechanical end stop/limit switch is clicked. I don't really care about the position of the first motor's shaft tbh
NYC CNC That is music to my ears! You're right about so many great machinists on YT with the likes of ABOM79, Oxtools and Kieth Fenner just to name a few. Projects playlists are brilliant and I bet most of your subs will feel the same way. I'm planning on doing the same once my DIY CNC Plasma table build is finished. I'll then shift focus to the cutting side of things.
Hooooly Poopie!!! A genius you are... Hmmm... lol Are you sure your name isn't Anikan Skywalker...??? lol I'm a programmer and could not, in my wildest dreams explain this shyet the way you do... Bravo! I also see that you are a total Hacker... That's a Good thing :-) What blows me away is, you're self-taught... Sheesh! You make me look like a newbie... I Love it :-)
It doesnt really matter and idk if it will work because ime new to arduino kinda but i have experience with coding but i think u can type Distance ++ instead of Distance = Distance +1 so it would save you a couple of words ++ means + 1 and -- means - 1 idk lol
+NYC CNC Thanks for that, was googling it all day there looking. Seems to be the perfect piece for what I'm looking to do. Thanks a lot for that. Very helpful tutorial too (y)
Last year I built a simple AHRS using an Arduino and the LSM9DS0 and was piping the feedback into an XNA 3D (game) environment. Lets combine the two, CNC and a heading reference, cut where you look... LMAO I don't foresee any problems with that... :-)
Great video, can you give me a link to some other stepper motors and stepper motor shield that will work for this video because the one that you have in the description will take to long to be delivered to my house.Thanks
I want to move 2 stepper motor. If pressed key then Ist motor start move 12 inch clockwise and stop 1st motor and start 2nd motor 4 inch clockwise and stop 2nd motor . And again 1st motor move 12inch anticlockwise. And finally I want goes to final position. Please help me..
does anyone know where is the next part of this video???? since ruclips.net/video/KbDPgxHpgAA/видео.html i can´t find any examples regarding this. thanks.
Thanks alot, or Even more than that! Need too design and fabrikate camera slider with deadline tonight, now that i can modify your code it will save me some time, design part should be Quick thanks too fusion 360, produce also quick thanks too you that made me build a cnc machine, and now the code thanks too you again. With all this time that i saved i can spend it on suporting you on Patreon. :-) keep it up, wish you the best.
What is that "star" in the code: int FullRotation = NumSteps MicroSteps; I get the error: 'NumSteps' was not declared in this scope 'NumSteps' was not declared in this scope New to all of this.. Someone knows why? :P
+NYC CNC The reason I asked is because I am following/building your widget at the same time. Kind of stuck cause everything else takes off with "how to build a CNC machine." It's not on the website either
I am just peeved he did not use INPUT_PULLUP and also the code is not always "grammatically good" for instance he did "distance = distance + 1" instead of distance++. Just curios if he has ever taken a coding class, or online course
hey NY CNC. Im currently doing a school project at the moment which ive been trying to code and was wondering if you could help me out. Im very very new to coding and as a result, i have been struggling trying to find code to allow my stepper motor to turn X amount of steps, then delay for an X amount of time, before repeating itself with the same process. If it helps im using an arduino motor controller shield and a stepper motor which has 200 steps. Everything runs of a 12V powersupply. www.freetronics.com.au/products/hbridge-dual-channel-h-bridge-motor-driver-shield#.VcH5rPmqpBc - This is the motor controller that im using. Please help me :)
I guess the target audience for this video are people who don't know the basics, but, have someone locally who setup the breadboard and selected all the components for them. Why wouldn't the person just ask the guy that setup the hardware? You've skipped an pretty significant step.
+beochie His code is not that different from the sample code that comes with Arduino under stepper with exception of push button, but you can just copy that part, he doesn't try to hide it.
Become friends as possible in order to teach me how to develop my myself in programming, I beg you from the country of Iraq has taught me that it will be sincerity to you when God
You’re “not an Engineer and not a Machinist” you’re “self taught”. You, Sir John, are a bad a-! Very Nice! You just pushed me over the edge to start mucking with this stuff. Thanks!
For someone that may be completely new to motors and electricity, good video. For others that have experience in both, not so much, please don't try and explain something that isn't clear for yourself, like "put current on it". You apply voltage and it "pulls", or "draws" current. Another thing "I don't really like schematics, i don't read schematics", isn't a good way to teach people. BTW pin layouts are schematics if they are not in paragraph form like in your code. Schematics are EXTREMELY helpful. Become friends with schematics. You will be amazed how many people will watch this, copy exactly what you say without doing their own research, and repeat it.
**I am subscribed and I do enjoy watching the NYC CNC vids, which are very interesting and very informative, but this one so far at 2:25 got to me.
Thanks,
Kyle
I love it how simple the explanation is.
Keep it up! The world of education needs more guys like you!
Very nice introduction. I like that you kept in concise and kept the speed in arbitrary units and no acceleration or even motor libraries in the first video.
Thanks so much for making these videos! I couldn't find this information anywhere else, but now I've built an arduino based CNC milling machine, I couldn't have done it without these videos. Thanks bro.
Awesome! Can’t wait for more stuff like this.
Also a quick little tip. Instead of doing Distance = Distance + 1; you can use Distance ++;
Also if you wanted to increment a number more than one for example three you can use Distance += 3; both tricks works with negative numbers as well just replace the + with -.
For beginners, it's good to tell them Distance=Distance+1; . Then they understand the underlying process of what they're doing, rather than teaching the shortcut right off the bat.
Cool stuff John! I enjoyed.
Adam
came here recently.
I am basically doing similar, just controlling the steppers via a Raspberry Pi (rather than an Arduino), and a bit lower-level (my stepper drivers are made out of raw transistors, and controlling them involves a little more than a direction-pin and a movement pulse).
using them basically to build a makeshift CNC machine (mill style, with an XY table and a tool head which moves in Z), which is mostly already built (but I have some doubts about its reliability/accuracy). construction is mostly made out of OSB with some steel pipe and 3D-printed plastic parts.
the steppers generally move things by spinning all-thread, with nuts used for movement (except for Z, where the nut is in a gearbox and moves the all-thread). a pair of steppers is used for Z as a single stepper was having a hard time moving the 17lb tool-head assembly. it isn't all that big (about the size of a short washing machine), but last measured, the thing was around 150 lbs.
have noted, with two steppers, the motors can also move the head-assembly with a cat sitting on top of it (not where he could get injured, also the XYZ movement is pretty slow).
thing is generally running at 12 volts, with an ATX PSU as the power-supply.
the code is fully custom written (including the G-code interpreter and similar).
A Digital Rotary encooder can be substituted for a Pot and will have a much faster conversion rate. These operate as using the same principle as linear scales used for a DRO (usually using quadrature encoding). The issue is with Pots is they can generate a lot of noise and have trouble providing linear output near the position ends which can trip up the arduino to change speed suddenly when you move it just a tiny amount in a dead spot.
I believe its possible to monitor the stepper current pulses to detect skipped steps, although I never looked into this method.
Another idea is to use a timer and interrupt to provide consistent loop delays. its possible to use a timer on the arduino that sends periodic interrupts that pulses the stepper pins.Instead of adjusting a count down loop for delay you adjust the timer (hardware) delay. The issue is that the more and more code you add to your loop the less and less responsive the stepper will become. You start to run into vibration issues because your control loop will not pulse the stepper smoothly. Thats when the timer/interrupt configuration comes in handy.
It might also be worthwhile using a better performance controller, such as an arm or pic-32 since arduinos have limited memory and processing capacity. I believe there are now arduino pic-32/arm kits available. Another option is the rasberry pi which runs linux but does have user controllable I/O pins. I believe some routers/3d-printers use the raspberry pi with Linux-EMC.
goood explanation and showing problems with analogread in loop. I learn that also hard way, now I like to use memory to store only data if is not changed, this method speed up a lot
Hey john, another great video.... The audio seemed to have some static with it, just a heads up.
These Arduino videos are cool. It is nice to see something moving in response to coding. Interested in seeing more of the Arduino CNC stuff.
Love the video, soo confused though. I have a 12v nema 17 and used easy driver with 12v supply, 1amp, easy driver got really hot and kept breaking, gone through 3 now, even the motor got hot. Am I missing something really easy people??
John because of you I am getting more interested in motors. When I was young not so much. Well, on another note Sue and I bought a house and the garage is two stories and is large enough for 4 cars and it is heated with water. Next summer I will add on to it. I applied for the Veterans app with Solid works should have that approved tomorrow or the next day. I wonder if I can make some sort of freight elevator for the garage from the ground floor to the second floor for many reasons. We shall see thanks for the vid.... Good times good times....
Hey John, another nice Arduino demo. Curious to see what interesting problems in the shop you'll be solving with them ;). You should be able to use the timer hardware in the AVR on the Arduino board to generate a fixed period pulse train without needing any involvement from the main code path. Then you can poll your pot or do whatever else on the side and just update the timer period when you need to.
best video on steppers I have seen
yep same
NYC CNC, Great Videos as usual!
can you describe where you taking the ground from?, i mean where is the origin of the DC ground of the arduino ?
I'm loving this, I just bought an arduino uno board myself for a project im working on, this is going to be a sweet little series, looking forward to seeing the next episode on arduino :)
Excellent presentation. Style, tone, content is very pleasant to watch and learn. Thank you.
NYCCNC is doing Arduino videos. Arduino Versus Evil is doing machining videos. Cats living with dogs. It's the apocalypse.
+Liberty4Ever I was lucky to get this wonderful=== FREE DOWNLOAD Arduino Tutorial and Programming plus.google.com/105456673395930650430/posts/PWgqWWct4AF? XOXO~fZ7
Great video. I work with Arduinos and steppers a lot. I will look up your other videos.
Thanks for the tutorial. My Arduino is "in the mail" and hopefully it will arrive faster than the proverbial check that is in the mail. I figured I was done with programming when I retired but I guess not. Thanks for the video.
Are you going to add a lcd and numpad to make a automated fence for say a cutoff saw or maybe a lathe feeder?
Nice video, cool combine CNC and stepper control with Arduino
I am wondering, how do you match the position of a stepper to the position of a potentiometer knob or another form of analog input?
I am a mechanical engineer and currently building a 3D printer. How many motors can you attach to the Arduino board? Also do you need a big easy drive for each motor?
Thank u
I'm thinking about building a flatbed printer using an Epson 1400. How difficult is it to connect a flatbed arduino assem. to an Epson printer?
Why not just use the integrated millis() or micros() Arduino functions? They're probably more precise if you use them the right way. You did great anyway, nice video!
Say you are running everything off 5V power. Can you run the power supply 5V directly to the pot instead of from the Arduino? (Also for limit switches for digital pins?) Advantages/Disadvantages?
I experimented with running the small Easydriver 4.4 with 5V and it was awful! It had about zero torque. Next, I'm going to try to power my Arduino (Adafruit Trinket Pro 5V) off the Easydriver on-board regulator and power the Easydriver with a 24V PSU similar to yours. I know the Easydriver regulator can't push out more than around 70mA, and hope that the Arduino can operate with less than that. Thank you for the reply and thank for all your awesome videos!
I did learn something, well explained a d made easy to understand. thank you
How do you convert your arbitrary speed to the actual RPM of the shaft? Or does it change according to the load?
John,
There's a ridiculous amount of overhead using digitalWrite/digitalRead in Arduino programming. The language is written to be easy to learn. Writing directly to the port registers bypasses the Arduino overhead. This should give you an increase in speed between 10x - 15x.
Hello, how do I go about plotting the output speed of the motor? For my project I need to plot force from a load cell vs velocity of the motor. Thank you.
Great video. Very interesting. I'm looking forward to the forthcoming episodes. Keep them coming. Thank you
How do you make the stepper motor run continuously in one direction?
Thanks for the video! I just wanna ask, is it possible to have the stepper motor run for a certain time, then stop? I'm working on a project which includes one motor rotating for a few seconds (maybe 15-20 seconds) and stops, then another motor rotates until a mechanical end stop/limit switch is clicked. I don't really care about the position of the first motor's shaft tbh
Quality video again John, excellent stuff. With the Arduino series are you looking at getting back into GRBL?
NYC CNC That is music to my ears! You're right about so many great machinists on YT with the likes of ABOM79, Oxtools and Kieth Fenner just to name a few. Projects playlists are brilliant and I bet most of your subs will feel the same way.
I'm planning on doing the same once my DIY CNC Plasma table build is finished. I'll then shift focus to the cutting side of things.
How can we increase the torque by keeping speed constant on stepper??
why did you create a delay variable when you could have easily just declared a delay function?
Hooooly Poopie!!! A genius you are... Hmmm... lol Are you sure your name isn't Anikan Skywalker...??? lol
I'm a programmer and could not, in my wildest dreams explain this shyet the way you do... Bravo! I also see that you are a total Hacker... That's a Good thing :-) What blows me away is, you're self-taught... Sheesh! You make me look like a newbie... I Love it :-)
does anyone know what button and potentiometer he used ??????
Are there code examples available?
Awesome !! I thoroughly enjoyed it., Now I am going to try this out myself. Looking forward to lots of learning.
hello sir i am working on a project and i want to know is their any way out to control 6 stepper motor with one arduino uno using some special drive
hi
rotary table on bearing shaft
what size of stepper motor i need
for stepper index
thanks
It doesnt really matter and idk if it will work because ime new to arduino kinda but i have experience with coding but i think u can type Distance ++ instead of Distance = Distance +1 so it would save you a couple of words ++ means + 1 and -- means - 1 idk lol
Great info
Hello sir can we increase frw/rew
Excellent video and very good explanation.
Hi NYC CNC.
I am new to Arduino and am wondering what the abbreviation "B.E.D" means?
Thanks.
+NYC CNC Thanks for that, was googling it all day there looking. Seems to be the perfect piece for what I'm looking to do. Thanks a lot for that. Very helpful tutorial too (y)
Nice one John.. Keep them coming.. (ps.. to ad on the slug btw.. )
Hey can u help me with adding a LCD display for Arduino CNC
can i use it for my wheelchair?
Last year I built a simple AHRS using an Arduino and the LSM9DS0 and was piping the feedback into an XNA 3D (game) environment.
Lets combine the two, CNC and a heading reference, cut where you look... LMAO
I don't foresee any problems with that... :-)
cool, looking forward for the encoder one
Great video, can you give me a link to some other stepper motors and stepper motor shield that will work for this video because the one that you have in the description will take to long to be delivered to my house.Thanks
ruclips.net/video/EV4LAljXZLk/видео.html is great little shield with its own library
Thanks for putting this up !
I want to move 2 stepper motor. If pressed key then Ist motor start move 12 inch clockwise and stop 1st motor and start 2nd motor 4 inch clockwise and stop 2nd motor . And again 1st motor move 12inch anticlockwise.
And finally I want goes to final position. Please help me..
My email id .. sah.indrachand@gmail.com
sounds awesome!
int means interval now does it?
Very useful video, Thanks for uploading.
Thank you for making these type of videos!
Thank you very much! This was very usefull!
Could I use Arduino Zero?
3:06 what language is used ? C++ ?
does anyone know where is the next part of this video???? since ruclips.net/video/KbDPgxHpgAA/видео.html i can´t find any examples regarding this. thanks.
Thanks alot, or Even more than that! Need too design and fabrikate camera slider with deadline tonight, now that i can modify your code it will save me some time, design part should be Quick thanks too fusion 360, produce also quick thanks too you that made me build a cnc machine, and now the code thanks too you again. With all this time that i saved i can spend it on suporting you on Patreon. :-) keep it up, wish you the best.
John, I could kiss you, you just saved my dissertation! Thanks!
Great video
Where's part 2?
thanks for your teach
What is that "star" in the code: int FullRotation = NumSteps MicroSteps;
I get the error: 'NumSteps' was not declared in this scope
'NumSteps' was not declared in this scope
New to all of this.. Someone knows why? :P
+Notion8 Multiplication. Look at Reference on arduino.cc for more
Nice video, but where is the rest of the series. where is the video after this and so on?
Did you check somthing like "how H-bridge works" and L293D ? I think it will be a good start :)
NYC CNC did you ever figure out the encoder?
can you share me a schematic and arduino code? thanks.
very cool thank you
Where's the next vid about the encoder?
+NYC CNC The reason I asked is because I am following/building your widget at the same time. Kind of stuck cause everything else takes off with "how to build a CNC machine." It's not on the website either
I am just peeved he did not use INPUT_PULLUP and also the code is not always "grammatically good" for instance he did "distance = distance + 1" instead of distance++. Just curios if he has ever taken a coding class, or online course
"Integer" distance, not interval :)
You don't need a paper to say you are an Engineer. I say you are an Engineer !!!!
Much smarter than most I have met in my career.
Awesome
arduino is open source is charging for the code going against the intended free use of
NYC CNC dis not mean to be negative just wondered if you could put the code in the description or web site love your videos and always thumbs up
unable to download the code. Can you help
www.patreon.com/nyccnc
+NYC CNC Thanks for any help you can provide
noise annoying on video unable to watch
I also usually have a Diet Coke can on my desk!
hey NY CNC.
Im currently doing a school project at the moment which ive been trying to code and was wondering if you could help me out. Im very very new to coding and as a result, i have been struggling trying to find code to allow my stepper motor to turn X amount of steps, then delay for an X amount of time, before repeating itself with the same process. If it helps im using an arduino motor controller shield and a stepper motor which has 200 steps. Everything runs of a 12V powersupply. www.freetronics.com.au/products/hbridge-dual-channel-h-bridge-motor-driver-shield#.VcH5rPmqpBc - This is the motor controller that im using.
Please help me :)
thankyou :) ill give it a try in the morning :) (I live in Australia hahaha)
I guess the target audience for this video are people who don't know the basics, but, have someone locally who setup the breadboard and selected all the components for them.
Why wouldn't the person just ask the guy that setup the hardware? You've skipped an pretty significant step.
Arduino is all about open source, putting you code up on a pay site is shady
+beochie His code is not that different from the sample code that comes with Arduino under stepper with exception of push button, but you can just copy that part, he doesn't try to hide it.
Become friends as possible in order to teach me how to develop my myself in programming, I beg you from the country of Iraq has taught me that it will be sincerity to you when God
mamtap