滑行回馈力矩给定修改力矩
if(1 == Vehicle_cmd.cmdmode.data.slip_feedback_flag)//滑行回馈{motor_regen_power = EV_MCU_Para.field.Motor_regen_power_slip_level;//滑行固定功率在 10kw *****11.22 这里除去2 5kw motor_regen_trq_lmt = _IQmpyI32(motor_regen_power, 9550) / 3000;//IQ10 10kw恒功率下的3000转速的 力矩31motor_regen_trq_lmt = _IQ10mpy(motor_regen_trq_lmt, SysBase.invtorque);//IQ24 乘以系数后的 最大力矩限制 31 motor_regen_trq_throad = _IQmpyI32(10, SysBase.invtorque);//IQ24 10N的力矩系数if (motor_regen_trq_lmt > motor_regen_trq_throad){motor_regen_trq_deta = motor_regen_trq_lmt - motor_regen_trq_throad;//IQ24 大概 21motor_regen_trq_start = motor_regen_trq_throad;//IQ24 大概 10}else{motor_regen_trq_deta = 0;//IQ24motor_regen_trq_start = motor_regen_trq_lmt;}if (speed >= 3000)//恒功率回馈{trq = _IQmpyI32(motor_regen_power, 9550) / speed;//IQ10 //此处可以调小功率,以致调小回馈sysCfgPara.TrqCmd_NEW = 0 - _IQ10mpy(trq, SysBase.invtorque);//IQ24}else if (speed >= 1500)//XN.m--->10N.m{/* 如下可以列出数学式子 最终得到 trq* (speed-1500)/ 1500 = k_tmp 大概是速度超出1500的余量 占据1500的比例 用这个比例获得trq力矩 */trq = motor_regen_trq_deta; //21的力矩 这里除去 5 减少滑行力矩 滑行回馈电流***************************************k_tmp = _IQdiv(trq, _IQmpyI32(1500, SysBase.invspeed));k_tmp = _IQmpy(_IQmpyI32((speed - 1500), SysBase.invspeed), k_tmp);trq = motor_regen_trq_start + k_tmp;//最终力矩 10+k_tmp sysCfgPara.TrqCmd_NEW = 0 - trq;}else if (speed >= 500)//10N.m--->0N.m{trq = motor_regen_trq_start;k_tmp = _IQdiv(trq, _IQmpyI32(1000, SysBase.invspeed));k_tmp = _IQmpy(_IQmpyI32((speed - 500), SysBase.invspeed), k_tmp);sysCfgPara.TrqCmd_NEW = 0 - k_tmp;}else{sysCfgPara.TrqCmd_NEW = 0;}if(sysCfgPara.TrqCmd_NEW < -trqLoopPara.Max_TorqueGen)//力矩下限保护{sysCfgPara.TrqCmd_NEW = -trqLoopPara.Max_TorqueGen;}}
在1500判断中的大概分解
令 SysBase.invspeed为s
第一个 k_tmp=trq/(1500s)
第一个 k_tmp=( trq/(1500s))* ((speed -1500)*s)消除有k_tmp= trq*(speed-1500)/1500
所以k_tmp=trq*(speed-1500)/1500
T =10+ T*(1500-speed)/1500 大概意思是 T增加 多余的速度占1500的比 的T力矩