View previous topic :: View next topic |
Author |
Message |
shami81
Joined: 14 Nov 2006 Posts: 4
|
Problems in pwm motor control using H-bridge |
Posted: Tue Nov 14, 2006 1:23 am |
|
|
HI all,
I am working on a project the details are given below,
DATA=
i am using pic 16F877 and i intend to count the rpm of a motor and then change the speed using PWM generated by CCP module of the PIC. I will use H-bridge IC L298 for running the motor in both directions.
what i have done till now==
i am able to count the rpms no big deal, i can generate one PWM signal using the CCP module of PIC.
PROBLEM==
The problem is that i need two different (different in phase) signals to drive the motor in two different directions using the H-bridge. I am unable to find a way to generate another PWM signal which is exactly out of phase from the one generated by CCP module.
waiting for your response. _________________ Never let the fear of losing stop you from playing the game ;)
Regards
Ehtisham |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Nov 14, 2006 1:57 pm |
|
|
My suggestion is to get an H-Bridge chip that's easier to use.
Try the LMD18200. This chip will accept a single PWM output
from a PIC. It costs more, but it's easy to use. |
|
|
shami81
Joined: 14 Nov 2006 Posts: 4
|
|
Posted: Wed Nov 15, 2006 12:04 am |
|
|
thankx PCM programmer,
i have found that very easy to use but as i am in pakistan the availibility of this chip is a problem. i have to get this from some other country which is not possible at the moment coz i have a very short time left for this project.
Can you please suggest any other ideas? Waiting for your reply. _________________ Never let the fear of losing stop you from playing the game ;)
Regards
Ehtisham |
|
|
Ttelmah Guest
|
|
Posted: Wed Nov 15, 2006 3:31 am |
|
|
The other simple answer, is to use a logic gate to give the inversion. If something really simple like a 74LS04, is not available, a single transistor can be wired to do this.
If you were using the 877a, then you can wire the comparator to behave as an inverter. It is possible to develop an inverted PWM, using the CCP, with an interrupt, in CCP mode, rather than PWM mode, but there will be too much latency between the inverted signal, and the +ve one, for this to be really 'comfortable'
This is a case, where a hardware solution, is really needed/better.
Best Wishes |
|
|
shami81
Joined: 14 Nov 2006 Posts: 4
|
|
Posted: Wed Nov 15, 2006 10:57 pm |
|
|
thanks again for showing your concern, can you please guide me how to use the CCP module in other mode that you have mentioned. I am a bit new to this PIC world so i will be very grateful if you tell me how to use the CCP module in some other useful mode. _________________ Never let the fear of losing stop you from playing the game ;)
Regards
Ehtisham |
|
|
|