Dual Motor Controller - Page 1
Forum section: electronics / projects

author: adamhixon
author_rank: Newbie
timestamp: July 22, 2011, 11:22:46 pm
content: First post here. I have been working on a dual H-bridge board driven by a PIC18F2431 (the schematic says otherwise,, I didn't have the proper eagle part layout). Anyway, I am definitely an amateur at all this and I'm quit sure I'v got some rookie mistakes here. I would appreciate any tips on the design. Thanks

author: Psi
author_rank: Super Contributor
timestamp: July 22, 2011, 11:40:23 pm
content: I'm really no expert on motor drivers but how do the PNP's turn off from MCU 0-5V

author: adamhixon
author_rank: Newbie
timestamp: July 23, 2011, 12:25:56 am
content: the MCU is actually going to be a PIC18F2431 or something similar, I didn't have the correct library for eagle so I went with what I had. Pins 21-24 are actually PWM outputs. The H-Bridge design was pretty much copied from:http://www.pyroelectro.com/tutorials/h_bridge_4_transistor/schematic.htmlI think Q1 base is pulled low through T2 and then into Q3 base. As I said, I copied that from the previous link and I don't have any real education here so I may just be babbling.

author: Rufus
author_rank: Super Contributor
timestamp: July 23, 2011, 01:41:03 am
content: Quote from: adamhixon on July 22, 2011, 11:22:46 pmThe rookie mistake is you have VDD and VSS the wrong way round on the processor. VSS is ground or 0v, VDD is the supply.The opto interrupter stuff doesn't look right but we don't know what they are.The bridge circuit looks OKish. The transistors are 10A absolute maximum so it isn't really a 10A bridge. The bridge transistor drive might be a bit marginal. Do you know what your maximum current requirement is, remembering to consider stalled motors.The LEDs on the bridge drive lines put too much load on the PIC outputs. You need to decrease LED current or you could just put them in series with bridge R3 and R4 resistors.The biggest danger with H bridges is turning on both sides at once and shorting out the power supply with possible catastrophic results. It looks like the PWM generator in the PIC you intend to use can mostly take care of that, as long as you get the configuration and software right

author: Psi
author_rank: Super Contributor
timestamp: July 23, 2011, 01:57:43 am
content: Quote from: adamhixon on July 23, 2011, 12:25:56 amhm.. when Q1 needs to be switched off, how does mcu get the Q1 base to +12v.

author: Rufus
author_rank: Super Contributor
timestamp: July 23, 2011, 02:37:20 am
content: Quote from: Psi on July 23, 2011, 01:57:43 amBy turning off T2. If T2 is off there is no Q1 base current which is all that matters. The TIP147/142s are darlingtons with internal base to emitter bleed resistors so the base will be pulled up avoiding any problem from T2 leakage.

author: adamhixon
author_rank: Newbie
timestamp: July 23, 2011, 06:09:37 am
content: Thanks a ton for the help. Wow,,, that Vss Vdd error would have been a headach. Attached is an updated schematic with the suggested changes.A 10A max stall should be plenty for my current application, but thanks for the correction on that H-bridge link. I may have tried to use this down the road for something bigger.I re-did the photo interrupter section here. On the first schematic that I posted, R16 & R17 were being used to drop the voltage a bit for the input. (removed on revised version) I have had trouble with latch-up errors on PIC chips in the past when input voltages were close to the Vdd voltage. Am I just being paranoid here, or could this be a problem?Thanks again! This is a learning experience for me.

author: Psi
author_rank: Super Contributor
timestamp: July 23, 2011, 10:11:02 am
content: Quote from: Rufus on July 23, 2011, 02:37:20 amah, that explains it. i noticed they were darlingtons but i wasn't aware darlingtons have bleed resistors.It all makes sense now

author: Rufus
author_rank: Super Contributor
timestamp: July 23, 2011, 01:26:07 pm
content: Quote from: adamhixon on July 23, 2011, 06:09:37 amLooks better.On the bridge drive Q1/Q3 have a minimum gain of 500 so for 10A maximum you need 20mA of base drive.Q1/Q3 base current is the (supply voltage less 4 x Vbe from Q1/Q3 less T2 Vce sat less the LED voltage) divided by R4 which is about 7.5v/1k or 7.5mA and it will drop if the 12v supply drops. I think R3,4,7,8 should be 390R and make sure the LEDs are OK with 20mA.

author: adamhixon
author_rank: Newbie
timestamp: July 25, 2011, 05:02:30 am
content: Are diodes D1-D8 necessary / used correctly? They were not used in the original H-bridge tutorial that I started from, but I have read elsewhere that they are necessary to handle the inductive charge in the motor. Is this correct or should I just leave them out? Thanks

author: scrat
author_rank: Frequent Contributor
timestamp: July 25, 2011, 08:23:26 am
content: Quote from: adamhixon on July 25, 2011, 05:02:30 amYes, the "free-wheeling diodes" are needed, especially if a high current is driven into a high inductance motor, and placed correctly.The reason is quite simple. If you're driving the motor with a certain current, and have to reverse the H-bridge, the motor inductance will force current to maintain its value, generating an overvoltage on the opening transistor. It's pretty much the same as it happens on the water pipes when you suddenly turn the tap off and it was wide open, you can usually hear the stroke the running water causes on it.

author: ivan747
author_rank: Super Contributor
timestamp: July 26, 2011, 01:32:36 am
content: Quote from: adamhixon on July 23, 2011, 12:25:56 amGo get a L298, save a week of trouble shooting. If it is for educational use, then just ignore me. The L298 will make the whole design a lot easier. Just one package, a single thing stuck on the heat-sink, it has enable pins to leave the H-bridge floating and you can use it directly with 5V logic.