Documentation

The Transistor class

class databaseClasses.Transistor(transistor_args: dict, switch_args: dict, diode_args: dict)

Bases: object

Transistor object which is the core class of transistordatabse module. Contains subclasses like Switch, Diode, FosterThermalModel etc, and other child classes using which all the features and functionalities of this module are based and developed.

Todo

  • 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

  • Documentation on how to add or extract a transistor-object to/from the database can be found in

__init__(transistor_args: dict, switch_args: dict, diode_args: dict) None

Takes in the following dictionary arguments for creating and initializing the transistor object. isvalid_dict() method is applied on transistor_args object to validate the argument. Else TypeError exception is raised. Module manufacturer type and housing type data validations are performed for matching the given values to the pre-existed types stored in the form of ‘housing.txt’ and ‘module_manufacturer.txt’ files.

Parameters
  • transistor_args (dict) – transistor argument object

  • switch_args (dict) – switch argument object

  • diode_args (dict) – diode argument object

Raises
  • TypeError – Raised if isvalid_dict() return false

  • ValueError – Raised if index based search for module_maufacturer or housing_type values fails

name: str

Name of the transistor. Choose as specific as possible. (Mandatory key)

type: str

Specifies the type of module either e.g IGBT, MOSFET, SiC MOSFET etc. (Mandatory key)

author: str

The author of the module specific object. Usually added when creating and adding a new datasheet module using template.py. (Mandatory key)

template_version: str

Specifies the template version using which a new datasheet module is created. (Mandatory/Automatic)

template_date: datetime.datetime

Specifies the date and time at which the template in created. (Mandatory/Automatic)

creation_date: datetime.datetime

Specifies the date and time of the new transistor module that is created using template. (Mandatory/Automatic)

comment: Optional[str]

Any user specific comment created when adding a new datasheet module. (Optional key)

As the name specifies, provides the hyperlink of the datasheet that is being referred to. Should be a valid link if specified(Optional)

datasheet_date: Optional[datetime.datetime]

pymongo cannot encode date => always save as datetime. (Optional key)

datasheet_version: Optional[str]

Specifies the version of the module manufacturer datasheet. (Optional key)

housing_area: float

Housing area extracted from datasheet. Units in m^2. (Mandatory key)

cooling_area: float

Housing area extracted from datasheet. Units in m^2. (Mandatory key)

t_c_max: float

Module specific maximum junction temperature. Units in °C (Optional key)

r_g_int: float

Internal gate resistance. Units in Ohm (Mandatory key)

c_oss_fix: Optional[float]

Parasitic constant capacitance. Units in F (Optional key)

c_iss_fix: Optional[float]

Parasitic constant capacitance. Units in F (Optional key)

c_rss_fix: Optional[float]

Parasitic constant capacitance. Units in F (Optional key)

housing_type: str

e.g. TO-220, etc. Must be from a list of specific strings. (Mandatory key)

manufacturer: str

Provides information of the module maufacturer. (Mandatory key)

r_th_cs: Optional[float]

Module specific case to sink thermal resistance. Units in K/W (Optional key)

r_th_switch_cs: Optional[float]

Switch specific case to sink thermal resistance. Units in K/W (Optional key)

r_th_diode_cs: Optional[float]

Diode specifc case to sink thermal resistance. Units in K/W (Optional key)

v_abs_max: float

Absolute maximum voltage rating. Units in V (Mandatory key)

i_abs_max: float

Absolute maximum current rating. Units in A (Mandatory key)

i_cont: Optional[float]

Module specific continuous current. Units in A e.g. Fuji = I_c, Semikron = I_c,nom (Mandatory key)

c_oss: Optional[List[VoltageDependentCapacitance]]

List of VoltageDependentCapacitance. (Optional key)

c_iss: Optional[List[VoltageDependentCapacitance]]

List of VoltageDependentCapacitance. (Optional key)

c_rss: Optional[List[VoltageDependentCapacitance]]

List of VoltageDependentCapacitance. (Optional key)

graph_v_ecoss: Optional[np.ndarray[np.float64]]

Member instance for storing the voltage dependant capacitance graph in the form of 2D numpy array. Units of Row 1 = V; Row 2 = J (Optional key)

diode: Diode

Member instance for class type Diode (Mandatory key)

switch: Switch

Member instance for class type Switch (Mandatory key)

save(collection: str = 'local', overwrite: Optional[bool] = None) None

The method save the transistor object to local mongodb database. Currently receives the execution instructions from update_from_fileexchange(..)

Parameters
  • collection (str) – By default local database is selected and “local” is provided as value

  • overwrite (bool or None) – Indicates whether to overwrite the existing transistor object in the local database if a match is found

export_json(path: Optional[str] = None) None

Exports the transistor object to .json file, e.g. to share this file on fileexchange on github

Parameters

path (str or None) – path to export

Raises

TypeError – Raised if the provided path is not a string type

convert_to_dict()

Converts the transistor object in scope to a dictionary datatype

Returns

Transitor object in dict type

Return type

dict

static isvalid_dict(dataset_dict: dict, dict_type: dict) bool

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.

Parameters
  • dataset_dict – Dataset of type dict

  • dict_type – Could be Transistor/SwitchEnergyData/FosterThermalModel/Diode_ChannelData etc. as specified in the internally provided list.

Raises
  • TypeError – Raised when the instance or dictionary values are not of expected type

  • ValueError – Raised when the certain dict values like housing type, module manufacturer values are not the expected values

  • KeyError – Raised when mandatory keys are not available in dataset_dict

Returns

True in case of valid dict, ‘False’ if dictionary is ‘None’ or Empty

Return type

bool

Todo

Error if given key is not used?

update_wp(t_j: float, v_g: float, i_channel: float, switch_or_diode: str = 'both', normalize_t_to_v=10)

Fills the .wp-class, a temporary storage for self-written user-programs Searches for the input values and fills the .wp-class with data next to this points

Parameters
  • t_j – junction temperature

  • v_g – gate voltage

  • i_channel – channel current for linearisation

  • switch_or_diode – ‘switch’ or ‘diode’ or ‘both’

  • normalize_t_to_v – ratio between t_j and v_g. e.g. 10 means 10°C is same difference as 1V

Returns

None

quickstart_wp() None

Function to fill out the .wp-class by just one command ‘quickstart_wp()’. Uses typical working points

  • channel linearisation next to v_g = 15V, i_cont and t_j = t_j_abs_max - 25 degree

  • switching loss curves next to t_j = t_j_abs_max - 25 degree

Returns

None

calc_v_eoss()

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

Returns

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

Returns

q_oss numpy array

plot_v_eoss(buffer_req=False)

Plots v_eoss with method calc_v_eoss

Parameters

buffer_req – Internally required for generating virtual datasheets

Returns

Respective plots are displayed

plot_v_qoss(buffer_req=False)

Plots v_qoss with method calc_v_qoss

Parameters

buffer_req – Internally required for generating virtual datasheets

Returns

Respective plots are displayed

get_object_v_i(switch_or_diode, t_j, v_g)

Used for getting a channel curve including boundary conditions

Parameters
  • switch_or_diode – ‘switch’ or ‘diode’

  • t_j – junction temperature

  • v_g – gate voltage

Raises

ValueError – When no data is available

Returns

v_i-object (channel curve including boundary conditions)

Return type

list

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

Parameters
  • e_on_off_rr – can be the following: ‘e_on’, ‘e_off’ or ‘e_rr’

  • t_j – junction temperature

  • v_g – gate voltage at turn-on / turn-off

  • v_supply – dc link voltage

  • r_g – gate resistor

Returns

e_on.graph_i_e or e_off.graph_i_e or e_rr.graph_i_e

Return type

list

get_object_i_e_simplified(e_on_off_rr, t_j)

Function to get the loss graphs out of the transistor class, simplified version

Parameters
  • e_on_off_rr – can be the following: ‘e_on’, ‘e_off’ or ‘e_rr’

  • t_j – junction temperature

Raises

ValueError – Raised when no graph_i_e information is available at the given operating point

Returns

e_on.graph_i_e or e_off.graph_i_e or e_rr.graph_i_e, e_on.graph_r_e or e_off.graph_r_e or e_rr.graph_r_e

Return type

list, list or None

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

Returns

e_on.graph_r_e or e_off.graph_r_e or e_rr.graph_r_e

Return type

list

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)

Parameters
  • e_on_off_rr – ‘e_on’, ‘e_off’, ‘e_rr’

  • r_g – gate resistor of interest

  • t_j – juncntion temperature of interest

  • v_supply – supply voltage of interest

Raises

Exception – When given gate resistance exceeds the existing maximum

Returns

object with corrected i_e curves due to r_g and v_supply at given t_j

Return type

list

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.

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

Parameters
  • t_j – junction temperature

  • v_g – gate voltage

  • i_channel – current to linearize the channel

  • switch_or_diode – ‘switch’ or ‘diode’

Raises

ValueError – Raised when the given arguments either exceed the maximum values or not the expected values

Returns

Linearized parameters for v_channel, r_channel

Return type

float

Todo

  • rethink method name. May include switch or diode as a parameter and use one global function

  • check if this function works for all types of transistors

  • Error handling

  • Unittest for this method

compare_channel_linearized(i_channel, t_j=150, v_g=15)

Shows channel plots for switch and diode comparing the linearized graph and the original graph. This function searches for the closest available curves for given arguments t_j and v_g

Parameters
  • i_channel – current to linearize the channel

  • t_j – junction temperature of interest, default set to 150 degree

  • v_g – gate voltage of interest, default set to 15V

export_datasheet()

Generates and exports the virtual datasheet in form of html page

Returns

.html file is created in the current working directory

Example

>>> transistor = tdb.load({'name': 'Fuji_2MBI100XAA120-50'})
>>> transistor.export_datasheet()

Todo

Instead of html file, generating a pdf file without third party requirements is a better option

buildList(attribute)

Gather list data (e.g. channel/e_on/e_off/e_rr) and check for ‘None’

Parameters
  • transistor – transistor object

  • attribute – attribute path to list

Returns

matlab compatible list of all attributes

Return type

list

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

Parameters
  • transistor – transistor object

  • r_g_on – gate turn on resistance, optional

  • r_g_off – gate turn off resistance, optional

  • v_supply – switch supply voltage, optional

Raises
  • Exception – Re-raised excception by calling calc_object_i_e(..)

  • ValueError – Raised when the switch type is other than IGBT

Returns

.mat file for import in matlab/simulink

Example

>>> transistor = tdb.load({'name': 'Infineon_FF200R12KE3'})
>>> transistor.export_simulink_loss_model()

Note

  • 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

Todo

C_th is fixed at the moment to 1e-6 for switch an diode. Needs to be calculated from ohter data

export_matlab()

Exports a transistor dictionary to a matlab dictionary

Parameters

transistor – transistor object

Returns

File stored in current working path

Example

>>> transistor = tdb.load({'name': 'Fuji_2MBI100XAA120-50'})
>>> transistor.export_matlab()
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 created in the current working directory

Example

>>> transistor = tdb.load({'name': 'Fuji_2MBI100XAA120-50'})
>>> transistor.export_geckocircuits(600, 15, -4, 2.5, 2.5)

Note

These .scl files are then imported into for geckoCIRCUITS

export_plecs(recheck=True, gate_voltages=[])

Generates and exports the switch and diode .xmls files to be imported into plecs simulator

Parameters
  • recheck – enables the selection of gate voltages near to the provided values if not found

  • gate_voltages – gate voltage like v_g_on, v_g_off, v_d_on, v_d_off

Returns

Two output files: ‘Transistor.name’_Switch.xml and ‘Transistor.name’_Diode.xml created in the current working directory

Example

>>> transistor = tdb.load({'name': 'Fuji_2MBI200XAA065-50'})
>>> transistor.export_plecs([15, -15, 15, 0])
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.

Todo

  • Add function to estimate parameters from transient data.

  • Add function to automatically calculate missing parameters from given ones.

  • Do these need to be numpy array or should they be lists instead?

__init__(args)

Initalization method of FosterThermalModel object

Parameters

args (dict) – argument to be passed for initialization

Note

Can be constructed from empty or ‘None’ argument dictionary since no attributes are mandatory.

r_th_total: Optional[float]

Sum of thermal_foster resistances of n-pole RC-network (scalar). Units in K/W (Optional key)

r_th_vector: Optional[List[float]]

Thermal resistances of RC-network (array). Units in K/W (Optional key)

c_th_total: Optional[float]

Sum of thermal_foster capacitances of n-pole low pass as (scalar). Units in J/K (Optional key)

c_th_vector: Optional[List[float]]

Thermal capacitances of n-pole RC-network (array). Units in J/K (Optional key)

tau_total: Optional[float]

Sum of thermal_foster time constants of n-pole RC-network (scalar). Units in s (Optional key)

tau_vector: Optional[List[float]]

Thermal time constants of n-pole RC-network (array). Units in s (Optional key)

graph_t_rthjc: Optional[np.ndarray[np.float64]]

Transient data for extraction of the thermal_foster parameters specified above. Units of Row 1 in s; Row 2 in K/W (Optional key)

convert_to_dict()

The method converts FosterThermalModel object into dict datatype

Returns

FosterThermalModel of dict type

Return type

dict

get_plots(buffer_req=False)

Plots tau vs rthjc

Parameters

buffer_req – Internally required for generating virtual datasheets

Returns

Respective plots are displayed if available else None is returned

collect_data()

Collects foster data in form of dictionary for generating virtual datahseet

Returns

foster data in form of dictionary

Return type

dict

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.

__init__(switch_args)

Initalization method of Switch object

Parameters

switch_args – argument to be passed for initialization

Raises
  • KeyError – Expected during the channele_one_off instance initiaization

  • ValueError – Expected during the channele_one_off instance initiaization

Todo

Is this the right behavior or should the ‘thermal_foster’ attribute be left empty istead?

thermal_foster: FosterThermalModel

Transient thermal_foster model. (Optional key)

t_j_max: float

Maximum junction temperature. Units in °C (Mandatory key)

comment: Optional[str]

Comment if any to be specified (Optional key)

manufacturer: Optional[str]

Name of the manufacturer (Optional key)

technology: Optional[str]

Semiconductor technology. e.g. IGBT3/IGBT4/IGBT7 (Optional key)

channel: Optional[List[ChannelData]]

Switch channel voltage and current data.

e_on: Optional[List[SwitchEnergyData]]

Switch on energy data.

e_off: Optional[List[SwitchEnergyData]]

Switch of energy data.

linearized_switch: Optional[List[LinearizedModel]]

Static data valid for a specific operating point.

convert_to_dict()

The method converts Switch object into dict datatype

Returns

Switch object of dict type

Return type

dict

find_next_gate_voltage(v_on, v_off, SwitchEnergyData_dataset_type='graph_i_e')

Finds the switch gate voltage nearest to the specified values from the available gate voltages in curve datasets

Parameters
  • v_on – gate turn on voltage/channel voltage

  • v_off – gate turn off voltage

  • SwitchEnergyData_dataset_type – dataset curve type to be specified

Returns

v_g, v_g_on, v_g_off

Return type

int

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

Parameters
  • t_j – junction temperature

  • v_g – gate voltage

  • normalize_t_to_v – ratio between t_j and v_g. e.g. 10 means 10°C is same difference as 1V

  • SwitchEnergyData_dataset_type – preferred dataset_type (single, graph_r_e, graph_i_e) for e_on and e_off

Raises

KeyError – Raised when there no data for the specified SwitchEnergyData_dataset_type

Returns

channel-object, e_on-object, e_off-object

plot_channel_data_vge(gatevoltage: float) None

Plot channel data with a chosen gate-voltage

Parameters

gatevoltage – gatevoltage at which the channel curves are selected and plotted

Returns

Respective plots are displayed

plot_channel_data_temp(temperature)

Plot channel data with chosen temperature

Parameters

temperature – junction temperature at which the channel curves are selected and plotted

Returns

Respective plots are displayed

plot_all_channel_data(switch_type=None, buffer_req=False)

Plot all switch channel characteristic curves

Parameters
  • switch_type – switch type e.g Mosfet, SiC-Mosfet, IGBT

  • buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

plot_energy_data(buffer_req=False)

Plots all switch energy i-e characterisitic curves which are extracted from the manufacturer datasheet

Parameters

buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

plot_energy_data_r(buffer_req=False)

Plots all switch energy r-e characteristic curves

Parameters

buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

collect_data(switch_type)

Collects switch data in form of dictionary for generating virtual datahseet

Parameters

switch_type – switch type e.g Mosfet, SiC-Mosfet, IGBT

Returns

Switch data in form of dictionary

Return type

dict

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.

__init__(diode_args)

Initalization method of Diode object

Parameters

diode_args – argument to be passed for initialization

Raises
  • KeyError – Expected during the channele_rr instance initiaization

  • ValueError – Expected during the channele_rr instance initiaization

thermal_foster: Optional[FosterThermalModel]

Transient thermal_foster model.

t_j_max: float

Diode maximum junction temperature. Units in °C (Mandatory key)

comment: Optional[str]

Comment if any specified by the user. (Optional key)

manufacturer: Optional[str]

Name of the manufacturer. (Optional key)

technology: Optional[str]

Semiconductor technology. e.g. IGBT3/IGBT4/IGBT7. (Optional key)

channel: List[ChannelData]

Diode forward voltage and forward current data.

e_rr: List[SwitchEnergyData]

Reverse recovery energy data.

linearized_diode: List[LinearizedModel]

Static data. Valid for a specific operating point.

convert_to_dict()

The method converts Diode object into dict datatype

Returns

Diode object of dict type

Return type

dict

find_next_gate_voltage(v_d, v_off, SwitchEnergyData_dataset_type='graph_i_e')

Finds the diode gate voltage nearest to the specified values from the available gate voltages in curve datasets. The diode has only turn-off gate voltage which is the switch turn-on gate voltage

Parameters
  • v_on – gate turn on voltage/channel voltage

  • v_off – gate turn off voltage

  • SwitchEnergyData_dataset_type – dataset curve type to be specified

  • SwitchEnergyData_dataset_type – ‘graph_i_e’ or ‘graph_r_e’

Returns

v_d, v_off

Return type

int

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

Parameters
  • t_j – junction temperature

  • v_g – gate voltage

  • normalize_t_to_v – ratio between t_j and v_g. e.g. 10 means 10°C is same difference as 1V

  • SwitchEnergyData_dataset_type – ‘graph_i_e’ or ‘graph_r_e’

Returns

channel-object, e_rr-object

plot_all_channel_data(switch_type=None, buffer_req=False)

Plot all diode channel characteristic curves

Parameters
  • switch_type – switch type e.g Mosfet, SiC-Mosfet, IGBT

  • buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

plot_energy_data(buffer_req=False)

Plots all diode reverse recovery energy i-e characterisitic curves which are extracted from the manufacturer datasheet

Parameters

buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

plot_energy_data_r(buffer_req=False)

Plots all diode energy r-e characteristic curves

Parameters

buffer_req – internally required for generating virtual datasheets

Returns

Respective plots are displayed

collect_data(switch_type)

Collects diode data in form of dictionary for generating virtual datahseet

Returns

Diode data in form of dictionary

Return type

dict

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.

__init__(args)

Initialization method for linearizedmodel object

Parameters

args – arguments to passed for initialization

t_j: float

Junction temperature of diodeswitch. Units in K (Mandatory key)

v_g: Optional[float]

Gate voltage of switch or diode. Units in V (Mandatory for Switch, Optional for some Diode types)

i_channel: float

Channel current of diodeswitch. Units in A (Mandatory key)

r_channel: float

Channel resistance of diodeswitch. Units in Ohm (Mandatory key)

v0_channel: float

Channel voltage of diodeswitch. Unis in V (Mandatory key)

convert_to_dict()

The method converts LinearizedModel object into dict datatype

Returns

LinearizedModel object of dict type

Return type

dict

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

__init__(args)

Initialization method for ChannelData object

Parameters

args – arguments to be passed for initialization

t_j: float

Junction temperature of switchdiode. (Mandatory key)

graph_v_i: np.ndarray[np.float64]

Represented as a numpy 2D array where row 1 is the voltage and row 2 the current. Units of Row 1 = V; Row 2 = A (Mandatory key)

v_g: float

optional (standard diode useless, for GaN ‘diode’ necessary

Type

Switch

Type

Mandatory key, Diode

convert_to_dict()

The method converts ChannelData object into dict datatype

Returns

ChannelData object of dict type

Return type

dict

plot_graph()

Plots the channel curve v_i characteristics called by using any ChannelData object

Returns

Respective plots are displayed

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.

__init__(args)

Initialization method for VoltageDependentCapacitance object

Parameters

args – arguments to be passed for initialization

t_j: float

Junction temperature (Mandatory key)

graph_v_c: np.ndarray[np.float64]

Represented as a 2D numpy array where row 1 is the voltage and row 2 the capacitance. Units of Row 1 = V; Row 2 = A (Mandatory key)

convert_to_dict()

The method converts VoltageDependentCapacitance object into dict datatype

Returns

VoltageDependentCapacitance object of dict type

Return type

dict

get_plots(ax=None, label=None)

Plots the voltage dependant capacitance graph_v_c of the VoltageDependentCapacitance object. Also attaches the plot to figure axes for the purpose virtual datasheet if ax argument is specified

Parameters
  • ax – figure axes for making the graph_v_c plot in virtual datasheet

  • label – label of the plot for virtual datasheet plot

Returns

Respective plots are displayed

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.

__init__(args)

Initialization method for VoltageDependentCapacitance object

Parameters

args – arguments to be passed for initialization

Todo

Add warning if data is ignored because of dataset_type?

dataset_type: str

Single, graph_r_e, graph_i_e (Mandatory key)

v_supply: float

Supply voltage. Units in V (Mandatory key)

v_g: float

Gate voltage. Units in V (Mandatory key)

t_j: float

Junction temperature. Units in °C (Mandatory key)

e_x: Optional[float]

Scalar dataset-parameter - switching energy. Units in J

r_g: Optional[float]

Scalar dataset-parameter - gate resistance. Units in Ohm

i_x: Optional[float]

Scalar dataset-parameter - current rating. Units in A

graph_i_e: Optional[np.ndarray[np.float64]]

Units for Row 1 = A; Row 2 = J

graph_r_e: Optional[np.ndarray[np.float64]]

Units for Row 1 = Ohm; Row 2 = J

convert_to_dict()

The method converts SwitchEnergyData object into dict datatype

Returns

SwitchEnergyData object of dict type

Return type

dict

plot_graph()

Plots switchdiode energy curve characteristics (either from graph_i_e or graph_r_e dataset)

Returns

Respective plots are displayed

class WP

Bases: object

The WP class is intended for user calculations in Python. It is used to access transistor data in user-written programs. It allows the user to linearize the channel and store the result in transistor.wp. Switching loss curves can be stored for specific boundary conditions, so that the same variable is always accessed in the self-written program, regardless of the transistor.

The class WP…

  • Always initialized as None.

  • Is always exported as None to .json or to the database.

  • Is a temporary workspace.

v_channel: Optional[float]
r_channel: Optional[float]
__init__()
e_on: Optional[np.ndarray[np.float64]]

A; Row 2: J

Type

Units

Type

Row 1

e_off: Optional[np.ndarray[np.float64]]

A; Row 2: J

Type

Units

Type

Row 1

e_rr: Optional[np.ndarray[np.float64]]

A; Row 2: J

Type

Units

Type

Row 1

v_switching_ref: Optional[float]

V

Type

Unit

e_oss: Optional[np.ndarray[np.float64]]

V; Row 2: J

Type

Units

Type

Row 1

q_oss: Optional[np.ndarray[np.float64]]

V; Row 2: C

Type

Units

Type

Row 1

parallel_transistors: Optional[float]

Number

Type

Unit

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

Example

>>> transistor = load({'name': 'Infineon_FF200R12KE3'})
>>> parallel_transistorobject = transistor.parallel_transistors(3)
validate_transistor()

A helper function for plecs exporter. Checks if curve characteristics and thermal network parameters of both switch and diode to be None or empty Appends corresponding codes for further verification in get_curve_data(..) method

Returns

Availability codes

Return type

dict

get_curve_data(channel_recheck, gate_voltages)

Collects the available information of switch and diode from transistor object and passes it to plecs_exporter(..) for generating the diode and switch .xml files

Parameters
  • channel_recheck (bool) – if set to True, collects the channel and energy curve characteristics at nearest gate voltage if the given gate voltages are not found

  • gate_voltages (list) – turn on and off gate voltages for selecting the curves of switch and diode

Raises

MissingDataError – If any information of switch or diode is missing completely

Returns

Switch and diode objects

Return type

dict

General methods

databaseClasses.connect_TDB(host)

A method for establishing connection with transistordatabase_exchange.

Parameters

host – “local” is specified by default, other cases need to be investigated

Returns

transistor_database collection

databaseClasses.connect_local_TDB()

A method for establishing connection with transistordatabase_exchange. Internally used by update_from_fileexchange() method to sync the local with transistordatabase_File_Exchange and load() methods for saving and loading the transistor object to local mongodb-database.

Returns

transistor_database collection

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 (bool) – 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 (bool) – 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 (bool) – 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

  • mirror_xy_data (bool) – Takes the absolue() of both axis. Used for given mirrored data, e.g. some datasheet show diode data in the 3rd quadrand instead of the 1st quadrant

Returns

2d array, ready to use in the transistor database

Return type

2D-array

databaseClasses.import_json(path: str) dict

Import a json-file to your local transistor database

Parameters

path (str) – path to the .json-file

Returns

transistor dictionary, loaded from the .json-file

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

load a transistor from your local mongodb-database

Parameters
  • dict_filter – element filter, see example

  • collection – mongodb connection, predefined value

Returns

transistor

Example

>>> transistor_imported = import_json('CREE_C3M0016120K.json')
databaseClasses.load_from_db(db_dict: dict)

Loads a transistor object from the database

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.

Parameters
  • curve – full curve

  • curve_detail – curve with zoom on x-axis

Returns

merged curve

Example (e.g. merges c_oss curve from 0-200V and from 0-1000V)

>>> c_oss_normal = tdb.csv2array('transistor_c_oss.csv', first_x_to_0=True)
>>> c_oss_detail = tdb.csv2array('transistor_c_oss_detail.csv', first_x_to_0=True)
>>> c_oss_merged = tdb.merge_curve(c_oss_normal, c_oss_detail)
databaseClasses.print_TDB(filters: List[str] = [], collection: str = 'local') List[str]

Print all transistorelements stored in the local database

Parameters
  • filters (List[str]) – filters for searching the database, e.g. ‘name’ or ‘type’

  • collection (str) – Choose database name in local mongodb client. Default name is “collection”

Returns

Return a list with all transistor objects fitting to the search-filter

Return type

list

Example

>>> tdb.print_TDB()
>>> # or
>>> tdb.print_TDB('type')
databaseClasses.r_g_max_rapid_channel_turn_off(v_gsth: float, c_ds: float, c_gd: float, i_off: Union[float, List[float]], v_driver_off: float) float

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

Parameters
  • v_gsth (float) – gate threshod voltage

  • c_ds (float) – equivalent drain-source capacitance

  • c_gd (float) – equivalent gate-drain capacitance

  • i_off (float or List[float]) – turn-off current

  • v_driver_off (float) – Driver voltage during turn-off

Returns

r_g_max_rcto maxiumum gate resistor to achieve rapid channel turn-off

Return type

float

databaseClasses.update_from_fileexchange(collection: str = 'local', overwrite: bool = True) None

Update your local transitor database from transistordatabase-fileexchange from github

Parameters
  • collection (str) – name of mongodb collection

  • overwrite (bool) – True to overwrite existing transistor objects in local database, False to not overwrite existing transistor objects in local database.

Returns

None