You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Park transform: transforms the currents from stator to the rotor reference frame
3716
3719
state_m->id=c*state_m->i_alpha+s*state_m->i_beta;
3717
3720
state_m->iq=c*state_m->i_beta-s*state_m->i_alpha;
3718
-
UTILS_LP_FAST(state_m->id_filter, state_m->id, conf_now->foc_current_filter_const); //Low passed currents are used for less time critical parts, not for the feedback
3721
+
3722
+
// Low passed currents are used for less time critical parts, not for the feedback
// Decoupling. Using feedforward this compensates for the fact that the equations of a PMSM are not really decoupled (the d axis current has impact on q axis voltage and visa-versa):
3753
-
// Resistance Inductance Cross terms Back-EMF (see www.mathworks.com/help/physmod/sps/ref/pmsm.html)
3754
-
//vd = Rs*id + Ld*did/dt − ωe*iq*Lq
3755
-
//vq = Rs*iq + Lq*diq/dt + ωe*id*Ld + ωe*ψm
3757
+
// Decoupling. Using feedforward this compensates for the fact that the equations of a PMSM
3758
+
// are not really decoupled (the d axis current has impact on q axis voltage and visa-versa):
3759
+
// Resistance Inductance Cross terms Back-EMF (see www.mathworks.com/help/physmod/sps/ref/pmsm.html)
state_m->vd-=dec_vd; //Negative sign as in the PMSM equations
3786
3792
state_m->vq+=dec_vq+dec_bemf;
3787
3793
3788
-
//Calculate the max length of the voltage space vector without overmodulation. Is simply 1/sqrt(3) * v_bus. See https://microchipdeveloper.com/mct5001:start. Adds margin with max_duty.
3794
+
// Calculate the max length of the voltage space vector without overmodulation.
3795
+
// Is simply 1/sqrt(3) * v_bus. See https://microchipdeveloper.com/mct5001:start. Adds margin with max_duty.
// Calculate the duty cycles for all the phases. This also injects a zero modulation signal to be able to fully utilize the bus voltage. See https://microchipdeveloper.com/mct5001:start.
3915
+
// Calculate the duty cycles for all the phases. This also injects a zero modulation signal to
3916
+
// be able to fully utilize the bus voltage. See https://microchipdeveloper.com/mct5001:start
0 commit comments