Go Down

### Topic: reading voltage of an N channel mosfet (Read 6586 times)previous topic - next topic

#### mtraven

##### Apr 24, 2018, 06:54 am
the general project is an EDM machine, from an arduino perspective I need to be able make a pulse and read the voltage between the two electrodes(to adjust spark gap).  I have the pulse system down but the reading of the voltage is giving me a real hard time.  In my current iteration, I am getting "inverted" voltage readings....when the mosfet is on, I get adc vals around 200 (low I guess), when mosfet is off, I get adc vals of 1023.  If you are thinking I messed up a register or am doing something wrong in software, I did too...so I put a multi meter on the voltage divider and it shows the same (1.2v when mosfet is on, 5.2v when off).

-all grounds are common

-i have been testing with a small load on the mosfet(fan), if I measure the voltage when ON, I get 11.6, off ~=0v...but if I remove that load, that voltage ranges from [6.6 ->11.6].  I am not SURE this is dysfunctional behavior, but that range being exactly 5v makes me dubious.

-I know the 3205 is not logical level, that's why its being driven by an NPN to get proper gate voltage...I know this is not ideal for fast switching, but its what I have & it does seem to work.

i have attach a diagram, note the electrodes are not pictured, but connect to +VpulseSupply and the drain of the mosfet.

any guidance would be greatly appreciated.  thanks.

#### mtraven

#1
##### Apr 24, 2018, 09:53 am
couple other tests runs:

when voltage divider is connected to +5V & ground adc=109 (reasonable number based on my divider ratio)
+12(transformer) & gnd , adc = 267

then when measuring the mosfet(fed by above 12v transformer ps), the adc vals (and readings @ divider) start inverting.

all those values are consistent with the math, so it seems my divider circuit is working properly ...I am thinking it may have to do with where my probe lines connect in the circuit?

also when I send the mosfet LOW, I get 5.22v @ the bridge input pin...thats the full Vcc/Vin.  by my math, it should take 44V to get that, and no such voltage exist in the system...perhaps it has something to do with the NPN that is driven high to turn MOSFET off....now that I wrote that all out, I am almost certain that what it is, somehow the base of that NPN is bleeding into the circuit ....how to fix?

#### MarkT

#2
##### Apr 24, 2018, 11:24 am
the general project is an EDM machine, from an arduino perspective I need to be able make a pulse and read the voltage between the two electrodes(to adjust spark gap).  I have the pulse system down but the reading of the voltage is giving me a real hard time.  In my current iteration, I am getting "inverted" voltage readings....when the mosfet is on, I get adc vals around 200 (low I guess), when mosfet is off, I get adc vals of 1023.  If you are thinking I messed up a register or am doing something wrong in software, I did too...so I put a multi meter on the voltage divider and it shows the same (1.2v when mosfet is on, 5.2v when off).
Yes that is exactly what I'd expect.  MOSFET on, low output voltage.

Explain exactly what you want to achieve, and what voltages will be involved in the machine (measuring high
voltages may have other challenges).

BTW that 10k pull up on the MOSFET gate is shockingly high. Try 680 ohms for faster pulses, or use a MOSFET
driver chip instead of the NPN stage.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### mtraven

#3
##### Apr 24, 2018, 01:11 pm
Yes that is exactly what I'd expect.  MOSFET on, low output voltage.

could you explain that? seems simple but I am not getting it.

Explain exactly what you want to achieve, and what voltages will be involved in the machine (measuring high
voltages may have other challenges).
the mosfet needs to pulse a spark across a gap (submerged in a dielectric).  pulse is 30-100 microseconds long, with a duty cycle 2-10x that.  voltage is relatively low (playing with 12v now, max would be 24).  The voltage measurement is used to adjust the position of the electrode (spark gap)...basically if that voltage is above a threshold the electrode is lowered, if its too low, raise electrode.

BTW that 10k pull up on the MOSFET gate is shockingly high. Try 680 ohms for faster pulses, or use a MOSFET
driver chip instead of the NPN stage.
that was a pull down on a different circuit that just kinda got shifted over, ill try some lower vals.

and I am just scrapping parts together, if I am gonna go with different hardware, id go with a logic level mosfet.  But I am curious what a driver chip would have in it?  wouldn't it just be and amp like my NPN?

#### allanhurst

#4
##### Apr 24, 2018, 01:21 pm
I'm puzzled...

What's an EDM machine?

Where does the 12v transformer come into this?

Where is the adc connected? If connected to the junction of the 2M2 and the 220k it will see +12 , or whatever your 12v pulse supply provides whenever the mosfet is off - ie +5 on the drive to the BJT.

Allan

#### mtraven

#5
##### Apr 24, 2018, 01:45 pm
I'm puzzled...

What's an EDM machine?

Where does the 12v transformer come into this?

Where is the adc connected? If connected to the junction of the 2M2 and the 220k it will see +12 , or whatever your 12v pulse supply provides whenever the mosfet is off - ie +5 on the drive to the BJT.

Allan
electrical discharge machining...its a method of using a controlled spark to slowly, but very precisely remove metal...also effective at cutting hardened metals otherwise machinable.  In my case I am making very small holes (<0.5mm) in hardened steel.

the pictured +12v supply is the transformer based power supply needed to make the pulses.  an additional atx  power supply runs the ardunio & supplies gate voltage to the mosfet.

the only thing missing from the drawing is the electrodes, not sure how to put those into my fritzing diagram, but they connect to +12v transformer supply & the drain of that mosfet.  the adc  connected to A0 as shown

so is there a way to not allow that BJT voltage to bleed through the rest of the circuit?

#### tinman13kup

#6
##### Apr 24, 2018, 03:17 pm
Since the mosfet  drain is connected to ground, when ON, the source is also connected to ground, so you would have "low output voltage when ON". Also, since the whole circuit is a bit hinkey with the resistors in series with the source, you would have minimal current anyhow (5uA).

Perhaps get those resistors in a parallel leg and actually connect a load to the drain. Just for testing, anything will do, like a led (and resistor). The divider would have to go on the switched side of things, so basically it has to go between the mosfet and load.
Tom
It's not a hobby if you're not having fun doing it. Step back and breathe

#### allanhurst

#7
##### Apr 24, 2018, 07:23 pm
EDM- gotcha - what we Brits call spark erosion.

Normally done under a blanket of flowing electrolyte to take the eroded particles away.

I take it you're rectifying your 12v transformer?

I've never done this but so far as I understand you must supply a limited current  - is there a series resistor?

Allan

ps many years ago I patented a method of making accurate holes down to  1 micron or less .  Think it's still in use for making calibrated leaks for gas detectors....

#### mtraven

#8
##### Apr 24, 2018, 09:28 pm
Since the mosfet  drain is connected to ground, when ON, the source is also connected to ground, so you would have "low output voltage when ON". Also, since the whole circuit is a bit hinkey with the resistors in series with the source, you would have minimal current anyhow (5uA).

Perhaps get those resistors in a parallel leg and actually connect a load to the drain. Just for testing, anything will do, like a led (and resistor). The divider would have to go on the switched side of things, so basically it has to go between the mosfet and load.
the voltage divider IS connect in parallel to the electrodes.

I thought I had mentioned I have been using a fan as a test load.

#### MarkT

#9
##### Apr 24, 2018, 09:31 pm
could you explain that? seems simple but I am not getting it.

Its a low-side switch.  A high side switch would be the opposite.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### mtraven

#10
##### Apr 24, 2018, 09:41 pmLast Edit: Apr 24, 2018, 09:45 pm by mtraven
EDM- gotcha - what we Brits call spark erosion.

Normally done under a blanket of flowing electrolyte to take the eroded particles away.

I take it you're rectifying your 12v transformer?

I've never done this but so far as I understand you must supply a limited current  - is there a series resistor?

Allan

ps many years ago I patented a method of making accurate holes down to  1 micron or less .  Think it's still in use for making calibrated leaks for gas detectors....
If I am honest, I like the term spark erosion better anyways.

