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


Closed Thread
Results 1 to 8 of 8

Hybrid View

  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.

Members who have read this thread : 0

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