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

Common solution to current limitations?


  • Please log in to reply
18 replies to this topic

#1 Gauss

Gauss

    Member

  • Members
  • PipPip
  • 14 posts

Posted 26 April 2011 - 04:02 PM

I am a bit concerned about what the common solutions are to people who use the Netduino for applications that involve motor control. According to the tech specs the pins are limited to 2 mA of current, unless I am misreading the tech specs that means effectively you can't directly run a motor from the controller. Just curious what are some common solutions to this dilemma? Do those of you out there that use this to control motors use relays? If so what are good? Is there something else? A relatively cheap motor controller (PWM/CAN)?

#2 Stefan

Stefan

    Moderator

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

Posted 26 April 2011 - 04:34 PM

It's possible to run very light motors directly from the netduino but with the right schematic it can also be solved in other ways. I connected a 12V DC-motor with a motorshield. There are also servomotor shields, or you could craft your own schematic.
"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

#3 mpearson

mpearson

    Member

  • Members
  • PipPip
  • 17 posts

Posted 26 April 2011 - 04:43 PM

I am not sure of the current limitation off hand, but assuming it is too low for that application, the simplest solution would be to get an H-Bridge circuit similar to this one

The input current is in the uA range, so this is very easy to drive. The output of this can drive up to 1A continuously.

It can be purchased here

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 26 April 2011 - 09:24 PM

Hi Gauss,

According to the tech specs the pins are limited to 2 mA of current, unless I am misreading the tech specs that means effectively you can't directly run a motor from the controller.

To add to what other community member's have noted, you generally won't run motors off of the pins--but rather use H-Bridges and use the digital pins to drive the speed/pulse signal.

If you do run a lightweight motor off of the PWM digital pins, they can provide 8mA of current.

Chris

#5 Rod Lopez

Rod Lopez

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts
  • LocationSweden

Posted 28 April 2011 - 01:39 PM

In many applications you can use servos, those you can feed power externally to the Netduino (with only the control signal coming from the Netduino) Servos can usually give you both ~180 degrees range and continuous rotation (many servos can be modified for the purpose) and provide a neat anchoring structure.

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 April 2011 - 01:53 PM

I would *NOT* connect any inductive load directly to an I/O port, because it produces voltage spikes that could seriously damage your board.
The overvoltages caused either from electrostatic sources and/or inductive loads, are the only real way to damage the board.

I have posted a small article on the sandbox here.

When there are inductive loads (e.g. coils, motors, etc) ALWAYS interface the board with transitors, drivers, etc.

I have lost many devices in that way.
Cheers
Biggest fault of Netduino? It runs by electricity.

#7 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 28 April 2011 - 04:53 PM

I would *NOT* connect any inductive load directly to an I/O port, because it produces voltage spikes that could seriously damage your board.
The overvoltages caused either from electrostatic sources and/or inductive loads, are the only real way to damage the board.

I have posted a small article on the sandbox here.

When there are inductive loads (e.g. coils, motors, etc) ALWAYS interface the board with transitors, drivers, etc.

I have lost many devices in that way.
Cheers


If you put a diode across the inductive load that will prevent the spike. But yes, I agree with you Mario, I would never directly connect an inductive load to a MCU pin.

#8 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 April 2011 - 05:25 PM

If you put a diode across the inductive load that will prevent the spike.

A diode could be useful, but I'd never bet a cent as a workaround for HCMOS logic.
You know, any chip has "diodes" internally, because of the substrate. The problem is that diode have a low threshold voltage, usually lower than a normal discrete diode. That mean the current will flow likely through the chip substrate, than the external diode.

I remind a long ago, when we tried to connect a MCU (MC68HC05) board to a car, powered by a 5V regulator from the 12V circuit. The board, working perfectly on the test lab, did not worked at all once in the car. It was completely crazy, self-resetting randomly, stopping the crystal oscillator, etc.
So far, we decided to connect a scope to inspect the board. We NEVER EVER seen so many spikes on the 12V wiring as in a car! We had a long task to filter even the devil flowing on that power line!
The spikes was entering everywhere, especially via the substrate diodes of the chips.
Amazing!

Cheers
Biggest fault of Netduino? It runs by electricity.

#9 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 28 April 2011 - 07:00 PM

A diode could be useful, but I'd never bet a cent as a workaround for HCMOS logic.
You know, any chip has "diodes" internally, because of the substrate. The problem is that diode have a low threshold voltage, usually lower than a normal discrete diode. That mean the current will flow likely through the chip substrate, than the external diode.

I remind a long ago, when we tried to connect a MCU (MC68HC05) board to a car, powered by a 5V regulator from the 12V circuit. The board, working perfectly on the test lab, did not worked at all once in the car. It was completely crazy, self-resetting randomly, stopping the crystal oscillator, etc.
So far, we decided to connect a scope to inspect the board. We NEVER EVER seen so many spikes on the 12V wiring as in a car! We had a long task to filter even the devil flowing on that power line!
The spikes was entering everywhere, especially via the substrate diodes of the chips.
Amazing!

Cheers


You are correct again on both counts :-) A car's 12v system is incredibly noisy electrically.

BTW, I edited the resistor polarity section of your sandbox article to make it (more) grammatically correct for the English language. You make want to check it out to verify that I didn't change the intent.

-dan

#10 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 29 April 2011 - 08:56 AM

Dan, I wish you thank you very very much indeed for the English corrections. That is a point where I want to learn, since I did not study English at school. Everyone has its own weakness! Thanks again PS: are you corrected as British English, American or which one else?
Biggest fault of Netduino? It runs by electricity.

#11 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 29 April 2011 - 06:08 PM

Dan, I wish you thank you very very much indeed for the English corrections.
That is a point where I want to learn, since I did not study English at school.
Everyone has its own weakness!
Thanks again

PS: are you corrected as British English, American or which one else?


Good question, I corrected it to American English. If you want the British version, just throw random "u"'s in there :-)

I hope my humor isn't lost. For example, the American English (AE) spelling is "color", the British English (and Canadian as well IIRC) spelling is "colour"

#12 Gauss

Gauss

    Member

  • Members
  • PipPip
  • 14 posts

Posted 30 April 2011 - 08:55 PM

Thanks for the advice everyone, I know the DC motor is inductive... I think the current limitation is a bigger deal though if you ask me.

It's possible to run very light motors directly from the netduino but with the right schematic it can also be solved in other ways. I connected a 12V DC-motor with a motorshield. There are also servomotor shields, or you could craft your own schematic.


I had considered that but the problem I've run into is that alot of the shields I've found aren't specific on their compatibilities or capabilities so I've been scared to buy. Do you have a recommendation?

I am not sure of the current limitation off hand, but assuming it is too low for that application, the simplest solution would be to get an H-Bridge circuit similar to this one

The input current is in the uA range, so this is very easy to drive. The output of this can drive up to 1A continuously.

It can be purchased here


Not a bad idea, hadn't considered an H bridge at all... Im wondering though if a relay would still be better.

Only problem is uni-directionality

#13 Gauss

Gauss

    Member

  • Members
  • PipPip
  • 14 posts

Posted 30 April 2011 - 08:59 PM

Sorry btw if I wasn't specific, but I am using DC motors for this project... I know servos are a different bag.

#14 Stefan

Stefan

    Moderator

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

Posted 30 April 2011 - 09:09 PM

Sorry btw if I wasn't specific, but I am using DC motors for this project... I know servos are a different bag.

This shield helps on that:
http://sandbox.netdu...tor-Shield.ashx

It can drive a 12V DC motor from an external power source.
"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

#15 mpearson

mpearson

    Member

  • Members
  • PipPip
  • 17 posts

Posted 30 April 2011 - 09:11 PM

Sorry btw if I wasn't specific, but I am using DC motors for this project... I know servos are a different bag.


Same rules apply. Both are inductive loads and as stated before, direct driving them from a logic device is a bad idea. With the H-Bridge, you get current gain and motor direction control.

#16 Beijer

Beijer

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationSweden

Posted 01 May 2011 - 06:14 AM

I don't have any good knowledge about elctronics but i'm learning.
Maybe this two are something you can use (There were someone on this forum that posted them):
http://digital-diy.c...-n-channel.html
http://digital-diy.c...-p-channel.html

Maybe they are something you can use.

#17 Gauss

Gauss

    Member

  • Members
  • PipPip
  • 14 posts

Posted 01 May 2011 - 01:14 PM

This shield helps on that:
http://sandbox.netdu...tor-Shield.ashx

It can drive a 12V DC motor from an external power source.


Oh thank god it has a real technical spec! That's not a a bad shield. Can they be stacked? At first glance it appears as though it only uses 2 of the PWM pins.

Same rules apply. Both are inductive loads and as stated before, direct driving them from a logic device is a bad idea. With the H-Bridge, you get current gain and motor direction control.


Same rule apply potentially, while they can share some of the same things in regard to control and yes are inductive, the solutions for controlling the aren't all the same.

Don't take this the wrong way and I really appreciate all the advice, but can we stop the inductive load thing? It's irrelevant and has been done to death in this thread. I know you don't want to direct drive an inductive load without some type of circuitry, but the current limitations on the pin change fundamentally how I approach the problem because irregardless of the inductive nature of a motor it's the current limitation that is the big issue.

#18 Stefan

Stefan

    Moderator

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

Posted 01 May 2011 - 01:36 PM

Oh thank god it has a real technical spec! That's not a a bad shield. Can they be stacked? At first glance it appears as though it only uses 2 of the PWM pins.

Officially, they can't stack since it uses pins 4 to 7 without an option to switch to other pins.

But if you desolder the headers and connect them at other netduino pins, it's possible to use multiple shields. The sample code I wrote supports configuring other pins then default.
"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

#19 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 01 May 2011 - 03:36 PM

Don't take this the wrong way and I really appreciate all the advice, but can we stop the inductive load thing? It's irrelevant and has been done to death in this thread. I know you don't want to direct drive an inductive load without some type of circuitry, but the current limitations on the pin change fundamentally how I approach the problem because irregardless of the inductive nature of a motor it's the current limitation that is the big issue.

I understand that you are not interested in any electrical argument, but I don't understand what are you looking for...
Either you use a shield to drive a motor, or you have to build your own circuit to drive it.
You cannot connect a motor directly to an output.
Cheers
Biggest fault of Netduino? It runs by electricity.




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.