Ver código fonte

motor param ind add rs log

Signed-off-by: kevin <huhui@sharkgulf.com>
kevin 2 anos atrás
pai
commit
3e45687325
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      Applications/foc/motor/mot_params_ind.c

+ 3 - 2
Applications/foc/motor/mot_params_ind.c

@@ -97,7 +97,8 @@ static void _rs_ind_timer_handler(shark_timer_t *t) {
 		foc_abc_2_dq(SIGN(iabc[0]), SIGN(iabc[1]), SIGN(iabc[2]), &d, &q);
 		float dtc = ((float)CONFIG_HW_DeadTime/(float)FOC_PWM_Half_Period) * motor.controller.foc.in.dc_vol * 1.5f;
 		float vd = (rs_vd_now - dtc) * TWO_BY_THREE;
-		float rs = vd / (motor.controller.foc.out.curr_dq.d + 0.0001f);
+		float id = motor.controller.foc.out.curr_dq.d;
+		float rs = vd / (id + 0.0001f);
 		rs_est_value = LowPass_Filter(rs_est_value, rs, 0.2f);
 		if (rs_meas_time-- <= 0) {
 			mot_params_ind_stop();
@@ -106,7 +107,7 @@ static void _rs_ind_timer_handler(shark_timer_t *t) {
 			finish = true;
 			b_rs_ested = true;
 			sys_debug("est rs = %f\n", rs_est_value);
-			sys_debug("vd is %f, wait %d\n", rs_vd_now, wait_iq_0_cnt);
+			sys_debug("vd-id is %f-%f-%f, wait %d\n", rs_vd_now, id, dtc/1.5f, wait_iq_0_cnt);
 		}
 	}
 	default: