Ok I know this isn't arduino related but I thought I might be able to get some help here.
I constructed this four transistor H-bridge on a breadboard.
I used two pnp and two npn transistors. Also four 1K-ohm resistors
I'm certain it is properly built, because I have two leds (in both directions) in place of the motor terminals.
When one input is set high (opposite set low) one led lights up and when the other input is set high (opposite set low), the other led lights up instead. This tells me it is functioning properly.
However, when I replace the testing leds with a motor it doesn't work!! Why is this??
The motor I am using is a standard worm drive motor. I also tried it with a few of my other model airplane motors and nothing works!
What's wrong here??
Using the transistors shown, you can probably get about 200mA to your motor, which is enough for pager motors, or high-efficiency DC motors. But a lot of "airplane" motors are relatively high-power motors, and it wouldn't surprise me if 200mA didn't make them move at all...
But how would I increase the output current to be suitable for a slightly larger motor??
You use transistors with larger current capability.
I have an h-bridge composed of four 2n3055 TO-3 case NPN power transistors that drives a large 12 VDC gear motor just fine with little effort; I plan on changing out the "high side" (I believe that's the correct side; I need to do some research first) transistors for the TO-3 case PNP complement (I've heard it would work better).
You could also switch to mosfets instead of bipolar transistors (better current capability in smaller packages, and less current draw on the pins of the Arduino). This is also something I am considering.
If you didn't want to go that route, and you can figure out how to do it, you could "parallel" the legs of each of the transistors with the same transistor to double the current capability; this might not be easy on a breadboard, though (it woudn't be easy on a PCB either). This still might not be enough for the motor you want to use.
IIRC the 2n2906 etc will drive about 600mA, perhaps just lowering the resistors to 470 ohm might help - however I think you might risk overloading the transistors - go for ones rated conversatively for the motor loads - and I think you need freewheeling diodes to protect against inductive spikes.
One concern I have is that your design is guaranteed to have shoot-through (both npn and pnp simulateously on on one side of the bridge as it switches). Bipolar transistors driven to saturation like this turn off quite slowly due to minority carriers. For high currents this may cause problems, particularly if switching at high frequencies. Larger power transistors are usually slower to switch... The Arduino can switch in a few nanoseconds, your H-bridge may take several microseconds...
If you drive all four bases individually then you can create some dead-time during switching (you will need freewheeling diodes for then to take the current during switch-over).
But how would I increase the output current to be suitable for a slightly larger motor?
the other option is to use FETs, these have a much higher current capability and burn up less power due to the low turn on resistance. You can even get ICs with H-bridges in them to save you wiring them up.
For example the FAN7382
But how would I increase the output current to be suitable for a slightly larger motor?
Fundamentally, you just use bigger transistors. But whether that means replacing your 390x with something slightly better spec'ed (2n2222a/2n2907a) or something dramatically different (bigger cases, mosfets) depends on just how much current your motor needs. Do you have specs for it, or can you measure current consumption using a meter and power supply?
Unfortunately, those "toy sized" motors (of about 2-3cm on a side) contain motors of wildly varying specifications without much externally-visible differences.
Basically any motor when stalled is pretty much a short-circuit, so you either make the transistors beefy enough to take the short-circuit current the the Rbase value implies or have some sort of extra protection like a fuse or resettable fuse or series resistance. The free-wheeling diodes need to handle the same current too...
Using a transistor as a fuse is not ideal as they give of noxious fumes and need unsoldering!
I know this is slightly off topic, but it does relate to h-bridges:
Can one use an h-bridge in reverse as a way to make a circuit run from a battery regardless of the polarity?
I've been looking at using FETs as a simple way to provide reverse voltage protection, but I wanted to take it one step further and provide polarity invariance. If we connect the battery where the motor typically goes, will we get + and - at the power input terminals, and will we get this regardless of which way the battery is connected? Would this be an easy addition to protect the motor's h-bridge from reverse voltage? Would this work, or am I missing something?
... you could "parallel" the legs of each of the transistors with the same transistor to double the current capability ...
You probably don't want to do this because bipolar transistors can suffer thermal runaway. As a bipolar transistor heats up, its resistance drops, which can cause more current to flow, which heats it up even more. When bipolar transistors are in parallel, they might get asymmetric, and one carries more current than the other, causing it to heat up, carry more current, get hotter, etc. If the first one pops, the other one gets all of the base current drive, and tries to conduct all the current, heating it up, etc. You can protect against this, but it makes things more complex.
FETs don't have the same problem, hence they are easier to parallel up. So, if you want to build an H-Bridge from discrete components, use bipolar transistors with plenty of current capacity, or FETs.
Personally, I'd use an H-Bridge chip because most competent implementations have built-in protection against thermal overload, current-overload, and prevent shoot-through. Some have built-in back-EMF diodes too, like an L293D.