Explorar el Código

修改功率前馈的变量名称

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin hace 2 años
padre
commit
e2d3656cd4
Se han modificado 2 ficheros con 15 adiciones y 15 borrados
  1. 14 14
      Applications/foc/core/controller.c
  2. 1 1
      Applications/foc/core/controller.h

+ 14 - 14
Applications/foc/core/controller.c

@@ -327,19 +327,19 @@ static __INLINE float mot_contrl_dc_curr_limiter(mot_contrl_t *ctrl, float maxTr
 	float iq_ff = q_axis_power / (ctrl->out_vdq_filterd.q + 0.0001f);
 	iq_ff = ABS(iq_ff);
 	if (iq_ff > maxTrq) {
-		ctrl->dc_lim_iq_ff = maxTrq;
+		ctrl->dc_lim_t_ff = maxTrq;
 	}else if (iq_ff < 0) {
-		ctrl->dc_lim_iq_ff = 0;
+		ctrl->dc_lim_t_ff = 0;
 	}else {
-		ctrl->dc_lim_iq_ff = iq_ff;
+		ctrl->dc_lim_t_ff = iq_ff;
 	}
-	/** 使用min(maxTrq, ctrl->dc_lim_iq_ff * 1.1f)带入max的原因是为了防止积分器饱和后有过冲现象
-	 *  1.1f的系数是为了保证ctrl->dc_lim_iq_ff计算偏小的情况下功率能达到上限,这个系数太大不能
+	/** 使用min(maxTrq, ctrl->dc_lim_t_ff * 1.1f)带入max的原因是为了防止积分器饱和后有过冲现象
+	 *  1.1f的系数是为了保证ctrl->dc_lim_t_ff 计算偏小的情况下功率能达到上限,这个系数太大不能
 	 *  防止过冲
 	*/
-	ctrl->pi_power.max = min(maxTrq, ctrl->dc_lim_iq_ff * 1.1f);
+	ctrl->pi_power.max = min(maxTrq, ctrl->dc_lim_t_ff * 1.1f);
 	float errRef = dc_lim - ctrl->dc_curr_filted;
-	return PI_Controller_Parallel(&ctrl->pi_power, errRef, ctrl->dc_lim_iq_ff);
+	return PI_Controller_Parallel(&ctrl->pi_power, errRef, ctrl->dc_lim_t_ff);
 }
 #else
 static __INLINE float mot_contrl_dc_curr_limiter(mot_contrl_t *ctrl, float maxTrq) {
@@ -350,19 +350,19 @@ static __INLINE float mot_contrl_dc_curr_limiter(mot_contrl_t *ctrl, float maxTr
 	float torque_ff = dc_lim * get_vbus_float() * 9.55f * 0.8f/(ctrl->foc.in.mot_velocity + 0.0001f);
 	torque_ff = ABS(torque_ff);
 	if (torque_ff > maxTrq) {
-		ctrl->dc_lim_iq_ff = maxTrq;
+		ctrl->dc_lim_t_ff = maxTrq;
 	}else if (torque_ff < 0) {
-		ctrl->dc_lim_iq_ff = 0;
+		ctrl->dc_lim_t_ff = 0;
 	}else {
-		ctrl->dc_lim_iq_ff = torque_ff;
+		ctrl->dc_lim_t_ff = torque_ff;
 	}
-	/** 使用min(maxTrq, ctrl->dc_lim_iq_ff * 1.1f)带入max的原因是为了防止积分器饱和后有过冲现象
-	 *  1.1f的系数是为了保证ctrl->dc_lim_iq_ff计算偏小的情况下功率能达到上限,这个系数太大不能
+	/** 使用min(maxTrq, ctrl->dc_lim_t_ff * 1.1f)带入max的原因是为了防止积分器饱和后有过冲现象
+	 *  1.1f的系数是为了保证ctrl->dc_lim_t_ff 计算偏小的情况下功率能达到上限,这个系数太大不能
 	 *  防止过冲
 	*/
-	ctrl->pi_power.max = min(maxTrq, ctrl->dc_lim_iq_ff * 1.1f);
+	ctrl->pi_power.max = min(maxTrq, ctrl->dc_lim_t_ff * 1.1f);
 	float errRef = dc_lim - ctrl->dc_curr_filted;
-	return PI_Controller_Parallel(&ctrl->pi_power, errRef, ctrl->dc_lim_iq_ff);
+	return PI_Controller_Parallel(&ctrl->pi_power, errRef, ctrl->dc_lim_t_ff);
 }
 #endif
 

+ 1 - 1
Applications/foc/core/controller.h

@@ -138,7 +138,7 @@ typedef struct{
 	u32				torque_dec_time;
 	float   		dc_curr_filted;
 	float			dc_curr_calc;
-	float 			dc_lim_iq_ff;
+	float 			dc_lim_t_ff;
 	float   		phase_curr_filted[3];
 	float           autohold_torque;
 	float			duty_raw;