Main Content

Operational Amplifier

Model operational amplifier with two or more poles

Since R2021b

  • Operational Amplifier

Libraries:
Mixed-Signal Blockset / Utilities

Description

Use the Operational Amplifier block to model an operational amplifier with two or more poles. You can create a double-pole amplifier from the important circuit parameters or a multiple-pole amplifier from a transfer function. Use the block to characterize the performance of an operational amplifier as part of a larger circuit system.

Examples

expand all

This example shows how to model an inverting amplifier circuit using the Operational Amplifier block and the Linear Circuit wizard block.

Inverting Amplifier

The inverting amplifier circuit contains an op-amp and a feedback network consisting of passive resistors. In this example, the Linear Circuit Wizard block is used to model the feedback network. The Linear Circuit Wizard uses a SPICE netlist describing the feedback stage from the output of the op-amp to its input.

Open the model Inverting_Amplifier attached to this example.

open_system('Inverting_Amplifier');

Operational Amplifier

The op-amp used in this example is a double pole circuit defined from the circuit parameters. In this example, the Input offset voltage (V) is set to 0, the Output resistance (Ohms) is set to 80, and the Open loop gain (v/v) is set to 855e3. The Unity Gain Bandwidth (Hz) is 1e8 Hz and the Maximum Tail Current (A) is 100e-6.

Linear Circuit Wizard

The Linear Circuit Wizard block uses a SPICE netlist to generate a linear circuit block. You can specify the SPICE netlist file name and click on the Build/modify block button to create a circuit block that models the SPICE netlist. The netlist attached to this example is InvertingAmplifier.sp.

Operation

The inverting amplifier circuit is designed with an Op-amp and a feedback network consisting of two resistors R2 and R1.

The feedback from Op-amp output to the input terminal is modeled in the attached SPICE file (R2 = 20KOhms, R1 = 2KOhms).

The closed loop gain of the inverting amplifier is -R2/R1, which is equal to -10. The input stimulus applied to this model has a sample rate of 1e-8. The same sample rate is used in the operational amplifier.

An input signal of 0.1V sine wave with 1KHz frequency is provided to the circuit model. The input and corresponding output are seen on the scope.

Ports

Input

expand all

Positive input terminal of the operational amplifier.

Data Types: single | double

Negative input terminal of the operational amplifier.

Data Types: single | double

Output

expand all

Positive output terminal of the operational amplifier.

Data Types: single | double

Negative output terminal of the operational amplifier.

Data Types: single | double

Parameters

expand all

Type of the operational amplifier circuit.

  • Double-pole Circuit — Use circuit parameters such as open-loop gain, unity gain bandwidth, maximum tail current, and slew rate to define a simple double-pole circuit.

  • Multipole Circuit — Use transfer function poles and zeros to define a multiple-pole circuit.

Programmatic Use

Block parameter: OpampType
Type: character vector
Values: Double-pole Circuit| Multipole Circuit
Default: Double-pole Circuit

Inherit the sample interval value from the input. By default, this option is deselected.

Sample interval value the block uses in MATLAB® analyses, specified as a scalar in seconds.

Dependencies

To enable this parameter, deselect the Inherit sample interval from input option.

Programmatic Use

Block parameter: SampleInterval
Type: character vector
Values: scalar
Default: 1e-8

Select the simulation mode. This option you choose affects simulation performance.

Simulating the model using the Code generation method requires additional startup time, but the subsequent simulations run faster. Simulating the model using the Interpreted execution method may reduce the startup time, but the subsequent simulations run slower. For more information, see Interpreted Execution vs. Code Generation.

Programmatic Use

Block parameter: SimulateUsing
Type: character vector
Values: Code generation| Interpreted execution
Default: Code generation

Signal Parameters

Maximum supply voltage provided to the Operational Amplifier block, specified as a real scalar in volts.

Programmatic Use

Block parameter: VoltageSupplyPlus
Type: character vector
Values: real scalar
Default: 5

Minimum supply voltage provided to the Operational Amplifier block, specified as a real scalar in volts.

Programmatic Use

Block parameter: VoltageSupplyMinus
Type: character vector
Values: real scalar
Default: -5

Offset voltage at the input terminals of the operational amplifier, specified as a scalar in volts. The block uses this value to obtain a zero voltage at the output terminals of the operational amplifier.

Programmatic Use

Block parameter: InputOffsetVoltage
Type: character vector
Values: scalar
Default: 0

Advanced Parameters

The gain of the operational amplifier without any positive or negative feedback, specified as a unitless positive real scalar.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: Gain
Type: character vector
Values: positive real scalar
Default: 3e3

The frequency at which the open-loop gain of the operational amplifier becomes unity, specified as a positive real scalar in hertz.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: FrequencyUnityGain
Type: character vector
Values: positive real scalar
Default: 10e6

Maximum value of the current passing through the tail MOSFET (metal oxide semiconductor field effect transistor) in the operational amplifier circuit, specified as a positive real scalar in amperes.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: InputCurrentMax
Type: character vector
Values: positive real scalar
Default: 100e-6

The rate of the change of the output voltage of the operational amplifier with respect to time, specified as a positive real scalar.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: SlewRate
Type: character vector
Values: positive real scalar
Default: 10e6

Resistance at the output terminals of the operational amplifier, specified as a positive real scalar in ohms.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: OutputResistance
Type: character vector
Values: positive real scalar
Default: 10e3

Capacitance at the output terminals of the operational amplifier, specified as a positive real scalar in farads.

Dependencies

To enable this parameter, set Operational Amplifier Circuit to Double Pole Circuit.

Programmatic Use

Block parameter: OutputCapacitance
Type: character vector
Values: positive real scalar
Default: 50e-12

Poles in the transfer function of the operational amplifier in the Laplace domain, specified as a column vector in rad/s.

If you set Operational Amplifier Circuit to Double-pole Circuit, the block automatically calculates the poles for you from the circuit parameters. If you set Operational Amplifier Circuit to Multipole Circuit, you can specify the poles.

Programmatic Use

Block parameter: Poles
Type: character vector
Values: column vector
Default: [-2.09e+04 -8.62e+07]

Zeros in the transfer function of the operational amplifier in the Laplace domain, specified as a column vector in rad/s.

If you set Operational Amplifier Circuit to Double-pole Circuit, the block automatically calculates the zeros for you from the circuit parameters. If you set Operational Amplifier Circuit to Multipole Circuit, you can specify the zeros.

Programmatic Use

Block parameter: Zeros
Type: character vector
Values: column vector
Default: [-9.14e+07]

Analysis

When plotting the open-loop response of the operational amplifier, include the z-domain (discrete time) approximation in addition to s-domain transfer function.

Plot the s-domain transfer function of the open loop response of the operational amplifier. The plot also reports the unity gain bandwidth and phase margin. You can choose to include the z-domain approximation.

Version History

Introduced in R2021b

expand all