CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problems in pwm motor control using H-bridge

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
shami81



Joined: 14 Nov 2006
Posts: 4

View user's profile Send private message Send e-mail

Problems in pwm motor control using H-bridge
PostPosted: Tue Nov 14, 2006 1:23 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 1:57 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Nov 15, 2006 12:04 am     Reply with quote

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







PostPosted: Wed Nov 15, 2006 3:31 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Nov 15, 2006 10:57 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group