The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Modeling >> Behavioral Models >> VerilogA Non Ideal OpAmp Model Voltage Limiting https://designers-guide.org/forum/YaBB.pl?num=1372205785 Message started by aintk on Jun 25th, 2013, 5:16pm |
Title: VerilogA Non Ideal OpAmp Model Voltage Limiting Post by aintk on Jun 25th, 2013, 5:16pm I am trying to build up a basic non-ideal opamp model in Verilog A and am having trouble understanding why my implementation of the voltage limiting doesn't function as I would expect it to(credit given to a model I saw somewhere that use an identical idea). Specifically, when I run a DC sweep from -20 to 20(where vss=-15 and vdd=15), I observe ideal behavior. Any explanations/help would be very appreciated. Code:
|
Title: Re: VerilogA Non Ideal OpAmp Model Voltage Limiting Post by boe on Jun 26th, 2013, 1:16am aintk wrote on Jun 25th, 2013, 5:16pm:
The code works by limiting the output current near vout_max/min. - B O E |
Title: Re: VerilogA Non Ideal OpAmp Model Voltage Limiting Post by aintk on Jun 26th, 2013, 2:24pm I first ran a simulation that did a dc sweep between -20 and 20V while the amplifier was in unity gain feedback. The output still saw a normal -20 to 20V ramp without the clipping I would expect. I figured there might be an issue with starting in an invalid range so i also did a test for 0 to 20V where I saw the same behavior(no clipping at 15V just a ramp). Thanks for the help. |
Title: Re: VerilogA Non Ideal OpAmp Model Voltage Limiting Post by boe on Jun 27th, 2013, 3:23am aintk, oh, ideal = not clipping. - B O E |
Title: Re: VerilogA Non Ideal OpAmp Model Voltage Limiting Post by weber8722 on Mar 1st, 2015, 11:04am Hi, best test the model 1st without feedback, this makes life much easier! Instead of the horrible 2 if-statements better use the min and max functions (or make little macros). ylimited=max(ymin,min(y,ymax)); // :) Bye Stephan |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |