Driving 2 DC motor with pic

Discussion in 'The Projects Forum' started by Chaabane, Nov 30, 2009.

  1. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    Hello,

    I'm working on a project that consist to control 2 DC motors (vehicle),i didn't choose them yet,but they will be about 10-20 V

    for each motor i have to :

    • use H-dridgefor direction.
    • speed feedback
    I'll use a pic to drive this 2 motors,so i need one with 2 separates PWM (not just 2 CCP module).
    what i really need here is some advice,links,ideas... before i start
    especially about wich pic i should choose.i'm using pic16F876 and i can also go for 18Fxx
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    why not the Pic16F887, newer than the F876, and it has 2 PWM modules.... then also use the LMD18200T H-Bridge, or the LMD18201T, (the only difference is one has a output pin for current draw, other does not, but both can handle 55 Volts and up to 6 Amps max current draw).... for speed feedback I would use an encoder to determine RPM's....
     
  3. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    I'll check this pic...and thanks for the details
     
  4. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    about Pic16F887 ,this one doesn't have 2 pwm signal
    it has just ECCP,and it uses to drive H-bridge
    am i wronge ?
     
  5. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    It has the following PWM capabilities:
    so If you are going to drive 2 identical motors with the same PWM, PWM steering sounds like a good way to do this....
     
  6. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    My Mongoose kit has a schematic that drives a Tamiya dual gearbox. It uses the 18F2525 which is a really nice 28pin PIC.
     
  7. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    this mean you can output the same PWM from other pins (up to 4)
    but i want to output 2 different PWM for controlling 2 motors.

    I'll check this one,thx
     
  8. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Then use each individual PWM output, and don't use the steering module, this Pic HAS 2 PWM modules....

    It was just a suggestion since you asked for one. You can also decide this one your own if you take the time and use the resources on the web just like we do, read the datasheets or use Microchips site to find the right uc for your project.
     
  9. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    if you look at the pic16F886 Datasheet.page 126&127

    ECCP (CCP1) use timer2 for PWM mode,and
    CCP2 use timer2 as well for PWM mode
    so you can't generate 2 different PWM signal from this modules

    i went into microchip and in the motor control section, i found

    http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=55&mid=10&lang=en&pageId=74
    (select "Show All Specs" in the top)
    but its not really helpful
    thanks anyway
     
  10. Chaabane

    Thread Starter Member

    Nov 30, 2009
    37
    0
    i have a question :
    this pic (18F2525) can generate 2 pwm ,but they have to be the pwm, coz both use the same timer
    (Datasheet :page 142 :"Both PWMs will have the same frequency and update rate (TMR2 interrupt)."
    so your "Mongoose" can't go right or left.Am I wrong ?
     
  11. luffy

    New Member

    Dec 27, 2009
    1
    0
    hi guys , does someone have the circuit and the program to control DC motor bidirictional from the computer? with usb gate
     
  12. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Both motors get the same period and that's fine, it's the duty that varies the speed (PWM) and that is independent.
     
Loading...