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 support@ccsinfo.com

driving a DC motor

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



Joined: 09 Mar 2004
Posts: 52
Location: Greater Manchester - UK

View user's profile Send private message

driving a DC motor
PostPosted: Fri Aug 20, 2004 6:21 am     Reply with quote

Hi friends,

I need a bit of help regarding driving a motor.


If I connect a PIC to the base of a NPN transistor via a resistor, and the
motor connected between +vcc and the collector
(transistor configured as a switch)

If I turn the transistor on, then current will flow causing the motor to come on.

I know how to calculate to make x amount of Ic to flow, how do I know what the voltage is being supplied to the motor??

If am using PWM on the base of the transisotr, what voltage will appear across the motor???

I hope you can understand

THANK YOU
[/img]
_________________
Best Regards
Ttelmah
Guest







Re: driving a DC motor
PostPosted: Fri Aug 20, 2004 7:01 am     Reply with quote

asjad wrote:
Hi friends,

I need a bit of help regarding driving a motor.


If I connect a PIC to the base of a NPN transistor via a resistor, and the
motor connected between +vcc and the collector
(transistor configured as a switch)

If I turn the transistor on, then current will flow causing the motor to come on.

I know how to calculate to make x amount of Ic to flow, how do I know what the voltage is being supplied to the motor??

If am using PWM on the base of the transisotr, what voltage will appear across the motor???

I hope you can understand

THANK YOU
[/img]

First remember that no transistor is 'perfect', The hfe figure is only a guide, and so the current that will actually flow for a given base drive, will _not_ be what you expect, unless you add a feedback circuit round the transistor (this can be as simple as a small emitter resistor, so that as the current drawn rises, the effective drive falls).
Secondly, if you are adjusting the base current, then the transistor will be acting as a resistor, and need to dissipate a significant amount of heat. As the transistor heats, it's hfe will change.
Instead, supply enough current to the base of the transistor, that it switches fully on. The voltage at the motor, will then be the supply voltage, less the diode drop in the transistor. The transistor then dissipates the least heat (the diode drop, times the current being drawn, times the 'on' percentage, plus the losses while swicthing on and off). You can then regulate the power generated, by using PWM. PWM on a motor, is a lot more complex than it looks, because of the behaviour of the motor (as you chop more slowly, the motor will actually drive harder in the 'on' periods, because of the inductive nature of it's coils). A useful guide is at:
http://www.4qdtec.com/pwm-01.html

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Aug 20, 2004 7:05 am     Reply with quote

First you need a catch diode across the motor with cathode to the motor +vcc terminal. Without that diode when you shut off the motor it will generate a voltage spike that can damage the transistor and maybe other things on the +vcc bus.

When the transistor is ON (saturated) the motor will see the +vcc voltage minus the saturation voltage of the transistor. The saturation voltage you get from the transistor datasheet knowing the aproximate collector current, base current and temperature. Generally for small transistors it will be 0.2V to 0.5V, 1V for darlington transistors.
_________________
The search for better is endless. Instead simply find very good and get the job done.
dbotkin



Joined: 08 Sep 2003
Posts: 197
Location: Omaha NE USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Aug 22, 2004 8:45 pm     Reply with quote

I'd suggest using a MOSFET rather than a bipolar transistor for this, by the way. Especially for driving small DC motors - I often use a 2N7000, or even two of them in parallel.
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