driving a heavy duty MOSFET from a picaxe pin

stocky

Senior Member
Can anyone suggest the best/correct way to drive either a IRFZ34N or BUZ11 MOSFET from a Picaxe 08M?

Can you just drive it direct as per the Picaxe-3 manual Pg7?

Is it better to have a current limiting resistor in the gate line?

Sorta new at *BIG* MOSFETS....sorry if these are dumb questions! Would have been 15 years ago I did the theory and my brain has sort of filed it somewhere where it cant find it...........

Stocky
 

Dippy

Moderator
Depends.
I assume you want to use it as a low-sided switch?

I've only had a quick look at IRFZ34N data.
I would say no, not if you want the 'best' performance from it as a simple high current switch. I assume your external circuit is >5V?. If all 5V you could look into Logic Level MOSFETs.
And definitely NO if you want to PWM it. (Gate capacitance/charge).

There have been numerous discussions on MOSFET driving recently, and so to prevent a long repetitive thread covering old ground I'd suggest you search on "MOSFET" over the last 2 weeks in 'advanced search'.
 

stocky

Senior Member
cheers :)

Basic operation of one will be a simple on/off switch in -VE to drive a "low volt disconnect" feature

Other will be as "shunt" on PV panel - not *exactly* PWM but pulsed at a rate of a few HZ max (on for 0-255ms/off for 100ms)

Will do a search and have a read :)
 

stocky

Senior Member
ok - had a read and also looked at datasheets for the devices listed

I'm reverse engineering a product to a point so have looked at their cct as well - similar ccts - one uses the BUZ11 and the other the IRFZ34N - and both in LOW SIDE mode

both devices have a gate voltage of 2-4v => hence suitable to drive direct from the 08M by the looks

In the existing cct the gate is driven from the "chip" (assuming custom ASIC/MCU) via a 1k resistor with a 120k resistor GATE TO SOURCE - whats the theory behind the 120k resistor?

Also rejigged my code and might use PWM now to drive the MOSFET - will see how it goes!

Stocky
 

Dippy

Moderator
Driving a power MOSFET for pwm? I hope it's slow PWM... good luck.

The only reason I can think of for that resistor is to make sure MOSFET is off if PIC o/p floats or gate floats. e.g. a disconnection or if PIC circuit is powered separately. But as I can't see circuit I'm only guessing.
 

stocky

Senior Member
ok..............more reading

the difference between the BUZ & IRFZ is the switching times

Typical time for the BUZ is 410ns & 127ns for the IRF!
I got those figues by adding TURN ON DELAY, RISE TIME, TURN OFF DELAY & FALL TIME

That equates to a freq of 1.8khz & 7.8khz roughly - i think???

So based on the 08m MINIMUM PWM freq of 3.9khz the IRFZ will be the better selection.....correct???

Or am I still MILES off here?

**reading reading......**
 

stocky

Senior Member
In the existing cct the gate is driven from the "chip" (assuming custom ASIC/MCU) via a 1k resistor with a 120k resistor GATE TO SOURCE - whats the theory behind the 120k resistor?
From the PICAXE manual (doh!)

When driving a FET, a pull-down resistor between the PICAXE pin and 0V is
essential. The purpose of the pull-down resistor is to hold the FET driver in the
correct off state whilst the PICAXE chip initialises upon power up. During this
short initialisation period the pwmout pins are not actively driven (ie they ‘float’)
and so the resistor is essential to hold the FET in the off condition.
 

evanh

Senior Member
Yes, do put the series resistor on the gate and a clamping zenor between the gate and source also. Due to the capacitance of the gate a mosfet kick's back proportionally to the inductance of the load circuit when turning it off.

As for operating PWM, there is a tradeoff between transistor heating and severity of kick back. The faster it is turned off and on the less it heats but the bigger the flyback spike becomes. So, if you have a softer series resistor then it'll heat the transitor more but won't punch the picaxe so hard.

Also, for PWM, if you don't use a logic level mosfet then the 4 volt switching level of a regular mosfet makes the driving current extremely lop-sided with much less available for turning it on compared to turning it off.


Evan
 

evanh

Senior Member
Yep, the pulldown too. That's a Pic thing I guess.

Continuing my spiel: As the frequency goes up you reach a point where the driving current is no longer enough to turn the transistor on/off fully before the next transision. At this point a stronger driver is needed to go further, or a lower capacitance mosfet. There is no ultimate limit.

BTW, 100ns rise and fall time would be 10MHz, not 10kHz.


Evan
 

stocky

Senior Member
just fired up the CRO on the commerical reg - gate is being driven with a PWM signal with a period of 100-120ms (8-10hz??)

maybe a simple loop instead of PWM is in order - back to the code!
 

