Thursday, August 11, 2011

Interesting details about H-bridges and MOSFETS

As I said, I salvaged my MOSFETS from old CRT computer monitors.

The T in MOSFET stands for Transistor. FETs, or Field Effect Transistors,
work in a different way than the more familiar BJTs or Bipolar Junction Transistors.

It's more common to use BJTs in applications where you want to use the Linear Region of Operation.  FETs are different  in two important ways:

1)   The Gate terminal has a very high impedance, which means almost no current  flows through it--the voltage you apply to it is basically creating a "field" or an electrical charge, that controls the current flow between the Source terminal and the Drain.

2) FETs are optimized for operation in the Saturation and Cutoff Regions --  completely ON (max current flow) or OFF (zero current flow) between Source and Drain terminals.

MOSFETS DO have a Linear region, but we want to avoid that! We want our MOSFETS to be either all the way ON or all the way OFF.

Why, you ask? First of all, if the MOSFETS don't turn on completely, then
they are limiting the current flow to our motor. Motors need their full design current if they are to put out their full design torque.

Secondly, if the MOSFET isn't completely on, then it is acting like a resistor. It's limiting current flow and therefore wasting some of the power you want to send to the motor in the form of heat.

N-Channel and P-Channel

There are two basic types of semiconductor devices...N-channel and P-channel.

N-channel devices are more common. They are simpler (and therefore cheaper) to manufacture, and they (generally speaking) work better and last longer.

Here would be a good place for a link to some technical discussion of what that's all about. I know I read it somewhere....check back later.

Three major differences between N-channel and P-channel MOSFETS:

  1. N-channel MOSFETS turn On with a positive voltage at the Gate terminal. P-channel MOSFETS turn On with a negative voltage at the Gate terminal.
  2. N-channel devices switch from On to Off faster.
  3. N-channel MOSFETS have a lower resistance when in the ON state.

The MOSFETS I was able to salvage were all of the N-Channel variety. And of that number, most were IRFS640A. Here's a link to a datasheet for them.

There are designs for MOSFET H-bridges that use a mixture of N-channel and P-channel MOSFETS. Said designs have their own particular blends of pros and cons.  One pro is that you don't need a separate, higher voltage to apply to the Gates. But P-channel MOSFETS have some cons both in terms of cost and performance (as noted in above).

You turn an N-channel MOSFET On by applying a positive voltage to the Gate, relative to the Source terminal.

The two MOSFETS located in the lower vertical legs of the H-bridge only require the voltage to be higher than zero (ground) by 4.5 to 7 Volts.

With an N-channel MOSFET H-bridge, the voltage required to turn either of the two top MOSFETS On will be higher than the power supply voltage you supply to the Drain terminals.

Why is that?

To turn the motor On, we need to turn one of those top MOSFETS completely ON.
That would raise the voltage at  its Source terminal, which is connected to the motor, to the value of our supply voltage. But to do that, we need a voltage at the Gate terminal that is 4.5 to 7 volts HIGHER than our supply!


Since my salvaged MOSFETS are all N-channel, that's what my H-bridge uses.  Therefore, I needed some way to provide that higher-than-supply voltage to the gates of those two upper MOSFETS.

After talking with my friend Gus about this, I decided to go with his suggestion to build a Cascade Voltage Multiplier circuit, to convert the power supply voltage (nominal 12 volts) to approximately 21 volts DC.
 
And notice that the gate of one upper MOSFET is wired in parallel with the gate of one lower MOSFET in the opposite leg. The datasheet for any MOSFET should tell you what the upper limit is for just about anything--here we are concerned with the upper limit for "source to gate voltage".

In the case of my N-channnel MOSFET H-bridge, the voltage would need to be high enough to turn that upper MOSFET completely on and yet not high enough to damage its associated lower MOSFET.

In the case of the MOSFETS I used (IRFS640A) the absolute max for Source to Gate voltage is +/-30 volts. So the 21 volts my little voltage multiplier produces is plenty to do the job, and yet well within that limit. 

Some links to useful information

I thought I'd post some links here. Eventually I'll get them strewn throughout my other posts here, to make them relate better to the stuff I'm talking about.

Link 1
 A better MOSFET H Bridge Schematic - The Using MOSFETS Website
Link 2
 H-Bridge Fundamentals « Roko.ca











Monday, August 8, 2011

More about H-bridges


First, a definition of the term MOSFET:

It's an acronym for

Monolithic Oxide Semiconductor Field Effect Transistor

Now you understand why we call them MOSFETs...it's a whole lot easier to say!

