Sunday, April 3, 2011

H-bridge trouble

Instead of just buying one off the shelf, I decided that I should try building a H-bridge myself. I do not have any experience actually designing one myself so I thought this would be a good experience. I later found out that it was not as easy as it looked. I was able to successfully drive a motor, but there were also many problems.

Here is a list of problems I ran into:
  1. Power supply affected by switching FETs > microcontroller resets :(
  2. PWM heats up the board (also doesn't work)
  3. Slow response of motor (~0.5 sec) > definitely why PWM doesn't work
(problem 1): I solved this by adding a separate power supply to the robot. This is not ideal since the robot can't support a large load.

(problem 2): This is possibly caused by two reasons. The first is that we may be switching the FETs in a bad order, causing a momentary short-circuit in between switches. The second is that I need to include a flyback diode. I believe that this is most likely the cause even though in the datasheet they say there is an internal diode (some times datasheets lie {also the diode's current tolerance may be under-spec}).

(problem 3): Having taken a course on control theory (doesn't help much), applying our knowledge we have decided to blame the time constant of the system. There are several issues that may be contributing to the slowness. I haven't removed the pull-up/down resistors from the gates from when I was testing it (to avoid floating inputs). In order to save power, I made them very large (100k Ohm), which means that the RC circuit created by the parasitic cap in the FET and the resistor has a massive time constant. The other problem may be that we are driving the motor at a voltage far off from what it's meant to be used at. It's also possible that the drain-source voltage of the FET is smashed (FET no longer in saturation region) and needs time to recover.

about flyback diodes: flyback diode wiki