PDA

View Full Version : h-bridge problem



vision
- 30th November 2006, 01:01
hi,

I'm a beginner in this amazing world of PICs and I have encountered 2 problems in controlling a dc motor direction...

1. I used this H-bridge to control my motor (see attachments) and works fine while adding a voltmeter across the output but when load it with any load e.g my 9v motor the voltage decreases to a value of 0.01v and couldn't drive my motor.

2. I wrote this program that reads a potentiometer value ,if this value is greater than 12kohms turns the motor CW, less than 12k ohms turns the motor CCW:


device=16f84a
dim R_Value as byte
trisb=%00000001

start:
portb=0
r_value=pot portb.0,153
if r_value > 65 then goto rotate_lower 'Making motor rotate CW
if r_value < 59 then goto rotate_higher 'Making motor rotate CCW

Rotate_Lower:
portb.1=1
delayms 250
goto start

Rotate_Higher:
portb.2=1
delayms 250
goto start


the program worked but instead of comparing the value to 12 k ohms it performs this operation at 1.2k ohms (I have checked my scale!)

any help will be appreciated, thank you :)

skimask
- 30th November 2006, 02:54
Have you tried some Google-ing on the subject yet?
What did you come up with?

mister_e
- 30th November 2006, 03:36
Have you tried to use the right forum?

And your circuit will NEVER work.

AND i suggest you use a newer PIC... not a museum part

AND YES I HAD A BAD DAY :D

SORRY

Armando Herjim
- 30th November 2006, 06:59
I think you should try to make a google search like they suggested. I guess your problem is that your motor requieres more much current (A) that your H-Bridge can handdle... or maybe you just need somo clamp diodes.... try clamp diodes on google...

Good Luck.... to you too stev! ;)

Armando Herjim.

Archangel
- 30th November 2006, 08:32
Hi Vision,
Looks like your schematic has the diodes reversed biased, I'm not sure you even need them try reversing them or jumpering them and see what happens, I haven't even looked at your code, I assumed the others did.
JS
edit
mister_e I see what you meant about using the correct forum, what manner of basic is that? Looks like a cross between c and basic. JS

vision
- 30th November 2006, 14:01
thanks all of you for your replies...

Yes I tried Google search but in vain , Well I'll try again

Actually I thought about adding my question in the schematic forum ,but thought about the PIC problem....

mister_e: why my circuit will never work ? Is there something wrong?
and please don't make your bad day affect your welcome to the newbies :)

skimask
- 30th November 2006, 14:20
thanks all of you for your replies...

Yes I tried Google search but in vain , Well I'll try again

Actually I thought about adding my question in the schematic forum ,but thought about the PIC problem....

mister_e: why my circuit will never work ? Is there something wrong?
and please don't make your bad day affect your welcome to the newbies :)


You tried a Google search...in vain? I just did a quicky and got over 1.43 million hits. I even got 186 hits on the images.

Try again....
JDG

mister_e
- 1st December 2006, 04:02
Sorry Vision for my stupid attitude...

The major problem is the reverse biased diodes for your PNP transistors. AND if you're going to drive inductive load, you'll have to add 4 diodes to avoid back emf.

something like the following is recommended
http://www.mcmanis.com/chuck/Robotics/tutorial/h-bridge/bjt-circuit.html
OR
http://www.bobblick.com/techref/projects/hbridge/hbridge.html

There's also dedicated ICs for that. L293D is popular.. and there's more and more like that.

HTH

welcome to the forum... even if you're using PDS Proton

vision
- 1st December 2006, 19:24
skimask :Thank you for your hint about the google IMAGE search,I didn't even think about it :)

mister_e :Thank you man ;)

I'll inform you about the results

skimask
- 1st December 2006, 22:41
skimask :Thank you for your hint about the google IMAGE search,I didn't even think about it :)

mister_e :Thank you man ;)

I'll inform you about the results



skimask :Thank you for your hint about the google IMAGE search,I didn't even think about it :)

Well, that backfired on me...and I thought I was being a smart ass! Glad you got some use out of it...
JDG

Ron Marcus
- 1st December 2006, 23:29
I use the L293DD for both stepper and DC gear head motors. It is a great work horse, but is there something smaller and or lower power for driving motors up to 100 mA? The Microchip 4424 looks good, but you would need two for the steppers. Any ideas?

Thanks,
Ron

vision
- 3rd December 2006, 00:04
I tried out this circuit and worked fine....

thank you people