Configurations of the operational amplifiers
Copyright (C) 2022 Miodrag Bolic
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details <https://www.gnu.org/licenses/>.
This code was developed by Miodrag Bolic for the book PERVASIVE CARDIAC AND RESPIRATORY MONITORING DEVICES.
% Changing the path from main_folder to a particular chapter
main_path=fileparts(which('Main_Content.mlx'));
%addpath(append(main_path,'/Chapter2'))
cd (append(main_path,'/Chapter3/Amplifier configurations'))
addpath(append(main_path,'/Service'))
SAVE_FLAG=0; % saving the figures in a file
Introduction
This notebook provides an introduction to operational amplifiers and models for a:
- The model of an operational amplifier
- Basic amplifier configurations
Operational amplifier
Operational amplifiers are characterized using several parameters such as:
- Open-loop gain where and can be order of million
- Input resistance, that should be very high, for example in the order of GΩ
- Output resistance, that is commonly low in order of 100 Ω
- Minimum and maximum output voltage
- Maximum slew rate which is the maximum positive or negative rate of change of output voltage magnitude. A typical number is, for example, 2.8 V/µs.
- Open-loop bandwidth is the frequency at which the gain drops by 3 dB in comparison with the gain at low frequencies.
Operational amplifiers are normally used in negative feedback configuration in which the output is connected to one input. By doing that, the ideal operational amplifier will adjust the output until the difference of the voltages at input is close to zero.
% Please note that we are using the model provided by Mathworks here.
%% Open the model and set circuit parameters
open_system('ssc_opamp_bandlimited')
[a,b,c,d]=linmod('ssc_opamp_bandlimited');
ssc_opamp_bandlimited_bodeplot
exportgraphics(gcf,"Fig3.2b.jpg", 'Resolution',600)
%annonation_save('b)',"Fig3.2b.jpg", SAVE_FLAG);
%% Open the model and set circuit parameters
open_system('ssc_opamp_bandlimited_noninverting')
[a,b,c,d]=linmod('ssc_opamp_bandlimited_noninverting');
ssc_opamp_bandlimited_bodeplot
Exersizes
Excersize 1: Analyze frequency response of the op-amp model without the feedback circuit. What is the Gain BandWidth Product (GBWP)?
Excersize 2: Analyze frequency response of the op-amp model acting as an invertiong amplifier. What is the Gain BandWidth Product (GBWP)?
Inverting amplifier
model_name = 'inverting';
ScopeData1=sim(model_name);
temp_vin = simlog_ssc_opamp_inverting.AC_Voltage.v.series;
temp_vout = simlog_ssc_opamp_inverting.Sensor_Vout.Voltage_Sensor.V.series;
plot(temp_vin.time,temp_vin.values,'LineWidth',1);
plot(temp_vout.time,temp_vout.values,'LineWidth',1);
text(0.1e-3,0.9,'Gain of Circuit:');
text(0.1e-3,0.8,sprintf('%s %2.2f','-R2/R1 =',-max(temp_vout.values)/max(temp_vin.values)));
title('Inverting Op-Amp circuit voltages');
legend({'Input','Output'},'Location','Best');
annonation_save('b)',"Fig3.3b.jpg", SAVE_FLAG);
Noninverting amplifier
clear_all_but('SAVE_FLAG')
model_name = 'noninverting1';
temp_vin = simlog_ssc_opamp_noninverting.Sensor_Vin.Voltage_Sensor.V.series;
temp_vout = simlog_ssc_opamp_noninverting.Sensor_Vout.Voltage_Sensor.V.series;
plot(temp_vin.time,temp_vin.values,'LineWidth',1);
plot(temp_vout.time,temp_vout.values,'LineWidth',1);
text(0.05,0.9,'Gain of Circuit:');
text(0.05,0.8,sprintf('%s %2.2f','1+R2/R1 =',max(temp_vout.values)/max(temp_vin.values)));
title('Noninverting Op-Amp circuit voltages');
legend({'Input','Output'},'Location','Best');
annonation_save('d)',"Fig3.3d.jpg", SAVE_FLAG);
Differentiator
clear_all_but('SAVE_FLAG')
model_name = 'differentiator';
temp_vin = simout.Data(:,2);
temp_vout = simout.Data(:,1);
plot(simout.Time,temp_vin,'LineWidth',1);
plot(simout.Time,temp_vout,'LineWidth',1);
title('Differentiator circuit voltages');
legend({'Input','Output'},'Location','Best');
annonation_save('f)',"Fig3.3f.jpg", SAVE_FLAG);
Integrator
This is the integrator from the Problem 4.17 from the book. Please note that the values of the resistance and the capacitance are not set properly and that this should be done in order to solve Problem 4.17.
model_name = 'integrator1';
pulse1=zeros(1, length(a));
temp_vin = simout.Data(:,2);
temp_vout = simout.Data(:,1);
plot(simout.Time,temp_vin,'LineWidth',1);
plot(simout.Time,temp_vout,'LineWidth',1);
title('Differentiator Circuit Voltages');
legend({'Input','Output'},'Location','Best');