Esempio n. 1
0
    def MakeCompensation(self, selectOpen = True, selectShort = True, selectLoad = True, loadValue = 50.0):
        """
        Make CVU open, short and load compensation.

        :param selectOpen: Run CVU open compensation.
        :param selectShort: Run CVU short compensation.
        :param selectLoad: Run CVU load compensation.
        :param loadValue: Load value used for load compensation on CVU.
        """
        
        lpt.setmode(self.__cvuId, param.KI_CVU_SET_CONSTANT_FILE, self.ConstantFileNameIndex)
        lpt.setmode(self.__cvuId, param.KI_CVU_CABLE_CORRECT, self.CableLength)

        if selectOpen:
            if ShowMessageBox("Action Required", "Perform CVU open compensation.\nDisconnect output connections from any DUT.", MessageBoxType.OkCancel) == MessageBoxReturn.Ok:
                # perform open compensation on CVU
                lpt.cvu_open_comp(self.__cvuId)

        if selectShort:
            if ShowMessageBox("Action Required", "Perform CVU short compensation.\nConnect Hi to Lo output connections together.", MessageBoxType.OkCancel) == MessageBoxReturn.Ok:
                # perform short compensation on CVU
                lpt.cvu_short_comp(self.__cvuId)

        if selectLoad:
            if ShowMessageBox("Action Required", "Perform CVU load compensation.\nApply load across Hi & Lo connections.", MessageBoxType.OkCancel) == MessageBoxReturn.Ok:
                # perform load compensation on CVU
                lpt.cvu_load_comp(self.__cvuId, loadValue)
Esempio n. 2
0
    def LoadCompensationConstants(self):
        """
        Loads a compensation constants file.

        :param constantFileNameIndex: Number (#) used to create the constants#.xml file.
        """
        if self.ConstantFileNameIndex > 0:
            constantFileName = "c:\\s4200\\sys\\constants\\constants{}.xml".format(self.ConstantFileNameIndex)
        else:
            constantFileName = "c:\\s4200\\sys\\constants\\constants.xml"

        if not os.path.exists(constantFileName):
            raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), constantFileName)

        lpt.setmode(self.__cvuId, param.KI_CVU_SET_CONSTANT_FILE, self.ConstantFileNameIndex)
Esempio n. 3
0
def CvuCompensation(cableLength,
                    selectOpen=True,
                    selectShort=True,
                    selectLoad=True,
                    loadValue=50.0,
                    constantFileNameIndex=1):
    """
    Make CVU open, short and load compensation.

    :param cableLength: Cable length used in setup (0, 1.5, 3) (in meters).
    :param selectOpen: Run CVU open compensation.
    :param selectShort: Run CVU short compensation.
    :param selectLoad: Run CVU load compensation.
    :param loadValue: Load value used for load compensation on CVU.
    :param constantFileNameIndex: Number (#) used to create the constants#.htm file.
    """

    # get CVU instrument ID
    cvu = lpt.getinstid("CVU1")

    lpt.setmode(cvu, param.KI_CVU_SET_CONSTANT_FILE, constantFileNameIndex)
    lpt.setmode(cvu, param.KI_CVU_CABLE_CORRECT, cableLength)

    if selectOpen:
        if msgbox.askokcancel(
                "Action Required",
                "Perform CVU open compensation.\nDisconnect output connections from any DUT."
        ):
            # perform open compensation on CVU
            lpt.cvu_open_comp(cvu)

    if selectShort:
        if msgbox.askokcancel(
                "Action Required",
                "Perform CVU short compensation.\nConnect Hi to Lo output connections together."
        ):
            # perform short compensation on CVU
            lpt.cvu_short_comp(cvu)

    if selectShort:
        if msgbox.askokcancel(
                "Action Required",
                "Perform CVU load compensation.\nApply load across Hi & Lo connections."
        ):
            # perform load compensation on CVU
            lpt.cvu_load_comp(cvu, loadValue)
def MosfetTransferCurve(numPoints, endVoltage):

    # load lpt library
    lpt.initialize()

    # initialie K4200
    lpt.tstsel(1)
    lpt.devint()

    # get gate, drain and source SMU
    smuGate = lpt.getinstid("SMU1")
    smuDrain = lpt.getinstid("SMU2")
    smuSource = lpt.getinstid("SMU3")

    # set limits and ranges
    lpt.limiti(smuGate, 1e-3)
    lpt.limiti(smuSource, 11E-3)
    lpt.limiti(smuDrain, 10E-3)

    lpt.lorangei(smuDrain, 1E-9)

    # set initial voltages
    lpt.forcev(smuSource, 0)
    lpt.forcev(smuGate, 0)
    lpt.forcev(smuDrain, 0.1)

    # set measurement integration time
    lpt.setmode(smuGate, param.KI_INTGPLC, 1.0)
    lpt.setmode(smuDrain, param.KI_INTGPLC, 1.0)

    # initialize the arrays to store the measurement data
    vArr = []
    iArr = []

    # initialize plot
    plt.ion()
    fig = plt.figure()
    axes = fig.add_subplot(111)
    line, = axes.plot(vArr, iArr, 'b-')

    plt.title("Mosfet transfer curve")
    plt.xlabel("Gate voltage (V)")
    plt.ylabel("Drain current (A)")
    plt.grid(True)

    # measurement loop
    for index in range(0, numPoints):

        # calculate the gate voltage
        voltGate = index / numPoints * endVoltage

        # force gate voltage
        lpt.forcev(smuGate, voltGate)

        # settling time 10 ms
        lpt.delay(10)

        # measue gate voltage and drain current
        v = lpt.intgv(smuGate)
        i = lpt.intgi(smuDrain)

        # store measurement values in arrays
        vArr.append(v)
        iArr.append(i)

        # output gate voltage and drain current
        print("Gate: {:2.3f} V, Drain: {:2.3g} mA".format(v, i * 1000.0))

        # update plot curve
        line.set_data(vArr, iArr)

        # autoscale plot
        axes.relim()
        axes.autoscale_view(True, True, True)

        # redraw curve
        fig.canvas.draw()

    # reset SMUs to default values
    lpt.devint()
Esempio n. 5
0
def MosfetTransferCurve(gateStartVolt, gateEndVolt, gateStepVolt,
                        drainStartVolt, drainEndVolt, drainStepVolt):

    # load lpt library
    lpt.initialize()

    # initialie K4200
    lpt.tstsel(1)
    lpt.devint()

    # get gate, drain and source SMU
    smuGate = lpt.getinstid("SMU1")
    smuDrain = lpt.getinstid("SMU2")
    smuSource = lpt.getinstid("SMU3")

    # set limits and ranges
    lpt.limiti(smuGate, 1e-3)
    lpt.limiti(smuSource, 11E-3)
    lpt.limiti(smuDrain, 10E-3)

    lpt.lorangei(smuDrain, 1E-9)

    # set initial voltages
    lpt.forcev(smuSource, 0)
    lpt.forcev(smuGate, 0)
    lpt.forcev(smuDrain, 0)

    # set measurement integration time
    lpt.setmode(smuGate, param.KI_INTGPLC, 0.01)
    lpt.setmode(smuDrain, param.KI_INTGPLC, 0.01)

    # disable range delay
    lpt.setmode(smuDrain, param.KI_RANGE_DELAY, 0)

    # initialize plot
    plt.ion()
    fig = plt.figure()
    axes = fig.add_subplot(111)

    plt.title("Mosfet transfer curve")
    plt.xlabel("Gate voltage (V)")
    plt.ylabel("Drain current (A)")
    plt.grid(True)

    # calculate point count
    gateIndexEnd = int(round((gateEndVolt - gateStartVolt) / gateStepVolt))
    drainIndexEnd = int(round((drainEndVolt - drainStartVolt) / drainStepVolt))

    # gate voltage loop
    for gateIndex in range(0, gateIndexEnd):

        # calculate and force gate voltage
        gateVolt = gateStartVolt + gateStepVolt * gateIndex
        lpt.forcev(smuGate, gateVolt)

        # initialize the arrays to store the measurement data
        vArr = []
        iArr = []

        line, = axes.plot(vArr, iArr, 'b-')

        # drain voltage loop
        for drainIndex in range(0, drainIndexEnd):

            # calculate and force drain voltage
            drainVolt = drainStartVolt + drainStepVolt * drainIndex
            lpt.forcev(smuDrain, drainVolt)

            # settling time 10 ms
            lpt.delay(10)

            # measue gate voltage and drain current
            v = lpt.intgv(smuDrain)
            i = lpt.intgi(smuDrain)

            # store measurement values in arrays
            vArr.append(v)
            iArr.append(i)

            # output gate voltage and drain current
            print("Gate: {:2.3f} V, Drain: {:2.3f} V, {:2.3g} mA".format(
                gateVolt, v, i * 1000.0))

            # update plot curve
            line.set_data(vArr, iArr)

            # autoscale plot
            axes.relim()
            axes.autoscale_view(True, True, True)

            # redraw curve
            fig.canvas.draw()

        # set drain voltage to 0 V before a new loop starts
        lpt.forcev(smuDrain, 0)

    # reset SMUs to default values
    lpt.devint()
