# A mosfet linearity problem

#### q12x

Joined Sep 25, 2015
1,634
This is my main problem and explain to me or give me other circuit examples that will hopefully resolve this linearity issue. IF possible.
Thank you.

Last edited:

#### Alec_t

Joined Sep 17, 2013
14,227
That is never going to be very linear. The best way for speed control is using pulse width modulation (PWM). This essentially switches the motor supply rapidly and repeatedly between on and off. The ratio of on to off durations (the duty cycle) is varied to vary speed.
There are many PWM modules available cheaply from online suppliers. Search for 'PWM speed control'.

#### Papabravo

Joined Feb 24, 2006
21,022
I'm not sure what kind of "linearity" you were expecting. Drain current, Id is proportional to,

$$(V_{gs}-V_{th})^{2}$$

Pretty tough to make a quadratic function linear. Where did this quaint notion of linearity come from?

#### LowQCab

Joined Nov 6, 2012
3,946
Here's a DIY version ...........
If You don't understand how it works, or you're just interested in why certain parts were chosen,
please leave a post with your questions, I'll be glad to explain any details or optional parts.
This Circuit works equally well when re-configured as a "High-Side" Controller by changing to a P-FET Transistor.
( High-Side = switching the Positive-Supply, instead of switching the Ground ), ( the control-Pot will then work in reverse ).
.

Last edited:

#### DickCappels

Joined Aug 21, 2008
10,123
@LowQCab , your circuit would be much more helpful if you provided a "how it works" description so others don't have to dope out the concept by reading the schematic and maybe guessing incorrectly. Just a thought.

Since, with DC motors RPM is usually directly related to the voltage across the motor, I would sense the voltage across the motor and compare it with the output of a pot and adjust the gate voltage appropriately via an opamp error amplifier.

Even better would be if you could use a tachometer for feedback and then a simple phase locked loop would deal with it nicely.

#### q12x

Joined Sep 25, 2015
1,634
Here's a DIY version ...
First, thank you for the circuit. (I want to see it working normally, and then we will discuss what it does)
I build your circuit on my breadboard. It kind of worked, but poorer than my simple test circuits.
If I touched with a wire, these 2 points (bypassing the potentiometer) the motor and LED got up to 100%.
If I touched the other point, the motor and LED got up to 90%. Very small range.

It has a very poor range. That's the conclusion. I triple check the circuit connections, all the values and connections are correct.
Now, if I am using the breadboard, it may be a error connection from the holes in the breadboard... thats why I jiggle everything multiple times and nothing changed. So the breadboard connections ...lets say are good enough.
I failed to mention the Mosfet I am using: is a SMD SOT-32 Mosfet marked A09T - datasheet
The opamp I used is DIP8 LM358 - datasheet

Maybe this particular A09T mosfet im using is not that easy to liniarize its gate? I know the transistors are made for 2 major purposes - to switch and to amplify. Maybe my transistor is made more towards switching and less for smooth gate commands? These are my guesses, and I know 'something', not everything for sure.

Last edited:

#### LowQCab

Joined Nov 6, 2012
3,946
The Circuit I provided was designed around certain Components that were chosen based
on their particular Specifications.

There's not really any such thing as "generic" Electronic-Components.
EVERYTHING has particular Specifications,
and You need to learn how to interpret what those Specifications mean so that You
can determine ahead of time whether-or-not a part is likely to be suitable for a particular function.

The FET that You provided a number for is a Transistor that was contracted-for by a device manufacturer.
It is not readily available for sale as an individual part by a major manufacturer, ( as far as I know ),
therefore, it doesn't have a readily available Specification-Sheet, ( at least that I can find ),
so there's no way to tell if it might behave as expected in the proposed Circuit.

The Op-Amp that You are using is a ~40 to ~50-year-old design,
that is loaded with all sorts of quirky behaviors that nobody really wants,
but they will sometimes "tolerate" those quirks because it's dirt-cheap and obtainable anywhere.

There's a remote chance, that with an Oscilloscope, and enough troubleshooting,
and parts shuffling, You might get it to work with these parts,
but I'm guessing that You don't have an Oscilloscope to play with.

