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

Electronic Speed Control question


  • Please log in to reply
10 replies to this topic

#1 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 18 September 2012 - 02:48 AM

Hi, My background is code and not electronics but this is probably a simple question for most of you... I am controlling a DC motor via PWM and a force sensor via Analog input. I map the 0 - 1023 values of the force sensor to a duty cycle of 0 - 100 for the PWM pin. It works fine. Using a multimeter I can see 0 - 3.3v coming out of the PWM as I squeeze the sensor but the motor doesn't move. If I hook the motor directly to a variable power supply it runs just fine on 3.3v. Is there not enough current drawing from the PWM pin or what? If I juice the motor from a different power source how can I make the voltage vary? I'm assuming I need to use an ESC. So if I power the motor via 9v and only want 3.3v do I just set the PWM duty cycle to around 33 for max voltage? If an ESC is what I need are there any recommendations?

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 18 September 2012 - 03:44 AM

Hello Bendage. Connecting a motor directly to any I/O pin is really one of the worst thing you could do. First off, any I/O pin has not enough current to make a motor spinning. The current required is *far* higher than the pin available. This leads to add at least a transistor. Secondly, any voltage variation on the pin (e.g. the edges of the PWM waveform) causes an huge voltage spike, that could damage seriously your Netduino. That's why you see some diode connected by the motor coils. The very simplest circuit you could use is having just one transistor or mosfet, although it has some disadvantage. Take a look at "Mosfet Driver 1": http://www.picotech....ns/pwm_drivers/ A better circuit is the "Mosfet Driver 2", although you can't use it directly because it needs a PWM swinging from 0 to +12V. Seriously, the best way (in terms of time and reliability) is using any ready-to-go module, but I don't know what to recommend, and/or where to purchase. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 18 September 2012 - 04:28 AM

Thanks Mario. You've always been good at responding to my questions. So like a L239D a motor shield would work?

#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 18 September 2012 - 08:54 AM

I guess so. However, you should check whether the driver features match the target motor. Well, "match" maybe is a too-hard constraint...let's say "look compatible". Cheers
Biggest fault of Netduino? It runs by electricity.

#5 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 18 September 2012 - 10:26 AM

So like a L239D a motor shield would work?


It is L293D. The better one is L298Posted Image

#6 Stefan

Stefan

    Moderator

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

Posted 18 September 2012 - 10:39 AM

It is L293D. The better one is L298Posted Image

Could you define in what way it's better?
Both have different specs, but I wouldn't know why one would be better then the other. It depends per application.
"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 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 18 September 2012 - 11:42 AM

Stefan, they are very different. The L298 is a very old product, yet very good. It embeds a double-bridge for either two brushed motors, or one stepper. It allows currents up to 2A (continuous) per channel (thus 4A), but up to 3A/ch peak. The driving is very easy: just feed your PWM signal, and the chip does all the rest. The package is also special, targeted for a good heat-sink. If it was wheeled, the L298 could be a truck. The L293D is much smaller: SO, or DIP-16. That immediately leads to a fewer ability to exchange heat with the environment. A DIP typically does not use any heat-sink. If you take a look, the max current is 0.6A. Internally it is much simpler than the bigger brother: you have to feed a proper-shaped signal, and if you get it wrong, then you'll see smoke on London. Again, if it was wheeled, the L293D could be a city-car. I suspect that most of the difference will rely on the price, though. Cheers
Biggest fault of Netduino? It runs by electricity.

#8 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 18 September 2012 - 11:58 AM

@Mario Thank u very much. The manufactures is moving forward to L298. The L293 is discontinued, but some are available on markets @stefan: I don't have link for latest version L298. It was dating back 5 yrs ago since i started doing pic16F887. U should read datasheet.

#9 Stefan

Stefan

    Moderator

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

Posted 18 September 2012 - 12:13 PM

@Mario: Thanks, makes sense.

@Supra: Normally when someone says: A is better then B, I like it when that person backs up his claim, that's all :)

If I quickly look at the datasheets (L293 / L298) I read that the logic input (Vcc1) of the L293 can only be 4.5-7V. The Netduino logic signals are at 3.3V, so would it work? Or maybe I'm interpreting it wrong ;)
"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

#10 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 18 September 2012 - 12:47 PM

The Netduino logic signals are at 3.3V, so would it work? Or maybe I'm interpreting it wrong ;)


U r not wrong.The logic supply voltage is 7V max. Input and enable voltage is -0.3 to 7V max.
Stefan, I haven't tried it. Because i'm waiting for shield base. It should be arriving next 3 hrs todayPosted Image

What Mario saying that For application with motors reaching currents up to 600mA( 1.2A @ 100us) use L293.

For current up to 2A(3A @100us peak 2.5A repetitive) use L298

Remember that L293 is half w/out heat stink and L298 is dual with heat sink


#11 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 18 September 2012 - 12:57 PM

It may also be used with just about any form of 0 to 5V signal(for exmaple relays, TTL logic gates and manual switches)




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.