element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Ben Heck Featured Content
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • Ben Heck Featured Content
  • More
  • Cancel
Ben Heck Featured Content
Documents Max Learns to Drive Motors -- Episode 307
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Ben Heck Featured Content requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 23 Jul 2017 12:40 AM Date Created
  • Last Updated Last Updated: 8 Sep 2017 7:24 AM
  • Views 1240 views
  • Likes 6 likes
  • Comments 7 comments
Related
Recommended

Max Learns to Drive Motors -- Episode 307

image

element14's The Ben Heck Show

Join the Ben Heck team every week for amazing hacks! Watch them build and mod community-inspired projects using electronics!

Back to The Ben Heck Show homepage image

Community Feedback
Featured Bonus Content
See All Episodes

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Max steps back from the camera to learn about motors, motor drives, and switches from Felix. Felix takes apart a Motor and they work on a basic H-bridge circuit made from P-channel MOSFETs controlled by NPN Transistors.

 

 

Felix gives Max a lesson on how motors work and how to control them. There are a bunch of different types of motors.  There are DC motors and AC motors with various phases.  Felix goes over DC motors with Max. He shows one that has a permanent magnet and draws a picture of one with a field winding known as an electromagnet stator.  The field winding goes to the armature. There are positive and negative leads on each side. There’s a stator and a rotor, depending on which of your two leads is negative or positive, will determine the direction that the rotor turns, either clockwise or counterclockwise.

 

Next, Felix takes apart the motor with a permanent magnet to see what’s inside. The two large magnets are stationary inside a large housing. The rotor has contacts down at the bottom that meet with these brushes so they come out to eternal. The power goes into one terminal, meets up with a contact on one side, goes through a coil and creates an electromagnet inside. The brush meets on the other side through the solar contact so that the electromagnet is energized and the poles are in a certain position.  The permanent magnets act in opposition to the magnetic poles of the electromagnet and it causes a rotation.  As it rotates, there’s a break in all the contacts, so as the motor turns on those brushes it inverts the magnetic pull, thus causing it to continue spinning. Now that Max is informed on what is in a DC motor, it’s time to teach him what an H-Bridge is.

 

Felix and Max work on a basic H-bridge circuit made from P-channel and N-channel MOSFETs controlled by NPN transistors Felix lays down the components they are using for the H-bridge They have a couple of 2n222 alpha transistors a couple of  IRF630IRF630 N-Channel MOSFETs and a couple of IRF9630 N-Channel MOSFETs They’re also going to need some resistors and a few other components but they’ve got the layout of the H-bridge organized An H-bridge takes a voltage and reverses the voltage sent to the different terminals of a motor They can turn it in one direction stop it and turn it the other direction Max familiarizes himself with the circuit by building it on a breadboard

 

Once Max has a working H-bridge, his next question for Felix is how to transfer it to his perf board. To do this they’ll need two P-channel MOSFETs, two n-channel MOSFETs.  Felix finds this and all additional parts they’ll need so that he can demonstrate what you need to do.  He does a layout that consists of two inputs, a motor, power, and ground.  He’s working off of a schematic but the layout will be different on a perf board. Max attempts to cobble up an H-bridge by taking Felix’s breadboard and referencing the schematic. The breadboarded circuit is an R/S latch to provide input for the H-bridge.

 

Disclaimer

  • hack
  • heck
  • ben
  • episode 307: max learns to drive motors
  • tbhs_ep
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • jc2048
    jc2048 over 7 years ago +3
    Just an observation on the circuit you show. If you use a high supply voltage you'll get 'shoot through' of the MOSFETs. At the switching transitions there is a period where both MOSFETs will be on and…
  • shabaz
    shabaz over 7 years ago in reply to Jan Cumps +3
    I've never found a convenient circuit, it always ends up taking so many discretes or logic. A CPLD would come in handy for that : ) I end up just using an off-the-shelf part, i.e. a motor controller IC…
  • jc2048
    jc2048 over 7 years ago in reply to Jan Cumps +3
    Yes. Here is what you were doing reworked a bit to use the gate capacitance itself to do the delays. I'm assuming 5V CMOS logic at the input. Sorry not very clear. Blue and red are the gate drives, cyan…
Parents
  • jc2048
    jc2048 over 7 years ago

    Just an observation on the circuit you show. If you use a high supply voltage you'll get 'shoot through' of the MOSFETs. At the switching transitions there is a period where both MOSFETs will be on and a high current can flow between the power rails.

     

    Here it is simulated in LTspice XVII (just so that people don't imagine I'm partisan and would only recommend TINA-TI) and running with a supply voltage of 24V. This is one half of your bridge with no load attached. I haven't used the same NMOS part as you have (can't be bothered to go and look for a model and import it, instead just picked another part, so we're looking at the general principle here and not accurate results).

     

    image

     

    Here are the traces

     

    image

     

    Green is the input. Blue is the gate drive voltage - you can see it's sluggish and doesn't move fast, particularly when it's rising (being pulled up by the resistor). That's because there's a fair amount of capacitance associated with the gates and they have to charge or discharge. The red trace is the current through the 1mOhm resistor (I put the resistor there so we can see the current down through the MOSFETs), current scale is on the right.

     

    If you want to use the circuit on a supply that's a lot more than the threshold voltages of the two MOSFETs added together, you'd probably do well to redesign the drive so that both can't be on at the same time.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to jc2048

    That's a good point, Jon. I've been checking out how to inject deadband into a plain PWM circuit (or other logic switching circuit) with simple logic gates, RC timers and diodes.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to jc2048

    That's a good point, Jon. I've been checking out how to inject deadband into a plain PWM circuit (or other logic switching circuit) with simple logic gates, RC timers and diodes.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • shabaz
    shabaz over 7 years ago in reply to Jan Cumps

    I've never found a convenient circuit, it always ends up taking so many discretes or logic. A CPLD would come in handy for that : ) I end up just using an off-the-shelf part, i.e. a motor controller IC. Lots of textbooks too specify a BJT or darlington or MOSFET layout without much extra, but they don't mention it is only practical for certain voltages or motors, and that otherwise there is the risk of shoot-through causing issues. A blog or video can be different because the author is always there to comment or suggest the intent of the design (e.g. small robot etc), but with textbooks this is not the case : (

     

    Here is a design from a textbook, and based on this one diagram the book is really not worth reading.. also they didn't even draw it as a 'H', but more of an 'X'..

    image

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to Jan Cumps

    Yes. Here is what you were doing reworked a bit to use the gate capacitance itself to do the delays. I'm assuming 5V CMOS logic at the input.

     

     

    image

     

     

    image

     

    Sorry not very clear. Blue and red are the gate drives, cyan is the current through the MOSFETs.

     

    The remaining current (about 130mA) isn't shoot-through. It might be the charging current as the drain capacitance of the opposing MOSFET becomes visible I suppose, though I haven't investigated in detail.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 7 years ago in reply to jc2048

    Got that slightly wrong. In my enthusiasm I overlooked that the gates won't take 24V. It would need to be limited in some way. A 12V zener across both Q1 and Q3 from collector to emitter would be one way to achieve that.

     

    That's a nice illustration of why something that works in the simulator isn't necessarily a proved, good circuit.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube