Let's Make Robots!

Dual Y-Bridge (was One and a Half H-Bridge)

I had an idea tonight that is either inspired... or stupid. Please help me determine which. ; j

I was thinking about using one of my new Picaxe-08 processors for a project. They only have 5 I/O ports, three of which can be either an input or an output. However, for my project, I wanted to be able to control two motors and two sensors. Since traditional dual H-Bridge designs would require four processor outputs to control two motors with forward and reverse, that would leave only one I/O port left. Boo hoo.

I began to wonder if there was a way to control two motors in forward and reverse with only three outputs.  I first thought of a simple Y-shaped circuit, which would have the motors sharing a common connector. After monkeying with the idea and reviewing some H-Bridge designs, here is what I came up with:

H2Bridge_Diagram3.jpg

I did not bother with flyback diodes for the back EMF for now. I just want to see if the circuit would work conceptually. If so, I'll look at practical matters like that. 

The logic table for this circuit is below. Note that the output at the top-right of the diagram is an inverted copy of Output 3.

H2Bridge_Logic.jpg

If I haven't overlooked something, this circuit would allow a robot with two motors to drive forward, reverse, spin left, spin right, or reverse to one side. The bottom two logic input settings would result in a condition where two or more transistors in the same leg of the circuit would short out power to ground, and should be avoided.

OK, folks. Fire away! What did I miss? 


Update

Based on Telefox's modification, I have updated the circuit diagram. I have also added base bias resistors and protection diodes.

Dual_Y-Bridge_Diagram1.jpg

Here's the logic table for the circuit.

Dual_Y-Bridge_Logic.jpg

I decided to call this circuit a "dual Y-Bridge". One "Y" is turned on when you enable the "Reverse" line. The other "Y" is turned on when you turn on "Forward_1" and "Forward_2".

In practical application, I'd like to add some logic to make sure the dangerous states are never applied and make this a "smoke-proof" bridge. I'd also have some noise supression capacitors on the motors.


Update

After testing my own and Telefox's "smoke-proof" circuits, we came to the conclusion that they were not working. The good news is that the 2n2222A transistors seemed capable of surviving the short condition I was trying to protect against. Therefore I will just leave the protection circuit out.

Here are some current results for the circuit, using 4xAAA batteries as the supply.

  • One motor forward: ~130mA
  • Two motors forward: ~240mA
  • Two motors reverse: ~220mA
  • Reverse + one motor forward: ~610mA (transistor short condition)
  • Reverse + two motors forward: ~850mA (transistor short condition)

The 2n2222A transistors I used are the high current version of the 2n2222. They seem to withstand the abuse of being shorted. 

 


Update

 

Here's the Y-Bridge implemented on a Picaxe-08 Protoboard.

Blind_Lemon_Y-Bridge1.jpg

Parts:

  • Six (6) pn2222A npn transistors
  • Six (6) 1n4454 diodes
  • Two (2) 1n4006diodes
  • Six (6) 1k ohm 1/8 watt resistors
  • Assembled Picaxe-08 Protoboard
  • Assorted wires, header pins, etc.

Although the initial layout went very well, I ended up having to get creative to provide all the contacts I needed for the motor output pins. I used cut off pieces of component lead to fit into the same contact hole as the Q1 and Q5 emitter leads. This was a pretty ugly hack, but it worked.

You can see the Y-Bridge implemented on Blind Lemon.

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I might be building a 08-bot in near (or far :-) future so this is an interesting topic. I thought I'll give a try for a different approach. I'm not so sure if it's a good one because it's kinda "crippling" a L293D H-Bridge.

The idea is to build a logic to between 08 Picaxe and L293D. I created one logic with 6 NAND gates and another with 2 XOR gates and 4 NAND gates. Here's what I ended up with (08 outputs/logic inputs on the left and L293D/logic outputs on the right side. Click for non-scaled image):
dual_y-bridge_logic.png

And here's the logic table:
dual_y-bridge_logic_table.png

If I try to build this I'll probably try to build the logic using two 4011 quad 2 input NAND gates (DIP14 case). Of course it may get difficult to fit in two DIP14 chips if you are really running out of free space :-) But I think I have enough space anyway.

Here's a nice video of my logic simulation in KTechLab: http://www.youtube.com/watch?v=bM8HI0YTF-A

 

The digital logic circuits are sound.

For my current bot, size is limited, so I wouldn't do this, but I could be a good approach on a different bot. 

Instead of crippling a nice L293D, why not just build the Y-Bridge. (OK, that's a shameless plug to use my circult.)

Good luck!

 

I have successfully moved from breadboard to a Picaxe-08 Protoboard. I was just barely able to fit the 6 transistors, 8 diodes and 6 resistors onto the board and make all the neccessary connections. I actually ran out of contacts and had to do some ugly hacks, but it all fits. I'll probably take some pics and post a blog on it later.

I can go to bed happy. Time for sleep. 

Here' the actual circuit as built. It is working, though we don't know why.

Dual_Y-Bridge_Smoke_Proof_Troubleshoot.jpg

It turns out this circuit does nothing to protect the transistors from a short condition. However the 2n2222A transitors seem capable of withstanding the short, so I'm not going to bother "smoke proofing".

My idea for smoke proofing the Y-Bridge is as follows:

I'll build a single transistor NOT gate to invert the Reverse signal. The output is called Not_Reverse.

Build two diode-resistor logic AND gates. Each will have as its input one of the two Forward signals and the Not_Reverse signal. These logic-modified signals will be used to drive the Y-Bridge.

The Foward_1 and Forward_2 outputs from the uProcessor will be modified with some simple logic to prevent the various danger conditions. I'll call the modified forward signals Fwd_1 and Fwd_2. Basically, I'm looking for:

Fwd_1 = Forward_1 AND Not_Reverse

Fwd_2 = Forward_2 AND Not_Reverse

Dual_Y-Bridge_Smoke_Proof_Diagram1.jpg

The behavior driven by this modification is that if the Reverse signal goes high, the logic above will ensure that Fwd_1 and Fwd_2 are low, even if Forward_1 or Forward_2 (from the uProcessor) are high. Therefore, if I accidently or on purpose set Reverse high, the robot will back up. If it had been going forward or turning at the time, it will stop doing that and instead back up until the Reverse signal goes low again.

While it is a good idea to take it easy on the drive train by not going suddenly from forward to reverse with no stop in between, this circuit is about preventing the motor drive from smoking. I won't program for the sudden reverses on purpose.

I had a similar idea at first, using an extra transistor or two as inverters, but then I realised there's already 2 transistors that are essentially inverting the Reverse signal: Q4 and Q6. 

2Y-Bridge.jpg

When Reverse is pulled high, Q4 and Q6 pull the two Forward signals low via the extra diodes D1 and D2. R1 and R2 are just there to limit current flow and ensure the Forward signals are easily defeated.

OK. I get that when Reverse goes high, it turns on Q4 and Q6, effectively giving you a Not_Reverse signal.

Diodes D1 and D2 are meant to bring that Not_Reverse signal and override the Forward_M1 and Forward_M2 signals. However, I think D1 and D2 need to be turned around with the anodes facing the other way. The way they are installed, I don't think it will work. I'm breadboarding now.

I must be missing something, because the circuit doesn't work with the diodes reversed. The circuit seems to work the way you designed it, I just don't quite understand how.

There is one minor weirdness. When I have M1 going forward, and then raise Reverse high, M1 stops (expected), but M2 turns on in reverse very slowly. The same is true if I am running M2 forward and apply Reverse high. If both motors are running in forward and Reverse is raised, both motors stop immediately.

This may be acceptable, since the purpose of the circuit is just to avoide smoking the transistors, and should not be applied under normal circumstance.

I'll study your circuit a bit more, but I'd appreciate any enlightenment you can shed on why it works. 

Oops, that's what I get for being hasty =)
I've flipped the diodes over in the above diagram.