are you sure you mean electrolyte and not dielectric?

my 12v transformer also has a 24v side and is rectified & smoothed with some bigass caps (also has inline breakers)

your method for small holes sounds interesting?  I don't need to be anywhere near 1 micron, 400 would be about where I need to be, would your method work for that? Would you be willing to share said method?

--I am not doing anything with current limiting, really just because I dont know how or what to limit it with...and I have seem these systems(not real nice ones) run without any current limiter.  I have a bunch of 5-25w ceramic resistors, would one of those before the electrode do the trick?  Do you have a recommendation for target current?

some general notes:
-I am more of a machinist than an electronics expert, so I am not set on this circuit.  If someone wants to recommend something different, I am open to it....but I would like to do it will parts on hand, of which I have a lot.  I have 30 or 40 atx power supplies that I have always wanted to pull chips from, might there be something in one of those that may make my spark better?

thank you.

#### mtraven

#11
##### Apr 24, 2018, 10:29 pmLast Edit: Apr 24, 2018, 11:03 pm by mtraven
Its a low-side switch.  A high side switch would be the opposite.
are you talking about it being an n channel vs p channel? does't really matter, its still a switch and when I put a voltage to the gate, the switch closes and should read high (and it does on a multi-meter)  but when I connect my voltage divider to those same points, I get the inverted behavior I described.

why are you saying you expect a low voltage when the mosfet gate is high?

#### tinman13kup

#12
##### Apr 24, 2018, 11:33 pm
You are not understanding what the mosfet is doing. When there is 10V on the gate, source and drain are connected. If the source is connected to ground, then the drain is connected to ground. You will not get 12V on the drain while the mosfet is ON unless you have blown the mosfet.

Now, with the resistor divider, if there is ground attached to the bottom end (mosfet ON), current is moving through it, and you will see 1.2ishVDC at the center. With the mosfet OFF, that 12V potential extends all the way to the drain of the mosfet, also putting 12VDC to the Uno.

Perhaps update your drawing to what you have, use a SPST momentary switch for the electrodes. Show the load as a resistor.
Tom
It's not a hobby if you're not having fun doing it. Step back and breathe

#### allanhurst

#13
##### Apr 25, 2018, 02:52 amLast Edit: Apr 25, 2018, 02:56 am by allanhurst
OP...

You're right - the 'electrolyte' is something like paraffin ( kerosene for yanks).

My method would have a constant current supply ,and a  very slow controllable feed mechanism whose speed depended on the average voltage across the gap. The bigger the volts, the faster the feed. Hence you'd get a constant gap as the hole was formed.

As used in carbon arc film projectors in cinemas years ago for feeding the anode carbon rod as it burned away..

I think this method is use for making eg dies for coin stamping.

My small hole idea relied upon deforming a malleable metal such as copper - not suitable for hard steel.

You can buy tungsten carbide drills down to about 300 micron - used for PCB manufacture. But very brittle.

Allan

#### mtraven

#14
##### Apr 25, 2018, 03:06 am
You are not understanding what the mosfet is doing. When there is 10V on the gate, source and drain are connected. If the source is connected to ground, then the drain is connected to ground. You will not get 12V on the drain while the mosfet is ON unless you have blown the mosfet.
that drain connects to ground....completing the circuit to +12V.  I do see 12v on a multimeter, but its not blown as I can turn in off & pwm it just fine...maybe the new drawing with change your view on this?

Now, with the resistor divider, if there is ground attached to the bottom end (mosfet ON), current is moving through it, and you will see 1.2ishVDC at the center. With the mosfet OFF, that 12V potential extends all the way to the drain of the mosfet, also putting 12VDC to the Uno.
i have seen that 1.2v you are talking about, i ive even worked with that spec from the datasheet. I have more to say/ask about this, but please look at the updated drawing and see if that changes your view at all.

Perhaps update your drawing to what you have, use a SPST momentary switch for the electrodes. Show the load as a resistor.
i think i did this as you asked, if its still unclear, just ask

Go Up