Ideal Op-Amp in Cadence Using VCVS
HTML-код
- Опубликовано: 24 фев 2020
- If you’ve ever wondered how to make an ideal op-amp in Cadence Virtuoso then this video is for you! I discuss how to create the ideal op-amp using a Voltage Controlled Voltage Source (VCVS) and I run a simple test simulation to show that it works. I also took it a step farther and used the same VCVS and added a 2-pole system to the input. This allows someone to give the “ideal” op-amp a frequency response of their own design. I use MATLAB to calculate the RC values of the system. The link to the MATLAB code is below. Please rate, subscribe, and let me know what else you’d like to see! Thanks 😊
MATLAB Code:
%Ideal_OpAmp_Generator
clear all;
close all;
clc;
syms R1 R2 W P1
C1=1E-6;
C2=1E-6;
P2 = 1.5E6;%Radians/sec
A = 100000;%DC Gain
PM = 60;%Phase Margin
num = [A*P1*P2];
den = sqrt((W*P2)^2+(10*P2-W^2)^2);
eqs = [den == num, -atan((W*P2/(P1*P2-W^2))) == PM*pi/180];
S = solve(eqs,[P1 W]);
P1 = double(S.P1);
W = double(S.W);
P1=P1(1)/(2*pi);
P2=P2(1)/(2*pi);
Calculated_UGF=sqrt(2*(sqrt(4*A^2*P1^2*P2^2+P1^4-2*P1^2*P2^2+P2^4)-P1^2-P2^2))/(4*pi);%Unity Gain Frequency
eqns = [P1 == -(sqrt((C1)^2*(R1)^2+2*C1*C2*R1*(R1-R2)+(C2)^2*((R1)^2+2*R1*R2+(R2)^2))-C1*R1-C2*(R1+R2))/(2*C1*C2*R1*R2),
P2 ==(sqrt((C1)^2*(R1)^2+2*C1*C2*R1*(R1-R2)+(C2)^2*((R1)^2+2*R1*R2+(R2)^2))+C1*R1+C2*(R1+R2))/(2*C1*C2*R1*R2)];
S = solve(eqns,[R1 R2]);
R1 = double(S.R1(1))
R2 = double(S.R2(1))
P1=-(sqrt((C1).^2.*(R1).^2+2.*C1.*C2.*R1.*(R1-R2)+(C2).^2.*((R1).^2+2.*R1.*R2+(R2).^2))-C1.*R1-C2.*(R1+R2))/(2.*C1.*C2.*R1.*R2);
P2=(sqrt((C1).^2.*(R1).^2+2.*C1.*C2.*R1.*(R1-R2)+(C2).^2.*((R1).^2+2.*R1.*R2+(R2).^2))+C1.*R1+C2.*(R1+R2))/(2.*C1.*C2.*R1.*R2);
num = [A.*P1(1).*P2(1)];
denom = [1 P1(1)+P2(1) P1(1).*P2(1)];
bode(tf(num,denom));%Plot op-loop transfer function of op-amp
Nice video. I would suggest adding 1 more vcvs with unity gain to the opamp input prior RC circuits. It'll make opamp input impedance -> infinity. So you can easily use this circuit not just with ideal voltage source at the input, but also with some real circuits before the opamp w/o any loading effects.
That is good advice! Thanks.
Thank you for the Great video.
GREAT VIDEO REALLY HELP FULL TO ME
Is there any block that has bias voltage with it?
the Matlab code doesn't exist anymore, would you mind sharing it again? Thanks。
Where to give supply voltages to the opamp, i.e VCVS here? in my case, I have no supply in the circuit except
supply voltages of the opamp
Since this is an Ideal Op-amp, it doesn't need a VDD nor VSS. But for Maximum/Minimum output voltage for the VCVS, set those to something reasonable and you should be fine.
@@speedyzebra210I'm trying to simulate a wien bridge oscillator with this ideal op amp and just like jagadish the only supply voltages are the ones to the op amp or in this case to the vcvs. I've already set a maximum/minimum output voltage like you suggested. Thanks for the video!
hi, you sure this line in the matlab code:
den = sqrt((W*P2)^2+(10*P2-W^2)^2);
isn't supposed to be:
den = sqrt((W*P2)^2+(P1*P2-W^2)^2);
?
thanks
the Matlab code doesn't exist anymore, would you mind sharing it again? Thanks。
Hi! Not sure why the link quit working. I put the code in the description so you can just copy and paste. The code works as is, but make sure it copies and pastes correctly. :)
thanks!