Skip to content

Commit

Permalink
Add MPCB with various thermal trip class
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed Aug 21, 2023
1 parent f4afe21 commit 1b5916b
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 4 deletions.
11 changes: 8 additions & 3 deletions gelectrical/elementmodel/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ..misc import FieldDict
from .element import ElementModel
from ..model.protection import ProtectionModel
from ..model.protection import get_protection_model
from ..model.protection import get_protection_model, get_thermal_protection_models


# # Common trip curves to be used accross classes
Expand Down Expand Up @@ -517,8 +517,9 @@ def __init__(self, cordinates=(0,0), **kwargs):
current_values_acb = [630,800,1000,1250,1600,2000,2500,3200]

breaker_types = ['LV breakers', 'MV breakers']
subtypes_lv = ['MCB','MCCB','ACB','MPCB','CB','RCCB']
subtypes_lv = ['MCB','MCCB','ACB','CB', 'MPCB','RCCB']
subtypes_mv = ['VCB']
prottypes_mpcb = ['Class 10A', 'Class 10', 'Class 20', 'Class 30']
prottypes_cb = ['Thermal Magnetic', 'Thermal', 'Magnetic', 'Microprocessor', 'None']
prottypes_cb_gf = ['None', 'Magnetic']
prottypes_cb_mv = ['Microprocessor', 'Thermal Magnetic', 'Thermal', 'Magnetic', 'None']
Expand All @@ -537,7 +538,7 @@ def __init__(self, cordinates=(0,0), **kwargs):
self.dict_prot_curve_type = {('LV breakers', 'MCB'): prottypes_mcb,
('LV breakers', 'MCCB'): prottypes_cb,
('LV breakers', 'ACB'): prottypes_cb,
('LV breakers', 'MPCB'): prottypes_cb,
('LV breakers', 'MPCB'): prottypes_mpcb,
('LV breakers', 'CB'): prottypes_cb,
('LV breakers', 'RCCB'): ['None'],
('MV breakers', 'VCB'): prottypes_cb_mv,}
Expand Down Expand Up @@ -655,6 +656,10 @@ def get_line_protection_model(self):
't_m_min' : ['Instantaneous trip time (min)', 's', 0.001, None],
't_m_max' : ['Instantaneous trip time (max)', 's', 0.01, None]}
curves = {'curve_u': curve_u, 'curve_l': curve_l}

# Thermal overload relay as per IS/IEC 60947-4-1
elif f.subtype in ('MPCB',):
parameters, curves = get_thermal_protection_models(f.prot_curve_type, magnetic=True)

# CB generic IS/IEC 60947
elif f.prot_curve_type in ('Thermal',):
Expand Down
92 changes: 91 additions & 1 deletion gelectrical/model/protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,4 +834,94 @@ def get_curves(Ir, Tr, T_conv, Im, Tm, Ii, Ti, r_tol, i2t_tol):
'curve_u3': curve_u3, 'curve_l3': curve_l3,
'curve_u4': curve_u4, 'curve_l4': curve_l4,}

return parameters, curves
return parameters, curves

def get_thermal_protection_models(prot_class, magnetic=False):
curves = {}
parameters = dict()

# Thermal trip curves
# trip_curves = ['Class 10A', 'Class 10', 'Class 20', 'Class 30']
tms_dict = {'Class 10A': [93,355],
'Class 10': [186,355],
'Class 20': [279,710],
'Class 30': [418.5,1065]}

# Instantaneous trip constants
ii_default_values_dict = { True : {'i_i': 13, 't_i': 0.01, 'tol_ii_p': 20, 'tol_ii_m': 20, 'tol_ti_p': 100, 'tol_ti_m': 90},
False : {'i_i': None, 't_i': None, 'tol_ii_p': None, 'tol_ii_m': None, 'tol_ti_p': None, 'tol_ti_m': None}}

In = 'f.In'
xIn = 'xIn'
Isc = '1000*f.Isc'

if magnetic is False:

def get_curves(Ir, Tr, t_min):
T_conv = '2*3600'
curve = [ ('point', Ir, T_conv),
('THERMAL', Tr, Ir, Ir + '*1.05', Isc, t_min, 50)]
return curve

# Upper curve
Ir = '1.2*d.i_r*' + In
Tr = tms_dict[prot_class][1]
t_min = 'd.t_min'
curve_u = get_curves(Ir, Tr, t_min)
# Lower curve
Ir = '1.05*d.i_r*' + In
Tr = tms_dict[prot_class][0]
t_min = 0
curve_l = get_curves(Ir, Tr, t_min)

parameters = {'head_t' : ['Thermal protection', '', '', None, '', 'heading'],
'i_r' : ['Ir', xIn, 1, None, 'Thermal protection pickup current'],
't_min' : ['Tmin', 's', 0.1, None, 'Minimum trip time']}
curves = {'curve_u': curve_u, 'curve_l': curve_l}

elif magnetic is True:
select_expr_list = ['d.i_i_on is False',
'd.i_i_on is True']

def get_curves(Ir, Tr, t_min, Ii, Ti):
T_conv = '2*3600'
curve1 = [ ('point', Ir, T_conv),
('THERMAL', Tr, Ir, Ir + '*1.05', Isc, t_min, 50)]
curve2 = [ ('point', Ir, T_conv),
('THERMAL', Tr, Ir, Ir + '*1.05', Ii, Ti, 50),
('point', Ii, Ti),
('point', Isc, Ti)]
return curve1, curve2

# Upper curve
Ir = '1.2*d.i_r*' + In
Tr = tms_dict[prot_class][1]
t_min = 'd.t_min'
Ii = '(d.i_i*(100+d.tol_ii_p)/100)*' + In
Ti = 'd.t_i*(100+d.tol_ti_p)/100'
curve_u1, curve_u2 = get_curves(Ir, Tr, t_min, Ii, Ti)
# Lower curve
Ir = '1.05*d.i_r*' + In
Tr = tms_dict[prot_class][0]
t_min = 0
Ii = '(d.i_i*(100-d.tol_ii_m)/100)*' + In
Ti = 'd.t_i*(100-d.tol_ti_m)/100'
curve_l1, curve_l2 = get_curves(Ir, Tr, t_min, Ii, Ti)

parameters = {'head_t' : ['Thermal protection', '', '', None, '', 'heading'],
'i_r' : ['Ir', xIn, 1, None, 'Thermal protection pickup current'],
't_min' : ['Tmin', 's', 0.1, None, 'Minimum trip time'],
'head_i' : ['Instantaneous protection', '', '', None, '', 'heading'],
'i_i_on' : ['Enable instantaneous protection', '', False, [True, False], '', 'bool', True, ii_default_values_dict],
'i_i' : ['Ii', xIn, 13, None, 'Instantaneous pickup current', 'float', False],
't_i' : ['Ti', 's', 0.01, None, 'Instantaneous trip time delay', 'float', False],
'tol_ii_p' : ['Ii tol (+)', '%', 20, None, 'Current pickup tolerance (+)', 'float', False],
'tol_ii_m' : ['Ii tol (-)', '%', 20, None, 'Current pickup tolerance (-)', 'float', False],
'tol_ti_p' : ['Ti tol (+)', '%', 100, None, 'Time delay tolerance (+)', 'float', False],
'tol_ti_m' : ['Ti tol (-)', '%', 90, None, 'Time delay tolerance (-)', 'float', False]}

curves = {'select_expr_list': select_expr_list,
'curve_u1': curve_u1, 'curve_l1': curve_l1,
'curve_u2': curve_u2, 'curve_l2': curve_l2}

return parameters, curves

0 comments on commit 1b5916b

Please sign in to comment.