stocky

Senior Member
ok - code for psuedo PWM loop :)

Code:
SHUNT:                        
    High 2                            'Turn on shunt MOSFET
    MARK = volts - charge_target        'calculate M/S values
    MARK = MARK * 3 MAX 100            ' 
    SPACE = 120-MARK                '
    pause MARK                    'pause
    Low 2                        'Turn off shunt MOSFET
    pause SPACE
    return                    'return to main loop
    end
might not be elegant but at this stage gives me a drive signal close-ish to what commerical unit uses - its somewhere to start!
 

gengis

New Member
Just offhand, you could be miles off . . .
1 microsecond or 1,000 nanoseconds is the period of a 1 megacycle wave.

Turn on and off times give you an idea how long you will be dallying in the linear region - not on or off all the way and generating heat and wasting power. It doesn't relate directly to frequency.

You also need to consider the circuit and how the manufacturer arrives at their figures - it is always possible to tweak the circuit in your favor (as a designer - one hopes the manufacturer didn't get their figures by cheating)

For instance, you want fast? There's a thing called the Baker switch in the National Semi. literature. It was invented to improve bipolar switching times but will work with mosfets too. Instead of letting the gate float down to cutoff or driving it to cutoff - you use a bias supply to drive it below cutoff hard and fast.

Look at the specs for pulse operation - that is usually a better predictor of pwm applicability. Remember you are driving a capacitor (the gate) the charge has to be there quickly - lot of current to move electrons fast and depleted fast - you have to suck the charge off the gate and that still means high current - for a very short period of time.

But you should be able to get it working at a much higher frequency - like tens of kilohertz.

The load inductance and driving circuit (driving voltage) and total power and voltage you are switching would determine the circuit design and ultimately the highest frequency you can use.

You don't give much information about the load . . . or how your axe will drive it
 

Dippy

Moderator
Flooby, yes you are right and it's been covered about 20 times in the last few weeks.

Those £1.50 driver chips as mentioned several times will do the job perfectly, but we can't force poeple to use them :)

Yes, I think Stocky has got his calcs wrong there. Prob an n/m typo. Those sorts of errors can crash a probe into Mars you know.

Just for reference, I'm using a P channel driver and the gate transition times are about 150nS for a pair of 270Ps into 10 Amp load.

I would deff use the on-board PWM. You want to do some tests whilst running e.g. charge current, battery delta etc. Can't see what you've got against it??

What I did was write a sub so that I could just give a percent and the sub works out the correct duty for the specified PWM frequency. Then update the PWM depending on various parameters.

Anyway, I've had enough of MOSFETs, I'm off to paint the lawn.
 

gengis

New Member
Hi Dippy

Yeah sorry, I sometimes forget not everyone in the world is trying to design on the hairy lower voltage potential that the 'axe or a mosfet will tolerate. Some folks have all of 6, even 12 volts to play with!

Second - - direct drive whenever possible. The lowest number of parts that does the job to specification is the ideal.

I think a few of the folks posting, lack a basic understanding of electronics - and that's OK, that is how I learned. With pics, there's a whole generation learning to run without learning to walk - and I envy them - but it is really no different than my own inculcation, it was that exciting for me too so I can empathize.

And perhaps I jump in wax didactic too often. mea culpa.

If you like history read some Maxwell - that's really humbling. He understood the relationships between inductance, impedance, resonance, and resistance - but there were no words to describe what he was observing; yet he could understand it to a formula level in some cases - while trying to explain it with mechanical models. James Clerk Maxwell "A Treastise on Electricity and Magnetism" still in print since 1891 - now it is just formulas we use and think nothing of them.


And yes - I'm drinking home brew Porter, while listening to "Pictures at an Exhibition" that's my excuse.
 

moxhamj

New Member
Re "When driving a FET, a pull-down resistor between the PICAXE pin and 0V is
essential"

Another reason, and a really good one but it isn't in the manual, is that sometimes you build a circuit and the picaxe sits in a socket. And sometimes you might take the picaxe out of the socket - maybe it is zapped, or maybe you want to reprogram it on another programming board. And if the picaxe is removed the mosfet gate would end up floating and whatever the mosfet is driving (eg a motor) turns on. The pulldown resistor is only worth a couple of cents.

Stocky, where is that bit about driving a fet in the manual and using a pulldown? I have searched through manual 3 searching for "fet" and also for "driving" and it isn't there. The schematic on page 7 doesn't show a pulldown. Maybe there is a newer version of the manual that does?
 

stocky

Senior Member
The pulldown info was found in the section for the PWMOUT command in the PICAXE-2 Manual

in answer to Flooby re the load:

The load is simply the MOSFET across a PV panel as a SHUNT.
 
Last edited:
Top