Signed-off-by: huhui <huhui@sharkgulf.com>
@@ -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
@@ -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;
return 0;