Skip to content

Add MOSFET channel-length modulation and scope trail persistence#221

Closed
esaruoho wants to merge 1 commit intopfalstad:masterfrom
esaruoho:mosfet-and-scope-fixes
Closed

Add MOSFET channel-length modulation and scope trail persistence#221
esaruoho wants to merge 1 commit intopfalstad:masterfrom
esaruoho:mosfet-and-scope-fixes

Conversation

@esaruoho
Copy link
Copy Markdown

@esaruoho esaruoho commented Mar 1, 2026

Summary

  • MOSFET channel-length modulation (fixes MOSFET output resistance #155): Adds a lambda parameter to MosfetElm/JfetElm for finite output resistance in saturation. In saturation region: Ids = 0.5beta(Vgs-Vt)^2*(1+lambdaVds), Gds = 0.5beta*(Vgs-Vt)^2*lambda. Default is 0 (ideal square-law, backward compatible). Shown in the info panel when non-zero.
  • Scope XY trail persistence (fixes [FEATURE] Option to configure the fade-out time of the oscilloscope x-y trail #157): Adds a "Trail Persistence" slider (0-50) in the scope properties dialog under XY Plots. Values 0-49 control fade speed (lower = faster fade); 50 = infinite persistence (no fade). Default is 2 (matches previous hardcoded behavior).

Changes

  • MosfetElm.java: Added lambda field, channel-length modulation math in saturation, serialization, edit dialog entry at n=2 (shifted subsequent items)
  • JfetElm.java: Extended getEditInfo threshold from n < 2 to n < 3 to expose lambda
  • Scope.java: Added trailLen field, changed fade condition to use configurable threshold
  • ScopePropertiesDialog.java: Added trail persistence scrollbar and label after XY plot checkboxes

Test plan

  • Place an n-MOSFET, set lambda > 0 (e.g. 0.02), verify finite output resistance in saturation (Ids increases with Vds)
  • Place a JFET, verify lambda parameter appears in edit dialog
  • Open scope XY plot, adjust Trail Persistence slider and verify fade behavior changes
  • Verify lambda=0 (default) gives identical behavior to before
  • Verify existing circuits load without issues (backward-compatible dump format)

- Add lambda parameter to MosfetElm for channel-length modulation (pfalstad#155).
  In saturation: Ids = 0.5*beta*(Vgs-Vt)^2*(1+lambda*Vds),
  Gds = 0.5*beta*(Vgs-Vt)^2*lambda. Default 0 (ideal).
- Expose lambda in JfetElm edit dialog (n < 3 threshold).
- Add configurable XY trail persistence slider in scope dialog (pfalstad#157).
  trailLen 0-49 = varying fade speed, 50 = infinite (no fade).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@esaruoho
Copy link
Copy Markdown
Author

esaruoho commented Mar 2, 2026

Superseded by #240 which targets v3-dev instead of master. Closing this PR.

@esaruoho esaruoho closed this Mar 2, 2026
@esaruoho esaruoho deleted the mosfet-and-scope-fixes branch March 2, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Option to configure the fade-out time of the oscilloscope x-y trail MOSFET output resistance

1 participant