Driving DC Motors with Microcontrollers

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ค. 2024
  • How to use 7 different motor driver modules with an Arduino or any microcontroller. Hookup, code & demonstrations with motors big and small.
    Article with code: dronebotworkshop.com/dc-motor...
    More articles and tutorials: dronebotworkshop.com
    Join the conversation on the forum: forum.dronebotworkshop.com
    Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
    Today we will be working with lots of motor drivers and lots of motors!
    You’ll see how there are actually three methods used among all of these drivers for controlling speed and direction. Because of this, it’s pretty easy to swap drivers and use a sketch for small motors to be used with much larger ones (or vice-versa).
    I’ll be driving everything with a simple Arduino Uno today, but you could use any microcontroller to work with these motor drivers.
    The code for all these motors is pretty simple, I’ll show it to you, and I’ll also introduce you to a few libraries that make coding for these motor drivers a breeze. We’ll also check out a motor driver library from Cytron that is a hidden gem, as it can be used with ANY of these drivers!
    Here is the Table of Contents for today's video:
    00:00 - Introduction
    01:17 - DC Motor Driver Basics
    08:05 - L298N Dual H-Bridge
    16:13 - TB6612FNG Dual H-Bridge
    25:24 - DRV8871 Single H-Bridge
    31:08 - MX1508 Dual H-Bridge
    38:54 - DBH-12 Dual H-Bridge
    46:27 - IBT-2 Single H-Bridge
    51:17 - MD25HV Single H-Bridge & Controller
    1:02:27 - Conclusion
    Hope you enjoy this, remember that the article on the DroneBot Workshop website has all the code I used today.
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 266

  • @Dronebotworkshop
    @Dronebotworkshop  3 หลายเดือนก่อน +16

    Hi everyone - It's come to my attention that there has been someone masquerading as myself, responding to some comments here with a link to a Telegram chat to win a prize from me. THIS IS A SCAM, I am not holding a contest, nor do I have a Telegram account. PLEASE DO NOT RESPOND TO THESE MESSAGES!!
    It's happening on a lot of my videos, I'm taking steps to remove them manually, but as I have 162 videos, it will take some time. If you do run across a suspicious comment, I would appreciate you letting me know at info@dronebotworkshop.com.
    Thanks!
    Bill (The real one!)

    • @alejandroaguirre2355
      @alejandroaguirre2355 28 วันที่ผ่านมา

      @Bill I was wondering if you have any info or videos on how to connect NEMA 23 steppers with Arduino Mega or Giga even a Uno. I have a few raspberry pies and I wanted to make a CNC controller but I can even install LinuxCNC so I thought I would try out Arduino excellent video by the way take care Bill

  • @mecanoman
    @mecanoman ปีที่แล้ว +190

    Just so you know the quality of the content here. This is waaaay better than the Automatization lab on my university at the Engineering faculty. Regards!

    • @dragon.fromindia3235
      @dragon.fromindia3235 ปีที่แล้ว

      Elon musk should start Google like companies

    • @alchemy1
      @alchemy1 ปีที่แล้ว +6

      That is because to these folks, it is a work of love. It is not a job they go to.

    • @ApteraEV2024
      @ApteraEV2024 6 หลายเดือนก่อน

      ​@@dragon.fromindia3235like, software?

  • @pixelsquarelight
    @pixelsquarelight 11 หลายเดือนก่อน +14

    Although I have watched many of your videos I rarely but I wanted to stop and thank you for the excellent content that you provide. I am highly appreciative of your presentational style you're calm demeanor and your thorough and useful explanations. There have been multiple times where your videos have helped me understand concepts well enough to implement them in my experiments and projects and this has enriched the quality of my life. I sincerely appreciate your efforts. Thank you

  • @TediumGenius
    @TediumGenius ปีที่แล้ว +2

    This is a FANTASTIC treatise in motor control options!!! With some excellent tips and the 98% speed warning!!! I can't get enough of your instruction! Well done as always!!!

  • @EsotericArctos
    @EsotericArctos ปีที่แล้ว +8

    H-Bridge devices have so many different applications. They can be looked at primarily as a motor controller but I also use a H Bridge to convert the digital signal out from an Arduino to DCC +-15V square wave for HO/OO scale model railways. Very versatile device.

  • @AllTheNamesWereInUse
    @AllTheNamesWereInUse ปีที่แล้ว +4

    Great video! You can always expect the quality and information to be excellent when a new video pops up.
    Thanks for all the time and effort you put into these.

  • @tukituki127
    @tukituki127 6 หลายเดือนก่อน +1

    I am currently a junior majoring in Computer Engineering. I can spend hours looking for specific information out there, and it drives me crazy. You bring all the essential knowledge in one video and with excellent structure and explanations. I cannot thank you enough for these kind of videos!

  • @MrOnlineCoder
    @MrOnlineCoder ปีที่แล้ว +30

    That's exactly the video I needed. As always, highest quality. Thank you!

  • @alwedtechnology8589
    @alwedtechnology8589 ปีที่แล้ว +8

    I am Edgar from Kenya, Africa..
    I don't have the words to thank you for turning my dreams into reality. May God Bless you Abundantly

    • @jasenchen3731
      @jasenchen3731 18 ชั่วโมงที่ผ่านมา

      good luck on your amazing journey

  • @p.g.pg38
    @p.g.pg38 ปีที่แล้ว +8

    Grand merci pour cet énorme travail de synthèse sur les drivers!

  • @JonathanDeWitt1988
    @JonathanDeWitt1988 ปีที่แล้ว +9

    Bill,
    I have watched many of your videos over the years. I have seen some of these motor drivers in those videos. But it is wonderful to have them all in one place compared to one another. It took me a few days to make it through this video. It is a great reference video that I am sure I will use over the years. Thank you for taking so much effort to create it. The quality is amazing. I really like those cytron boards. I especially liked the feature of it testing a motor without the microcontroller.

  • @Eagle621
    @Eagle621 4 หลายเดือนก่อน

    As an aircraft mechanic, A/P, with an Inspectors Authorization, IA, I’m just getting into this world…but I find your videos VERY informative and helpful. Thank you and I really appreciate your help in understanding in a way that I can develop my own projects. Cheers, new sub here👍

  • @xzs6ba0
    @xzs6ba0 ปีที่แล้ว +5

    Thank you very much... you have helped an 80 year Old Man to understand how his CNC motors work. Very much appreciated. Have a Great and Safe Day.

  • @braddixon3338
    @braddixon3338 ปีที่แล้ว +1

    Kind of a long video, but a ton of info was presented, all in a very detailed format as usual. Thanks for taking the time to put these together, folks really appreciate your efforts!

  • @absinthe4breakfast299
    @absinthe4breakfast299 ปีที่แล้ว +3

    Fantastic video, it's just what I've been looking for.
    I've been building a 3d printed tank and I got stuck trying to figure out the electronics side of things, this video has been incredibly helpful and should allow me to move forward with the project.

  • @sinjhguddu4974
    @sinjhguddu4974 ปีที่แล้ว +4

    Once more, thank you for this beautiful masterclass on controlling DC motors. Thoroughly enjoyed it. Do stay well.

  • @Reach41
    @Reach41 ปีที่แล้ว +18

    Not to be ignored are the motor controller boards that communicate with the Arduino via I2C. They only require two of the precious IO pins to drive your robot’s motors, and the libraries available to control them take care of all the setup details. People new to the sport will be best off sticking with brands such as SparkFun or Adafruit, and picking motors from the same places that they indicate are compatible with the board you choose.

  • @dustyfisk1887
    @dustyfisk1887 ปีที่แล้ว +1

    This video and tutorial is absolutely amazing! Thank you so much for putting together this clear, concise, tutorial. So much easier to understand! Looking forward to watching all of your other videos!

  • @TYGAMatt
    @TYGAMatt ปีที่แล้ว +1

    Great work Bill. I'm using the TB6612FNG in my latest project but only driving one motor. But thanks to your vid I've just ordered a DRV8817 to replace it. Keep up the good work!

  • @kajitis_1
    @kajitis_1 ปีที่แล้ว +4

    Fantastic introduction to the world of controling motors. Your vids are brilliant. Keep up the good work 👏

  • @mizbot
    @mizbot 5 หลายเดือนก่อน +1

    Love the effort you put in in your videos, I've come back to this video again and again as reference for the motor drivers. Appreciate your content a lot really helpful ❤️

  • @lorisrobots
    @lorisrobots ปีที่แล้ว +2

    Thanks for this great content! I always find your videos well researched and accessible. Please keep them coming!

  • @andrewrevelee5097
    @andrewrevelee5097 ปีที่แล้ว +2

    Im just a hobbyist when it comes to electronics and have been slowing learning an self teaching myself for a few years know and even though I may know how to use h bridge controllers I still feel you can learn more about things by listening to others especially ones who are well versed or educated on the topic I just found this channel and subbed after the linear ps video because of how well you did in making a high quality informative video an because you don't drag on one thing forever explaining it you condense the important points with enough detail to get the message across then move on and that's why these videos I feel are packed full of information in a decent run time and can be watched with ease.

  • @willlockler9433
    @willlockler9433 ปีที่แล้ว

    Great presentation as always! Cytron urc10 robot control board, which is UNO R3 and cytron 10/30 amp driver all on one board, is great project option. One power hookup and lots of pins.

  • @rogueart7706
    @rogueart7706 ปีที่แล้ว +1

    Excellent video. I needed this as I’m building a CNC router. The drivers are the only thing I couldn’t quite grasp.
    Thanks a bunch

  • @bruinflight1
    @bruinflight1 ปีที่แล้ว +4

    EXCELLENT TOPIC! Thank you for sharing this knowledge, I've got some projects in mind that I'd love to apply this to.

  • @harryhino2267
    @harryhino2267 ปีที่แล้ว +2

    Great content as usual.
    Minor nit pick. Vbe is 0.7V for bipolar transistors; Vce(sat) is 0.3V.
    When using FETs, keep in mind that they cannot change from OFF to ON (or ON to OFF) instantaneously; there is a slew rate. When they are in this intermediate state, there is a voltage drop and a current flow; so they have to dissipate power as heat. It is nowhere near as bad as bipolar devices, but needs to be kept in mind when switching them very fast.

  • @chadizdroid
    @chadizdroid ปีที่แล้ว +1

    Thank you for another Great video, to complement this, I would follow up by showing how we can do current sensing on all, and also how to use an different types of motor encoders to demonstrate feedback control loop concepts.

  • @Graham1904
    @Graham1904 7 หลายเดือนก่อน

    An awesome video for those people just started with DC motor controlling. Brilliant!!

  • @erickbermudez8219
    @erickbermudez8219 ปีที่แล้ว +3

    You really know how to transfer knowledge! Great job, thanks for be so professional and provide excellent videos, very well explain and easy to follow.

  • @munjee2
    @munjee2 ปีที่แล้ว

    The 5v logic input on the l298 also acts as a ~5v supply actually, which is pretty useful to supply μC's without built-in voltage regulator

  • @tobi9648
    @tobi9648 8 หลายเดือนก่อน

    such a great video. exactly what I needed. Thank you very much!!

  • @ausgewogen
    @ausgewogen ปีที่แล้ว

    Perfectly explained, the right speech speed and super diagrams.

  • @gersonfer
    @gersonfer 8 หลายเดือนก่อน

    Very good class covering all aspects as always. Thank you. I have a question regarding IBT2: How can I apply a progressive motor braking function? i.e. I don't want the motor to stop suddenly.

  • @gpTeacher
    @gpTeacher ปีที่แล้ว +7

    Very informative and well-presented! Thank you!

  • @ernierasta
    @ernierasta 6 หลายเดือนก่อน +1

    Thank you! Your videos are so pleasant to watch and easy to understand!

  • @Kamal_Kalyan887
    @Kamal_Kalyan887 ปีที่แล้ว +3

    Thank you so much 💖 and I wish all the happiness be with you professor

  • @Matt2chee
    @Matt2chee ปีที่แล้ว

    That helped, considering I started in industrial when MG set's were still commonly in use. The current rating is amazing in some of these small packages.

  • @sciacabale
    @sciacabale ปีที่แล้ว

    This is a very well conceived and instructive tutorial.
    However, the most versatile motor controller I know of was left out.
    This is Basic Micro's ROBOCLAW.
    It comes in different sizes but the most common is the Roboclaw 2x7 capable of driving two motors drawing up to 7 Amp each.
    This controller has the ability of processing signal coming from motor encoders and controlling the motor's speed via a PID (Proportional, Integral, Derivative) feedback loop.

  • @waynefilkins8394
    @waynefilkins8394 5 หลายเดือนก่อน

    Great video, helped a TON with my project. Sadly I already ordered 5 of the L298N, but I got them super cheap so went ahead and ordered the ones I need, the TB6612FNG. Problem with the first one is that huge heatsink, and I only need 12v so 2nd one was perfect.

  • @79ober
    @79ober ปีที่แล้ว +1

    Hi Bill, great video! Thanks for trying out Cytron's MD25HV and happy that you like it.

  • @ladiran
    @ladiran ปีที่แล้ว +4

    Great tutorial.
    It will be appreciated if a display showing the motor speed could also be included.
    Thanks, again, for the tutorial

  • @darkoprintshop9927
    @darkoprintshop9927 ปีที่แล้ว

    Another great video. These are so helpful. Thanks for putting them together. 🎉

  • @michaelkosciewicz1623
    @michaelkosciewicz1623 ปีที่แล้ว +4

    Phenomenon! i start with electrical machines, this semestr. Great thnx Bill:)

  • @usefulelectronics
    @usefulelectronics ปีที่แล้ว +11

    This is all in one motor driver tutorial!
    I didn’t not know about some of these drivers. Thank you for the amazing comparison!
    Keep it up !

  • @crazytronics9917
    @crazytronics9917 ปีที่แล้ว +5

    Please make video on FOC and how we can use it for position controlling of BLDC motor.
    👍

    • @stefanguiton
      @stefanguiton ปีที่แล้ว

      Would be great to see this

    • @TheMarshallFan
      @TheMarshallFan ปีที่แล้ว

      Electronoobs has a video on FOC PMSM control, but I'd like to see Bill's take on the topic as well.

  • @MitzpatrickFitzsimmons
    @MitzpatrickFitzsimmons ปีที่แล้ว +4

    I just rceived my motors for my remote controlled lawnmower project yesterday... and today this video!
    Coincedence or Syncronicity?
    Either way... thanks Bill!

  • @lesthompson5907
    @lesthompson5907 3 หลายเดือนก่อน +1

    that was very revelling & did infect answer a questions or tow i have still have to get in to wring the set up. And loop for the ono but at lest now i may have a drivers to handle the job thank you a lot once has figured out how to put it together on my lath.

  • @TheUnofficialMaker
    @TheUnofficialMaker ปีที่แล้ว +11

    Very comprehensive as usual, thanks for your efforts. I always learn a lot from your well made experiments.

  • @LeslieIsgrigg
    @LeslieIsgrigg ปีที่แล้ว +3

    👍 Very good course.
    Thanks again for your efforts.

  • @Zeddify
    @Zeddify ปีที่แล้ว

    This channel deserves more recognition.

  • @Googolplex6
    @Googolplex6 5 หลายเดือนก่อน +1

    Amazing video. I am a beginner but this video gave me the right answer were to start. Thanks!

  • @hammabuckshot5062
    @hammabuckshot5062 ปีที่แล้ว +1

    Yet another amazing video,this truly magnificent.keep up the good work ❤️❤️❤️

  • @ms.informed
    @ms.informed 10 หลายเดือนก่อน

    This is a godsend, exactly what I need for my next wannabe project, if I stop procrastinating, that is.

  • @johneagle4384
    @johneagle4384 6 หลายเดือนก่อน +1

    Very comprehensive, very useful. Thank you very much!

  • @tungstikum
    @tungstikum ปีที่แล้ว +3

    Thank you for all your quality content

  • @donaldkormos5529
    @donaldkormos5529 ปีที่แล้ว +2

    Super video on motor drivers!! All the best to you ...

  • @Chloe_59
    @Chloe_59 ปีที่แล้ว

    Awesome! Thank you very much, you just released exactly the video I needed

  • @j.b.9474
    @j.b.9474 ปีที่แล้ว +4

    Would love to see video on motors with position feedback.

  • @warrenking1815
    @warrenking1815 6 หลายเดือนก่อน +1

    Great video, real good information presented in a clear and thoughtful manner!

  • @yucynthia644
    @yucynthia644 ปีที่แล้ว

    Thanks! Very detailed and comprehensive!!!

  • @rich4239
    @rich4239 ปีที่แล้ว +4

    excellent work!!! thanks for your outstanding presentation...your consistent, clear outline for your videos makes them superior to any other source. You were the first source for my arduino learning process and as my level of understanding grows...you seem to be there with a video on the topic.
    I am a noob trying to control 12v powerwheels toy with my 80v lawn mower battery...needing to get the voltage down to 12-18v...from your explanation, an h-bridge does not seem to work...or am I missing something...is there a standard way to control lower voltage, lower cost dc motors with a much bigger voltage source...thanks again

  • @U8uxa8SP
    @U8uxa8SP ปีที่แล้ว +2

    Thanks for another wonderful video. I learned a lot.

  • @simonlyons5681
    @simonlyons5681 4 หลายเดือนก่อน +1

    At 3:40 I think you are confusing the base-emitter voltage drop of a bipolar transistor (about 0.7V) with Vce(sat) which is often on the order of 0.1V, similar to a MOSFET. Otherwise, amazing video. I can't believe the work you put in here!

  • @TrillChords
    @TrillChords ปีที่แล้ว

    Nice variety in coverage. Bless 🙏

  • @user-px3kp9eg8v
    @user-px3kp9eg8v 6 วันที่ผ่านมา

    I couldn't find any like this. Thank you🎉

  • @Mike.Kachar
    @Mike.Kachar ปีที่แล้ว +5

    Thank you very much for the videos you do!

  • @JochenRoth
    @JochenRoth หลายเดือนก่อน

    Thank you for this very interesting video and workshop! Best regards from Germany!

  • @Ben_Lovely
    @Ben_Lovely 8 หลายเดือนก่อน +1

    Please do a video on driving 3 phase dc motors found in old computer printers so we can all repurpose them :) love your content!

  • @jackisgoofingoff5510
    @jackisgoofingoff5510 6 หลายเดือนก่อน +1

    This is so detailed and useful, thanks.

  • @diogenesofSinope87
    @diogenesofSinope87 ปีที่แล้ว

    Absolutely fantastic content thank you!

  • @MrTweetyhack
    @MrTweetyhack 8 หลายเดือนก่อน

    Excellent content

  • @JBernhard72
    @JBernhard72 ปีที่แล้ว +1

    Just to add ... if you try to 'roll our own' H-bridge, timing of the 'switches' is important! It is VERY easy to momentarily short out to ground and release the magic smoke!

  • @GiC7
    @GiC7 6 หลายเดือนก่อน +1

    Master, I love the pr.oject. thanks

  • @petermolnar6017
    @petermolnar6017 ปีที่แล้ว +3

    Great as always! Thank you!

  • @roybouvier5021
    @roybouvier5021 ปีที่แล้ว +1

    Hi Bill, great video as always. Can you tell us where you sourced the 24VDC motor you were controlling with the MD25HV? Thanks.

  • @ingodering9649
    @ingodering9649 ปีที่แล้ว

    Many thanks for perfect explanation ☺️

  • @duinobox6991
    @duinobox6991 ปีที่แล้ว

    Parabéns! bem explicado! aprendi muito

  • @donodono2287
    @donodono2287 ปีที่แล้ว +2

    Wish we'd been taught this stuff at school. Absolutely essential now!

    • @ronaldmorrison2765
      @ronaldmorrison2765 ปีที่แล้ว

      Me too but microcontrollers and H bridges weren't popular in the classroom 55 years ago.

  • @jlucasound
    @jlucasound ปีที่แล้ว

    😲 You forgot to say "Wipers" @ 50:24. 😄 I so love your videos! Your illustrations, diagrams and tutorials are the BEST! And I mean that. I'm still keeping my L298Ns. I'll use a wall wart on a project with no wheels. A Pinball Machine!! 🤣 Thank You, Sir!

  • @q12x
    @q12x ปีที่แล้ว +1

    Very good tutorial ! Thank you !

  • @stevenlightfoot6479
    @stevenlightfoot6479 2 หลายเดือนก่อน

    This is really excellent, I have now watched the whole thing. If you have any info on reading the current sensing from L298 on the Arduino Motor Shield Rev 3 I would love to see it.

  • @Jeovanivm
    @Jeovanivm 10 หลายเดือนก่อน

    Thanks so much, I am from Brazil and I can understand you very well,

  • @amirajpal6382
    @amirajpal6382 ปีที่แล้ว

    Great explanation in your video. Very Professional.

  • @GreenFootprint
    @GreenFootprint ปีที่แล้ว

    Thank you for the excellent quality of the presentation. I have a 3-Phase 48V DC brushless motor (BLDC) with maximum current of 7 Amps. The motor has a PWM input pins. I would appreciate if you could recommend an appropriate controller for this motor.

  • @wodzimierzkeska2380
    @wodzimierzkeska2380 ปีที่แล้ว

    Perfect presentation!

  • @eduardprivat9821
    @eduardprivat9821 6 หลายเดือนก่อน +1

    thx. amazing presentation

  • @DingusGoesWest
    @DingusGoesWest ปีที่แล้ว

    Great video, very valuable information!

  • @juliojoseruizolivo4697
    @juliojoseruizolivo4697 6 หลายเดือนก่อน

    Very helpful, keep doing this videos!

  • @WhiteLion1337
    @WhiteLion1337 ปีที่แล้ว

    Great Video!
    Is there a difference with the use of stepper motors instead of DC motors? Or can I use the same setup and replace the DC motor with a stepper motor (like Nema 17 or so) ?

  • @joshuaoduroadu5376
    @joshuaoduroadu5376 ปีที่แล้ว +2

    Thanks Bill for another excellent 👍👌 video.

  • @cornjulio4033
    @cornjulio4033 ปีที่แล้ว

    Cool video ! Also, at 46:00 that's a nice power supply, it reacts super fast.

  • @mahmoodmohammad7241
    @mahmoodmohammad7241 ปีที่แล้ว +1

    Great Tutorial, Thanks

  • @christopherhughes6519
    @christopherhughes6519 ปีที่แล้ว

    I've got to admit that at 70 I'm too impatient to actually learn to code. I usually try an find some online project that looks like what I want to do and give it a try. Sometimes it works and sometimes it doesn't. But from that effort I pick up enough clues to come here and choose your video that seems about right, pay attention and usually get the thing going the way I wanted. Thanks for doing what you do.

  • @barneycarparts
    @barneycarparts ปีที่แล้ว

    BTW: I see eBayers selling Wheel Chair motors without wheels. I found that Harbor Freight pneumatic wheels with 4 bolt holes line up perfectly, and cost around $5. You should knock out the inside bearing to fit the hub nut, and fill the tire with Fix a Flat or Slime since the valve stem will be on the inside mount side. I think they are the 4-5 in rim, white wheels. The IBT-2 45 amp motor controller works on a wheel chair motor. You can get the IBT-2 cheap 2 for $15. I bench tested my Wheel chair motor yesterday and it only pulled 10-12 amps under no load so there is plenty of amps left for a load. I believe DWS said the IBT-2 were 30 Amps continuous. 43 peak. I just looked on eBay Wheel Chair motor prices have skyrocketed They run from $130 to $200 each. It might be better to look on Craigslist and buy a whole chair for $100-300 from an estate sale. 5 years ago I got 2 eBay motors without wheels for $75. I also had 2 chairs given to me when a friend's mother passed away

  • @millbean13
    @millbean13 4 หลายเดือนก่อน +1

    Very informative content. I enjoy it. lol, this guy is interesting. I don’t think I’ve ever heard someone pronounce the arbitrary names of any circuit board so many times. I don’t think he skipped a single time saying the entire name of board when talking about them. Very funny. Most people would shorten them or only refer to a small portion of the name. Interesting guy.

  • @paramtrx9558
    @paramtrx9558 ปีที่แล้ว +1

    Thx again for a great video!

  • @Mrgasman1978
    @Mrgasman1978 4 หลายเดือนก่อน

    channels like this make our traditional school system looking obsolete

  • @eneleich373
    @eneleich373 5 หลายเดือนก่อน

    Very usefully, thanks a lot

  • @ramybrahim3188
    @ramybrahim3188 5 หลายเดือนก่อน +1

    thank you from Morocco