在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 6115|回复: 19

[求助] 晶振仿真问题求助

[复制链接]
发表于 2020-12-14 11:38:59 来自手机 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
使用皮尔斯振荡器,起振要求反相器跨导gm>5*gmcrit。这里的反相器跨导是指什么
IMG_20201214_113312.jpg
IMG_20201214_113337.jpg
 楼主| 发表于 2020-12-15 15:02:19 来自手机 | 显示全部楼层
环路增益要怎么仿,仿出来的波形应该是怎么样的?
发表于 2020-12-15 18:12:53 | 显示全部楼层
本帖最后由 jzr1989 于 2020-12-15 18:20 编辑

仿真波形是这样的:
image.png

image.png
发表于 2020-12-15 18:28:36 | 显示全部楼层
还有这个,找gm_crit用的

image.png
发表于 2020-12-17 09:29:39 | 显示全部楼层


jzr1989 发表于 2020-12-15 18:28
还有这个,找gm_crit用的


能否分享一下你的code,xiexie !!

发表于 2020-12-18 15:51:59 | 显示全部楼层


love1226 发表于 2020-12-17 09:29
能否分享一下你的code,xiexie !!





  1. clear;
  2. clc;

  3. % Series resonant circuit model of montional osillation
  4. syms wm fm Lm Cm Rm Q real;
  5. fm=4.00e6;Cm=5.0e-15;Rm=400.0;% Designer specified parameters:motional resonant frequency
  6. %,motional capacitance and motional resistance
  7. wm=2*pi*fm;% Calculate motional resonant angular frequency
  8. Lm=wm^-2/Cm;% Calculate motional inductance
  9. Q=1/(wm*Cm*Rm);% Calculate quality factor

  10. % Ocillator circuit model
  11. syms Rf C3 C1 C2 Cload gm real;
  12. Rf=1e6;
  13. %gm=34.5e-3;
  14. C3=5.0e-12;C1=16.0e-12;C2=16.0e-12;
  15. Cload=C1*C2/(C1+C2);
  16. % Actual ocillation angular frequency
  17. syms w wa f;
  18. %w=wm*(1+Cm/(2*(C3+Cload)));% Calculate actual ocillation angular frequency
  19. w=wm*sqrt(1+Cm/(C3+Cload));% Calculate actual ocillation angular frequency
  20. f=w/(2*pi);

  21. wa=wm*sqrt(1+Cm/C3);% Calculate anti ocillation angular frequency
  22. fa=wa/(2*pi);


  23. % The mount of frequeancy pulling above wm
  24. syms p real;
  25. p=(w-wm)/wm;

  26. % Motional impedance
  27. syms Zm;
  28. Zm=Rm+1i*2*p/(w*Cm);

  29. % Oscilator circuit impedance
  30. syms Zc Z1 Z2 Z3 R1 R2 R3;
  31. %Z1=1/(1i*w*C1);Z2=1/(1i*w*C2);Z3=1/(1i*w*C3+1/Rf);% Rf
  32. %Z1=1/(1i*w*C1);Z2=1/(1i*w*C2);Z3=1/(1i*w*C3);% For lossless circuit
  33. R1=inf;R2=inf;R3=inf;
  34. Z1=1/(1i*w*C1+1/R1);Z2=1/(1i*w*C2+1/R2);Z3=1/(1i*w*C3+1/R3);% For lossy circuit
  35. Zc=(Z1*Z3+Z2*Z3+gm*Z1*Z2*Z3)/(Z1+Z2+Z3+gm*Z1*Z2);

  36. % Transconductances
  37. syms gm_crit gm_max gm_opt Rneg Rneg_max real;
  38. Rneg=real(Zc);
  39. gm_opt=solve(diff(Rneg),gm);
  40. gm_opt=double(gm_opt(2));
  41. %gm_opt=w*(C1+C2+C1*C2/C3);
  42. Rneg_max=double(subs(Rneg,'gm',gm_opt));
  43. %Rneg_max=-1/(2*w*C3*(1+(C1+C2)*C3/(C1*C2)));

  44. gm_crit_max=double(solve(Rneg==-Rm,gm));
  45. %gm_crit_max=solve(Rneg==-Rm,gm);
  46. gm_crit=gm_crit_max(1);
  47. %gm_crit=(w*(C1*C2+C2*C3+C3*C1)^2)/(Q*Cm*C1*C2);
  48. gm_max=gm_crit_max(2);

  49. %Actual gm and Rneg
  50. gm=0.1e-3:0.1e-4:500.0e-3;
  51. Rneg=double(subs(Rneg,'gm',gm));
  52. figure(10);
  53. semilogx(gm,Rneg,'r-');grid on
  54. xlabel('gm(S)');
  55. ylabel('Negative Resistance(ohm)');
  56. title(['Negative Resistance VS. gm',newline,'fm=',num2str(fm/1000000,'%.f'),'MHz']);
  57. hold on

  58. xlim=get(gca,'Xlim');
  59. plot(xlim,[min(Rneg),min(Rneg)],'b-')
  60. plot(xlim,[-Rm,-Rm],'m-');
  61. % plot(xlim,[-200,-200],'c-');

  62. ylim=get(gca,'Ylim');
  63. plot([gm_crit,gm_crit],ylim,'k--');
  64. plot([gm_opt,gm_opt],ylim,'k--');
  65. plot([gm_max,gm_max],ylim,'k--');
  66. % plot([10.84e-3,10.84e-3],ylim,'k--');
  67. % plot([40.37e-3,40.37e-3],ylim,'k--');
  68. clear xlim ylim;
  69. text(gm_crit,-Rm,['(gm_crit,-Rm)',newline,'(',num2str(1000*gm_crit,'%.2f'),'m,',num2str(-Rm,'%.0f'),')',newline,newline],'Interpreter','none');
  70. text(gm_opt,Rneg_max,['(gm_opt,Rneg_max)',newline,'(',num2str(1000*gm_opt,'%.2f'),'m,',num2str(Rneg_max,'%.0f'),')',newline,newline],'Interpreter','none');
  71. text(gm_max,-Rm,['(gm_max,-Rm)',newline,'(',num2str(1000*gm_max,'%.2f'),'m,',num2str(-Rm,'%.0f'),')',newline,newline],'Interpreter','none');
  72. legend('Negative Resistance','Max Negative Resistance','Motional Resistance','Location','Best');


  73. syms Cc;

  74. ww=wm*sqrt(1+Cm/Cc);
  75. ff=ww/(2*pi);

  76. Cc=-(w*imag(Zc))^-1;
  77. Cc=double(subs(Cc,'gm',gm));
  78. figure(20)
  79. semilogx(gm,Cc,'b-');grid on
  80. axis([0.1e-3,1000.0e-3,C3-1e-12 C3+Cload+1e-12]);
  81. xlabel('gm(S)');
  82. ylabel('Capacitance(F)');
  83. title(['Capacitance VS. gm',newline,'fm=',num2str(fm/1000000,'%.f'),'MHz']);
  84. hold on

  85. xlim=get(gca,'Xlim');
  86. plot(xlim,[max(Cc),max(Cc)],'c-');
  87. plot(xlim,[min(Cc),min(Cc)],'m-');

  88. ylim=get(gca,'Ylim');
  89. plot([gm_crit,gm_crit],ylim,'k--');
  90. plot([gm_opt,gm_opt],ylim,'k--');
  91. plot([gm_max,gm_max],ylim,'k--');

  92. clear xlim ylim;
  93. text(10e-5,max(Cc),[' Cload+C3:',newline,' ',num2str(1e12*(Cload+C3),'%.1f'),'p',newline,newline],'Interpreter','none');
  94. text(10e-5,min(Cc),[' C3:',newline,' ',num2str(1e12*C3,'%.1f'),'p',newline,newline],'Interpreter','none');
  95. text(gm_crit,min(ylim),[' gm_crit:',newline,' ',num2str(1e3*gm_crit,'%.2f'),'m',newline,newline],'Interpreter','none');
  96. text(gm_opt,min(ylim),[' gm_opt:',newline,' ',num2str(1e3*gm_opt,'%.2f'),'m',newline,newline],'Interpreter','none');
  97. text(gm_max,min(ylim),[' gm_max:',newline,' ',num2str(1e3*gm_max,'%.2f'),'m',newline,newline],'Interpreter','none');
  98. legend('Cc','Cload+C3','C3','Location','Best')




  99. %A=2*Rm*w*C3*(C1*C2+C2*C3+C1*C3)/C1/C2

  100. %semilogx(gm,subs(imag(Zc),'gm',gm),'r-');grid on


复制代码


发表于 2020-12-18 15:53:09 | 显示全部楼层


love1226 发表于 2020-12-17 09:29
能否分享一下你的code,xiexie !!





  1. clear
  2. clc
  3. syms s V1 V2 Vin real;
  4. fm=4.0e6;Cm=5.0e-15;Rm=4000.0;
  5. %syms fm Cm Rm;
  6. wm=2*pi*fm;
  7. Lm=wm^-2/Cm;
  8. %syms Lm;
  9. C3=5.0e-12;C1=16.0e-12;C2=16.0e-12;
  10. %syms C3 C1 C2;
  11. %gm=34.66e-3;
  12. %syms gm;
  13. %gm=0.001720210255586;
  14. %gm=0.020914461554307;
  15. gm=0.254279789744414;

  16. Cload=C1*C2/(C1+C2);
  17. w=wm*sqrt(1+Cm/(C3+Cload));
  18. f=w/(2*pi);
  19. wa=wm*sqrt(1+Cm/C3);
  20. fa=wa/(2*pi);

  21. [V1,V2]=solve(-(V1-V2)/(1/(s*Cm)+s*Lm+Rm)+s*C3*(V2-V1)-s*C1*V1==0,(V1-V2)/(1/(s*Cm)+s*Lm+Rm)-gm*Vin-s*C2*V2-s*C3*(V2-V1)==0,[V1,V2]);
  22. LoopGain=V1/Vin;
  23. syms ww ff
  24. LoopGain_jw=subs(LoopGain,'s',1i*ww);
  25. LoopGain_jf=subs(LoopGain_jw,'ww',2*pi*ff);
  26. LoopGain_real=real(LoopGain_jf);
  27. LoopGain_imag=imag(LoopGain_jf);
  28. LoopGain_mag=sqrt((LoopGain_real)^2+(LoopGain_imag)^2);
  29. LoopGain_mag_db=20*log10(sqrt((LoopGain_real)^2+(LoopGain_imag)^2));

  30. LoopGain_pha=atan(LoopGain_imag/LoopGain_real)*180/pi;

  31. %ff=1:1e6:100e6;
  32. ff=fm-20e3:0.05e3:fm+40e3;
  33. LoopGain_mag_db=subs(LoopGain_mag_db,'ff',ff);
  34. LoopGain_pha=subs(LoopGain_pha,'ff',ff);

  35. figure(1)
  36. hold on

  37. subplot(2,1,1)
  38. plot(ff,LoopGain_mag_db,'b')
  39. xlabel('Frequency(Hz)');
  40. ylabel('Magnitude(dB)');
  41. grid on
  42. hold on
  43. ylim=get(gca,'Ylim');
  44. plot([f,f],ylim,'k--');
  45. plot([fm,fm],ylim,'k--');
  46. plot([fa,fa],ylim,'k--');
  47. clear xlim ylim;

  48. subplot(2,1,2)
  49. plot(ff,LoopGain_pha,'b')
  50. xlabel('Frequency(Hz)');
  51. ylabel('Phase(deg)');
  52. grid on
  53. hold on
  54. ylim=get(gca,'Ylim');
  55. plot([f,f],ylim,'k--');
  56. plot([fm,fm],ylim,'k--');
  57. plot([fa,fa],ylim,'k--');
  58. clear xlim ylim;

  59. suptitle(['Oscillaor Loop Gain',newline,'fm=',num2str(fm/1e6,'%.f'),'MHz']);
  60. hold on

  61. % [LoopGain_num,LoopGain_den]=numden(LoopGain);
  62. %
  63. % LoopGain_num_coeffs=double(coeffs(expand(LoopGain_num),s,'All'));
  64. % %  fliplr(LoopGain_num_coeffs);
  65. %
  66. % LoopGain_den_coeffs=double(coeffs(expand(LoopGain_den),s,'All'));
  67. % %  fliplr(LoopGain_den_coeffs);
  68. %
  69. % LoopGain_tf=tf(LoopGain_num_coeffs,LoopGain_den_coeffs);
  70. %
  71. % figure(2)
  72. %
  73. % P=bodeoptions;
  74. % P.Grid='on';
  75. % P.FreqScale='log';
  76. % %P.Xlim={[fm-2e6 fm+2e6]};
  77. % %P.XlimMode={'manual'};
  78. % P.FreqUnits='Hz';
  79. % bodeplot(LoopGain_tf,P,'r')
  80. % % bode(LoopGain_tf)
  81. % hold on

  82. ylim=get(gca,'Ylim');
  83. plot([f,f],ylim,'k--');
  84. plot([fm,fm],ylim,'k--');
  85. clear xlim ylim;


复制代码


发表于 2020-12-20 12:41:24 | 显示全部楼层
路过学习,很实用,学习分享。
发表于 2020-12-20 12:42:19 | 显示全部楼层
路过学习,很实用,学习分享。
发表于 2020-12-22 15:18:31 | 显示全部楼层
路过学习,很实用,学习分享。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-1 04:00 , Processed in 0.033138 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表