transistordatabase package

exception databaseClasses.MissingDataError

Bases: Exception

class databaseClasses.Transistor(transistor_args, switch_args, diode_args)

Bases: object

Groups data of all other classes for a single transistor. Methods are specified in such a way that only user-interaction with this class is necessary (ToDo!) Documentation on how to add or extract a transistor-object to/from the database can be found in (ToDo!)

class ChannelData(args)

Bases: object

Contains channel V-I data for either switch or diode. Data is given for only one junction temperature t_j. For different temperatures: Create additional ChannelData-objects and store them as a list in the respective Diode- or Switch-object. This data can be used to linearize the transistor at a specific operating point

class Diode(diode_args)

Bases: object

Contains data associated with the (reverse) diode-characteristics of a MOSFET/SiC-MOSFET or IGBT. Can contain multiple channel- and e_rr- datasets.

find_approx_wp(t_j, v_g, normalize_t_to_v=10, SwitchEnergyData_dataset_type='graph_i_e')

This function looks for the smallest distance to stored object value and returns this working point :param t_j: junction temperature :param v_g: gate voltage :param normalize_t_to_v: ratio between t_j and v_g. e.g. 10 means 10°C is same difference as 1V :return: channel-object, e_rr-object

plot_all_channel_data(buffer_req=False)

Plot all channel data

plot_energy_data(buffer_req=False)

Plot all switching data for diode i-e-graphs

plot_energy_data_r(buffer_req=False)

Plot all switching data for diode r-e-graphs

class FosterThermalModel(args)

Bases: object

Contains data to specify parameters of the Foster thermal_foster model. This model describes the transient temperature behavior as a thermal_foster RC-network. The necessary parameters can be estimated by curve-fitting transient temperature data supplied in graph_t_rthjc or by manually specifying the individual 2 out of 3 of the parameters R, C, and tau.

class LinearizedModel(args)

Bases: object

Contains data for a linearized Switch/Diode depending on given operating point. Operating point specified by t_j, i_channel and (not for all diode types) v_g.

class Switch(switch_args)

Bases: object

Contains data associated with the switchting-characteristics of a MOSFET/SiC-MOSFET or IGBT. Can contain multiple channel-, e_on- and e_off-datasets.

find_approx_wp(t_j, v_g, normalize_t_to_v=10, SwitchEnergyData_dataset_type='graph_i_e')

This function looks for the smallest distance to stored object value and returns this working point :param t_j: junction temperature :param v_g: gate voltage :param normalize_t_to_v: ratio between t_j and v_g. e.g. 10 means 10°C is same difference as 1V :param SwitchEnergyData_dataset_type: preferred dataset_type (single, graph_r_e, graph_i_e) for e_on and e_off :return: channel-object, e_on-object, e_off-object

plot_all_channel_data(switch_type=None, buffer_req=False)

Plot all channel data

plot_channel_data_temp(temperature)

Plot channel data with chosen temperature

plot_channel_data_vge(gatevoltage)

Plot channel data with a chosen gate-voltage

plot_energy_data(buffer_req=False)

Plot all switching data for i-e-graphs

plot_energy_data_r(buffer_req=False)

Plot all switching data for r-e-graphs

class SwitchEnergyData(args)

Bases: object

Contains switching energy data for either switch or diode. The type of Energy (E_on, E_off or E_rr) is already implicitly specified by how the respective objects of this class are used in a Diode- or Switch-object. For each set (e.g. every curve in the datasheet) of switching energy data a separate object should be created. This also includes the reference values in a datasheet given without a graph. (Those are considered as data sets with just a single data point.) Data sets with more than one point are given as graph_i_e with an r_g parameter or as graph_r_e with an i_x parameter. Unused parameters or datasets should be left empty. Which of these cases (single point, E vs I dataset, E vs R dataset) is valid for the current object also needs to be specified by the dataset_type-property.

class VoltageDependentCapacitance(args)

Bases: object

Contains graph_v_c data for transistor class. Data is given for only one junction temperature t_j. For different temperatures: Create additional VoltageDependentCapacitance-objects and store them as a list in the transistor-object.

class WP

Bases: object

Class WP is for user calculations in python. The user is able to linearize the channel and store the result in transistor.wp . Doing so, it will be easy to handle transistor objects in later calculating code. Always initialized as None. Always exported as None to .json or to database. This is a temporary workspace.

buildList(attribute)

Gather list data (e.g. channel/e_on/e_off/e_rr) and check for ‘None’ :param Transistor: transistor object :param attribute: attribute path to list :return: matlab compatible list of all attributes

calc_lin_channel(t_j, v_g, i_channel, switch_or_diode)

Get interpolated channel parameters. This function searches for ui_graphs with the chosen t_j and v_g. At the desired current, the equivalent parameters for u_channel and r_channel are returned :param t_j: junction temperature :param v_g: gate voltage :param i_channel: current to linearize the channel :param switch_or_diode: ‘switch’ or ‘diode’ :return: linearized parameters for v_channel, r_channel

calc_object_i_e(e_on_off_rr, r_g, t_j, v_supply, normalize_t_to_v)

Calculate loss curves for other gate resistor than the standard one. This function uses i_e loss curve in combination with r_e loss curve, to calculate a new i_e loss curve for a choosen gate restistor. Also voltage correction is implemented (e.g. half voltage compared to datasheet means half losses) Note: r_e_object may has not same voltage as i_e_object. #ToDo: r_e_object may has not same voltage as i_e_object. :param e_on_off_rr: ‘e_on’, ‘e_off’, ‘e_rr’ :param r_g: gate resistor of interest :param t_j: juncntion temperature of interest :param v_supply: supply voltage of interest :return: object with corrected i_e curves due to r_g and v_supply at given t_j

calc_v_eoss()

Calculates e_oss stored in c_oss depend on the voltage. Uses transistor.c_oss[0].graph_v_coss :return: e_oss numpy array

calc_v_qoss()

Calculates q_oss stored in c_oss depend on the voltage. Uses transistor.c_oss[0].graph_v_coss :return: q_oss numpy array

export_geckocircuits(v_supply, v_g_on, v_g_off, r_g_on, r_g_off)

Export transistor data to GeckoCIRCUITS

Parameters
  • Transistor – choose the transistor to export

  • v_supply – supply voltage for turn-on/off losses

  • v_g_on – gate turn-on voltage

  • v_g_off – gate turn-off voltage

  • r_g_on – gate resistor for turn-on

  • r_g_off – gate resistor for turn-off

Returns

two output files: ‘Transistor.name’_Switch.scl and ‘Transistor.name’_Diode.scl for geckoCIRCUITS import

export_json(path=None)

export a transistor to .json file, e.g. to share this file on fileexchange on github :param path: path to export :return: -

export_matlab()

Exports a transistor dictionary to a matlab dictionary :param transistor: transistor object :return: file stored in current working path

Exports a simulation model for simulink inverter loss models, see https://de.mathworks.com/help/physmod/sps/ug/loss-calculation-in-a-three-phase-3-level-inverter.html #ToDo: C_th is fixed at the moment to 1e-6 for switch an diode. Needs to be calculated from ohter data .. rubric:: Notes

  • temperature next to 25 and 150 degree at 15V gate voltage will be used for channel and switching loss

  • in case of just one temperature curve, the upper temperature will increased (+1K) to bring a small temperature change in the curves. Otherwise the model will not work

  • only necessary data from tdb will be exported to simulink

  • Simulink model need switching energy loss in ‘mJ’

  • in case of no complete curve (e.g. not starting from zero), this tool will interpolate the curve

Parameters

transistor – transistor object

Returns

.mat file for import in matlab/simulink

get_object_i_e(e_on_off_rr, t_j, v_g, v_supply, r_g)

Function to get the loss graphs out of the transistor class :param e_on_off_rr: can be the following: ‘e_on’, ‘e_off’ or ‘e_rr’ :param t_j: junction temperature :param v_g: gate voltage at turn-on / turn-off :param v_supply: dc link voltage :param r_g: gate resistor :return: e_on.graph_i_e or e_off.graph_i_e or e_rr.graph_i_e

get_object_i_e_simplified(e_on_off_rr, t_j)

Function to get the loss graphs out of the transistor class, simplified version :param e_on_off_rr: can be the following: ‘e_on’, ‘e_off’ or ‘e_rr’ :param t_j: junction temperature :return: e_on.graph_i_e or e_off.graph_i_e or e_rr.graph_i_e

get_object_r_e_simplified(e_on_off_rr, t_j, v_g, v_supply, normalize_t_to_v)

Function to get the loss graphs out of the transistor class, simplified version :param e_on_off_rr: can be the following: ‘e_on’, ‘e_off’ or ‘e_rr’ :param t_j: junction temperature :return: e_on.graph_i_e or e_off.graph_i_e or e_rr.graph_i_e

get_object_v_i(switch_or_diode, t_j, v_g)

get a channel curve including boundary conditions :param switch_or_diode: ‘switch’ or ‘diode’ :param t_j: junction temperature :param v_g: gate voltage :return: v_i-object (channel curve including boundary conditions)

static isvalid_dict(dataset_dict, dict_type)

This method checks input argument dictionaries for their validity. It is checked whether all mandatory keys are present, have the right type and permitted values (e.g. ‘MOSFET’ or ‘IGBT’ or ‘SiC-MOSFET’ for ‘type’). Returns ‘False’ if dictionary is ‘None’ or Empty. These cases should be handled outside this method. Raises appropriate errors if dictionary invalid in other ways. :param dataset_dict: dataset dict :param dict_type: :return: True in case of valid dict, ‘False’ if dictionary is ‘None’ or Empty

parallel_transistors(count_parallels=2)

Connect [count_parallels] transistors in parallel The returned transistor object behaves like a single transistor. - name will be modified by adding _[count_parallels]_parallel - channel characteristics will be modified - e_on/e_off/e_rr characteristics will be modified - thermal behaviour will be modified

