Voltage rise between diode and Nmosfet drain - Page 1
Forum section: electronics / beginners

author: Hex173t
author_rank: Contributor
timestamp: December 09, 2012, 08:54:13 pm
content: I've been using LTSpice to simulate turning on and off a led using a mosfet. When trying the circuit with the LED and resistor between drain and batt +, there is a small rise in voltage at the led anode pin. The higher the gate voltage relative to battery, the more the rise before the mosfet is turned on.Why is this? I'm new to reading data sheets, is there something in there that would describe this happening?I've attached the view of the spice and the circuit.Thanks

author: Hex173t
author_rank: Contributor
timestamp: December 09, 2012, 09:27:06 pm
content: I'd like to add that I know it has to do with the diode, it doesn't do that when a plain resistor is in there.

author: amyk
author_rank: Super Contributor
timestamp: December 10, 2012, 09:14:01 am
content: Diodes are non-ohmic and their forward voltage varies depending on the current.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: December 10, 2012, 01:15:54 pm
content: HiYour problem is at the cathode of the LED not the anode.I can see that you have a problem, why is the cathode going above 13v?This occasionally happens in Spice, the simulation is only as good as the models.The cathode is effectively floating because the models don't have any leakage.Try putting a 100Megohm resistor in parrallel with the diode.Any weird stuff and check the models, try a similar model, or put in some sensible initial conditions to help it converge.Hope this helps.

author: AlfBaz
author_rank: Super Contributor
timestamp: December 10, 2012, 02:39:54 pm
content: Quote from: HackedFridgeMagnet on December 10, 2012, 01:15:54 pmAre you sure about that? Considering spice was originally devised to assist developing IC's if something as rudimentary as a PN junction can't be modelled correctly then I don't think spice would have made it as far as it hasQuoteI think the reason that works is because you are bleeding away the charge being developed due to the capacitive nature of the PN junction.Its been a long, long time since I knew this stuff so I'm very likely to be talking out my arse here.I think whats happening is that as the gate voltage rises we are getting charges (holes/electrons) moving to/from the drain and the cathode of the LED, probably further exacerbated spice's tendency to chuck hissy fits at points that dont have good DC paths to groundIt would be good to breadboard it and see what happens there

author: Neilm
author_rank: Super Contributor
timestamp: December 10, 2012, 05:31:54 pm
content: Quote from: AlfBaz on December 10, 2012, 02:39:54 pmA simulation is only as good as the data it uses. If you put rubbish in, you will get rubbish out. Many simulation models omit a large amount of data to allow the simulation to run quicker.Neil

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: December 10, 2012, 09:40:40 pm
content: QuoteSorry what I meant was this particular model of the led didn't seem to have any leakage.The only thing that could force the drain up above the 13v at that point in the waveform was if the node was floating. Which obviously would never happen on a breadboard. That is why I suggested the 100Meg resistor.I just looked up the leakage it is Is and should be .27nA. I don't know why this doesn't seem to work.I must admit I have had troubles with spice models before, and never got to the bottom of why, so a work around seemed in order.

author: Hex173t
author_rank: Contributor
timestamp: December 10, 2012, 10:23:23 pm
content: Thanks to all for the replies.I think I'll end up getting the parts and breadboarding it test.I may be thinking of this wrong, but I'm imagining a sort of convergence of voltages at the led cathode pin, where the V1 voltage starts dropped by. If I have a rising voltage from 0 to 13v at the gate, with the transitor turning on around 6v, I don't understand how am I building up voltage over the V1 of 13, higher than any voltage source in the circuit.Before I posted, I did 1 more thing, since the gate has some capacitance, I just replaced the mosfet with a 180pF capacitor and while goofing around with it I changed the dropper resistory to .1mohm.Green= V1, 6 volts acrossBlue=Anode side of diode, near 6 volt acrossBluegreen= V2, starting at 0 and rising to 13 volts.Red=Cathode side of diode, rising from 6 volts to near 15 volts.I didn't anticipate that. I'm worse off than I ever thought. V=IR right?

author: free_electron
author_rank: Super Contributor
timestamp: December 10, 2012, 10:37:38 pm
content: Quote from: AlfBaz on December 10, 2012, 02:39:54 pmHell yeah, we're sure about that. The standard models in run of the mill spice programs absolutely SUCK ! they are all 'ideal models' leading to a lot of problems getting the simulation to converge and give a correct result.Yes spice was designed to model electronics systems mathematically and there is nothing wrong with the mathematics , the problem is the parameter set fed into the algorithm needs ot be accurate and complete. Generating an accurate spice model is very difficult. Datasets become gigantic very guickly and simulation times are long.A good spice engine costs a lot of money. Good meaning as an engine that works efficient and fast. not all spice 'motors' are built the same. One of the benchmark 'spice' motors out there is Eldo.you are feeding a spice netlist of an ideal mosfet and an ideal led. spice creates a calcualtion matrix and attempts to solve it. as the matrix is 'seeded' wrong you get very weird outcomes.... it would n;t be the first time that spice geves you a 5000 voltpp output amplitude for an opamp powered with 12 volts... simply because spice does was not told the actual opamp will clip at a certain voltage. the idealized models do not provided that information.it's like driving a car. you move along the high way fine and all of a sudden the car stops... if nobody told you it needs gas ... spice is a dumb computer program. if you don't give it a restriction 'das tank hold 40 liters , we use 1 liter per 10 kilometer' it doesn;t take gas consumption into account. according to the simulation the car would drive forever ....

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: December 10, 2012, 10:50:11 pm
content: This reply is intended for the original poster.The rising Drain voltage can be explained in the LTspice model by the following actions:The MOSFET has parasitic capacitors between all the terminalsWhen the pulse is applied between the Gate and Source, the positive going pulse will be coupled through the Gate-Drain capacitance to the Drain.The LED in the Drain circuit is reverse biased and there is no path for the current.When the voltage on the Gate reaches the Gate threshold voltage for the MOSFET the voltage Vds will collapse.This is will be seen in the real circuit as well as the LTspice.Jay_Diddy_B

author: AlfBaz
author_rank: Super Contributor
timestamp: December 11, 2012, 02:22:31 am
content: Quote from: free_electron on December 10, 2012, 10:37:38 pmI don't mean to nit pick but surely you can concede there is ideal behaviour, spice behaviour and real behaviour and in that order of accuracy.I'm not going to be the one to laud spice's virtues, but it just seems that whenever something goes wrong with a sim, rather than ascertaining where the inaccuracy lies nearly everyone starts with the standard "spice is shit" remarks. Its a rarity to have a discussion about spice that doesn't end in the gutterMaybe I'm being a little sentimental but spice has served me well over the years, its just a matter of understainding its limitations