Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper unit for gamma. It is computed as the square root of something. #4377

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HansOlsson
Copy link
Contributor

Closes #4369
To confirm I just binged "gamma spice Bulk threshold parameter" and found: https://www.seas.upenn.edu/~jan/spice/spice.MOSparamlist.html
which contains the same unit for gamma.
And the copilot said: "Its units are Volts^(1/2)."

@HansOlsson HansOlsson added L: Electrical.Spice3 Issue addresses Modelica.Electrical.Spice3 requires Modelica 3.7 Issue that requires Modelica Language Specification 3.7 labels Apr 2, 2024
Copy link
Member

@beutlich beutlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What about MosModelLineVariableqs.m_gamma where it is of type Real?
  • Did you notice that there are two different calculations in the lib? In Modelica.Electrical.Spice3.Internal.Mos1.mos1ModelLineParamsInitEquations it is a sqrt, in Modelica.Electrical.Spice3.Internal.Mos2.mos2ModelLineParamsInitEquationsRevised it is a quotient. I am not sure if this is intentional.
out_v.m_gamma := sqrt(2 * SpiceConstants.EPSSIL * SpiceConstants.CHARGE *
			   in_p.m_substrateDoping * 1e6 / out_v.m_oxideCapFactor);         // (cm**3/m**3)

vs.

out_p.m_gamma := sqrt(2.0*Spice3.Internal.SpiceConstants.EPSSIL*
	Spice3.Internal.SpiceConstants.CHARGE*out_p.m_substrateDoping*1.0e6)
	/out_p.m_oxideCapFactor;

@HansOlsson
Copy link
Contributor Author

HansOlsson commented Apr 3, 2024

  • What about MosModelLineVariableqs.m_gamma where it is of type Real?

Should also be updated.

  • Did you notice that there are two different calculations in the lib? In Modelica.Electrical.Spice3.Internal.Mos1.mos1ModelLineParamsInitEquations it is a sqrt, in Modelica.Electrical.Spice3.Internal.Mos2.mos2ModelLineParamsInitEquationsRevised it is a quotient. I am not sure if this is intentional.

I have mostly skipped units in functions.

out_v.m_gamma := sqrt(2 * SpiceConstants.EPSSIL * SpiceConstants.CHARGE *
			   in_p.m_substrateDoping * 1e6 / out_v.m_oxideCapFactor);         // (cm**3/m**3)

vs.

out_p.m_gamma := sqrt(2.0*Spice3.Internal.SpiceConstants.EPSSIL*
	Spice3.Internal.SpiceConstants.CHARGE*out_p.m_substrateDoping*1.0e6)
	/out_p.m_oxideCapFactor;

An additional problem here is that m_substrateDoping and m_oxideCapFactor both lack units.

Deleted

Additionally spice is weird in that it has prefixed SI-units, and even not really SI-units (like eV).

@HansOlsson
Copy link
Contributor Author

HansOlsson commented Apr 3, 2024

Oh, I realized that the units are even weirder - and the previous was incorrect.

EPSSIL shouldn't be unit-less, but as far as I understand has unit "F/m", specifically it is computed based on the relative di-electric constant of Silicon being 11.7 and 8.85...e-12 F/m being Modelica.Constants.epsilon_0.

Added: The name EPSSIL means epsilion (di-electric constant) for Silicon.

The m_oxideCapFactor is computed as di-electric-constant divided by thickness and should thus have unit "F/m2" (ignoring unit-conversions - I think thickness is measured in "um").

That would make the first equation unit-correct if doping was measured in "1/m2" instead of "1/m3"; and I don't know how the second equation would be unit-correct.

But: for doping we have: out_p.m_substrateDoping*1.0e6 > Modelica.Electrical.Spice3.Internal.MaterialParameters.IntCondCarrDensity - where IntCondCarrDensity clearly is per volume, and 1.0e6 is cm3 to m3 conversion (for mos1 the IntCondCarrDensity is inlined, but they are the same formulas); so it should have unit "1/m3".

Or basically: There seems to be some remaining unit-issues, but I don't know which ones; and I don't know if it is just a matter of missing/incorrect units or whether some formulas should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Electrical.Spice3 Issue addresses Modelica.Electrical.Spice3 requires Modelica 3.7 Issue that requires Modelica Language Specification 3.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Units for gamma in Modelica.Electrical.Spice3.Internal.Mos.mos2CalcCalcTempDependenciesRevised
2 participants