Need guidance with DC motor controller - PWM & H-Bridge


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2010
    Posts
    12

    Default Need guidance with DC motor controller - PWM & H-Bridge

    Hello all,

    I'm wanting to continue advancing my PIC programming knowledge by taking my recent train controller project to another level. If you have read my postings, and/or assisted me, on my recent project, then you know that I'm a novice in the true meaning.

    I've done quite a bit of reading the past couple days but just haven't found the right starting code for what I'm wanting to do. Maybe one of you can point me to some code that will help jump-start my project.

    I'm wanting to control the speed and direction of the small dc motor in a HO gauge train. The current requirement is less than 1 amp. The max voltage would be ~12 VDC. I would like to use a pot to control the speed and I would use my existing reed switches to control the direction, via the PIC input pins.

    In addition to some pointers to code samples, do you think that I can use a 12F683 or should I go to the 16F684. Of course, any other PIC that is you feel more suitable. What H-bridge IC would you recommend and do you know of any schematic diagrams that you could point me to that might show a PIC interfacing to the h-bridge?

    Thanks,
    Mitch

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The attachment might help.
    Attached Images Attached Images
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave,

    I read that one yesterday and, while I'm not opposed to building with discrete components, the cost is somewhat higher. Also, more components to mount and solder into the pcb.

    The L298HN is an IC that seems to be popular and I have found some circuitry and code to control direction but just need to add the PWM speed control.

    Anyway, the code in Scott Edwards article seemed pretty simple so I wasn't sure if it offered a good smooth speed control. Guess I could breadboard it and see...

    Regards,
    Mitch

  4. #4
    Join Date
    Oct 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    After re-reading some of my search results, I believe that I can modify the code that I found from HankMcSpank...

    http://www.picbasic.co.uk/forum/show...highlight=HPWM

    This will allow me to read a POT and convert that into a PWM output. I should be able to do this with a 12F683 as I only need one channel. If so, then I now need to decide on a IC or discrete components. I am favoring an IC, forgot the part number without re-searching, that only requires one pin for directional control.

    Still would appreciate any input.

    Mitch

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    You could use one BD6220 3 to 36 volts @ 2 Amps with PWM capability.

    See the attached Pdf.

    Cheers

    Al.
    Attached Images Attached Images
    Last edited by aratti; - 11th November 2010 at 15:19.
    All progress began with an idea

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Per your data sheet, the BD6220 is good to 18V @ 0.5A.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    I was referring to the BD62xx series. BD6232 is 36 Volts Max 2 Amps. But you have a choice from 0.5 to 2 Amps


    Al.
    All progress began with an idea

  8. #8
    Join Date
    Oct 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    If I understand the data sheet correctly, the BD622x and BD623x series have a minimum frequency requirement of 20kHz. That would rule out using the PIC internal oscillator, would it not? It also appears that the IC's require 2 channels of PWM for control. If that is true, then the PIC12F683 would not qualify, I suppose.

    The LMD18200 would be great, and it only requires 1 PWM input, except that the cost is more than I want to put into this project - ~$12.00. The BD6232 is less than half the cost of the LMD18200 at ~$5.00.

    So far, I'm leaning towards the popular L298N. It cost about $2.50 and requires just the 1 PWM input and no limitations on the frequency so I could use the 12F683 with internal osc.

    Of course, I may be missing some things so please let me know if that is true.

    Mitch

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts