Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Connecting a motor to the netduino


  • Please log in to reply
8 replies to this topic

#1 Ben Harel

Ben Harel

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 13 November 2012 - 05:56 PM

Hi! How can I connect and controll a DC motor from the netduino? I have an H-Bridge and Transistors,as well as a breadboard.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 November 2012 - 08:03 PM

Hi Ben,

How can I connect and controll a DC motor from the netduino? I have an H-Bridge and Transistors,as well as a breadboard.

You'll use the H-Bridge to convert the PWM signal from Netduino to an amplified signal.

Have you taken a look at the schematics of the Adafruit or Arduino motor shields? The wiring for H-Bridges is pretty standard. Which H-Bridge do you have?

Also...Stefan and others have worked quite a bit with moving platforms using H-Bridges with Netduinos. So quite a few people may want to pitch in here to offer advice.

Chris

#3 Nobby

Nobby

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts

Posted 13 November 2012 - 10:19 PM

You've got two goals to achieve here. Your circuit build/hook-up and software to control the H-Bridge. The good news is that regardless of how you end up controlling the H-Bridge, the connections are the same.


You haven't specified what your H-Bridge is and how it's been put together etc. They're simple systems to understand. You need to connect at least three different kinds of connections:


  • DC Bus link voltage. This is the power supply you provide the H-Bridge. It can be bi-polar or uni-polar but it depends on if your H-bridge will allow you to connect a 'center-tap' for setting the ground as a mid-point.
  • CMOS/IGBT gate inputs. You connect your PWM outputs to these. There are four of them but they are in pairs so you only need two PWMs to drive it. One switch is always off when the other is on for each pair(side note on this)
  • H-Bridge output goes to the motor. You will be able to drive a DC or an AC motor with an H-bridge.

There may be some other component considerations depending on the gear you've bought.

Controlling the motor can be as easy or difficult as you want and it's a massive field for you to explore. To start with, you will most likely be able to get a library or use .Net classes which will operate the PWMs for you. Because you have an H-Bridge you have two options:


  • Use one PWM on half of the H-Bridge as a starting point. It turns your H-Bridge into a single phase-leg modulator which means you can't drive an AC motor
  • Use two PWMs on the full H-bridge which will allow you to drive an AC motor as well as DC

Above is your starting point but it has no feedback control loop. Without feedback from the motor, you won't be able to know how fast it is actually spinning for a given input signal. If it's important for you to have precise control of the motor speed, you need software in your project which will measure the motor speed and figure out the difference in desired speed and actual speed the adjust your modulation depth to drive the H-bridge harder or less. Some motors can tell you their position as well so you can precisely control the position of the motor as well as speed.

Having said all this, if you're just a hobbyist and want to see the motor spin, you don't need a feedback control system or understand much about modulation theory. If you told us more about your goals then we can be very specific about helping you to setup the right system.



--edit: oops forgot the side note. Depending on how your H-bridge has been designed, you have to build a "dead-zone" into the PWM signal. If there's free-wheeling diodes and/or your H-bridge uses IGBTs, there's a discharge transient when the device attempts to switch off. If you toggle the other switch on before its complimentry switch has fully turned off, you create a short on your power supply every time the PWM switches on/off. It will damage your supply and possibly much more.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 14 November 2012 - 07:49 AM

Also...Stefan and others have worked quite a bit with moving platforms using H-Bridges with Netduinos. So quite a few people may want to pitch in here to offer advice.

Oh yes, including schematics. Keep in mind this is a very simple approach;
http://netmftoolbox....ardware.HBridge
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 Ben Harel

Ben Harel

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 17 November 2012 - 03:05 PM

My H-bridge is sn75441one. Here's his schematics : http://pdf1.alldatas...SN754410NE.html How can I connect it to my Netduino, using a breadboard? EDIT I tried the NETMF toolbox, does it apply to all H bridges, and can it power only one motor?

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 17 November 2012 - 03:11 PM

I've used it with the SN754410 and the above schematic, so you should be just fine. It can drive 2 dc-motors.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#7 Ben Harel

Ben Harel

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 18 November 2012 - 05:25 PM

I've used it with the SN754410 and the above schematic, so you should be just fine.
It can drive 2 dc-motors.



Ok,thank you.
I'm completely new to this, can you guide me through how to connect it to the netduino? What are those signs next to each arm?(2Y,Vcc..)

#8 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 18 November 2012 - 06:13 PM

Ok,thank you.
I'm completely new to this, can you guide me through how to connect it to the netduino? What are those signs next to each arm?(2Y,Vcc..)

You can connect it just like in this diagram. If you look closely you'll see it mentions the exact same chip:
http://i3.codeplex.c...wnloadId=334904
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#9 Ben Harel

Ben Harel

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 20 November 2012 - 02:37 PM

Ok, I'll try.Thank you!In order to connect only one motor,I do not need to change anything in the connections right?Also, when I create a new PWM(v4.2),what are the dutycycle and frequency?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.