With the Parts that I specified ............
which are less than ~\$10.oo, with shipping, from DigiKey-Electronics,
( and probably every other proper Electronics-Supply-Company that You can name ),
............the Circuit will work perfectly as shown.
( as long as the Fan in question doesn't draw more than about ~1.5-Amps,
You didn't specify a Fan-Current-Rating, so I'm just guessing that it's less than that ).

You never know what You are going to get when it comes from China.
...........................................................................................................................................................................

"" Maybe this particular A09T mosfet im using is not that easy to liniarize its gate? ""

It is not possible to "Linearize" a MOSFET's Gate behavior.
But it is possible to build a Circuit, ( that uses a FET ), that behaves in a Linear manner.
But this Circuit is not a "Linear-Circuit",
but the end-result of the Circuit is apparent Linear-Speed-Control of the Fan-Motor.

The FET in this Circuit is being "switched"
completely "On", and then, completely "Off",
roughly ~714 times per second,
(~714-Hertz ), ( 714-cps, cycles-per-second ).

The amount of time that the FET stays in the "On" condition,
is variable from "zero-percent", to, 100% of the time, in each cycle,
this is the actual definition of "Pulse-Width-Modulation", or PWM.

The FET is virtually never "part-way-On", or, "part-way-Off".
( actually there is only an extremely short period of time when the FET is "in-between" "On" and "Off",
nothing is actually "instantaneous", just very very fast )

The "Average" amount of time that the FET stays "On"
determines the "Average" amount of Power being delivered to the Fan-Motor.

Can You get the specified FET and Op-Amp ?
Do You have other parts that You might be able to use ?
.
.
.

#### q12x

Joined Sep 25, 2015
1,634
to @LowQCab I get all your points, and no, I dont want to buy other components. I already have a good stock of these A09T and I have to learn how to properly drive them. That was the whole point. I did provide a datasheet for this specific transistor, in my post before. I know is a weird one, but it was very cheap and in good quantity and also with good specs. Please take a look into the specs I provided. This circuit is working at roughly ~714 times per second, as you said and when I look into A09T specs, it says... 1 MHz = 1000000 cycle/second...hmmm it should have no problem with your fv. I do get what you are saying, that the PWM is ON and OFF periods, but.... very weird. I do have a DSO138 "Gold edition" osciloscope, and also a transistorized oscilloscope from ~1960 probably, it was a teaching osc in school with some very basic functions. But it can see the 240VAC waveform ! Thats why I keep it. Haha. Yes I have some means to look and analyze. I get your point... I will update you with the results from the oscilloscope then.

#### LowQCab

Joined Nov 6, 2012
3,946
.
There are hundreds of different "versions" of the LM-358 Op-Amp ........
Here is a "modern", "updated" and "improved" version ........

Even though this is an improved version, it's still incredibly SLOW,
it's so slow, ( 0.5-V/us Slew-Rate ),
that it might even tend to cause overheating in the FET that it is driving.
( the LM-6142 Op-Amp has up to a 30-V/us Slew-Rate, that's 60-times faster than the LM-358 )

Also, while the Sourcing-Output-Current is probably sort-of acceptable, at ~30ma
the Sinking-Output-Current is not acceptable at only ~20ma,
( the 35ma Output-Current of the LM-6142 Op-Amp that I suggested is just barely adequate )
and anything less will require an additional Current-boosting FET added to the Circuit.

Also, a 300-Ohm "Open-Loop-Output-Impedance" for the LM-358 is way too high,
whereas, the LM-6142 Op-Amp can drive a 1000pf Capacitive-Load without getting into Oscillation problems,
( the Gate-Capacitance of the FET I recommended is only ~300pf ),
this means that the LM-6142 Op-Amp could probably drive the Gate without any "Gate-Resistor" installed,
and be quite happy doing it.
I'm not so sure about your particular "generic" LM-358 Op-Amp working under those conditions,
it will probably over-heat the FET, and possibly smoke it.

I can't comment on your odd Chinese "AO9T" FET until I see a Spec-Sheet for it.
This is the best I could do ........
It seems that there are at least 3 different FETs with a case marking of "AO9T",
and they have substantially differing Specifications,
( one of them is quite acceptable for this project, the other 2 are a little sketchy ).
Do You really know what FET You are trying to use ?
.
.
.

#### q12x

Joined Sep 25, 2015
1,634
Yes, I put the direct link to the datasheet and it worked for me, but it doesnt for you? Thats not good. Here is the link to the page containing the datasheet then: A09T - page with datasheet . I only have the transistor marking as a guide, I literally searched and find anything it pop out on the internet for datasheet. So your characteristics guess are good as mine.

I made a video for you and explain everything in it, the behavior of your circuit and the results I got.
It didnt worked for a long time, but your suggestion to use the osciloscope was genius! It really helped and confirmed that the circuit is working and in what parameters. The circuit is still not good, still not doing the maximum and the minimum balance speed of the motor or led luminosity. We have to tweak it more.

#### LowQCab

Joined Nov 6, 2012
3,946
There is nothing that needs to be "adjusted" in the Schematic.

This Circuit will NOT WORK with a 5V-Supply and a LM358-Op-Amp.

The poor performance of the LM-358 is the entire problem,
( if all other Components are exactly as shown ).

Here are the Waveforms and Voltages that You will see when using a LM-6142 Op-Amp ................
.

#### dl324

Joined Mar 30, 2015
16,720
A09T - page with datasheet . I only have the transistor marking as a guide, I literally searched and find anything it pop out on the internet for datasheet.
At least the datasheet included the marking they use. It seems to be comparable to Alpha & Omega Semiconductor's AO3400. I think the marking they use is A01T.

#### Attachments

• 472.2 KB Views: 3

#### LowQCab

Joined Nov 6, 2012
3,946
The only MOSFET parameter that makes any difference in this Circuit is the Gate-Capacitance,
( and possibly the maximum Gate-Voltage,
because there are some FETs with a max Gate-Voltage less than ~12-Volts, which might be damaged ).

A very high Gate-Capacitance can severely slow-down the Switching-Speed,
and this can cause over-heating of the FET.
With this Circuit, as it is,
there is very little Current available to drive the Gate-Capacitance, ( ~35ma ),
so only very small FETs will work satisfactorily.

This means that "guessing" that this "might be" the correct Spec-Sheet is not a good plan.
Although, the Thread-Starter does have an Oscilloscope for checking the Gate-Drive waveform.
.
.
.

#### crutschow

Joined Mar 14, 2008
34,058
Below is the LTspice simulation of a simple PWM circuit that uses one CD40106 hex inverting Schmidt-trigger buffer package.
One buffer is connected as a relaxation oscillator with duty-cycle adjustable from a <5% to >95%.
Five of the buffers are connected in parallel to help drive the large MOSFET gate capacitance.
(Connecting the buffers in parallel should not be a problem since all the buffers in one package should be pretty closely matched.)

Note that the average simulated motor current for the shown 50% duty-cycle is about 1/2 of the 1A full-on motor current, as expected.

Last edited:

#### q12x

Joined Sep 25, 2015
1,634
Thanks to your hint to use the oscilloscope, and also thanks for the multiple circuits that gathered here to enforce the point of using a PWM, I searched for myself a PWM circuit using a 555. Everything is working Excellent now. Thanks to you guys! Now is completely turn down and completely up. Although remains some "spikes", is never flat 0 or flat 12V. I played with PWM in my life but not that much. Thank you for pointing me in the right direction using PWM for driving both a mosfet and a motor (through the mosfet).
Here is the circuit I used, tested and working. The only different component that I used was 1nF for C1 instead of 10nF as in the original circuit. But that is purely because the noise of the motor switching so fast, was creating a very high pitch noise, very irritating to hearing. So by changing that capacitor, the noise is somewhat there, but is negligible, is not a nuisance anymore. At least with my test motor that I used. It my vary with other motors.

Last edited:

#### LowQCab

Joined Nov 6, 2012
3,946
You need to be cautious about how high You make the Frequency.
As the Frequency goes up,
the amount of time for the FET to Switch completely,
goes down.
This can cause the FET to get really hot and the whole Circuit to do strange things.

There is another bonus to using a 7555,
as it has ~3 to ~4 times the Output-Current of most Op-Amps,
this will speed-up the Switching process by ~3 to ~4 times.

Always check the Switching-Waveform at the FET-Gate to make sure
it's nice and square, and doesn't have excessive "ringing" or oscillations.
.
.
.

#### q12x

Joined Sep 25, 2015
1,634
I just finished the circuit drawing.
Also you can see it here, in my art gallery on devianart website.

Last edited:

#### ElectricSpidey

Joined Dec 2, 2017
2,753
Why are you showing a buffer gate symbol on the output of the 555? Is that an actual component?

And I would think the gate resistor is too high of a value.

#### q12x

Joined Sep 25, 2015
1,634
Why are you showing a buffer gate symbol on the output of the 555? Is that an actual component?
And I would think the gate resistor is too high of a value.
Haha, that is an arrow from the original drawing. I should change it, right? Yes, the image is updated now !
That value might be even 100k for security reasons. I destroyed a transistor by simply linking the pin3 directly to the gate and I swear I could see a white smoke, it was an intense light from my lamp in the vicinity and I could barely see it. I also burned a second transistor by overheating the pads he got soldered. I presume the gate again was the sensitive pin to soldering overheating. Although I know all this stuff, I still make mistakes. Im not doing it routinely enough, thats why.
So 10k, in my experimentation, is optimal.

Last edited:

#### DickCappels

Joined Aug 21, 2008
10,123
If you have failures in the circuit, particularly the MOSFET, remember:

100 or 200 ohms are a more common values for the gate resistor. A large resistor will, as LowQ mentioned in post #16, slow down the MOSFET's switching speed and likely lead to over heating. If it is a cheap MOSFET maybe not a worry, you can always find the optimum value by experimenting.

The characteristics of your motor are not well understood. If there is little inter-winding capacitance or little in the way of high frequency eddy current losses the turn-off spike across the motor may be faster than a 1N4007 can clamp. 1N4007's are cheap these days, but so in a 1N5819 or other fast diode.

If the NE555 is going to be socketed a pull-down resistor of 10k or so from the gate to ground will keep the gate from floating if the socket goes bad or operation is attempted without the NE555 being plugged in.

No need for a response, just wanted to mention it.