Parameters

count_parallels – count of parallel transistors of same type, default = 2

Returns

transistor object with parallel transistors

plot_v_eoss(buffer_req=False)

Plots v_eoss with method calc_v_eoss :return:

databaseClasses.check_2d_dataset(x)

Check if argument is real 2D-dataset of right shape. Raise TypeError if not. None is also accepted because it is valid for optional keys. Mandatory keys that must not contain None are checked somewhere else beforehand. :param x: 2d-dataset :return: True in case of valid 2d-dataset

databaseClasses.check_realnum(x)

Check if argument is real numeric scalar. Raise TypeError if not. None is also accepted because it is valid for optional keys. Mandatory keys that must not contain None are checked somewhere else beforehand. :param x: input argument :return: True in case of numeric scalar.

databaseClasses.check_str(x)

Check if argument is string. Raise TypeError if not. Function not necessary but helpful to keep raising of errors consistent with other type checks. None is also accepted because it is valid for optional keys. Mandatory keys that must not contain None are checked somewhere else beforehand. :param x: input string :return: True in case of valid string

databaseClasses.compatibilityTest(Transistor, attribute)

checks attribute for occurrences of None an replace it with np.nan :param Transistor: transistor object :param attribute: path to given attribute :return: attribute value or np.nan

databaseClasses.csv2array(csv_filename, first_xy_to_00=False, second_y_to_0=False, first_x_to_0=False, mirror_xy_data=False)

Imports a .csv file and extracts its input to a numpy array. Delimiter in .csv file must be ‘;’. Both ‘,’ or ‘.’ are supported as decimal separators. .csv file can generated from a 2D-graph for example via https://apps.automeris.io/wpd/

Parameters
  • csv_filename – str. Insert .csv filename, e.g. “switch_channel_25_15v”

  • first_xy_to_00 – boolean True/False. Set ‘True’ to change the first value pair to zero. This is necessary in case of webplotdigitizer returns the first value pair e.g. as -0,13; 0,00349.

  • second_y_to_0 – boolean True/False. Set ‘True’ to set the second y-value to zero. This is interesting in case of diode / igbt forward channel characteristic, if you want to make sure to set the point where the ui-graph leaves the u axis on the u-point to zero. Otherwise there might be a very small (and negative) value of u.

  • first_x_to_0 – boolean True/False. Set ‘True’ to set the first x-value to zero. This is interesting in case of nonlinear input/output capacitances, e.g. c_oss, c_iss, c_rss

Returns

2d array, ready to use in the transistor database

databaseClasses.dict_clean(input_dict)

Cleans a python dict and makes it compatible with matlab Dict must be cleaned from ‘None’s to np.nan (= NaN in Matlab) see https://stackoverflow.com/questions/35985923/replace-none-in-a-python-dictionary :param input_dict: dictionary :return:

databaseClasses.load(dict_filter, collection='local')

load a transistor from your local mongodb-database example: transistor_imported = import_json(‘CREE_C3M0016120K.json’) :param dict_filter: element filter, see example :param collection: mongodb connection, predefined value :return: transistor object

databaseClasses.load_from_db(db_dict)
Parameters

db_dict

Returns

transistorobject

databaseClasses.merge_curve(curve, curve_detail)

merges two equal curves, one of which contains an enlarged section of the first curve. Use case is the merging of capacity curves, here often two curves (normal and zoom) are given in the data sheets. :param curve: full curve :param curve_detail: curve with zoom on x-axis :return: merged curve

databaseClasses.print_TDB(filters=[], collection='local')

Print all transistorelements stored in the local database :param filters: filters for searching the database :param collection: Choose database name in local mongodb client. Default name is “collection” :return: Return a list with all transistor objects fitting to the search-filter

databaseClasses.r_g_max_rapid_channel_turn_off(v_gsth, c_ds, c_gd, i_off, v_driver_off)

Calculates the maximum gate resistor to achieve no turn-off losses when working with MOSFETs ‘rapid channel turn-off’ (rcto) Note: Input (e.g. i_off can also be a vector) Source: D. Kübrich, T. Dürbraum, A. Bucher: ‘Investigation of Turn-Off Behaviour under the Assumption of Linear Capacitances’ International Conference of Power Electronics Intelligent Motion Power Quality 2006, PCIM 2006, p. 239 –244 :param v_gsth: gate threshod voltage :param c_ds: equivalent drain-source capacitance :param c_gd: equivalent gate-drain capacitance :param i_off: turn-off current :param v_driver_off: Driver voltage during turn-off :return: r_g_max_rcto maxiumum gate resistor to achieve rapid channel turn-off

databaseClasses.update_from_fileexchange(collection='local', overwrite=True)

Update your local transitor database from transistordatabase-fileexchange from github :param collection: name of mongodb collection :param overwrite: True to overwrite existing transistor objects in local database, False to not overwrite existing transistor objects in local database. :return: -