Parcourir la source

放电母线电流为正,发送母线电流为负

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui il y a 3 ans
Parent
commit
51faf5ecd4
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      Applications/foc/core/PMSM_FOC_Core.c
  2. 1 1
      Applications/foc/samples.c

+ 1 - 1
Applications/foc/core/PMSM_FOC_Core.c

@@ -1025,7 +1025,7 @@ void PMSM_FOC_Calc_Current(void) {
 	if (id_thr >= 100.0f) {
 		id_thr = 100.0f;
 	}
-	float raw_idc = -m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
+	float raw_idc = m_pow / get_vbus_float() * (1.0f - 0.2f * id_thr/100.0f);// * 1.5f * 0.66f; //s16q5
 #else
 	float raw_idc = get_vbus_current();
 #endif

+ 1 - 1
Applications/foc/samples.c

@@ -115,7 +115,7 @@ int get_acc_vol(void) {
 float get_vbus_current(void) {
 #ifdef VBUS_I_CHAN
 	s16 ibus = _ibus.filted_value * 10.0f;
-	return (float)ibus/10.0f;
+	return -(float)ibus/10.0f;
 #else
 	return 0;
 #endif