vedderb / bldc

The VESC motor control firmware
2.16k stars 1.35k forks source link

[Question] Virtual motor id current update #384

Open Guillaume227 opened 2 years ago

Guillaume227 commented 2 years ago

@maxicor88 : the virtual motor idea is awesome, thank you.

Looking at the code there is one thing I do not understand regarding how id current is updated: why is m_conf->foc_motor_flux_linkage / virtual_motor.ld substracted from id_int? virtual_motor.id = virtual_motor.id_int - m_conf->foc_motor_flux_linkage / virtual_motor.ld;

The reason I am wondering is that in pure standstill (Valpha = Vbeta = we = 0) that extra term causes id current to be non zero, which bothers me.

Is there an electrical equation discretization trick I am missing?

ElwinBoots commented 2 years ago

I also saw this and had the exact same remark. Since I don't use the virtual motor I did not mention it yet.

I don't see how the virtual motor can work correctly with this extra term.