H-Bridge PIC query!

Interested in Robotics? Here's the place to be.
Post Reply
User avatar
shaiqbashir
Posts: 7
Joined: Tue Nov 28, 2006 6:07 am
Contact:

H-Bridge PIC query!

Post by shaiqbashir »

Hi guys!

Hope u would be fine out there!

well! i was reading the August 2006 issue of the Servo magazine. Where there was an article related with H-bridges. The author has used PICHV616 as a microcontroller for controlling those H-bridges. He says that there are 4 PWM modules present in this PIC. it is same as PIC 16F616 except of the former one supports higher voltages as well.

My question is this that the PWM modules that the writer has mentioned , are these Hardware PWM modules or simply the PWM ones??

Unfortunately this PIC is not available in my city. So can i go with PIC16F877A which has got two HPWM modules in it. So i can use two PIC16F877A (one for each wheel ) in order to drive my robot??

Using two PIC16F877A will give me 4 HPWm modules. Isnt that true??

Now, is it really true that HPWM allows u to generate PWM commands on the pins while ur Microcontroller can do other operations as well. If i take PIC16F877A which has got two HPWM modules. May i use it two generate two PWMs with different duty cycles from two pins simulatenously???
and while my PIC is generating these two PWMs , will it be able to perform other tasks at the same time??

Remember that im talking about HPWM modules in my pics.

I shall be looking forward for ur precious replies:

take carez!

Good Bye!
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Post by hp »

Some PICs are designed to be motor controll PICs, which means they have the ability to use one or two hardware PWM generators to generate 4 signals for an h-bridge.

The PIC16F87x series chips have 2 hardware pwm channels. Using two in theory would give you 4, but it may not be the 4 that you want (it won't be the same as using the h-bridge mode on the motor control PICs).

Read the datasheets for more information as there are way too many PICs out there to know exactly what each one can do.
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Post by hlreed »

h-bridges have only two inputs, direction and go. So you can drive them from almost any pic. Direction is dc, that is held forward or backward.
So you only need one pulse control. Full on is DC on full. Half speed is pulse is on 50% of the time. And so on.
Harold L. Reed
Microbes got brains
hp
Posts: 245
Joined: Sat Aug 09, 2003 1:01 am
Location: Friendswood, TX
Contact:

Post by hp »

Here is an AppNote for controlling DC motors with an h-bridge that is directly controlled and managed by a PIC16F684. The PIC16F684 has an advanced PWM module which can output PWM signals to directly control an hbridge.

Note that this specific PIC directly controls the mosfet drive transistors in the h-bridge. This PIC does not require the use of a specific h-bridge chip or module. So in this specifc situation, 4 PWM outputs are used (although all must be running at the same frequency and duty cycle).

http://ww1.microchip.com/downloads/en/A ... 00893a.pdf

http://www.microchip.com/stellent/idcpl ... e=en012134
User avatar
shaiqbashir
Posts: 7
Joined: Tue Nov 28, 2006 6:07 am
Contact:

Post by shaiqbashir »

Thanks a lot for all that precious help!

Im getting things now!

Okz so this is quite cleared to me now that we can control one Motor with the help of a PIC16F84A PWM command. What if i have to use a Two-Wheel Differential Drive, i.e. one motor for each wheel, and each motor requires a PWM to go with.

Since in PIC16F84A, there is no HPWM, and i cannot generate a PWM command simultaneously on its two pins. SO in this case i have to go with PIC16F877A isnt it??

Then, if i use PIC16F877A, then i have to utilize its two HPWM outputs which will allow me to generate two PWMs with different duty cycles on its two pins simultaneously. Then i can control my two motors simultaneously using two PWM commands?

am i correct in all above description??

Do tell me about that plz!

take carez!

Good BYe!
User avatar
shaiqbashir
Posts: 7
Joined: Tue Nov 28, 2006 6:07 am
Contact:

Post by shaiqbashir »

Okz but there is a bit problem prevailing as well!

When i was reading the above mentioned PDF, i saw that what they did is this that they generate PWM one by one on two outputs of PIC16F84A, first for controlling the right N-channel Mosfet and then for controlling the left N-Channel. This actually utilizes two separate outputs of the PIC.

WHen i have to drive two motors in a TWO-WHEEL DIFFEERENTIAL drive, what best method could there be?

Obviously one PIC16F84A cannot be enough for me! so should i go for two PIC16F84As , one for each wheel.

If i would go with PIC16F877A then there is a bit problem in it that HPWM can be generated on two fixed pins, so how can i use it two control two MOTORs simultaneously??

I have one idea in my mind, please tell me if im correct or not:

" I would use a PIC16F877A, it has got two fixed pins used for two HPWM. So what i would do is this that i would connect each of my H-bridge with each of this output.

For example i have to drive my right motor, then i would use the 1st HPWM pin to control my right N-channel MOS of the right motor. Then using some relay, i charge the relay and it switches my PWM ping towards the left N-channel MOS of the right motor, now my HPWM will reach that left MOS and the right motor will work in the reverse direction.
Can i go in this way??

DO u guys think that going with a relay is a good option in this case??
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests