Shop OBEX P1 Docs P2 Docs Learn Events
DC Motor speed control — Parallax Forums

DC Motor speed control

Alex41Alex41 Posts: 112
edited 2007-12-22 06:49 in General Discussion
Hello,

I am looking to build a DC motor speed control.

The motor is 12volt, Permanent Magnet. The spec sheet shows just under 6 amps under load, more amperage needed for start up I'm sure. No number is published for the locked rotor amperage.

I would like to control this with a SX-48 using the TIMER function. I'd like to use the adjustable PWM of this feature to control the speed of the motor.

Can I do·this with a few MOSFETS in parallel?

I've thought of·one logic level transistor controlled directly from the SX pin to control 2-3 MOSFETS in parallel to share the amperage of the motor?

I understand Parallax has a HB-25 motor controller,·but would like to avoid spending $50. I figure·I may be able to do this for less than $10 as described above.

Any comments, ideas, suggestions?

I did a search on motor control and didn't find anything directly related to this.

Alex

Comments

  • Brian218Brian218 Posts: 92
    edited 2007-12-09 20:45
    Hi Alex,

    A single mosfet can be used as long as you don't exceed its power rating. Be carefull about handling the mosfets, they can be easily damaged by ESD. It's also a good idea to put a heavy duty diode in reverse bias across the load so you circuit isn't zapped by the motor's inductive kick.

    Try searching for PWM, instead of motor control; there are a number of circuits on the web.
  • Brian218Brian218 Posts: 92
    edited 2007-12-11 08:34
    Hey Alex,

    Check out this link if you haven't already done so. It's on this web site as a down-loadable PDF file of the book "Exploring the SX Microcontroller w/assembly and BASIC programming"

    http://www.parallax.com/Store/Books/SX/tabid/169/CategoryID/43/List/0/Level/a/ProductID/414/Default.aspx?SortField=ProductName%2cProductName

    It has some info along the same lines as what you want to do with the SX.
    It's FREE, which puts it into my price rangejumpin.gif ..BTW thank-you Parallax!
  • crgwbrcrgwbr Posts: 614
    edited 2007-12-16 00:41
    I hate to say it Alex, but you're going to spend much more than $10 to get it built. A motor that draws 6 amps running may well draw 30 at startup (unless you ramp it), and up to 50 at stall. You can get FETs that will handle that amount of current, but you'll need to put a big heat sink on them. Another thing you must take into account is the current draw of the FETs gate. While it won't pull current the entire time its on, during the initial turn on, it can take quite a bit of power to fully saturate the gate (it acts like a capacitor). To accomplish this and prevent feedback, you should put an opto-coupler between the gate of the FET and the SX. My guess for total cost on a project like this is $25-$35.

    Regards,
    Craig

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a duel boot of Ubuntu Linux and Windows Vista. Vista, because it came with the PC, Ubuntu because I like software that works.

    "If Python is executable pseudo code, then Perl is executable line noise."

    "Failure is not an option -- it comes bundled with Windows."

    Use The Best...
    Linux for Servers
    Mac for Graphics
    Palm for Mobility
    Windows for Solitaire
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-16 02:46
    But not just any optocoupler. Something designed for the purpose, like this. (Mouser carries them.) If you're reasonably adept at trace (or wire) routing, the opto is optional, and one of the Micrel driver chips will do fine. Just be sure to connect your motor ground and Vss together at a single point near where the power supplies come onto the board.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/16/2007 2:52:49 AM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2007-12-18 17:00
    I guess I am a little opto happy, lol. I'm sure it normally will work fine without them, but I put them in for a couple reasons. 1) Prevents feedback, even if you're horrible at trace routing (like me) 2) Allows you to completely separate logic power and motor power. All you're logic control can be on one battery, while the other side of the opto can be a completely different battery (not even having a common ground).

    On my motor control boards, I like to put a line down the middle. To the left of this line, is the logic side. To the right of the line is the power switching stuff (mainly the FETs). The only thing that is allowed to cross this line and connect the two sides are the optos, which sit directly on top of the line. Therefore, everything (even ground) is seperate, therefore strictly seperateing the electrical noise from anything that could be messed up by it.

    regards,
    Craig

    PS. Phil, I think the PDF you linked to is dead. It crashed both browsers I tried to open it with.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a duel boot of Ubuntu Linux and Windows Vista. Vista, because it came with the PC, Ubuntu because I like software that works.

    "If Python is executable pseudo code, then Perl is executable line noise."

    "Failure is not an option -- it comes bundled with Windows."

    Use The Best...
    Linux for Servers
    Mac for Graphics
    Palm for Mobility
    Windows for Solitaire

    Post Edited (crgwbr) : 12/18/2007 5:31:42 PM GMT
  • Alex41Alex41 Posts: 112
    edited 2007-12-19 14:31
    Thanks for the replies!

    I'll look into the optocouplers a bit more as they seem to be a popular choice for many.

    My one question is that since the SX pin may have trouble turning on the gate of a large MOSFET, couldn't I put a transistor in between? What I mean is having the pin turn on a transistor which would better carry the current of turning on the MOSFET's gate? And using 2, maybe 3 MOSFETS to handle the current?

    Thanks,
    Alex

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If at first you don't succeed, then skydiving is not for you.
  • crgwbrcrgwbr Posts: 614
    edited 2007-12-21 23:51
    Yes you could. Thats basically what the opto-coupler does. Inside the IC is an LED and a photo-transistor. When the micro turns on the LED, the transistor turns on and conducts power into the gate of the MOSFET. The neat part has to do with the voltage difference. You can use the normal 5v to turn the LED on, and since they're only linked optically, the transistor can conduct a much higher voltage (15v). This is impossible with a standard transistor, but important to the FET that it gets the highest gate voltage possible. Typically, a FET likes a gate voltage of 12v to 15v, so that it turns on fully.

    Regards,
    Craig

    P.S. Don't forget to put a pull-down resistor in the gate. This is very important, as the FET will stay on as long as the Gate (acting like a capacitor) stays powered. The pull-down will drain the power from the gate after you stop supplying power.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My system: 1.6 GHz AMD Turion64 X2, 4GB DDR2, 256MB ATI Radeon Graphics card, 15.4" Widescreen HD Screen

    I have a duel boot of Ubuntu Linux and Windows Vista. Vista, because it came with the PC, Ubuntu because I like software that works.

    "Failure is not an option -- it comes bundled with Windows."

    Use The Best...
    Linux for Servers
    Mac for Graphics
    Palm for Mobility
    Windows for Solitaire
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-12-22 06:49
    I did a motor controller with similar application/current requirements to what you describe:

    system.windows.codeslinger.googlepages.com/motorcontroller2

    I wish that I had known before about that optocoupler that can drive MOSFET's - thanks Phil! I would definitely use an optocoupler next time; it is nearly impossible to filter out all of the spike voltage from the motor switching. I never did get rid of all of it. You can even get spikes back-driven through your gate driver, and I had ground bounce between boards. If I had used an opto to drive the MOSFETs, it would have been much easier to keep the spikes out.

    Also, note that there is an error in my schematic or at least my description of the schematic: I ended up having to use a much bigger filter than I described across the motor; a huge bank of medium-sized capacitors, and 100 watt's worth of power resistors in series with the capacitor bank, to absorb the spikes coming off the motor switching. It probably wastes a lot of power that way but it just goes to show how energetic the spikes coming off the motor can be if you don't tune your MOSFET switching right (as mine is not). Also I did not use Schottky diodes, I used regular ones, and perhaps the slow switching speed of the regular diodes makes them insufficient to absorb switching spikes.
Sign In or Register to comment.