For all practical purposes, you can think of a MOSFET as a solid-state On/Off
switch. We control this "switch" by applying voltages to the Gate terminal.

Current flow through the MOSFET will be between the Drain and the Source terminals.


Why is it called an H-bridge?

This arrangement of wires, MOSFETs and a motor can be thought of as looking like an H



The motor you want to control is located in the horizontal leg of the H.

There are four MOSFETS, two in each vertical leg of the H, one above the horizontal leg and one below.

The two upper ends of the vertical legs are connected to the Positive side of your DC supply. The two lower ends are connected to the Negative side.


How Does It Work?

With this arrangement, you simply turn On on upper MOSFET in one vertical leg of the H, and the lower MOSFET in the opposite leg of the H. In doing so, you send current from the DC voltage supply through the motor in one of two possible directions. And as a result, the motor turns in one of two possible directions.

To make the motor turn in the other direction, you turn Off those two MOSFETs and turn On the other two.

You must take great care to turn the correct MOSFETS On and Off in the correct order! If both MOSFETS in one leg are ON at the same time, it results in a DIRECT SHORT TO GROUND, which is a Bad Thing.

Here is an interconnect diagram of the H-bridge circuit I built.



I wish I could claim the credit for the pull-down resistors (thanks FunGus).

The pull-down resistors ensure that in the absence of any voltage applied to the gates of the MOSFETS, they will be OFF. I think of this as a safety measure, a "default condition" --everything is turned Off unless deliberately turned ON.

This also makes it easy to use an SPDT switch to control the direction of the motor. In the drawing you see a box that says "Polarity Reversal" .

Notice that one of the two wires leading to that box ties together the gates of two MOSFETS -- the "high" MOSFET in one vertical leg of the H and the "low" MOSFET in the opposite vertical leg.

And of course the other of the two wires ties together the gates of the other two MOSFETS in each vertical leg.

In this way we ensure that the correct MOSFETs will be turned On and Off in the correct order.

I'm saving the arcane details for later for the sake of simplicity. Things like "it's a bad idea to reverse the motor too fast and/or often", "DC braking" and "free spindown". Baby steps first.

Some images of my work

Very Important Legalese Message:

JUST BECAUSE I take my life in my hands, tinkering with electricity and other  POTENTIALLY HAZARDOUS stuff, does not mean YOU should try to do likewise.

IF YOU CHOOSE TO DO SO, it's YOUR DECISION, and YOU ALONE will REAP THE REWARDS --- OR SUFFER THE CONSEQUENCES. Or some mixture of the two!

I wish you Luck, but don't depend on Luck! Do your homework and CYA at all times!




As you read on you will learn that I salvage a lot of my parts from discarded electronic devices.

What use is a circuit like this? DC motors can be used in robotics projects.

Being able to change the direction a motor turns is pretty important.

Next comes being able to control the speed of the motor.

Next would be the ability to precisely position some mechanical device (like a robot arm).

That involves stepper motors, or some sort of position feedback device. Check back for future news on these subjects.

Also I need to put in a word of thanks to my friend Gus, who is an Electrical Engineer. He helped me get past quite a few of the stumbling blocks I have encountered.

OK, here are some photos of the prototype I've been working on:

This photo shows two groups of four MOSFETS (two separate H-bridges). I salvaged them, the heat sinks and most of the insulated wire from some old CRT monitors.

The supply voltage for this project is a nominal 12 Volts DC. I use a salvaged PC power supply to power up this gadjet.



The motor assembly was salvaged from a printer. I couldn't find any specs on this motor. It may have been designed to run on 24 volts, since that's what the printer's power supply was designed for, but it seems to do fairly well on 12 volts.



The small circuit board visible in the lower left corner is a voltage multiplier (more about this later).
There is a toggle switch mounted to the right of the motor and associated plastic gears, for reversing the motor direction.



A closeup of the voltage multiplier circuit.
This takes the nominal 12 Volts DC and converts it to approximately 21 Volts DC, to drive the gates of the MOSFETS. Why? More on that later.



H-Bridge for DC Motor Control

I got a basic education in electronics in tech school, and I've spent a lot of time working in fields where it came in handy. Now I've got time to play around with some things that have caught my interest.

My first real project was building a MOSFET H-bridge from discrete components, for the purpose of controlling a DC motor. Wiser heads have pointed out "you can just buy a chip that does all that". While that may be true, and easier to do, for me it bypasses a lot of learning opportunities.

Bear with me, I'm very new to blogging in general, but I'll try to post some photos of my work and provide some links to the resources I used, for your edification.