HOW TO: Arduino control of DC, Stepper, and servo motors

  Рет қаралды 107,702

DonovanStudio

DonovanStudio

Күн бұрын

Пікірлер: 82
@edwardmoseley2891
@edwardmoseley2891 8 жыл бұрын
Very, very well done. You answered my "what would happen if" questions throughout! Thanks for your time-- excellent video!
@Akosyeah
@Akosyeah 7 жыл бұрын
Thank you thank you thank you, man some people can not teach a thing. But you on the other hand you have talent .
@johncgibson4720
@johncgibson4720 7 жыл бұрын
My problems with the transistors is that the step signals to motor generates hi frequency em noise, maybe giga hertz, that travels through the power line back to the controller board into the gyro. Lump capacitors, including tantalum packs, have cut off frequency below giga hertz, and their reactions to giga hertz noise is not defined in their spec. The helicopter crashes when the gyro is thrown out of operation by those noise. Maybe that is why the commercial grade Electronic Speed Controllers sell. But I don't know what big secrets they have other than having the capacitors as surface mounts and smoothing out the step signals at the source.
@TheMadManPlace
@TheMadManPlace 8 жыл бұрын
All of a sudden the lights are turning on in my head - this is a VERY nice tutorial - thanks.
@Ziplock9000
@Ziplock9000 8 жыл бұрын
Brilliant video. Very comprehensive.
@stevethomason3133
@stevethomason3133 7 жыл бұрын
best video I've seen about motors and arduino but for my project the motor I want to use. Uses 7amps with out a load and up to 40 amps with a load but you where using the L298N with a pretty big motor for me the voltage is right but the amps are not would you happen to know what bridge driver I would use
@AMITBUBU
@AMITBUBU 8 жыл бұрын
Hello dear sir , thank you for your great tutorial! I want to ask about a switching mosfet. I have had a situation that I've needed to connect a resistor between logic to ground (2 pins of the transistor) because it didn't switched off when the logic were low ,I heard it involved with some "electrostatic dissipation" ?.. any way could you explain about that a little and most import tell when it happens and when not because it didnet happend with all my circuits ? thank you in advance
@christiansamir1273
@christiansamir1273 3 жыл бұрын
You prolly dont give a shit but does any of you know a way to get back into an Instagram account?? I stupidly lost the password. I would appreciate any assistance you can offer me
@jonterrence3114
@jonterrence3114 3 жыл бұрын
@Christian Samir instablaster =)
@christiansamir1273
@christiansamir1273 3 жыл бұрын
@Jon Terrence thanks for your reply. I got to the site through google and I'm waiting for the hacking stuff now. I see it takes quite some time so I will reply here later when my account password hopefully is recovered.
@christiansamir1273
@christiansamir1273 3 жыл бұрын
@Jon Terrence it worked and I now got access to my account again. I am so happy:D Thank you so much you saved my account :D
@jonterrence3114
@jonterrence3114 3 жыл бұрын
@Christian Samir Glad I could help xD
@imysteryman
@imysteryman 7 жыл бұрын
I am interested in that last motor control you showed, can that be run off an arduino to run a large dc motor?
@Mehdidib
@Mehdidib 8 жыл бұрын
Great video !! can i control a synchronous AC motor (48v) with this shield ?
@pablomoreno1206
@pablomoreno1206 8 жыл бұрын
I pulled apart a couple old printers for stepper motors i found at goodwill and they all used dc motors except for one... What's great is its the same one you are using in your video although i can find a spec sheet for it because my has particular labeling. Do you happen to know the proper voltage and power rating for it? Thanks!
@jorgewashington2981
@jorgewashington2981 8 жыл бұрын
Another awesome vid especially for rookies like me. Thanks for sharing your valuable time with us. Question..can I have a Nano and the Uno R3 installed on one computer without any conflicts?
@DonovanStudioMain
@DonovanStudioMain 8 жыл бұрын
+Jorge Washington Thanks! Not a problem. They will simply show up as different oddly named ports. If you are especially unlucky on windows they will even periodically swap ports. The simple "cure" for this is to just make sure that when you are sending code to the device to watch the TX/RX lights to make sure that it is going to the correct one. There are ways to nail them down so they don't dance around if it becomes a problem.
@jorgewashington2981
@jorgewashington2981 8 жыл бұрын
+LessonStudio Got it. Thanks.
@julioluna2014
@julioluna2014 7 жыл бұрын
What would happen if I replace a stepper with a servo while using the stepper library ? would it work?
@jorgewashington2981
@jorgewashington2981 8 жыл бұрын
Hi. When you were using a Mosfet with the very first motor (DC) I didn' t see any diode protection against Inductive Spiking or Back EMF. How did you not damage your Fet or the Nano? Is it because you carefully looked at the Fet's datasheet and operating range? I hope you dont think its a stupid question. Just a newbie trying to learn? Thanks in advance.
@DonovanStudioMain
@DonovanStudioMain 8 жыл бұрын
+Jorge Washington Good catch. I think that I mentioned it that I had dumbed down that circuit quite a bit and left out the protective bits to keep it simple. You are correct that you minimally need a diode as motors just don't play well with many solid state bits. As to how it survived is a combination of luck, only doing that for the short video, and that my experience is that electronics are perfectly robust until you must depend upon them. That is when your motor will fry something. As for a careful examination of the specsheet, no that MOSFET was massive overkill as I was out of my favourite logic level MOSFETS (FQP30N06L) so it wasn't even a good choice. I really thought about that issue if someone replicates my design and then suffers the nearly inevitable consequences. Then I thought that by keeping it simple and most people are probably using small motors, the video would be more valuable by showing it at its most elemental. The counter argument is a very easy, "Would one more diode have put that many people off?" I shakily stand by my decision as in any time I work on something electronic or when I am programming something new in software, I love to break things down to their most basic; even more basic than would be sensible in a normal deployment. Then I build upon the basic until I have something robust and functional. I also have another video where I recommend just using motor control modules. They really take care of all the hard bits such as not frying things.
@jorgewashington2981
@jorgewashington2981 8 жыл бұрын
+LessonStudio Thanks for the info. You are absolutely right imo of keeping it very simple especially for folks like me. I have a year of formal Electronics School (a long long time ago) but never worked in the field. Im just getting back to it as a hobby only since im pushing 60 y.o. lol and im using the Arduino for fun and motivation. BTW I was really impressed by the way that mosfet handled that drill motor and didn't even get hot. Once again I want to thank you for this fairly comprehensive tutorial/exposure on dc motors and for sharing your valuable time with me.
@DonovanStudioMain
@DonovanStudioMain 8 жыл бұрын
+Jorge Washington With things like MOSFETs my simple way of doing things is to over do the MOSFET as they are very cheap. Where I find they get hot with fairly reasonable loads is when you switch them on and off very quickly. I usually only pull the math out when I know that I am approaching the limits. Using my IR thermometer, I check against my own rule of thumb which is to never let a MOSFET go over 100 degrees C. If it does, then I get more heat sinking, more airflow, rethink my circuit, or a bigger MOSFET. Yet MOSFETS can handle much more than that. Once in a blue moon I have to let it tough it out and climb closer to its theoretical limits. Your long ago Electronics School would probably have been much more analog; that is a cool area that I have largely neglected. In fact with things like super cheap micro controllers I even tend to ignore great swaths of older style digital technology such as flip flops and whatnot. It is just so much easier for me to code great gobs of what otherwise would have to be circuitry.
@jorgewashington2981
@jorgewashington2981 8 жыл бұрын
+LessonStudio Good rule of thumbs that Im going to borrow from you. Yes it was mostly Analog with a brief course in Digital Electronics that covered the Flip Flops that you mention and things like Karnaugh Mapping etc etc. Outstanding course but its been so so long ago that I have forgotten most of it. So basically Im starting from scratch but it doesn't matter because Im having fun . Something to do after my retirement. Thanks to persons like you and KZbin its all coming back to me.
@videoart1496
@videoart1496 7 жыл бұрын
excellent tutorial for beginners!!! thank you.
@petersjlie3567
@petersjlie3567 8 жыл бұрын
Hi. Nice video! What is the last controller called? The one who can take 50 amps or so.
@DonovanStudioMain
@DonovanStudioMain 8 жыл бұрын
It doesn't really have a name; it is just a generic mosfet based pwm motor controller. There are many like it.
@boowonder888
@boowonder888 8 жыл бұрын
hi, I'm new to the Arduino. do you use the analog or digital pins for the servo? strange that I cant get something so simple to work right away!
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
boowonder888 that would depend on your servo obvious really
@Ziplock9000
@Ziplock9000 8 жыл бұрын
Am I right in thinking that a MOSFET is all ON or all OFF unlike a power transistor that can vary it's output?
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
John Michael Stock transistor and midget are both the same thing except that a midget is use for higher power applications while a transistor is used for smaller ones
@Ziplock9000
@Ziplock9000 7 жыл бұрын
Midget? WTF? LOLOL.. That hilarious auto correct issue aside, I thought MOSFETS were more binary in output? I've also got "Power Transistors" that go up to 400v and 35A same as MOSFETS?
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
Lol my bad lol yes my phone screen is cracked so I did not want to cut myself swiping lol You are just looking at it as input output but when you use these passive components in a circuit really you change the game, you see you can use midget mainly because you are dealing with highly power systems where the Amps are up there and you can use it as a on off switch but using other passive components like a pot you can limit the flow of electrons, same goes for transistors except that you can use it just like a mosfet in the sense that use used life binary but add code to just make it go on and off, in a H bridge ic you can find they coffee made it off mosfet as well as transistor both n type and p type and sometimes you will also find h bridges that use both mosfet and transistor in a very unique setup giving you the best of both worlds so you see they are both the same, don't look at it as only binary or analogue it all depends on your setup.
@Ziplock9000
@Ziplock9000 7 жыл бұрын
Ok thanks. I'll look out for those binary midgets lol
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
Lol I'm dead lol
@carlscut4238
@carlscut4238 8 жыл бұрын
Thanks for the video, found it very helpful
@grahamtech
@grahamtech 7 жыл бұрын
can u show me how to control two motors on each axis of a joystick? for ex: y axis forward and backward of motor a. and X axis forward and backward motor B, plz i rly need a code for this a help on making it for exo skeleton project
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
how do we tell how many steps a stepper motor has?
@uniquehero244
@uniquehero244 8 жыл бұрын
where to get servo motors
@muratcakr5640
@muratcakr5640 8 жыл бұрын
Hello, it's a great video. I am totally new to Arduino, i just saw a couple of videos, I am amazed! Now I have a small project, requesting your help. I want to run a DC Motor with Arduino, I would like to set a spesific speed to run at a spesific amount of time. (Ex Run motor at 300 RPM for 3 minutes, 700 RPM for the next 5 minutes) The motor is 24V 13 amps. I would like to make a couple of programmes like this that i want to switch between with buttons and start it. What do I need for this project except motor and power supply? I would very much appreciate your help!
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
Murat çakır what you just explain it's called pseudo coding, and it sounds to me like you actually know what you want so your question seen redundant, what you are actually allying for is for someone to do your work. You might want to try scratch ide for Arduino since it sounds like you need to brush up on your programming skills
@muratcakr5640
@muratcakr5640 7 жыл бұрын
Hello Jai, I never asked someone to do my work. If you read again, you will see that I am asking about the equipment, not the code.
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
i did read your comment and okay maybe i got off the wrong foot with the whole code but like i said your Q is vague i mean you asked this a month ago or so so im just giving it a crack really for no reason other then to narrow down the help, figure this guy is busy so i figure ill help him by helping out some of his viewers we all here to learn from one another and all i got from your comment is that you know what you want so im not sure what are you really asking for? you just named off everything in your setup from buttons to power supply volt and amps so you might want to clarify your Q a bit man i be glad to help anyone but you gotta be clear
@emilianoacuna9705
@emilianoacuna9705 7 жыл бұрын
Dude im having trouble with the servo,when i upload the code, my comp gets crazy and starts to ignore my arduino uno,and then it recognice it again,the only thing the servo does its to get the initial position
@jeanluca2904
@jeanluca2904 8 жыл бұрын
Thanks man, great job
@raheemahgomez5406
@raheemahgomez5406 8 жыл бұрын
Hi! How can I use arduino to control a solenoid valve? It would be a great help. Thanks! :) great video!
@Jai_Lopez
@Jai_Lopez 7 жыл бұрын
Raheemah Gomez la mima forma que el use el motor dc no hay diferencia
@musicfuse
@musicfuse 9 жыл бұрын
What mosfet are you using? Thanks
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+musicfuse In the video I used an IRF540N which is not a logic level MOSFET. The key problem with it not being logic level is that to really open it up requires something more like 10v. Normally I have a supply FQP30N06L MOSFETs which are my goto logic level MOSFETs that can control quite a bit of power. 60V 32A with around 70Watts of dissipation. So for a smaller motor like this the IRF540N is fine. A few factoids: when a MOSFET has an L at the end it is usually an indication that it is logic level. And what I mean by logic level is that they will be happy with a gate voltage in the 3.3 -5V range. If you do what I did and put 5v into the IRF540N it really won't work as you push the amperage you are controlling too high.
@grandmetallic556
@grandmetallic556 5 жыл бұрын
model of this dc motor please
@FrankLopezx
@FrankLopezx 9 жыл бұрын
should do a video on controlling dc gear motors with a pot on it and control it like a servo, basically a DIY servo
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+Frank Lopez Interestingly enough I have been working on a PID video. My goal with all these videos is to keep it as simple as possible so what you describe would very much fit with that. PID on the surface is very simple and complex just under the surface. What I am trying to figure out is how to pretty much hide the complex so that it just works. The cool thing with PID when it goes wrong is that it acts like it is alive. Thus this might be my first video with outtakes.
@FrankLopezx
@FrankLopezx 9 жыл бұрын
LessonStudio actually IF your going to do a DIY servo video PID is NOT what you need to implement , what you need is a PD algorithm, you have a FB ? i got some videos on there that you might find interesting
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+Frank Lopez Correct, I would probably go with an opamp based circuit for a DIY servo; but the PID part of the video would be all about feedback between motors and the things they move. So servos with pots, other digital encoders, and PID for wobbly balancing arm thing-a-ma-bobs. Then this can lead into something like the classic balancing on two wheels thing where it gets its feedback from a gyro. In the above video I show how a stepper motor can "lose" track of the steps if you force it to skip a step or more. Thus some kind of feedback is required for many motor operations. One challenge that I was first doing the math on is to see if it is possible to balance a two wheeled thing using ultrasonic sensors as feedback. The question becomes if the PID math can handle the fairly poor data that comes out of a ultra sonic sensor. The idea is to show that movement data from a motor can be measured in a zillion different ways.
@FrankLopezx
@FrankLopezx 9 жыл бұрын
well i can tell you that i seen balancing bots using ultra sonic ping, but your right it does come down to code and threshold values and map functions imu always help asure any doubts by the system, but im not about thos little stupid bots im more on the humanoid life size androids and pd or pid controllers or algorithms using basic trig "cosines ....ect" to work out IK for walking and finger displacements
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+Frank Lopez Cool. Two legged walking without big flat feet is something that I really want to take a crack at someday. That would be my foray into humanoid.
@andymouse
@andymouse 9 жыл бұрын
please use the correct mosfet pin names gate, drain and source, it helps beginner's
@garycandrl146
@garycandrl146 8 жыл бұрын
nice video!
@marlonmabanan8374
@marlonmabanan8374 4 жыл бұрын
do you have a code ? can I request the code itself
@lantornify
@lantornify 9 жыл бұрын
is there any way I can contact you regarding a big project?
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+Ee vert Yes, no problem. Just email me at donovan@ (the LS name above) .com Sounds interesting.
@ChanseyhaEng
@ChanseyhaEng 9 жыл бұрын
HI I have question about L298N heatsink getting hot. I use 12Vol dc motor from drill, Arduio Mega2560 R3, L298N and expertPower 12v 7ah Rechargeable Sealed Lead Acid Battery and connect and code the same as you. I run it about 30 sec the heatsink L298N is getting very hot. can anyone please help me why?
@ChanseyhaEng
@ChanseyhaEng 9 жыл бұрын
+seyha seyha I put multimeter in series and the current is up to 3A. maybe is that what make the L298N is getting hot right? do anyone know what good dc driver will work?
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+seyha seyha The L298N is rated for around 2A, so that it is surviving is lucky. The question is do you need an H-Bridge to make the motor go both ways, or do you just need to make it turn one way?
@ChanseyhaEng
@ChanseyhaEng 9 жыл бұрын
+LessonStudio thanks for help I need it turn both way. I m making robot lawnmower. this is my first experiment. any idea for help please?
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+seyha seyha If you google ebay for "5A H-bridge" pretty much any of the square shaped ones would be fine. They operate nearly identically to the L298N module in this video. If your limit is 3A then 5A should leave you some margin.
@ChanseyhaEng
@ChanseyhaEng 9 жыл бұрын
Thanks so much I found few H-Bridge that can take up to 10A on amazon. I will give it try again :)
@mrMirzam
@mrMirzam 9 жыл бұрын
Use original Arduino people! The money goes to the good purpose of open-hardware.
@DonovanStudioMain
@DonovanStudioMain 9 жыл бұрын
+mrMirzam The Uno in the video is Italian made. The Nanos are not. I use Nanos where disposable is the key.
@Harrzack
@Harrzack 8 жыл бұрын
Good info poor presentation. Review your video production techniques. I can't see the Arduino code, but get a great view of your desktop. Get a copy of Camtasia Studio and make a real vid!
@DonovanStudioMain
@DonovanStudioMain 8 жыл бұрын
+Harrzack Bump your resolution up to HD and the text is crisp as can be. Also when the code is more complex than this I usually put it all up on Github.
A comparison of many common Arduino types and their uses.
15:04
DonovanStudio
Рет қаралды 159 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Electronic Basics #24: Stepper Motors and how to use them
6:47
GreatScott!
Рет қаралды 2,2 МЛН
A simple guide to electronic components.
38:06
bigclivedotcom
Рет қаралды 8 МЛН
28BYJ-48 Stepper Motor and ULN2003 Driver Intro
21:03
Bret Stateham
Рет қаралды 557 М.
You can learn Arduino in 15 minutes.
16:34
Afrotechmods
Рет қаралды 10 МЛН
Making coffee from scratch (is hard)
38:34
NileBlue
Рет қаралды 1 МЛН
I Built 9 Satisfying Ball Machines
16:06
Engineezy
Рет қаралды 197 М.
How to Make a Real Diamond - (Not Clickbait)
8:51
JerryRigEverything
Рет қаралды 2,5 МЛН
Arduino Tut#16 - DC Motor Drives, Voltage, Direction, H-Bridge, PWM
10:51
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН