Shop OBEX P1 Docs P2 Docs Learn Events
H-bridge circuit? — Parallax Forums

H-bridge circuit?

Curtis BrooksCurtis Brooks Posts: 38
edited 2009-01-10 21:48 in General Discussion
Will someone be so kind as to take a look at this H-bridge circuit for accuracy? I'm looking to develop a cheap high-current circuit and still use PWM. Specifically, did I get the flyback diodes right?

I placed the high-speed Schotkky clamping diodes in the circuit to protect the MOSFET from the CEMF generated by the motor as the power is switched on/off via the PWM signal. This will help keep the FET from generating to much heat and destroying itself. Also, the Optoisolator is a fast-switching type that will help ensure the MOSFET is switched on/off quickly. The opto has a fast rise/fall time. The relays are set up in an H-bridge configuration while the FET is used for the PWM signal. If anyone finds errors in this design please post them.

Thanks,
Curtis

** Updated 04 Jan 09 **

I updated the schematic to add some extra protection and a MOSFET driver. Please review and provide input.

I left the old schematic uploaded as well for comparison

** Updated 10 Jan 09 **

I updated the schematic yet again. I updated the original schematic to show isolation of the logic grounds from the motor grounds.

Updated the schematic for those that want to save an I/O pin. There is a Hex Inverter/Buffer circuit (U1) that feeds the inputs of the Optoisolator (U2). If you look at the wiring for the Hex Inverter you will notice that the output of the second inverter feeds the input of the first inverter. So, when a logic 1 is placed across pin-3 it is inverted into a logic 0 which turns off the Reverse Relay. A logic 0 is also placed at the input of the first inverter which gets converted to a logic 1 on its output and turns on the Forward Relay.

By using the inverter circuit you will no longer have the capability for dynamic breaking. In other words, one of the relays will be active as longs as powered is applied to the circuit. Disabling the PWM signal will keep the motor from turning.

I left the old schematic uploaded for comparison

Thanks,
Curtis

Hobbybotics%20Motor%20Controller_5.jpg

Hobbybotics%20Motor%20Controller_6.jpg

Post Edited (Curtis Brooks) : 1/10/2009 9:49:02 PM GMT

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-01-04 05:06
    Looks good, but kind of weird using relays for PWM... What frequency are you talking about using this for? Thos contacts can only move so fast...
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-04 05:09
    Actually, the relays are only used for direction control. The FET is used to apply the PWM signal. I'm breadboarding the circuit tomorrow for testing.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2009-01-04 05:10
    Philldapill,

    He's using the PWM to throttle the Ground through the Q3... the Relays are for direction control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-04 05:13
    Beau, that is exactly what the circuit is designed to do. Do you happen to see any issues with the design?
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2009-01-04 05:20
    Curtis Brooks,

    I have used something very similar with RC cars that don't need to go in reverse much.... only I use a single DPDT relay for direction with it being energized for reverse.

    The only thing that I can see, and this depends on the intended design, is that you have a HARD electrical brake to the motor when the FWD and REV relays are in the same position. This can cause abrupt stops if your intention is to free-wheel. But as I said it depends on the design, in some cases this feature might be desirable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-04 05:33
    Thanks for the reply. The intentions are to ramp the motor down to a stop and then change the direction as to not have an abrupt stop. Thanks for the suggestions. I put this circuit together as I didnot have any DPDT relays for a simpler circuit. With this circuit my intentions are to be able to adjust the current requirements based on the current limits of the relay and FET. This circuit will operate at about 20 to 40 Amps. The Shotkky diodes and FET will have a heatsink on them. There will also be an inline fuse for further protection.

    Thanks to all for the help,
    Curtis
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2009-01-04 06:02
    Curtis Brooks,

    Should be ok, those FET's are rated for about 50 Amps with an Rds "ON" of 17.5 milli-Ohms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2009-01-04 18:30
    One concern is the 10 kOhm resistor from gate to source of the power mosFET. I'd recommend ~1 kOhm. The fast switching times of less than 10 microseconds for the PS2501 optocoupler are specified for resistance of 100 to 2000 ohms, and the switching time with a 10kohm resistor is more like 100 microseconds. Also the RC time constant of the 10 kOhms with the 1400pF of the transistor would slow down the discharge side of the transition. It depends too on the form/frequency of the PWM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-04 21:00
    Thanks Tracy.

    I was thinking of using a Microchip TC4427 1.5A Dual High-Speed Power MOSFET Driver or TLP250 Photocoupler Power MOSFET Gate Driver instead of driving the MOSFET with the PS2501 optocoupler as it was suggested that it will provide more current to the gate of the FET. Any thoughts on whether this will be better than the current design?

    Thanks to all for the help/suggestions
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-05 04:18
    I updated the schematic in the first post
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-01-05 05:32
    That 1K resistor across gate and source seems a little low... 10K or maybe 100K would work just fine with virtually no current drain.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2009-01-05 16:37
    The driver chip is a good idea for fast transitions both up and down. Be sure to ground the unused inB. With this chip and its totem pole output, there is no need for a low 1k resistor for the pulldown R9, so 10k or 100k would be fine. The LED on the input of the driver chip is going to keep it pulled low anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-01-05 20:42
    Tracy, what if for some reason, the power to the driver fails, or the driver fails and the gate is left floating? Isn't that what the pulldown on the gate-source is for? To ensure the mosfet remains off? I'm just a little confused since the LED does indeed pull the driver INPUT down, but not the gate...
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-06 01:13
    I updated the schematic again. It was suggested by others that by using the MOSFET driver the pull-down resistor on the gate-source to ground was not needed. Any thoughts on this? I suppose that a 10K across it would not cause any problems.

    Also, I hope someone else finds this all useful. I plan to add a Melexis 90217 Hall-Effect Sensor for RPM feedback.
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2009-01-06 08:29
    I'd also probably leave the 100k gate/source resistor in there, just to be sure, however, there is not much(?!) chance that the driver will fail. The driver is powered from the same 12 V supply, so if that goes out, the relays, mosfet and motor will remain off too.

    The TC4427 is an active driver and does need a pulldown on its input in case the PWM input is disconnected or fails open, and in that earlier circuit, the LED with its resistor serve as the pulldown. The TLP250 in the current schematic is a very different beast. It is a glorified optocoupler with internal level shifting and a totem pole output connection. Its spec sheet states that its output will be low when its input LED is off, so the mosfet would be off, as it shoud be, when the PWM input is floating.

    To save parts, I'd be tempted to go back to the original circuit with only the quad PS2501 optocoupler, and use the 4th section as an active pulldown for a totem pole arrangement. When the PWM input is active low, it turns on the 4th LED, which turns on the 4th transistor, which is connected in series with a 270 ohm resistor from gate to source on the power mosfet. Keep the ~10k resistor in parallel direct from gate to source to keep the mosfet off when there is no input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-06 14:11
    Thanks Tracy for the great explanation. Using the original PS2501 with a totem pole arrangement seems to essentially be duplicating what the TLP250 is designed to do in the current schematic. Great idea!

    Thanks,
    Curtis
  • Dennis FerronDennis Ferron Posts: 480
    edited 2009-01-06 16:53
    I did a similar design for my powerwheels robots. Based on what I learned from my project, your design here looks good: you're using optoisolators, Schottky bridge rectifiers on the motor lines, and relays for direction. Very good. Word of advice, if I were you, and if you can manage it with your circuit, I would not even connect the ground from the motor drive to the ground for the optoisolator. I found that the spikes coming off the motor inductions were so strong, they could even back-feed into the logic through the ground, i.e. single-ended like an antenna. If possible, you might want to run your logic from a separate smaller battery and communicated only over optoisolator between the power side and the logic side.
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-06 23:09
    Thanks Dennis, I was not aware that feedback could be induced into the opto from the motor.· I assumed the purpose of the opto was to keep that from happening.

    I see what you are refering to.· Actually the logic grounds from the opto and driver will not be grounded to the same as the motor.· I suppose I should've made that clearer in the schematic.· I will fix it and repost.

    Thanks,

    Curtis

    Post Edited (Curtis Brooks) : 1/6/2009 11:34:38 PM GMT
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2009-01-10 21:48
    I updated the schematic in the first post to reflect the isolation of the logic grounds from the motor grounds. I also added a version that uses a hex inverter to consolidate the FWD/REV signals.
Sign In or Register to comment.