Esempio n. 6
0
    def MeasureCV(self,
                  dcVoltageStart, dcVoltageEnd, dcVoltageStep,
                  settlingTime,
                  acVoltage, acFrequency,
                  initialDelay = 0.5,
                  cvuRange = K4210CvuRange.Auto,
                  cvuSpeed = K4210CvuSpeed.Normal,
                  openCompensation = False, shortCompensation = False, loadCompensation = 0):
        """
        Performs a CV measurement.

        :param dcVoltageStart:
        :param dcVoltageEnd:
        :param dcVoltageStep:
        :param settlingTime: Settling time in seconds for DC voltage sweep.
        :param acVoltage: AC voltage level (1e-3 to 0.1).
        :param acFrequency: Frequence for CVU AC voltage (10 kHz to 10 MHz).
        :param initialDelay: Delay time after apply first voltage and before the first measurement starts.
        :param cvuRange: CVU measurement range (see K4210CvuRange).
        :param cvuSpeed: CVU measurement speed (see K4210CvuSpeed).
        """

        cvuId = self.__cvuId

        dcVoltMax = max(abs(dcVoltageStart), abs(dcVoltageEnd))
        dcVoltPoints = int(round((dcVoltageEnd - dcVoltageStart) / dcVoltageStep + 1.0))

        # initialize CVU
        lpt.forcev(cvuId, 0)

        # configure compensation
        lpt.setmode(cvuId, param.KI_CVU_OPEN_COMPENSATE, 1 if openCompensation else 0)
        lpt.setmode(cvuId, param.KI_CVU_SHORT_COMPENSATE, 1 if shortCompensation else 0)
        lpt.setmode(cvuId, param.KI_CVU_LOAD_COMPENSATE, loadCompensation)

        # set AC voltage
        lpt.setlevel(cvuId, acVoltage)
        lpt.setfreq(cvuId, acFrequency)
        lpt.rangei(cvuId, cvuRange.value)

        # CVU speed settings
        cvuSpeedVal = param.KI_CVU_SPEED_NORMAL
        
        if cvuSpeed == K4210CvuSpeed.Fast:
            cvuSpeedVal = param.KI_CVU_SPEED_FAST
            
        if cvuSpeed == K4210CvuSpeed.Slow:
            cvuSpeedVal = param.KI_CVU_SPEED_QUIET
        
        vArr = []
        cpArr = []
        gpArr = []
        tArr = []

        # apply first voltage
        lpt.forcev(cvuId, dcVoltageStart)
        lpt.delay(int(initialDelay * 1000))
        
        # sweep DC voltage
        for dcVoltIndex in range(0, dcVoltPoints):

            dcVolt = dcVoltageStart + dcVoltageStep * dcVoltIndex

            # force DC voltage
            lpt.forcev(cvuId, dcVolt)
            lpt.delay(int(settlingTime * 1000))

            # measure impedance
            cp, gp = lpt.measz(cvuId, param.KI_CVU_TYPE_CPGP, cvuSpeedVal)
            t = lpt.meast(cvuId)

            stat = int(lpt.getstatus(cvuId, param.KI_CVU_MEASURE_STATUS))
            if (stat & (~3)) != 0:
                raise RuntimeError("CVU error: {}".format(stat))
            
            # store values
            vArr.append(dcVolt)
            cpArr.append(cp)
            gpArr.append(gp)
            tArr.append(t)
        
        # set all sources to zero
        lpt.devint()

        return vArr, cpArr, gpArr, tArr