예제 #1
0
    with Schematic(filename='mfed.svg', line_width=2, background='none'):

        vin = Source(name='Vin', value='1 V', kind='sine')
        Ground(C=vin.n)
        rs = Resistor(name='Rs', value=Rref, n=vin.p, xoff=25)
        Wire([vin.p, rs.n])
        c1 = Capacitor(name='C1', value=C1, p=rs.p, xoff=25)
        Ground(C=c1.n)
        l2 = Inductor(name='L2', value=L2, n=c1.p, xoff=25)
        Wire([rs.p, l2.n])
        c3 = Capacitor(name='C3', value=C3, p=l2.p, xoff=25)
        Ground(C=c3.n)
        l4 = Inductor(name='L4', value=L4, n=c3.p, xoff=25)
        Wire([l2.p, l4.n])
        c5 = Capacitor(name='C5', value=C5, p=l4.p, xoff=25)
        Ground(C=c5.n)
        rl = Resistor(name='Rl', value=Rref, p=c5.p, xoff=100, orient='v')
        Ground(C=rl.n)
        out = Pin(name='out', C=rl.p, xoff=50, w=2)
        Wire([l4.p, out.t])
        Label(S=c3.N, yoff=-50, name=f'{Fo} LPF', loc='s')
        Dot(C=c1.p)
        Dot(C=c3.p)
        Dot(C=c5.p)
        Dot(C=rl.p)

except Error as e:
    e.report()
except OSError as e:
    error(os_error(e))
예제 #2
0
#!/usr/bin/env python3

from svg_schematic import (Schematic, Amp, Dot, Ground, Label, Pin, Resistor,
                           Source, Wire)
from inform import Error, error, os_error

try:
    with Schematic(filename="noninverting.svg", line_width=2):

        vin = Source(kind='sine')
        Label(C=vin.p, name='Vin', loc='n')
        Ground(C=vin.n)
        amp = Amp(pi=vin.p, xoff=100, kind='oa')
        Label(C=amp.ni, xoff=-25, name='Vf', loc='n')
        Wire([vin.p, amp.pi])
        out = Pin(C=amp.o, xoff=50, name='out', w=2)
        Wire([amp.o, out.C])
        oj = Dot(C=amp.o, xoff=25)
        r1 = Resistor(p=amp.ni, off=(-25, 50), name='R1', orient='v')
        Wire([r1.N, amp.ni], kind='|-')
        r2 = Resistor(C=amp.C, yoff=75, name='R2')
        Wire([r1.p, r2.W], kind='|-')
        Wire([oj.C, r2.E], kind='|-')
        fj = Dot(C=r2.W, xoff=-25)
        Ground(C=r1.n)

except Error as e:
    e.report()
except OSError as e:
    error(os_error(e))
예제 #3
0
        Wire([pfet.d, ind.n])
        cap = Capacitor(p=ind.p, orient='v')
        Ground(C=cap.n)
        out = Pin(C=ind.p, xoff=100, kind='out', name='out', w=2)
        out_wire = Wire([ind.p, out.C])

        fb = shift_y(R1.n, 100)

        Rt = Resistor(n=with_x(fb, out_wire.m), orient='v')
        Rb = Resistor(p=with_x(fb, out_wire.m), orient='v')
        Wire([Rt.p, with_y(Rt.p, out.C)])
        Ground(C=Rb.n)

        RG = Box(o=C1.n, yoff=175)
        rg2cmp = Wire([RG.o, cmp.ni], kind='-|-')
        Dot(C=with_y(rg2cmp.m, fb), color='white')
        Wire([
            shift_x(RG.C, -30),
            shift(RG.C, -25, 25),
            shift(RG.C, 25, -25),
            shift_x(RG.C, 30)
        ])
        Label(C=RG.S, loc='s', name='ramp_gen')
        Wire([R1.n, fb, Rt.n], kind='|-')

        en = Pin(C=lvl.C, yoff=250, kind='in', name='en', w=2)
        Wire([en.C, shift_x(en.C, 50)])
        avss = Pin(C=en.C, yoff=50, kind='in', name='avss', w=2)
        Wire([avss.C, shift_x(avss.C, 50)])

except Error as e:
예제 #4
0
#!/usr/bin/env python3

from svg_schematic import (Schematic, Amp, Dot, Ground, Label, Pin, Resistor,
                           Source, Wire)
from inform import Error, error, os_error

try:
    with Schematic(filename="inverting.svg", font_size=16,
                   font_family='serif'):

        vin = Pin(kind='in', name='in', w=1.5)
        vout = Pin(C=vin.C, xoff=350, kind='out', name='out', w=2)
        Wire([vin.C, vout.C])
        rin = Resistor(W=vin.C, xoff=25, name='Rin')
        vg = Dot(C=rin.E, xoff=25)
        rfb = Resistor(W=vg.C, xoff=25, name='Rfb')
        oj = Dot(C=rfb.E, xoff=25)
        amp = Amp(C=rfb.C, yoff=75, orient='-', kind='oa')
        Wire([oj.C, amp.o], kind='|-')
        gnd = Ground(C=amp.pi, xoff=-25, orient='h|')
        Wire([gnd.C, amp.pi])
        Wire([vg.C, amp.ni], kind='|-')
        Label(C=vg.C, name='Vg', loc='sw')

except Error as e:
    e.report()
except OSError as e:
    error(os_error(e))
예제 #5
0
        d3 = Diode(a=d2.c, xoff=50, orient='h')
        c3 = Capacitor(p=d3.c, off=(25, 25), orient='v')
        d4 = Diode(a=d3.c, xoff=50, orient='h')
        c4 = Capacitor(p=d4.c, off=(25, 25), orient='v')
        d5 = Diode(a=d4.c, xoff=50, orient='h')
        c5 = Capacitor(p=d5.c, off=(25, 25), orient='v')
        vout = Pin(C=d5.c, xoff=75, kind='out', name=r'$V_{\rm out}$', w=2)
        Ground(t=c5.n)

        Wire([vin.t, d1.a])
        Wire([d1.c, d2.a])
        Wire([d2.c, d3.a])
        Wire([d3.c, d4.a])
        Wire([d4.c, d5.a])
        Wire([d5.c, vout.t])
        Wire([with_x(vin.t, c1.C), c1.p])
        Wire([with_x(vin.t, c2.C), c2.p])
        Wire([with_x(vin.t, c3.C), c3.p])
        Wire([with_x(vin.t, c4.C), c4.p])
        Wire([with_x(vin.t, c5.C), c5.p])
        Wire([p1.t, c1.n], kind='-|')
        Wire([p2.t, c2.n], kind='-|')
        co = Dot(C=with_x(p1.C, c2.C), color='white')     # wire cross over
        Wire([p1.t, c3.n], kind='-|')
        Wire([p2.t, c4.n], kind='-|')

except Error as e:
    e.report()
except OSError as e:
    error(os_error(e))