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

controling a MOSFET with PWM??

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



Joined: 18 Apr 2007
Posts: 3

View user's profile Send private message

controling a MOSFET with PWM??
PostPosted: Wed Apr 18, 2007 7:58 am     Reply with quote

Hi all,
I'm currently trying to control a heating element using a MOSFET and tryiong to control the MOSFET using the PWM output on my PIC16F877. I have the PWM working properly or atleast thats what my multimeter tells me, but i'm unsure if the MOSFET is being opened/closed. Any suggustions dealing with this type of thing would be greatly appreciated, thanks.
Matt
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Apr 18, 2007 8:47 am     Reply with quote

Is it a N-FET or a P-FET?
I would build a simple LED circuit.
Then test you can turn it on and off.
then try pwm to "dim" the led.
IRLZ24 spec
http://www.irf.com/product-info/datasheets/data/irlz24.pdf


Last edited by treitmey on Wed Apr 18, 2007 9:43 am; edited 1 time in total
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 8:51 am     Reply with quote

Also depend from power supply the way to drive the mosfet.
I use TLP250 optocopler to drive IRFP250 mosfet.

Regards,
crovex



Joined: 18 Apr 2007
Posts: 3

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 9:17 am     Reply with quote

It's a IRLZ24 product number, I believe its a N_Fet, but i'm not sure. The data sheets arent handy. as for power supply I was using a 12 volt powersource fromthe lab, not sure on the type. and the LED idea is pretty obvisous too bad I never thought it haha. thanks for all ur suggestions.,
Matt
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 9:55 am     Reply with quote

Trying to debug this kind of blind problems using a meter will be a pain.
To preserve your sanity, try to borrow one, but the use of a scope is a must.


Humberto
SherpaDoug



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

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 10:12 am     Reply with quote

That is a hefty MOSFET. What voltage and current are you running through it? What is your PWM frequency? Are you driving the gate directly from the PIC, or using some driver chip or transistor?
The threshold is as low as 1V so at high currents grounding is going to be crucial. Also with the transfer capacitance you will be driving several thousand pF of gate capacitance. You say you are unsure the MOSFET is being opened/closed. Is the heater getting hot? is the MOSFET getting hot?...Is the PIC getting hot?
_________________
The search for better is endless. Instead simply find very good and get the job done.
crovex



Joined: 18 Apr 2007
Posts: 3

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 10:53 am     Reply with quote

i'm sending 12 volts from a power supply and operting the switch with a pwm frequency dependent on temperature. the mosfet itself did get hot at a few points and the heat sink on the pic also become hot to the touch at times.
SherpaDoug



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

View user's profile Send private message

PostPosted: Wed Apr 18, 2007 1:03 pm     Reply with quote

If the FET is getting hot it indicates you are not switching it properly. For driving such a big FET I would use a driver like a MAX627. Read the MAX627 data sheet to see what it will do for you.

If the PIC is getting hot it implies something is REALLY wrong! The PIC should not need a heatsink. I would guess you are getting some sort of voltage spikes from the FET into the PIC causing problems.

1) First try dimming a LED as previously suggested.
2) Then add your FET and use it to drive the LED and make sure you can still dim the LED.
3) Finally put the heater back in and see if you can control that.
_________________
The search for better is endless. Instead simply find very good and get the job done.
mikebroom
Guest







Driving FET
PostPosted: Thu Apr 19, 2007 12:47 am     Reply with quote

Is the FET in the high side, or the low side of the circuit. i currently drive IRFL640 FET using PWM at up to 24V an 5A without any problem in a low side switch configuration.
Low side switching is +V connected to device-negative of device connected to FET Drain, FET Source connected to 0V.

Include a 10R resistor to the FET from the PIC, and a 10-100k pull down resistor from the gate to 0v. Depending on your switching frequency also try using a 4R7 resistor in series with a 47pF capacitor from the FET Drain to 0v.

Connecting the FET in High side switching configuration (+V to FET Drain, FET Source to device +, device - to ground) can occasonally result in voltages appearing on the gate of the FET. These will be higher that the PIC 5v. Also in this configuration you will not be able to turn on the FET to full power without a driver, as you have to apply a higher gate voltage than you have on the Drain to swutch the FET full on.
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