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 matchOP27
,OP37
,OP227
, etc.?
Match a single character, e.g.
LT1?28
would matchLT1028
andLT1128
but notLT10028
.
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 |
---|---|---|
|
|
descending |
|
|
descending |
|
|
ascending |
|
|
ascending |
|
|
ascending |
|
|
ascending |
|
|
ascending |
|
|
descending |
|
|
descending |
|
|
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
Command reference¶
zero library¶
Component library functions.
zero library [OPTIONS] COMMAND [ARGS]...
search¶
Search Zero op-amp library.
Op-amp parameters listed in the library can be searched:
model (model name), a0 (open loop gain), gbw (gain-bandwidth product), 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)
The parser supports basic comparison and logic operators:
== (equal), != (not equal), > (greater than), >= (greater than or equal), < (less than), <= (less than or equal), & (logic AND), | (logic OR)
Clauses can be grouped together with parentheses:
(vnoise < 10n & inoise < 10p) | (vnoise < 100n & inoise < 1p)
The query engine supports arbitrary expressions.
The ‘a0’ parameter can be specified in magnitude or decibels. For decibels, append ‘dB’ (case insensitive) to the value.
The results are sorted sequentially in the order that each parameter appears in the search query (left to right). The sort direction (descending or ascending) depends on the type of parameter. The sort direction for parameter ‘X’ can be overridden using the corresponding ‘–sort-X’ flag. Specify ‘ASC’ for ascending and ‘DESC’ for descending order.
zero library search [OPTIONS] QUERY
Options
-
--sort-a0
<sort_a0>
¶ [default: DESC]
- Options
ASC|DESC
-
--sort-gbw
<sort_gbw>
¶ [default: DESC]
- Options
ASC|DESC
-
--sort-delay
<sort_delay>
¶ [default: ASC]
- Options
ASC|DESC
-
--sort-vnoise
<sort_vnoise>
¶ [default: ASC]
- Options
ASC|DESC
-
--sort-vcorner
<sort_vcorner>
¶ [default: ASC]
- Options
ASC|DESC
-
--sort-inoise
<sort_inoise>
¶ [default: ASC]
- Options
ASC|DESC
-
--sort-icorner
<sort_icorner>
¶ [default: ASC]
- Options
ASC|DESC
-
--sort-vmax
<sort_vmax>
¶ [default: DESC]
- Options
ASC|DESC
-
--sort-imax
<sort_imax>
¶ [default: DESC]
- Options
ASC|DESC
-
--sort-sr
<sort_sr>
¶ [default: ASC]
- Options
ASC|DESC
-
--show-table
,
--no-show-table
¶
Print results as a table. [default: True]
-
--paged
¶
Print results with paging.
-
--save-data
<save_data>
¶ Save search results to file. The file format is decided based on the specified extension. Supported extensions are “csv” and “txt”. Can be specified multiple times.
-
--plot-voltage-noise
,
--no-plot-voltage-noise
¶
Display op-amp voltage noise as figure. [default: False]
-
--plot-current-noise
,
--no-plot-current-noise
¶
Display op-amp current noise as figure. [default: False]
-
--plot-gain
,
--no-plot-gain
¶
Display op-amp open loop gain as figure. [default: False]
-
--save-voltage-noise-figure
<save_voltage_noise_figure>
¶ Save image of voltage noise figure to file. Can be specified multiple times.
-
--save-current-noise-figure
<save_current_noise_figure>
¶ Save image of current noise figure to file. Can be specified multiple times.
-
--save-gain-figure
<save_gain_figure>
¶ Save image of open loop gain figure to file. Can be specified multiple times.
-
--fstart
<fstart>
¶ Plot start frequency. [default: 1]
-
--fstop
<fstop>
¶ Plot stop frequency. [default: 1G]
-
--npoints
<npoints>
¶ Plot number of points. [default: 1000]
Arguments
-
QUERY
¶
Required argument