motor design programming & 分析自动化 (透过 ansys maxwell) - mo

Why use program to design motor

Save labor cost - program具有自动化的好处,重複的步骤只要编写一次,之后只需要执行程式就好Code represent design concept and step - 当设计变成code,并且利用的是好理解且通用的 code structure ,人员转换造成的工作问题就会下降,因为所有人只要能看懂code,就能看懂设计步骤,进而理解设计。

How to represent motor design concept and step

专注在两个非常重要却又简单的东西 data & function

Input & Output Data

先思考 input 与 ouput的data是什么

input data - 规格output data - 定子外径、马达长度、匝数、BEMP(@1000rpm)、操作点数据(torque data, average torque, speed, torque ripple, current, current density, line voltage, coreloss, copperloss)

Design function and data

手算一次将 规格 转换成 马达模型数据 与 电气数据。将中间所有的 步骤,以及当中用到的 数据名称 记录下来。将 数据名称 根据 步骤 的概念分类 (定转子、磁石、电气...等)。使用 dict 这个 data structure将其收起来,还不知道的值就先给 None,用专案中马达设计的部分呈现如下。
motor_cal_params = {    "stator": {        "OD_limit": None,        "slot": 12,        "shoes_height_front": 1,        "shoes_height_back": 1,        "slot_open": 4.5,        "slot_corner_arc": 0.5,    },    "rotor": {        "pole": 10,        "mag_emb": 0.8,  # easier magetization    },    "coil": {        "conductor_OD": 1,        "y_para": 1,        "membrane_ratio": 1.075,        "slot_fill_factor": 0.43,    },    "estimate": {        "kt_ke_ratio": 0.9,        "max_J": 18,        "voltage_buffer": 0.9,        "torque_density":   25,        "teeth_mag_ang_ratio": 0.6,        "york_teeth_ratio": 0.7,        "rotor_OD_ratio": 0.6,        "bg": 1.2,        "mag_pc": 7.5,  # for not easy to broke    },    "calculation": {        "est_rotor_OD": None,        "est_stator_OD": None,        "mag_thick": None,        "teeth_width": None,        "york_width": None,        "slot_height": None,        "slot_width_front": None,        "slot_width_back": None,        "para_conductor": None,        "coil_turns": None,        "real_slot_fill_factor": None,    },    "material": {        "stator": "\"35CS250_steel\"",        "rotor": "\"35CS250_steel\"",        "magnet": "\"N44SH_20deg_mag\"",        "coil": "\"copper\"",    },    "setting": {        "cycle": 1,        "split_step": 50    },    "voltage_dc": None,    "length": None,    "airgap": 0.5,    "w_factor_10p12s": 0.933,    "ke":               None,    "kt":               None,    "corner_speed_rpm": None,    "max_speed_rpm":    None,    "max_current_rms":  None,    "core_loss_factor": 1,}
将步骤拆成小的function,专案中马达设计的部分如下
def ktke_calculation(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_paramsdef assign_spec_value(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_paramsdef expend_NBLR(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_paramsdef expend_stator_teeth_york(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_paramsdef expend_stator_slot(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_paramsdef expend_magnet(total_cal_params):    # 计算 total_cal_params 的某个值    # 将 计算值 替算掉原本在total_cal_params中的未定值    return total_cal_params
将 3. 的data贯穿 4. 的所有function (3.的 motor_cal_params 放在 ctx[params]中)
total_cal_params = ctx["params"]ktke_calculation(total_cal_params) and \    assign_spec_value(total_cal_params) and \    expend_NBLR(total_cal_params) and \    expend_stator_teeth_york(total_cal_params) and \    expend_stator_slot(total_cal_params) and \    expend_magnet(total_cal_params)    print(total_cal_params)
Ansys maxwell 的沟通部分也是用同样的方式,可参考 这里

结论

使用上述的方法,是不是很单纯,且很直观就能看懂设计的过程,debug也非常容易,执行程式时将total_cal_params 印出来看就好。

当整个程式设计完成后,接下来就是去优化每一个 function & data 让它们更容易被看懂,更能直观的对应马达设计。

更详细可参考我的设计,未来还会持续的优化设计。

更多相关文章发表于我的网站。


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章