Skip to content

Input dynamic range calculator for MOSFET circuits on LTSpice

License

Notifications You must be signed in to change notification settings

micangl/lts_input_dynamics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

lts_input_dynamics

This python script is a simple input dynamic-range calculator for MOSFET circuits on LTSpice.

In this context, we refer to the input dynamic-range as the maximum (or minimum) voltage of a signal which can be applied to a circuit, whilst guaranteeing that each MOSFET operates in the saturation region and isn't turned off.

Note that this script is based on the PyLTSpice library and is designed to work with the level 1 spice MOSFET model.

Installation

You'll need to install PyLTSpice and, then, download this script.

Calculating the input dynamic-range for sinusoidal or positive input-signals

In LTSpice, set the input-signal amplitude to a parameter (e.g. {vi}). Perform a transient simulation whilst stepping this parameter. These directives are an example:

.tran 0 100u 1u 100n
.step param vi 1m 1 10m

Be careful not to leave the Time to start saving data field of the transient analysis set to 0 (in the example directives it's equal to 1u), as we don't want to start saving data until the circuit has reached some form of "steady state".

LTSpice will produce a file with the .raw extension in the same directory as the main .asc file. To invoke this script, issue:

python <path_to_script> <path_to_raw_file>

Calculating the minimum input voltage

The only differences will be, of course, the range for the parameter step and having to pass the -n parameter to the script:

python <path_to_script> <path_to_raw_file> -n

About

Input dynamic range calculator for MOSFET circuits on LTSpice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages