Author Topic: Dual Motor Controller  (Read 5428 times)

0 Members and 1 Guest are viewing this topic.

Offline adamhixonTopic starter

  • Newbie
  • Posts: 6
Dual Motor Controller
« on: July 22, 2011, 11:22:46 pm »
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
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Dual Motor Controller
« Reply #1 on: July 22, 2011, 11:40:23 pm »
I'm really no expert on motor drivers but how do the PNP's turn off from MCU 0-5V

« Last Edit: July 22, 2011, 11:59:16 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline adamhixonTopic starter

  • Newbie
  • Posts: 6
Re: Dual Motor Controller
« Reply #2 on: July 23, 2011, 12:25:56 am »
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.html

I 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.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Dual Motor Controller
« Reply #3 on: July 23, 2011, 01:41:03 am »
I am definitely an amateur at all this and I'm quit sure I'v got some rookie mistakes here.

The 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 :)
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Dual Motor Controller
« Reply #4 on: July 23, 2011, 01:57:43 am »
I 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.

hm.. when Q1 needs to be switched off, how does mcu get the Q1 base to +12v.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Dual Motor Controller
« Reply #5 on: July 23, 2011, 02:37:20 am »
hm.. when Q1 needs to be switched off, how does mcu get the Q1 base to +12v.

By 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.
 

Offline adamhixonTopic starter

  • Newbie
  • Posts: 6
Re: Dual Motor Controller
« Reply #6 on: July 23, 2011, 06:09:37 am »
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.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10234
  • Country: nz
Re: Dual Motor Controller
« Reply #7 on: July 23, 2011, 10:11:02 am »
hm.. when Q1 needs to be switched off, how does mcu get the Q1 base to +12v.

...The TIP147/142s are darlingtons with internal base to emitter bleed resistors so the base will be pulled up...

ah, that explains it. i noticed they were darlingtons but i wasn't aware darlingtons have bleed resistors.
It all makes sense now :)
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Dual Motor Controller
« Reply #8 on: July 23, 2011, 01:26:07 pm »
Attached is an updated schematic with the suggested changes.

Looks 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.
 

Offline adamhixonTopic starter

  • Newbie
  • Posts: 6
Re: Dual Motor Controller
« Reply #9 on: July 25, 2011, 05:02:30 am »
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
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Dual Motor Controller
« Reply #10 on: July 25, 2011, 08:23:26 am »
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

Yes, 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.
« Last Edit: July 25, 2011, 08:29:42 am by scrat »
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2046
  • Country: us
Re: Dual Motor Controller
« Reply #11 on: July 26, 2011, 01:32:36 am »
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.html

I 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.

Go 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.
« Last Edit: July 26, 2011, 01:34:30 am by ivan747 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf