H bridge help

Discussion in 'Embedded Systems and Microcontrollers' started by wewe, Apr 12, 2010.

  1. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    hello , i made a program on PIC to generate a pwm signal to control the MOSFETs on a H bridge to control a DC motor , that was the entire point behind the H bridge but our teacher told me that i must have a dead time or there will be a short circuit , which means that when i control the mosfets 1 & 3 i should turn them off then start mosfets 2 & 4 , but with my PWMs this is done simultaneously which will cause a short circuit according to my teacher , any idea how to make this dead time in PIC ???
     
  2. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    The PICs with a 'Motor PWM' module can generally do the dead time automatically, you just set a register.

    What PIC are you using and what pins are connected to the H bridge stages?
     
  3. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    the pic i am using is 16f877A and the pin connected to the H bridge is pin 17 (which is CCP1 pin) , i only have one pin connected to the H bridge because i will use an inverter wired to the same pin to feed the other 2 transistors of the bridge
     
  4. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    OK, swap whatever inverter you are using for a 40106 and add two more sections between that and the bridge. The 40106 is a hex schmtt trigger inverter.

    Use a series resistor with a shunt diode, plus a cap to ground, on the inputs of the extra inverters.

    Something like 10K + 100pF should give around a microsecond or so delay, with the diode across the resistor so it still turns off instantly.

    That should give a delay at each changeover so both halves of the bridge are off, allowing things to settle. You can adjust the dead time by changing the capacitor values.

    40106 info:
    http://ics.nxp.com/products/hef/datasheet/hef40106b.pdf
     
    wewe likes this.
  5. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    u seem like an expert in these stuff , however english is not my first language and i didn't really understood what you meant
    first things first , i am not using any special functions in the schmitt trigger inverter ???
    and how can i calculate the delay exactly ??
    and what about the PICS which can calculate dead time ?? can u recommend one ??? isn't it easier to use one of those than to make a complex circuit to get a dead time ??
    i know these are lots of questions but i would appreciate any help , and one more question please , programming a 18f pic is the same as programming a 16f pic ?
     
  6. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    If you are OK using a different PIC, look on the microchip web site -

    This is a table of parts that have a Motor control PWM, have a look through to see which have any other features you need:

    http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=55&mid=10&lang=en&pageId=74

    The PIC16 and PIC18 are similar language-wise and you would have no problems using MPLab, but if you program in C you need to check if your compiler supports PIC18. Some do both, some have different versions or options.
     
  7. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    do u know any free compilers that work for pic 16F and pic 18F ???
    i found a project on a DC motor control , but it's on a microcontroller called ATMEGA16 , i don't know if i can find this in my country but i would like to know if these microcontrollers are better than standard PICs ..... here's the link to the project
     
  8. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Sorry, I use the CCS PICC compiler, which is a commercial one.
    It may have a free demo? - www.ccsinfo.com

    Hopefully other users on the board will be able to provide information on others.
     
  9. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
  10. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    okay now before everything i will try this method , if it works then i will not need to swap PICs , which is something i am really trying to do :)
    now if i want to apply this on proteus
    what did you mean by " add two more sections between that and the bridge"
    on the output of pin 17 i will have 2 wires that will feed the bridge , one of them will be connected to the inverter , now i will use a 40106 inverter in place of the normal inverter , then what ???
    and do u know how can i calculate the delay time ?? i am operating on a frequency of 10Khz , which means a period of 100 micro seconds , so i am going to need almost 2 micro seconds as a delay (on each up and down) , do u think it's enough ?? and what about the value of the capacitor
    if u cant help in calculating the delay time just , please, explain to me how to wire the circuit you described above
    now we're talking electronics :D
     
  11. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Rather than feed the exiisting two signal direct to the H bridge, connect each to a 10K resistor and the the other end of the resistor to the input of a new inverter section. Add a diode across the resistor and a 220pF capacitor from the invertor input to 0V.

    The output of that new invertor then goes to the original feed point on the bridge.

    That's what I meant by 'between the invertor and bridge'.

    (So two new R-C + inverter sections, one in each half of the bridge feed).

    The 10K plus 220pF should hopefully give about a 2uS delay in each transition.
    By fitting the diodes the correct way round (depending on the bridge setup), you can bypass the resistors for the turn-off but still delay the turn-on, so you get a dead time.
     
    wewe likes this.
  12. wewe

    Thread Starter Member

    Apr 9, 2010
    31
    1
    thx for the help but i must ask , can i find a driver that does all this without building this circuit , i mean that i will give the driver (IC) the pwm input and i got an output of 2 PWMs that are inverted with the dead time i need?
    i need a driver that does this and that i can find on proteus in order to make a simulation
     
Loading...