Skip to content

Instantly share code, notes, and snippets.

@saiprasad1996
Created January 22, 2020 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saiprasad1996/cc5372445190bae651c2e8046bc8b100 to your computer and use it in GitHub Desktop.
Save saiprasad1996/cc5372445190bae651c2e8046bc8b100 to your computer and use it in GitHub Desktop.
import math
fc = 113.8275e3
c2 = 22e-6
fc= 90e3
gea = 60e-6
gcs=9
vout=5
vfb = 0.8
def calculateCompensationResistor():
r3 = (2*math.pi*c2*fc*vout)/(gea*gcs*vfb)
print(r3)
print('Standard form in Kohm : ',r3/1000)
return r3
def calculateCompensationCapacitor():
r3 = calculateCompensationResistor()
c3 = 4/(2*math.pi*r3*fc)
print("Capacitor - ",c3)
def calculateCrossOverFreq():
r3 = 100000
fc_cal = (r3*gea*gcs*vfb)/(2*math.pi*c2*vout)
print("Cross over frequency - ",fc_cal)
return fc_cal
calculateCompensationResistor()
calculateCompensationCapacitor()
calculateCrossOverFreq()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment