Xilinx / Vitis_Libraries

Vitis Libraries
https://docs.xilinx.com/r/en-US/Vitis_Libraries
Apache License 2.0
894 stars 356 forks source link

Motor control [field weakening] #191

Open mcuby opened 1 year ago

mcuby commented 1 year ago

Hi. There is a strange entry in the calculations for field weakening

`template <class T_IN, class T_MID, class T_MID2, class T_OUT, int MAX_AD_SCL> void Decoupling_T_ap_fixed( T_OUT& Vd_decoup, T_OUT& Vq_decoup, T_MID Id, T_MID Iq, T_IN Vd, T_IN Vq, T_IN RPM, T_OUT RPM_to_speed) {

pragma HLS INLINE

const T_MID2 Ls = COMM_MOTOR_PARA_LD;
const T_MID2 FAI_M = COMM_MOTOR_PARA_FAI_M;
T_MID2 Flux_decoup, Torque_decoup;

Flux_decoup = Vd + RPM_to_speed * RPM * (Ls * Iq);
Torque_decoup = Vq - RPM_to_speed * RPM * ((Ls * Id) + FAI_M);

Vd_decoup = Flux_decoup;
Vd_decoup = 0;
Vq_decoup = Torque_decoup;

}`

Why first Vd_decoup = Flux_decoup; and after Vd_decoup = 0;? Isn't this a mistake?

What equation did you use to field weakening?