Component library tools

Zero’s command line interface can be used to search the op-amp library bundled with the project.

Listing the user library file path

The built-in op-amp definitions can be supplemented or overridden by a user-defined op-amp library. This library is stored within the user’s home directory in a location that depends on the operating system.

The path to this file can be listed with the command zero library path.

Creating a user library

An empty user library can be created with zero library create.

Opening the user library for editing

The user library can be opened with the command zero library edit.

Removing the user library

The user library can be removed with zero library remove.

Showing the library

The combined contents of the built-in library and any user-defined additions or overrides can be printed to the screen with zero library show. For large libraries, it is often useful to specify the --paged flag to allow the contents to be navigated.

Search queries

Search queries are specified as a set of declarative filters after the zero library search command. Zero implements an expression parser which allows queries to be arbitrarily long and complex, e.g.:

$ zero library search "model != OP* & ((vnoise <= 2n & vcorner < 10) | (vnoise <= 25n & inoise < 100f & icorner < 100))"
7 op-amps found:
╒═════════╤══════════╤═══════════╤═════════════════╤═══════════╤════════════════╤═══════════╤════════╤════════╤══════════╕
│ model   │ a0       │ gbw       │ vnoise          │ vcorner   │ inoise         │ icorner   │ vmax   │ imax   │ sr       │
╞═════════╪══════════╪═══════════╪═════════════════╪═══════════╪════════════════╪═══════════╪════════╪════════╪══════════╡
│ AD706   │ 2 MV/V   │ 800 kHz   │ 17 nV/sqrt(Hz)  │ 3 Hz      │ 50 fA/sqrt(Hz) │ 10 Hz     │ 14 V   │ 10 mA  │ 150 kV/s │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ AD8628  │ 10 MV/V  │ 2.5 MHz   │ 22 nV/sqrt(Hz)  │ 1 uHz     │ 5 fA/sqrt(Hz)  │ 1 uHz     │ 5 V    │ 30 mA  │ 1 MV/s   │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ LT1028  │ 30 MV/V  │ 72 MHz    │ 850 pV/sqrt(Hz) │ 3.5 Hz    │ 1 pA/sqrt(Hz)  │ 250 Hz    │ 12 V   │ 20 mA  │ 15 MV/s  │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ LT1128  │ 30 MV/V  │ 15 MHz    │ 850 pV/sqrt(Hz) │ 3.5 Hz    │ 1 pA/sqrt(Hz)  │ 250 Hz    │ 12 V   │ 20 mA  │ 6 MV/s   │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ PZTFET1 │ 21 V/V   │ 421 kHz   │ 1 nV/sqrt(Hz)   │ 1 Hz      │ 1 pA/sqrt(Hz)  │ 1 Hz      │ 12 V   │ 10 mA  │ 10 MV/s  │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ PZTFET2 │ 21.3 V/V │ 322.8 kHz │ 1 nV/sqrt(Hz)   │ 1 Hz      │ 1 pA/sqrt(Hz)  │ 1 Hz      │ 12 V   │ 10 mA  │ 10 MV/s  │
├─────────┼──────────┼───────────┼─────────────────┼───────────┼────────────────┼───────────┼────────┼────────┼──────────┤
│ PZTFET3 │ 22.2 V/V │ 18.4 kHz  │ 1 nV/sqrt(Hz)   │ 1 Hz      │ 1 pA/sqrt(Hz)  │ 1 Hz      │ 12 V   │ 10 mA  │ 10 MV/s  │
╘═════════╧══════════╧═══════════╧═════════════════╧═══════════╧════════════════╧═══════════╧════════╧════════╧══════════╛

The expression must be defined on one line. Whitespace is ignored. Where values are specified, such as “1n”, these are parsed by Quantity (see Parsing and displaying quantities).

Where a string comparison is made, e.g. with model, wildcards are supported:

*

Match any number of characters (including zero), e.g. OP* would match OP27, OP37, OP227, etc.

?

Match a single character, e.g. LT1?28 would match LT1028 and LT1128 but not LT10028.

Available parameters

The following op-amp library parameters can be searched:

model

Model name, e.g. OP27.

a0

Open loop gain.

gbw

Gain-bandwidth product.

delay

Delay.

vnoise

Flat voltage noise.

vcorner

Voltage noise corner frequency.

inoise

Flat current noise.

icorner

Current noise corner frequency.

vmax

Maximum output voltage.

imax

Maximum output current.

sr

Slew rate.

Operators

Expressions can use the following operators:

==

Equal.

!=

Not equal.

<

Less than.

<=

Less than or equal.

>

Greater than.

>=

Greater than or equal.

&

Logical AND.

|

Logical OR.

Groups

Parentheses may be used to delimit groups:

(vnoise < 10n & inoise < 10p) | (vnoise < 100n & inoise < 1p)

Display

The results are by default displayed in a table. The rows are sorted based on the order in which the parameters are defined in the search query, from left to right, with the leftmost parameter being sorted last. The default sort direction is defined based on the parameter. The sort direction can be specified explicitly as ASC (ascending) or DESC (descending) with the corresponding --sort parameter:

Flag

Parameter

Default direction

--sort-a0

a0

descending

--sort-gbw

gbw

descending

--sort-delay

delay

ascending

--sort-vnoise

vnoise

ascending

--sort-vcorner

vcorner

ascending

--sort-inoise

inoise

ascending

--sort-icorner

icorner

ascending

--sort-vmax

vmax

descending

--sort-imax

imax

descending

--sort-sr

sr

ascending

Parameters that are not explicitly searched are not ordered.

The display of the results table can be disabled using the --no-show-table flag. The results can also be saved into a text file by specifying it with --save-data. The specified file extension will be used to guess the format to use, e.g. csv for comma-separated values or txt for tab-separated values.

Results can also be plotted. The flags --plot-voltage-noise, --plot-current-noise and --plot-gain can be used to plot the voltage and current noise or open loop gain of the op-amp, respectively. Generated plots can also be saved by specifying a filename (or multiple filenames, if you like) with the --save-voltage-noise-figure, --save-current-noise-figure and --save-gain-figure options, respectively. Figures can be saved without being displayed with --no-plot-voltage-noise, --no-plot-current-noise and --no-plot-gain, respectively.

The following command will produce the plot below.

$ zero library search "gbw > 800M & ((vnoise < 10n & inoise < 10p) | (vnoise < 100n & inoise < 1p)) & model != OP00" --plot-gain --fstop 1M
../_images/cli-opamp-gain.svg

Command reference

zero library

Component library functions.

zero library [OPTIONS] COMMAND [ARGS]...

create

Create empty library file in user directory.

zero library create [OPTIONS]

edit

Open library file in default editor.

zero library edit [OPTIONS]

path

Print component library file path.

Note: this path may not exist.

zero library path [OPTIONS]

remove

Remove user component library file.

zero library remove [OPTIONS]

show

Print the library that Zero uses.

zero library show [OPTIONS]

Options

--paged

Print with paging.