PMOS channel-length modulation has the wrong sign: (1 + lambda*V_DS) with V_DS ≤ 0

Aperta
#532 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Ambito
backend

Direzione di ricerca

Start in src/Electrical/Analog/mosfets.jl: the PMOS channel-length modulation terms are on lines 160 and 162, and the NMOS form at lines 76-77 is the reference to match. Add a test that compares PMOS against a mirrored NMOS at nonzero lambda, then fix the sign in both PMOS branches. Also correct the PMOS docstring on line 90, which says N-type. Done when the mirrored comparison passes at lambda = 1/25.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🤖 Automated issue from an AI agent — not written or reviewed by @ChrisRackauckas.

PMOS in src/Electrical/Analog/mosfets.jl (lines 160 and 162 on main) applies channel-length modulation as (1 + lambda * V_DS). For a PMOS in conduction V_DS ≤ 0, so the factor is below 1 and the drain current falls as |V_DS| grows. The Sedra/Smith model cited in the docstring uses (1 + λ|v_DS|), as NMOS does (lines 76-77, where V_DS ≥ 0).

Consequence: the "PMOS with all node voltages negated carries the negated NMOS current" property from #521 holds at lambda = 0 but fails at the default lambda = 1/25. Checked by an independent reviewer on a grid of 8820 (vd, vg, vs) points with the leakage-sign fix from https://github.com/SciML/ModelingToolkitStandardLibrary.jl/pull/522 applied: mismatches at 4488 points; first mismatch (vd, vg, vs) = (-5, -5, -3), PMOS -0.0223 vs mirrored NMOS -0.0227.

Proposed fix: use (1 - lambda * V_DS) (equivalently 1 + lambda * |V_DS|) in both the triode and saturation branches of PMOS, with a test comparing PMOS against mirrored NMOS at nonzero lambda. This changes simulation results for every PMOS with lambda ≠ 0, so it needs a release note.

Also out of date: the PMOS docstring says "Creates an N-type MOSFET transistor" (line 90).

Split out of #521; https://github.com/SciML/ModelingToolkitStandardLibrary.jl/pull/522 fixes only the leakage sign.


🤖 Filed by an AI agent — harness: Claude Code, model: claude-opus-5-5[1m]. Session: https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP

Lingua principale
Julia
Stelle
173
Fork
52
Merge medio
10h 9m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SciML/ModelingToolkitStandardLibrary.jl

Tutte le issue di SciML/ModelingToolkitStandardLibrary.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.